Domain Model

evergreenLast update on Sep 1, 2026
Download .md

Domain Model

The asset model tracks identity, custody, tags, lifecycle events, documents, compliance, and maintenance.

Core Entities

EntityPurpose
app_userPerson using the system
role / permissionAuthorization model
departmentOwning organizational unit
locationPhysical asset location
partyUser, department, or vendor in a handoff
assetCurrent asset read model derived from events
asset_tagTag history for an asset
asset_eventAppend-only action log
handoff_transactionTwo-sided custody transfer
handoff_lineAssets included in a handoff
discrepancyMismatch between record and reality
approvalMaker-checker decision
financial_profileAsset financial view
compliance_itemWarranty, certificate, maintenance due date, lease end
documentAsset file attachment
work_orderMaintenance job

Entity Relationships

erDiagram
    app_user ||--o{ user_role : has
    role ||--o{ user_role : assigned
    role ||--o{ role_permission : grants
    permission ||--o{ role_permission : included
    department ||--o{ asset : owns
    location ||--o{ asset : contains
    app_user ||--o{ asset : custodian
    asset ||--o{ asset_tag : tagged_by
    asset ||--o{ asset_event : has
    party ||--o{ handoff_transaction : from
    party ||--o{ handoff_transaction : to
    handoff_transaction ||--o{ handoff_line : contains
    asset ||--o{ handoff_line : moved
    asset ||--o{ discrepancy : reports
    asset ||--o{ financial_profile : has
    asset ||--o{ compliance_item : tracks
    asset ||--o{ document : attaches
    asset ||--o{ work_order : maintains

Invariants

  • Asset history is append-only.
  • Current asset state is derived from events.
  • A correction points to an earlier event; it does not overwrite it.
  • A handoff closes only when the receiver confirms.
  • Maker and checker must differ for approvals.
  • Tags are globally unique while active.
  • Missing or temporary tags create follow-up work, not blocked receiving.

Mobile POC Domain Mapping

The current POC uses simplified Dart models in reference/mobile_app_demo/lib/models/:

Dart modelConcept
GrnDelivery work list
GrnLineItemPhysical unit expected or received
AssetEventLocal event queued for backend sync
OnboardedAssetIn-memory current view

See Data Model Reference for table-level fields.