# DesiRyva AI – Master Project Roadmap v1

Baseline date: 2026-11-04  
Basis: files and implementation notes currently available in `/mnt/data/desiryva_pos_shift_work`, plus the 2026-11-03 code review.  
Purpose: establish one platform-wide phase register. This is a scope/acceptance tracker, not evidence of live production readiness.

## Counting rules

- **Implemented** means a corresponding feature/module has source files or documented workflows in the current working project. It does not mean live XAMPP/MySQL acceptance has passed.
- **Partial** means a foundation or some workflows exist, but significant requirements remain.
- **Pending / unverified** means not present in the reviewed working source, or a separate development track cannot be confirmed integrated into this exact project folder.
- A phase is only **production accepted** after schema migration, positive and negative workflow tests, tenant/branch isolation tests, security review, and deployment validation pass.

## Executive count

| Status | Count | Meaning |
|---|---:|---|
| Implemented (development source present) | 5 | Code/documentation exists for the defined milestone; live acceptance remains open |
| Partial | 16 | Working foundation or limited workflows exist; substantial scope remains |
| Pending / unverified | 9 | Not implemented in this exact cumulative source or integration cannot be verified |
| **Total roadmap phases** | **30** | Fixed baseline for this roadmap version |
| **Production-accepted phases** | **0** | No complete end-to-end production acceptance evidence is available |

These counts describe the whole DesiRyva AI programme, not the 11 recent POS enhancement sub-phases. The POS sub-phases are included inside the POS milestones below and are not added again to the platform-wide total.

## Master phase register

| # | Phase / workstream | Current status | Evidence / gap | Exit criteria |
|---:|---|---|---|---|
| 1 | Core application foundation, configuration and routing | Implemented | Core PHP app, config and shared bootstrap present | Clean install and config validation on supported XAMPP and cPanel |
| 2 | Super Admin authentication and dashboard | Implemented | Super-admin login/dashboard source present | Login, logout, session expiry, lockout and admin role tests |
| 3 | Tenant registration and tenant registry | Implemented | Tenant registry and registration workflows present | Full lifecycle, duplicate prevention and tenant suspension tests |
| 4 | Shared database assignment and provisioning foundation | Partial | Provisioning scaffolding exists; privileged account and rollback hardening remain | Least-privilege provisioning, rollback, retry and secret-handling tests |
| 5 | Branch registry and synchronization | Implemented | Branch registry and MAIN branch synchronization documented | Multi-branch create/edit/disable and cross-tenant negative tests |
| 6 | Authentication, CSRF and baseline access controls | Partial | Tenant-scoped role permission tables, owner permission screen and CRM permission gates added; other modules are not yet migrated and MFA/password recovery/throttling remain open | Enforce the full role/action matrix across every module; password reset, MFA option, throttling and CSRF tests |
| 7 | Tenant/branch isolation framework | Partial | Added TenantScope helper and POS active-branch validation; legacy modules and adversarial suite remain unverified | Two-tenant/two-branch tests for every read/write/export/action |
| 8 | CRM | Partial | CRM source and enhancement notes present | Leads, contacts, companies, pipeline, activities, tasks, imports, reports and permissions end-to-end |
| 9 | ERP | Pending / unverified | No complete ERP workflow confirmed in current source | Define and deliver purchasing, sales, stock, finance and operational integration scope |
| 10 | HRM and Payroll | Partial | Employee/attendance/leave foundation and salary master; statutory payroll absent | Leave approvals, payroll engine, deductions, payslips, bank export and audit tests |
| 11 | POS core, inventory and checkout | Partial | Product, checkout, stock, payments, returns and inventory workflows exist | Full integrated regression including concurrent stock, tender, returns and branch scope |
| 12 | POS advanced operations and customer engagement | Implemented | Barcode, variants, loyalty, promotions, coupons, gift cards, wallet, shifts and cashier reports documented | End-to-end tests for each feature and all combined checkout/refund cases |
| 13 | POS GST, credit notes and tax reporting | Partial | GST profiles, product tax, invoice and credit-note source exist; reporting/statutory coverage incomplete | GST expert-reviewed scenarios, reporting, return reconciliation and rounding tests |
| 14 | Restaurant management, QR ordering, KOT and billing | Partial | Menu/table, QR ordering, KOT, billing and inventory integration present | Menu lifecycle, modifiers, kitchen routing, refunds, tax, reservations and full test suite |
| 15 | Hotel management and guest operations | Partial | Rooms, reservations, housekeeping, payments and folio foundations present | Guest lifecycle, deposits, room moves, night audit, tax, refunds and end-to-end tests |
| 16 | Salon & Spa SaaS | Pending / unverified | Separate development track exists in conversation; integration into this exact source not verified | Merge current complete salon source; verify appointments, staff, services, branches, POS and Razorpay |
| 17 | Pharmacy management | Partial | Catalogue, batches, purchases, payables, returns and credit-note workflows present | Prescription controls, pharmacist workflows, regulated reporting, tax, batch traceability and tests |
| 18 | Gym & Sports Club SaaS | Pending / unverified | Separate ClubLink-inspired development track; current source integration not verified | Merge current source and verify memberships, plans, attendance, classes, bookings, facilities and billing |
| 19 | School and College management | Partial | Students, classes, attendance, exams, marks and memo foundations present | Fees, admissions, timetable, grade rules, portals, transport, bulk imports and permissions |
| 20 | Doctor appointments | Partial | Doctor/patient register and appointment lifecycle present | Clinical workflow boundary, reminders, payments, privacy controls and tests |
| 21 | Hospital HMS | Partial | Wards, beds, admissions and discharge foundations present | OPD/IPD, clinical records, prescriptions, labs, pharmacy, billing, roles, audit and privacy review |
| 22 | Accounting and finance | Partial | Manual cashbook and POS sales overview present | Double-entry ledger, journals, chart of accounts, reconciliation, tax and financial statements |
| 23 | Central AI engine and AI business insights | Pending / unverified | No complete shared AI service, model governance or tenant-safe AI workflow confirmed | Tenant-scoped AI services, consent, audit, data boundaries, usage limits and evaluation tests |
| 24 | Subscription plans, billing and Razorpay | Pending / unverified | Required product direction is known; full verified billing lifecycle not present in this source | Plans, trials, checkout, webhooks, retries, cancellation, invoices, entitlements and sandbox tests |
| 25 | Notifications and communication automation | Pending / unverified | Full integrated notification service not confirmed | Email/SMS/WhatsApp provider abstraction, templates, queue, retries, consent and audit |
| 26 | Unified reporting and analytics | Partial | Several module-specific reports and exports exist | Consolidated tenant/branch dashboards, cross-module KPIs, scheduled reports and export controls |
| 27 | Central audit log and operational monitoring | Partial | Some module-level audit trails exist; central observability not verified | Unified immutable audit events, error monitoring, health checks and alerting |
| 28 | Automated tests and migration orchestration | Pending / unverified | Syntax reports exist; runnable integration/regression suite absent | Repeatable fresh/upgrade migrations, fixtures, CI tests and rollback validation |
| 29 | Security, privacy, backup and recovery hardening | Pending / unverified | Known security gaps remain in review | Threat review, secrets hardening, encryption, backups, restore drill, access review and penetration tests |
| 30 | XAMPP acceptance, cPanel deployment and final release | Pending / unverified | XAMPP is target environment; live integrated test and cPanel release not completed | Signed acceptance checklist, clean deployment, migration guide, final ZIP and consolidated SQL |

## Latest execution note – Phase 6 RBAC foundation

Added `database/phase6_rbac.sql`, `app/Permissions.php`, `permissions.php` and `README_PHASE6_ROLE_PERMISSIONS.md`. CRM now checks view/create/delete permissions. This is a partial milestone only: the rest of the modules still need explicit permission gates, and live database/browser/adversarial tests have not been run.

## What this means now

- **5 implemented development milestones** are represented in the current source.
- **16 milestones are partial** and need more implementation or integration.
- **9 milestones are pending or unverified** in this exact source folder.
- **All 30 still require acceptance evidence** before being called production complete. The current evidence supports PHP syntax checks and ZIP integrity checks, not complete runtime acceptance.

## Next execution order

1. Phase 23 – central AI engine (after tenant-safe data boundaries are defined), or first complete the platform-critical phases 6–7 if strict sequencing is preferred.
2. Phase 24 – subscription plans and Razorpay lifecycle.
3. Phase 25 – notifications and automation.
4. Phase 26–27 – unified reporting and audit/monitoring.
5. Phase 28–30 – automated tests, security, XAMPP acceptance and cPanel release.

Recommended dependency-first sequence: finish phases 6–7 and 28 foundations before exposing additional modules or AI to production tenants. The roadmap order is a tracking sequence, not permission to bypass dependencies.

## Baseline limitations

The Salon & Spa and Gym & Sports workstreams were discussed and developed separately, but their integration into this exact working source has not been established. The same caution applies to any external ZIP or local project copy not present in this workspace. To verify those integrations, the latest full project folder must be reviewed. Never upload real passwords, API keys, encryption keys, patient records or customer data with that project copy.


## Latest execution note – Phase 10 HRM & Payroll enhancement
Added `hrm-payroll.php`, `hrm-payslip.php`, `database/hrm_phase10.sql` and `README_PHASE10_HRM_PAYROLL.md`; updated `hrm.php` with navigation. Supports branch-scoped leave decisions, monthly salary snapshots, manual earning/deduction components, draft payroll, manual paid reference and printable payslips. This is not statutory payroll. Runtime/database acceptance remains pending.
