Alhuda ERP Implementation Plan (MVP)
Superseded — kept for history only
This page was written in January 2026 and is not a description of how the system works today. It is kept so the reasoning behind early decisions stays readable. Current behaviour is described in the upgrade program. Do not build from this page.
Each step is sized for small incremental delivery.
1) Repo Setup
- Acceptance: app runs, DB connects, Supabase schema applied.
- Files:
src/db/schema.sql,app/layout.tsx,app/page.tsx. - UI: basic dashboard placeholder.
- API: health check route.
- Tests: migration smoke test, lint.
2) Auth + RBAC
- Acceptance: login/logout, role-based route guards.
- Files:
/lib/auth,/middleware/rbac.ts. - UI:
/auth,/admin/users. - API:
/api/auth/login,/api/auth/me. - Tests: role access checks.
3) Core Inventory
- Acceptance: create airlines, quota blocks, generate slots.
- UI:
/inventory/airlines,/inventory/quota-blocks,/inventory/slots. - API:
/api/airlines,/api/quota-blocks,/api/slots/generate. - Tests: slot count == quota total.
4) Groups
- Acceptance: create groups, assign slots, enforce capacity.
- UI:
/groups,/groups/[id]. - API:
/api/groups,/api/groups/:id/assign-slots. - Tests: capacity violation returns 409.
5) Sales (Customers/Agents/Quotations/Bookings)
- Acceptance: create customers, agents, quotations, bookings.
- UI:
/sales/customers,/sales/quotations,/sales/bookings,/agents. - API:
/api/customers,/api/agents,/api/quotations,/api/bookings. - Tests: convert quotation -> booking.
6) Ops Approvals + Communications Log
- Acceptance: ops approval queue, verification log.
- UI:
/ops/approvals. - API:
/api/bookings/:id/ops-approve,/api/communications. - Tests: ops approval blocked if finance policy not met.
7) Finance (Payments, Dues, Clearance)
- Acceptance: payments recorded, dues calculated, clearance flag.
- UI:
/finance. - API:
/api/payments,/api/bookings/:id/finance-approve. - Tests: clearance requires dues <= 0 or policy met.
8) Visa Module
- Acceptance: visa case lifecycle with status history.
- UI:
/visa. - API:
/api/visa,/api/visa/:id/status,/api/visa/:id/upload. - Tests: status history stored on every change.
9) Tickets Module
- Acceptance: name update queue, hold/issue flow, GM exception.
- UI:
/tickets. - API:
/api/tickets/:id/issue,/api/tickets/:id/exception-approve. - Tests: ticket issue blocked without clearance or exception proof.
10) Hotels/Food Inventory
- Acceptance: inventory CRUD and group assignment.
- UI:
/hotels,/food. - API:
/api/hotels,/api/food,/api/groups/:id/assign-hotel. - Tests: assignment reduces availability.
11) Audit Logs + Reports
- Acceptance: audit log entries on key actions and downloadable reports.
- UI:
/admin/audit,/reports. - API:
/api/audit,/api/reports/*. - Tests: audit log written on approvals/transitions.