Audience: Engineers, DBAs. What this answers: how the catalog, allocation, release, and status axes are built.

Source: AssetService.cs (1,069 lines), AdminAssetsService.cs (681), Employee/AssetsService.cs (68), the Asset / EmployeeAsset entity graph (TenantDb), AssetModel.cs, and web-app/src/pages/dashboard/documents/assets/*. Verified 2026-07-20.


1. Entity graph (all in TenantDb, scoped by CompanyId)

AssetType (AssetTypeId, Description)
   └─< AssetSubType (AssetSubTypeId, AssetTypeId, Description)
          └─< Asset (AssetId, Alias, Identifier, Barcode, AssetSubTypeId,
                     AssetStatusId, IsMultipleAssignable, MaxAssignment,
                     AssignmentCount, CommissionDate, DecommissionDate, CompanyId)
                 ├─ AssetStatus (AssetStatusId, Description)          // Active/Inactive
                 └─< EmployeeAsset (EmployeeAssetId, AssetId, PersonId,
                        EmployeeAssetStatusId, AssignmentDate, ReleaseDate,
                        AutoReleaseDate, AssignmentIntervalId, AssignmentPeriod, Note)
                        ├─ EmployeeAssetStatus (Assigned/Released)
                        ├─ Person  (the employee)
                        └─ Interval (AssignmentInterval — Days/Months/…)

Read models: ViewAsset, ViewAssetSubType, ViewEmployeeAsset — denormalised views for list screens (carry names, not just ids).

2. Two status axes

Axis Enum (AssetModel.cs) Values On
Item status AssetStatuParams Active=1, Inactive=2 Asset.AssetStatusId
Allocation status EmployeeAssetStatuParams Assigned=1, Released=2 EmployeeAsset.EmployeeAssetStatusId

Both are backed by configurable tables (AssetStatus, EmployeeAssetStatus — id + description), but the constants above are the ones the code branches on. Never assume a query filtering "available" items means one axis — check both (Asset Active and no live Assigned allocation, or seats free).

3. Assignment (AssetService.CreateEmployeeAsset / AdminAssetsService.AddEmployee_Asset)

Creating an EmployeeAsset:

AssignmentDate   = parse(x.assignment_date, "dd/MM/yyyy") ?? Now.Date
AssignmentPeriod = int?(x.assignment_period)                 // the count, e.g. 6
AssignmentIntervalId = int?(x.assignment_interval_id)        // the unit → Interval (Months)
EmployeeAssetStatusId = Assigned (1)

4. Release (ReleaseEmployeeAsset / ReleaseEmployeeAssets)

Auto-release: AutoReleaseDate exists on the entity and is surfaced in read models, but — see RFD-002 — no scheduled job / worker was found that flips assignments to Released when that date passes. Treat auto-release as not implemented; release is manual.

5. Catalog operations