Skip to main content

Expense Schema Reference

Summary

The catalog contains the six objects mapped by the current Expense EF model. Owned claim values are included with their aggregate rather than presented as independent objects.

Audience

Backend developers, database reviewers, QA, architects, DevOps, support, and implementation teams.

Confirmed persistence

Persisted objectPurpose and ownershipRelationshipsIndexesQuery filterStatus
ExpenseClaimAggregate state; owns claimant, category, and money valuesParent navigation to receipt references; no cross-service FKsPrimary key; unique CompatId; TenantId + Status; WorkflowInstanceIdTenant predicate with privileged bypassConfirmed
ExpenseReceiptReferenceExpense-owned metadata pointing to externally managed receipt contentRequired ExpenseClaimId FK; cascade on claim deletionPrimary key; ExpenseClaimId; TenantId + ExpenseClaimIdTenant predicate with privileged bypassConfirmed
ExpenseAuditLogExpense mutation evidenceEntityType and EntityId are logical identifiers; no claim FKPrimary key; TenantId + OccurredAtUtcTenant predicate with privileged bypassConfirmed
ExpenseTimelineExpense lifecycle activity evidenceEntityType and EntityId are logical identifiers; no claim FKPrimary key; TenantId + OccurredAtUtcTenant predicate with privileged bypassConfirmed
OutboxMessageDurable outbound integration intent owned operationally by ExpenseLogical event correlation only; no claim FKPrimary key; unique EventId; Status + OccurredAtUtcNone configuredConfirmed
ProcessedIntegrationEventInbound integration idempotency ledgerLogical event correlation only; no claim FKPrimary key; unique EventIdNone configuredConfirmed but no current subscriber use confirmed

Money, ExpenseCategory, and ExpenseClaimant are owned claim values rather than separate persisted objects. ExpensePolicy, ExpenseLimit, ClaimItem, CostCenter, PaymentBatch, and ReimbursementSchedule are Not implemented.

Requires confirmation

Production migration governance, retention, archival, masking, performance targets, concurrency roadmap, operational-store access, and rollback ownership remain unconfirmed unless narrowed above.

Source References

  • microservices/src/expense-service/Infrastructure/ExpenseDbContext.cs

See Also

Keywords

  • Expense database
  • Schema Reference

Revision Information

  • Status: Draft
  • Last reviewed: 2026-07-16
  • Review cycle: Quarterly