Master Improvement Plan
Date: January 2026 Status: ✅ ALL PROJECTS COMPLETED Last Updated: February 11, 2026
Historical Document: This improvement plan has been fully executed. All 5 projects are complete.
1. Executive Summary
The audit of the OLOW Hotel ERP system has confirmed a solid architectural foundation (Domain-Driven Design, Modular Monolith) but identified critical risks in Data Integrity, Multi-Tenancy, and Financial Accuracy.
This plan organizes the 60+ identified issues into 5 Strategic Projects for execution.
2. Project A: Critical Stability Fixes (P0 & P1) — ✅ COMPLETED
Objective: Eliminate system-breaking bugs and data loss risks.
| ID | Issue | Module | Risk |
|---|---|---|---|
| CRIT-001 | Multi-Tenancy Leak: Audit all property_id usages and remove fallbacks to '1' or 'auth()'. | Global | High |
| MAJ-WAL-001 | Race Condition: Implement lockForUpdate() on Wallet transactions. | Wallet | High |
| MAJ-HK-001 | Broken Checklist: Fix Nightly Reset job to properly populate checklists. | Housekeeping | High |
| MAJ-FD-001 | Missing Cash Account: Add cash_account_id to folio_payments. | FrontDesk | High |
| MAJ-FD-002 | Deposit Tracking: Differentiate Deposits vs Regular payments in DB. | FrontDesk | High |
| MAJ-AP-002 | Unsafe AP Creation: Fix property context in Bill creation. | AP | High |
| MAJ-AR-002 | Unsafe AR Creation: Fix property context in Invoice creation. | AR | High |
Action Plan:
- Immediate: Fix Wallet Race Condition (Money at risk).
- Immediate: Audit
PropertyContextusage across Services. - Week 1: Run database migrations to fix
folio_paymentsandproperty_idcolumns.
3. Project B: Accounting Integration Overhaul — ✅ COMPLETED
Objective: Decouple business logic from hardcoded Chart of Accounts.
Problem: Nearly every module hardcoded GL Account IDs (e.g., '101', '204'). Solution: Implemented AccountingMapService + AccountingKey enum. All modules now use dynamic, property-scoped account resolution.
| Sub-Task | Description |
|---|---|
| Map Registry | Create a config/database registry mapping Logical Keys (e.g., REVENUE_ROOM) to Account Codes. |
| Refactor Services | Update PayrollService, FolioService, InventoryService to use the registry. |
| Validation | Ensure all mapped accounts exist before allowing a transaction. |
4. Project C: Performance Optimization (N+1) — ✅ COMPLETED
Objective: Ensure system handles 100+ concurrent users.
| ID | Issue | Location |
|---|---|---|
| MAJ-HK-002 | Memory Leak: Nightly Job loads all rooms at once. Fix: Use chunk(). | Housekeeping |
| MAJ-INV-001 | N+1 Accessors: InventoryItem::getAuditAccount queries DB on access. Fix: Cache or Eager Load. | Inventory |
| MIN-HR-002 | Payroll Loop: generateLines queries per staff. Fix: Eager Loading. | HR |
| MIN-EXP-002 | Expense Validation: Lazy load during approval check. Fix: Eager Load. | Expense |
5. Project D: Data Integrity & Standardization — ✅ COMPLETED
Objective: Enforce consistency across modules.
| ID | Issue | Description |
|---|---|---|
| MIN-ACC-001 | Source Enum: Replace ENUM('FRONTDESK', ...) with String to allow new modules easily. | |
| MIN-FD-003 | Room Uniqueness: Add Unique Index on (property_id, room_number). | |
| MIN-INV-001 | Soft Deletes: Add SoftDeletes to Inventory Items to preserve history. | |
| MIN-PTY-001 | Terminology: Rename TYPE_EMPLOYEE to TYPE_STAFF in Party module constants. |
6. Project E: Feature Enhancements — ✅ COMPLETED
Objective: High-value user improvements.
| ID | Feature | Value |
|---|---|---|
| ENH-FD-002 | Overbooking Protection: Configurable limits. | Revenue Optimization |
| ENH-ACC-001 | Batch Posting: Optimize AccountingPoster for bulk entries. | Performance |
| ENH-GST-001 | Loyalty Points: Add points logic to Customer/Wallet. | Guest Retention |
7. Execution Timeline
All projects completed ahead of schedule:
- ✅ Week 1: Project A (Critical Fixes) — Done
- ✅ Week 2: Project B (Accounting Overhaul) — Done
- ✅ Week 3: Project C (Performance) & Project D (Data Consistency) — Done
- ✅ Week 4: Project E (Enhancements) & User Acceptance Testing — Done