Data Model Reference

evergreenLast update on Sep 1, 2026
Download .md

Data Model Reference

This reference condenses the original spreadsheet-derived model into implementation guidance.

Tables

TableRequired purpose
app_userSystem user: name, email, status, timestamps
roleNamed role
user_roleMany-to-many users to roles
permissionModule/action permission
role_permissionMany-to-many roles to permissions
departmentOwning unit with optional parent
locationPhysical location with optional parent
partyUser, department, or vendor participant
assetCurrent asset state/read model
asset_tagTag code, technology, batch, status, binding proof
asset_eventAppend-only event log
handoff_transactionCustody transfer header
handoff_lineAssets in a handoff
discrepancyReported mismatch or conflict
approvalMaker-checker workflow
financial_profileAcquisition cost, depreciation, book value
compliance_itemDated warranty/certificate/maintenance/lease obligation
documentFile attached to an asset
work_orderMaintenance task

Common Types

TypeUse
BIGSERIALdatabase primary keys where server-generated IDs are acceptable
BIGINTforeign keys
TEXTnames, statuses, references
NUMERIC(14,2)BDT money fields
BOOLEANflags
DATEdate-only business fields
TIMESTAMPTZaudit and lifecycle timestamps
JSONBevent payloads and flexible metadata

Key Status Fields

FieldValues
asset.statusin_use, in_storage, under_repair, in_transit, lost, disposed
asset.ownership_typeowned, leased, rented, borrowed, byod, vendor
asset_tag.statusprinted, attached, verified, damaged, replaced
handoff_transaction.statusopen, overdue, closed, cancelled
discrepancy.statusopen, investigating, resolved, dismissed
approval.statuspending, approved, rejected
compliance_item.statusupcoming, due, overdue, closed
work_order.statusopen, in_progress, done, cancelled

Implementation Notes

  • Prefer UUID public identifiers even when using numeric database IDs internally.
  • Add unique constraints for user email, active tag code, and idempotency keys.
  • Index foreign keys and high-cardinality query filters.
  • Keep financial precision in the database and API contract.
  • Do not allow Hibernate auto-update outside disposable development databases.