Skip to content

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.

IDIssueModuleRisk
CRIT-001Multi-Tenancy Leak: Audit all property_id usages and remove fallbacks to '1' or 'auth()'.GlobalHigh
MAJ-WAL-001Race Condition: Implement lockForUpdate() on Wallet transactions.WalletHigh
MAJ-HK-001Broken Checklist: Fix Nightly Reset job to properly populate checklists.HousekeepingHigh
MAJ-FD-001Missing Cash Account: Add cash_account_id to folio_payments.FrontDeskHigh
MAJ-FD-002Deposit Tracking: Differentiate Deposits vs Regular payments in DB.FrontDeskHigh
MAJ-AP-002Unsafe AP Creation: Fix property context in Bill creation.APHigh
MAJ-AR-002Unsafe AR Creation: Fix property context in Invoice creation.ARHigh

Action Plan:

  1. Immediate: Fix Wallet Race Condition (Money at risk).
  2. Immediate: Audit PropertyContext usage across Services.
  3. Week 1: Run database migrations to fix folio_payments and property_id columns.

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-TaskDescription
Map RegistryCreate a config/database registry mapping Logical Keys (e.g., REVENUE_ROOM) to Account Codes.
Refactor ServicesUpdate PayrollService, FolioService, InventoryService to use the registry.
ValidationEnsure all mapped accounts exist before allowing a transaction.

4. Project C: Performance Optimization (N+1) — ✅ COMPLETED

Objective: Ensure system handles 100+ concurrent users.

IDIssueLocation
MAJ-HK-002Memory Leak: Nightly Job loads all rooms at once. Fix: Use chunk().Housekeeping
MAJ-INV-001N+1 Accessors: InventoryItem::getAuditAccount queries DB on access. Fix: Cache or Eager Load.Inventory
MIN-HR-002Payroll Loop: generateLines queries per staff. Fix: Eager Loading.HR
MIN-EXP-002Expense Validation: Lazy load during approval check. Fix: Eager Load.Expense

5. Project D: Data Integrity & Standardization — ✅ COMPLETED

Objective: Enforce consistency across modules.

IDIssueDescription
MIN-ACC-001Source Enum: Replace ENUM('FRONTDESK', ...) with String to allow new modules easily.
MIN-FD-003Room Uniqueness: Add Unique Index on (property_id, room_number).
MIN-INV-001Soft Deletes: Add SoftDeletes to Inventory Items to preserve history.
MIN-PTY-001Terminology: Rename TYPE_EMPLOYEE to TYPE_STAFF in Party module constants.

6. Project E: Feature Enhancements — ✅ COMPLETED

Objective: High-value user improvements.

IDFeatureValue
ENH-FD-002Overbooking Protection: Configurable limits.Revenue Optimization
ENH-ACC-001Batch Posting: Optimize AccountingPoster for bulk entries.Performance
ENH-GST-001Loyalty 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