Skip to main content

Developer Guide: Navigation Hierarchy, Menu Layout & Deduplication Architecture

This technical guide documents the modular menu taxonomy, permission-aware navigation routers, and deduplication protocols governing the left drawer and operations menus across all business modules.


Table of Contents​

  1. Navigation Architecture & Module Capability Filtering
  2. Operations Menu Taxonomy & Deduplication
  3. Permission-Aware Dynamic Menu Router
  4. Role-Based Module Matrix

1. Navigation Architecture & Module Capability Filtering​

The navigation tree is dynamically derived at runtime based on two parameters:

  1. business_module (RETAIL, RESTAURANT, SUPERMARKET, ALL)
  2. user.permissions (Set<String> resolved from JWT token)
flowchart TD
A[App Startup / Route Request] --> B[Load Token & Business Module]
B --> C{Module Capability Check}

C -->|Has Retail| D[Mount Retail Sales, Pos Terminal, Customer App]
C -->|Has Restaurant| E[Mount Captain Console, Table Setup, Floor Plan, KDS]
C -->|Core Operations| F[Mount Unified Inventory & Procurement]

F --> G{Operations Sub-Menu Deduplication}
G --> H[Unified 'Purchase Orders' - Canonical Route]
G -.->|Removed Redundant| I[Duplicate 'Vendor Purchase Order']

2. Operations Menu Taxonomy & Deduplication​

In earlier iterations, both "Purchase Order" and "Vendor Purchase Order" appeared in the Operations sub-menu. The taxonomy has been unified into a single canonical entry:

Canonical Operations Menu Map:​

SectionMenu LabelTarget ScreenRequired Permission
ProcurementPurchase OrdersPurchaseOrderListScreenPURCHASE_ORDER
ProcurementGoods Receiving (GRN)ReceivingListScreenSTOCK_IN
ProcurementSupplier MasterSupplierMasterScreenSUPPLIER_MASTER
InventoryItem Master & BarcodesItemMasterScreenITEM_MASTER
InventoryStock Taking & AuditStockTakingScreenSTOCK_BALANCE
InventoryStock TransfersStockTransferScreenSTOCK_TRANSFER
InventoryModifiers MasterModifierMasterScreenITEM_MASTER

3. Permission-Aware Dynamic Menu Router​

In lib/core/navigation/home_route_helper.dart and AppDrawer:

  • Single source of truth prevents duplicate routes from being rendered.
  • Menu items verify PermissionService.can(permissionKey).
  • If an operator lacks procurement rights, the entire Purchase Ordersgroup is hidden gracefully.

4. Role-Based Module Matrix​

RoleOperations MenuPOS BillingFloor ConsoleKDSReports
ADMINFullFullFullFullFull
MANAGERFullFullFullFullFull
STOREInventory & POStock Reports
RETAILPOSSales Reports
WAITERFloor Tables
CAPTAINFull Floor
KDSKDS Live