Skip to content

Community Module: Gap Analysis (Phase 2)

Date: 2026-01-29 Scope: occupancy, tenancy, packages

1. Findings

  • Tenancy vs Leases:
  • src/tenancy/: EMPTY. This is a zombie directory.
  • src/contracts/lease-service.ts: This is the active service for Leases.
  • Recommendation: Delete src/tenancy.

  • Occupancy vs Ownership:

  • OwnershipService: Tracks LEGAL rights (Deed/Contract).
  • OccupancyService: Tracks PHYSICAL access (and Google Groups).
  • Gap: There is no direct link triggering Occupancy creation when a Lease is signed.
  • Recommendation: LeaseService (or Event Bus) should trigger OccupancyService.addOccupant when a lease starts.

  • Anomalies:

  • src/packages/: Contains a nested modules structure. This is a copy-paste error.
  • Recommendation: Delete immediately.

  • Property vs Assets:

  • property/: Contains PropertyService (Unit Management).
  • Finding: High potential for overlap with @sd/mod-assets. Currently used for HOA-specific logic (indiviso, user-unit lookup).
  • Recommendation: Keep for now, but mark for future consolidation into a unified Asset Domain.

2. Updated Architecture Map

  • Legal Layer: contracts/ (Deeds, Leases) -> Emits Events.
  • State Layer:
  • ownership/ (Titled/Possessed owners)
  • occupancy/ (Residents/Tenants with keys)
  • Identity Layer: registry/ (Profiles, Google Sync)

3. Action Plan

  1. [x] Delete src/tenancy and src/packages.
  2. [ ] (Future) Connect LeaseSigned event to OccupancyService.