Skip to content

06. Domain Architecture: The Skeletal Map (MOCKUP)

Status: Auto-Generated by index-architecture.ts Drift Detected: ⚠️ 2 Orphans, 1 Zombie

This document is the "Living Map" of the application. It connects the Intent (Capabilities) to the Implementation (Code/Data).


1. Finance Module (L1: Vertical)

Path: packages/modules/finance

📒 Sub-Module: Ledger (L2)

Summary: The double-entry bookkeeping core.

⚡ Capabilities (The Feature)

  • [FIN-GL-JOURNAL] Manual Journal Entry creation
    • Implementation: finance/src/ledger/service.ts (createJournalEntry)
    • Access: Accounting Department
    • Data Used: JournalEntry, Account
    • Triggers Event: SIG-FIN-JOURNAL-POSTED

💾 Data Entities (The Structure)

  • [JournalEntry]: A set of balanced debits/credits.
    • Schema: finance/src/ledger/schema.ts
    • Relations: HasMany List<LedgerEntry>, BelongsTo Account
  • [Account]: A chart of accounts node.
    • Schema: finance/src/ledger/schema.ts

🔌 Interface (The Skin)

  • POST /api/finance/journal -> Maps to [FIN-GL-JOURNAL]
  • GET /api/finance/ledger/{id} -> Maps to [FIN-GL-VIEW]

📡 Nervous System (Events)

  • [SIG-FIN-JOURNAL-POSTED]
    • Triggered By: createJournalEntry
    • Listeners: AuditLog, BudgetWatchdog

2. Operations Module (L1: Vertical)

Path: packages/modules/operations

🛠️ Sub-Module: Maintenance (L2)

⚡ Capabilities

  • [OPS-WO-SUBMIT] Request Work Order
    • Implementation: operations/src/maintenance/service.ts
    • Access: Resident
  • [OPS-WO-ASSIGN] Dispatch Ticket
    • Implementation: operations/src/maintenance/service.ts
    • Access: Dispatcher

⚠️ ARCHITECTURAL DRIFT DETECTED

The Indexer found code that doesn't match the design.

  • 👻 Zombie Capability: [OPS-WO-ARCHIVE]
    • Issue: Tag exist in service.ts but is NOT registered in the Master Matrix.
    • Action: Register it or delete the dead code.
  • 🚧 Orphaned Route: DELETE /api/operations/ticket/{id}
    • Issue: This API route exists but has NO @cap tag.
    • Risk: Who is allowed to call this? What capability does it serve?
  • 🏚️ Unused Entity: [VendorRating]
    • Issue: Schema defined in schema.ts but never referenced by any Service.

3. How to Read This Map

  1. If it's here, it's real. (Generated from code, not manual wiki edits).
  2. If it has a warning (⚠️), the implementation has drifted from the design.
  3. Clicking a Link takes you directly to the source file line number.