Skip to main content

Asset Aggregate

Aggregate boundary

The aggregate owns tenant identity, compatibility identity, asset code/type/name/serial, assignee references, assignment and due dates, condition, lifecycle status, notes, workflow instance reference, timestamps, history, documents, and queued domain events.

Factory methods create inventory in Available or a requester-linked record in Requested. Methods implement approve, assign, return, reject, damage, loss, retire, descriptive update, availability, workflow attachment/decision, document-reference add/remove, and delete eligibility. Invariants are enforced by domain exceptions and value objects. EF Core persists the aggregate with owned value objects and child collections; domain events are translated to outbox records during save.

Missing invariants include employee existence/ownership, serial uniqueness, category governance, reservation, location, maintenance, warranty, purchase/vendor, transfer, disposal, document versioning, and fine-grained authorization. Application-only code uniqueness is not backed by a tenant-plus-code unique database constraint.

Requires confirmation

Production ownership, authorization governance, operational policy, and future architecture require confirmation where the source does not enforce them.

Source References

  • microservices/src/asset-service/Domain/Asset/Asset.cs
  • microservices/src/asset-service/Domain/Common/Enums.cs
  • microservices/src/asset-service/Infrastructure/AssetDbContext.cs