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
Occupancycreation when aLeaseis signed. -
Recommendation:
LeaseService(or Event Bus) should triggerOccupancyService.addOccupantwhen a lease starts. -
Anomalies:
src/packages/: Contains a nestedmodulesstructure. This is a copy-paste error.-
Recommendation: Delete immediately.
-
Property vs Assets:
property/: ContainsPropertyService(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
- [x] Delete
src/tenancyandsrc/packages. - [ ] (Future) Connect
LeaseSignedevent toOccupancyService.