Skip to main content

System Architecture Upgrades & Changelog (Sept 2026 - Nov 2026)

Executive Summary​

This document details all major architectural enhancements, cost optimizations, cloud integrations, and migration features implemented in the Famalth Lynx ERP & POS Suitefrom September 2026 to November 2026.


System Architecture Overview​

graph TD
subgraph Client_Layer["Frontend Client Layer (Flutter Cross-Platform)"]
POS["Retail POS Billing Terminal"]
KDS["Kitchen Display System (KDS)"]
Captain["Captain Console & Floor Tables"]
CustApp["Customer Self-Ordering App"]
RiderApp["Rider & Delivery Portal"]
RetailerApp["Retailer Console & B2B Chat"]
end

subgraph Guard_Layer["Cloud Feature Gate & Lifecycle Manager"]
Gate["CloudFeatureGate (Offline vs. Online Guard)"]
LifeObs["Lifecycle-Aware Timers (WidgetsBindingObserver)"]
Wizard["1-Click Migration Wizard (CloudMigrationScreen)"]
end

subgraph Backend_Layer["Backend Micro-Services (Express / Node.js)"]
AuthSvc["Auth & Multi-Tenant Scoping"]
SalesSvc["Sales, Invoicing & GST Engine"]
MigrateSvc["1-Click Relational Migration Gateway"]
WAQueue["WhatsApp Queue Worker (Adaptive Backoff)"]
SubSvc["Subscription Delivery Engine"]
end

subgraph Storage_Layer["Database & Storage Layer"]
PG["PostgreSQL Database (Multi-Tenant Relational Store)"]
Drive["Google Drive / S3 Encrypted Backups"]
end

Client_Layer --> Guard_Layer
Guard_Layer --> Backend_Layer
Backend_Layer --> Storage_Layer

Comprehensive Changelog & Feature Timeline​

1. Bi-Directional 1-Click Store Migration Engine (Oct 2026)​

  • Problem Solved:
    • In shared multi-tenant cloud databases, other merchants already occupy database IDs (id = 1, 2, 3...). Simply inserting local offline records causes primary key and foreign key constraint violations.
    • When downloading a store from online to offline, leftover local rows can create orphaned or duplicate data.
  • Architecture Implemented:
    • Dynamic Relational ID Translation Engine:
      • Builds in-memory translation hash maps during ingestion (userMap, taxGroupMap, groupMap, brandMap, itemMap, locationMap, customerMap, supplierMap, salesMap, poMap, grnMap, expenseCatMap, accountMap, bankMap, voucherMap, floorMap, areaMap, tableMap, kotMap, empMap).
      • Remaps foreign keys (e.g., sales_items.sale_id = salesMap[oldId], sales_items.item_id = itemMap[oldId], purchase_order_items.po_id = poMap[oldId]).
      • Re-aligns PostgreSQL auto-increment sequence counters (setval(max(id))).
    • Online-to-Offline Clean Wipe & Restore:
      • Cleanly cascades and purges local database tables before importing the cloud store snapshot.
    • Full Table Coverage Across 11 Domains:
      • outlets, users, system_settings, branding, property_info, numbering_settings, tax_groups, categories, brands, item_master, stock_locations, stock_ledger, customers, suppliers, sales_headers, sales_items, purchase_orders, purchase_order_items, expenses, chart_of_accounts, bank_accounts, accounting_vouchers, voucher_lines, floors, dining_areas, restaurant_tables, kot_headers, kot_items, milk_subscriptions, delivery_customers, hr_employees.
    • Flutter UI Migration Wizard:
      • Created CloudMigrationScreen & CloudMigrationService.
      • Provides 2-way toggle: Offline -> Online Cloud and Online Cloud -> Offline.
      • Step-by-step visual tracker and statistical summary cards (Products, Customers, Bills).

2. Cloud Feature Gating & Server Configuration Routing (Oct 2026)​

  • Cloud-Exclusive Modules Guarded:
    • B2B Wholesale Marketplace, Marketplace Vendor Portal & Catalog Publisher, B2B Messaging & Communication Center, Customer Self-Ordering App, Retailer Console, Delivery Rider App, and Online Payment Gateways (Razorpay, Stripe, Paytm, UPI).
  • Behavior by Mode:
    • Online Hosted Mode (!AppConfig.isLocalServer): Features load and connect directly.
    • Local Offline Mode (AppConfig.isLocalServer): Displays the CloudFeatureGate notice explaining self-hosted VPS vs. managed Famalth cloud options.
  • Direct Server Configuration Link:
    • Replaced generic settings redirects with direct navigation to ServerConfigScreen for quick cloud server URL configuration and outlet verification.
  • Settings Tab Cloud Notices:

3. Infrastructure Cost & API Polling Optimizations (Sept-Oct 2026)​

  • WhatsApp Queue Worker Adaptive Backoff:
    • Replaced aggressive 2-second polling with an adaptive idle backoff (sleeps 30 seconds when queue is empty).
    • Added event-driven **wakeWhatsappQueue()**trigger so new invoice notifications process instantly with 0 idle database load (97%+ reduction in idle DB queries).
  • Subscription Delivery Job Active Count Pre-Check:
    • Added global active subscription pre-checks (milk_subscriptions.count()) to skip unnecessary multi-tenant iterations when no active recurring deliveries exist for the day.
  • Lifecycle-Aware Screen Timers (WidgetsBindingObserver):
  • Business Module Polling Gates:
    • Gated KDS and live dining table polling so retail and grocery businesses never hit restaurant endpoints.

4. Design Standardization & High-Entropy Security (Sept 2026)​

  • Design & Color Palette Synchronization:
    • Aligned design tokens, gradients, and elevation styling across Login, Self-Registration, Billing POS, and Settings screens.

5. Backend JavaScript to TypeScript (JS -> TS) Migration (Sept-Oct 2026)​

  • Full-Stack Type Safety:
    • Migrated backend from legacy CommonJS JavaScript to strong **TypeScript (.ts)**with modular tsconfig.json architecture.
    • Converted all controllers (controllers/public/, controllers/auth/, controllers/settings/, controllers/inventory/, controllers/sales/), route files (routes/*.routes.ts), services (services/*.service.ts), jobs (jobs/*.ts), and utility modules (utils/*.ts).
  • Dual Runtime Resilience:
    • Implemented dual-compatibility exporting (module.exports = ...; export default ...;) ensuring seamless support for direct TypeScript execution (ts-node / tsx) and bundled CommonJS production execution.
  • Type-Safe Database Schema Modeling:
    • Integrated Sequelize TypeScript typings across models in backend/db/models/index.ts and backend/models/property/.

6. B2B Wholesale Marketplace & Vendor Onboarding (Sept-Oct 2026)​

  • Vendor Self-Onboarding & Catalog Publishing:
    • Merchants can toggle "Become a Marketplace Vendor", configure Minimum Order Value (MOV), operational regional hub, and accepted payment modes.
    • Automated synchronization of active item_master catalog into the regional marketplace.
  • Regional Multi-City Vendor Discovery:
    • Integrated multi-city filtering (New York, Los Angeles, Chicago, Miami, Dallas, Austin, Seattle, San Francisco, Boston).
    • Category-based trade sector filters: Grocery & Staples, Dairy & Frozen, Bakery & Confectionery, Beverages, Personal Care, Household & Cleaning, Electronics.

7. B2B Direct Trade Chat & Community Hub (Sept-Oct 2026)​

  • Direct Supplier-to-Retailer Messaging:
    • Integrated private 1-on-1 chat (/api/community/*) for instant price quotes, bulk discounts, invoice exchanges, and delivery schedules.
  • Community Trade Groups & Public Channels:
    • Public trade channels, merchant associations, and broadcast announcement feeds.
  • Enterprise Chat Operations:
    • Message editing, Delete for Everyone / Delete for Me, Block/Unblock user moderation, channel join/exit, and real-time unread badges.

8. 1-Click Purchase Order Generation from Vendor Catalog (Sept-Oct 2026)​

  • Direct Catalog-to-PO Conversion:
  • Automated Vendor Linkage:
    • Automatically creates/links the vendor in supplier_master and sets up Goods Receiving Note (GRN) tracking with 1 click.

9. Famalth Lynx AI Assistant & Natural Language PO Generation (Sept-Oct 2026)​

  • Natural Language Store Intelligence:
    • Integrated Lynx AI conversational assistant in LynxAssistModal and ai_assist.controller.ts.
    • Real-time intent detection for revenue analysis, low stock alerts, top-selling items, customer balance lookups, and fast POS voice shortcuts.
  • Direct PO Generation via Natural Language:
    • Users can converse with Lynx (e.g., "Order 50 units of Organic Milk 1L from Amul Dairy").
    • Lynx parses quantities, matches supplier records, extracts item IDs, and drafts structured purchase order intents directly from chat.
  • Universal Dashboard Search Bar:
    • Integrated persistent search header in MainDashboardScreen supporting quick navigation, customer lookup, and Lynx AI query shortcuts.

10. Sticky Notes Collaboration System (Sept-Oct 2026)​

  • Digital Shift Sticky Notes:
    • Floating widget in StickyNotesModal and management via userNote.controller.ts.
    • Color-coded note cards (Yellow, Green, Blue, Purple, Orange, Pink, Teal).
    • Pinned shift notes, copy/duplicate notes, archive workflows, and recycling trash bin management.
    • User-scoped storage guaranteeing confidentiality between shift cashiers and managers.

11. Global Multi-Currency & Multi-Tax Matrix (Sept-Oct 2026)​

  • Multi-Currency Engine:
    • Configurable currency symbols, ISO codes (USD, EUR, GBP, KES, INR, AED, CAD, AUD), symbol placement (before/after amount), and customizable decimal precision.
    • Centralized formatting via CurrencyService and SystemSettings.
  • Flexible Multi-Tax Matrix (GST, CTL, VAT, CESS, Custom):
    • Unified Tax Group system configured via taxGroup.controller.ts and TaxGroup.
    • Support for Single Flat Taxes (VAT, Sales Tax), Split Destination Taxes (Indian GST: CGST + SGST / IGST), Compound Multi-Tier Taxes (CTL + VAT + CESS), and custom enterprise tax schedules.
    • Automated tax calculation in sales orders, purchase orders, invoices, thermal receipts, and financial tax liability ledgers.

12. Staff Quick PIN & Username-Scoped Authentication (Oct 2026)​

  • Pre-Login Quick User Selector:
    • Endpoint GET /api/auth/quick-users delivering active staff with show_in_quick_login = true.
    • Mobile Floor Console (waiter_auth_screen.dart) and Desktop POS (login_screen.dart) user pickers.
  • Username-Scoped Tuple Authentication:
    • Scoped validation via $\langle Outlet Code, Username, PIN \rangle$ eliminating duplicate PIN collisions across staff members.
    • Database migration version 113 adding show_in_quick_login and pin_code to the users table.
    • User Management toggle in Create/Edit user dialogs.

13. Multi-Country Auto-Tax Seeding & Dependency Protection (Oct 2026)​

  • Automated Fiscal Slabs:
    • Auto-generation of country-specific tax rules on initial outlet load:
      • India (IN): GST 5%, GST 18%, IGST 5%, IGST 18%, Nil / Exempt (0%).
      • Germany / EU (DE, EU): Standard MwSt (19%), Reduced MwSt (7%), Zero (0%).
      • USA (US): Sales Tax (8.25%, 6.0%), Tax Exempt.
      • Kenya (KE): Standard VAT (16%), Zero-Rated (0%), Exempt (0%).
      • Brazil (BR): ICMS (18%), PIS/COFINS (9.25%), ISS (5%).
      • UK (GB): Standard VAT (20%), Reduced (5%), Zero (0%).
  • Relational Integrity & Item Reassignment:
    • Safe deletion verification checking item_master.tax_group_id.
    • Atomic reassign-and-delete workflow preventing orphaned items.

14. A5 Half-Page Invoice Engine & Template Customization (Oct 2026)​

  • Dedicated A5 Geometry:
    • High-precision vector rendering for standard A5 sheets ($148 \times 210 mm$, $419.53 \times 595.28 pt$).
    • Supported alongside Thermal 80mm, Thermal 58mm, and A4 formats.
  • Persistent A5 Configuration:
    • Stored in system_settings.a5_template_config JSONB column.
    • Direct format routing in pdf_preview_dialog.dart and pos_invoice_printer.dart.

15. Dynamic Console Routing & Multi-Channel Dispatch (Oct 2026)​

  • Automated Workstation Routing:
    • Segregated order dispatching based on order origin and assigned role:
      • Dining Floor / Table QR $\rightarrow$ Captain / Waiter Console (CaptainDashboardScreen).
      • Retail Mobile App / Web Catalog $\rightarrow$ Retailer Operations Console (RetailerConsoleScreen).
      • Home Delivery $\rightarrow$ Rider & Logistics Portal (RiderPortalScreen).

16. Contactless QR Table Ordering & Digital Dining Suite (Oct 2026)​

  • Table QR Designer & Print Geometry Engine:
    • 5 physical print formats in table_qr_designer_screen.dart (Google Standee, Foldable Tent Card, Acrylic Stand, Sticker Disc, A4 Multi-Table Grid Sheet).
    • QR payloads with deep link schema: http://{server_ip}:3000/#/dining?outlet_id=...&table_id=....
  • Zero-Install Customer Dining Web App:
    • Live digital menu browsing (table_dining_screen.dart) with pure veg / non-veg switches, search, and modifier customization.
    • Real-time kitchen state polling and live status progression (Placed $\rightarrow$ Preparing $\rightarrow$ Served).
  • Automatic KOT Firing & Table Session Merging:
    • Atomic KOT dispatching via dining.controller.ts pushing orders directly to Kitchen Display Systems (KDS), thermal printers, and Captain Consoles.

17. Fast PIN Login & Post-Login Preloading Optimization (Oct 2026)​

  • Staff Quick-Login & User Dropdown Matrix:
    • Direct PIN entry without requiring typing lengthy email/passwords on mobile screens.
    • User dropdown selector in login_screen.dart and waiter_auth_screen.dart dynamically filtered by show_in_quick_login = true.
    • Outlet-scoped PIN validation ensuring that multiple staff with identical numeric PINs (e.g. 1234) are safely authenticated by resolving (outlet_id, username, pin_code).
  • Post-Login Pre-Warming Pipeline:
    • Parallel asynchronous preloading of taxes, payment methods, categories, and offline cached catalogs to reduce post-login wait times by over 80%.

18. Captain Console & Floor Table Management (Oct 2026)​

  • Multi-Client Separate Bills per Table:
    • Support for multiple independent guest sub-sessions/tickets seated at the same physical table.
    • Each client ticket can order, generate distinct KOTs, and settle bills independently without closing the physical table.
  • Waiter/User Table Assignment:
    • Real-time binding of specific tables or floor sections to individual waiters and captains (restaurant_tables.assigned_user_id).
  • Bulk Table Import from Excel:
    • Built-in Excel/CSV parser and template validator importing hundreds of tables across floors and dining areas in a single operation.

19. Navigation Menu Taxonomy & Deduplication (Oct 2026)​

  • Consolidated Operations Menu:
    • Removed duplicate entries (Purchase Order vs. Vendor Purchase Order) under Operations, establishing a single canonical route to PurchaseOrderListScreen.
  • Permission-Driven Dynamic Sidebar:
    • Dynamic sidebar rendering based on active business module (RETAIL, RESTAURANT, SUPERMARKET) and granular user permissions.

20. Vendor Lifecycle, Purchase Engine & COA Integration (Oct 2026)​

  • Optional State for International Vendors:
    • Relaxed mandatory state validation for cross-border and international supplier registration.
  • Vendor Opening Balance with Automated COA Ledger Sync:
    • Entering an opening balance on vendor creation automatically posts double-entry vouchers to Accounts Payable and Opening Balance Offset.
  • VAT-Inclusive Net Amount Rounding:
    • Fixed fractional cent calculation disputes by enforcing standard integer rounding (Math.round(...)) for net invoice amounts when taxes are inclusive.
  • Dynamic Custom Payment Methods & COA Account Binding:
    • Custom payment methods defined under Settings now seamlessly populate supplier payment screens and map to their respective Balance Sheet asset accounts in Chart of Accounts (payment_methods.coa_account_id).

21. Stock Taking, Item Modifiers & Operator-Only GRN Doctrine (Oct 2026)​

  • Physical Stock Taking & Variance Reconciliation:
    • Dedicated cycle count screen tracking Item Name, Unit, Current System Balance, Counted in Hand, Variance, and Reason/Remarks, with filtering by department, search, and audit reports.
  • Modifiers & Add-ons Engine (e.g., Extra Cheese):
    • Full Add/Edit/Delete lifecycle for item modifiers with optional raw material stock deduction (e.g., deducting 30g cheese from inventory per burger).
  • Dietary Tagging & Waiter App Direct KOT Dispatch:
    • Veg / Non-Veg / Vegan dietary tags in Item Master and POS item cards.
    • Waiter app direct kitchen dispatch with immediate KOT thermal printing and KDS sync.
  • Operator-Only Manual GRN Physical Receiving Doctrine:
    • Clarified and verified that Goods Receiving (GRN) is strictly manual upon operator inspection and physical counting; GRNs are NEVER auto-generated on PO placement.

Key File Map​

File PathRole / Description
backend/controllers/public/migration.controller.ts & .jsBi-directional migration controller with Relational ID Translation & sequence syncing
backend/routes/public.routes.ts & .jsMounts migration endpoints (ping, export-bundle, import-bundle, sync-online-to-offline)
backend/controllers/community.controller.ts & .jsB2B Community chat, group channels, direct merchant messaging
backend/routes/community.routes.ts & .jsMounts community & chat endpoints (conversations, messages, merchants, channels)
backend/services/community.service.ts & .jsBusiness logic for B2B chat, moderation, and channel routing
backend/controllers/ai_assist.controller.ts & .jsLynx AI engine handling NLP store queries and chat PO intent drafting
backend/controllers/notes/userNote.controller.ts & .jsSticky notes controller supporting color codes, pinning, trash & restore
backend/controllers/settings/taxGroup.controller.ts & .jsMulti-Tax group manager for GST, VAT, CTL, CESS & custom taxes
backend/jobs/whatsappQueueJob.ts & .service.tsWhatsApp queue worker with adaptive backoff & instant wake event
backend/jobs/subscriptionDeliveryJob.tsDaily recurring subscription generator with active count pre-check
lib/core/services/cloud_migration_service.dartClient-side migration service for export, upload, pull, and configuration switch
lib/screens/dashboard/cloud_migration_screen.dartInteractive 1-Click Migration Wizard with bi-directional toggle & live stats
lib/screens/community/community_hub_screen.dartB2B Community hub and channel directory
lib/screens/community/chat_conversation_screen.dartReal-time direct chat with vendors & retailers
lib/screens/inventory/b2b_marketplace_screen.dartB2B Wholesale Marketplace with vendor discovery & direct PO cart
lib/controllers/inventory/marketplace_controller.dartMarketplace state management & direct PO generation
lib/widgets/lynx_assist_dialog.dartFamalth Lynx AI assistant voice & chat interface
lib/widgets/sticky_note_widget.dartColor-coded draggable and pinnable sticky notes widget
lib/widgets/cloud_feature_gate.dartCloud feature gate with direct server config & migration wizard actions
lib/screens/dashboard/server_config_screen.dartDedicated server configuration & migration launcher screen
lib/screens/settings/settings_screen.dartSettings screen with cloud banners and 1-Click Migration launcher
docs/One-Click-Cloud-Migration-Guide.mdArchitectural guide and table mapping reference for migrations
docs/B2B-Marketplace-And-Community-Guide.mdArchitecture guide for Marketplace, Vendor Onboarding, Chat & POs
docs/Lynx-AI-StickyNotes-Currency-Tax-Guide.mdArchitecture guide for Lynx AI, Sticky Notes, Multi-Currency & Tax Matrix
docs/System-Architecture-And-Changelog.mdComprehensive system architecture and chronological upgrades changelog
docs/Developer-Guide-QR-Table-Ordering.mdArchitecture, KOT state machine & API guide for QR Table Dining
docs/User-Guide-QR-Table-Ordering.mdOperations guide for designing table QR standees and managing dining orders
docs/Developer-Guide-Staff-PIN-And-Quick-Login.mdArchitecture & API guide for Staff PIN and User Dropdown
docs/User-Guide-Staff-PIN-And-Quick-Login.mdOperational guide for staff PIN setup and mobile login
docs/Developer-Guide-Fast-Login-And-Preloading.mdPreloading architecture, cache warmup & benchmark optimizations
docs/User-Guide-Fast-Login-And-PIN-Access.mdUser guide for rapid PIN authentication & post-login load speedup
docs/Developer-Guide-Captain-Console-Table-Management.mdArchitecture for multi-client table orders, waiter assignment, and Excel bulk table import
docs/User-Guide-Captain-Console-Table-Management.mdOperations guide for managing split bills, assigning tables, and importing floor plans
docs/Developer-Guide-Menu-Layout-And-Deduplication.mdNavigation taxonomy, permission filtering, and route deduplication
docs/User-Guide-Navigation-And-Menu-Structure.mdStep-by-step navigation guide, drawer hierarchy, and role views
docs/Developer-Guide-Vendor-Purchase-And-COA-Integration.mdTechnical specifications for vendor opening balance, VAT rounding, and COA binding
docs/User-Guide-Vendor-Purchase-And-Payments.mdUser guide for vendor onboarding, PO/GRN integer rounding, and COA payment methods
docs/Developer-Guide-Stock-Taking-Modifiers-And-GRN-Verification.mdArchitecture for cycle count audits, modifier raw stock deduction, and operator-only GRN
docs/User-Guide-Stock-Taking-Modifiers-And-GRN-Verification.mdUser guide for physical stock audits, extra cheese modifiers, and manual GRN checking
docs/Developer-Guide-Auto-Tax-Seeding-And-Tax-Integrity.mdMulti-Country Tax Seeding and Relational Item Integrity
docs/User-Guide-Auto-Tax-Seeding-And-Tax-Integrity.mdUser guide for international taxes and safe tax replacement
docs/Developer-Guide-Dynamic-Console-Routing.mdMulti-channel order routing architecture & dispatching
docs/User-Guide-Dynamic-Console-Routing.mdUser guide for order flows across Captain, Retailer, and Rider consoles
docs/Developer-Guide-Payment-Gateways-And-Virtual-Simulator.mdMulti-gateway backend architecture and Virtual Payment Simulator state machine
docs/User-Guide-Payment-Gateways-And-Virtual-Simulator.mdStep-by-step user guide for configuring gateways and simulating digital checkout
docs/Developer-Guide-Plugin-Dev-Studio-And-Sandbox.mdIn-app Plugin Dev Studio, safe TypeScript runner, and lifecycle hooks
docs/User-Guide-Plugin-Dev-Studio-And-Marketplace.mdUser guide for browsing marketplace plugins and coding custom store automations
docs/Developer-Guide-Third-Party-Orders-And-Outlet-OTP.mdAggregator order ingestion architecture, commission engine, and outlet onboarding OTP
docs/User-Guide-Third-Party-Orders-And-Outlet-OTP.mdUser guide for viewing third-party aggregator analytics and outlet OTP verification
docs/Developer-Guide-Operations-Document-Modification-Workflows.mdDifferential stock ledger algorithm, concurrency locks, and document revision tracking
docs/User-Guide-Operations-Document-Modification-Workflows.mdUser guide for safely editing existing POs, GRNs, requisitions, and stock issues

22. Omnichannel Payment Gateways & Virtual Payment Simulator (Oct 2026)​

  • Omnichannel Gateway Hub (payment_gateways_screen.dart):
    • Unified configuration for Razorpay, Stripe, Square POS, PayPal, M-Pesa (Kenya), and UPI QR payments.
    • Secret key masking (********), test/sandbox vs. live environment switches, and direct vs. hold settlement modes.
  • Interactive Virtual Payment Simulator (virtual_payment_simulator_dialog.dart):
    • In-app terminal dialog simulating digital transactions during POS checkout.
    • Simulates dynamic UPI QR scanning, card tap/chip insertion with mock approval codes/RRNs, and M-Pesa STK push polling.

23. In-App Plugin Dev Studio & Sandboxed Marketplace (Oct 2026)​

  • Plugin Dev Studio (plugin_dev_studio_screen.dart):
    • Integrated in-app IDE with TypeScript/JavaScript support, manifest builder, and instant syntax validation.
    • Sandbox test console with execution timer, console log capture, and mock payload execution.
  • Safe Cloud Plugin Runner (plugin_runner.service.ts):
    • Production TypeScript dependency configuration ensuring zero-crash deployments on Render/cloud platforms.
    • Sandboxed execution of lifecycle hooks (onInit, onPaymentCreate, onSaleComplete, onKotCreated, onInventoryDeduct).

24. Third-Party Orders Report & Outlet Onboarding OTP (Oct 2026)​

  • Third-Party Delivery Analytics (third_party_orders_report_screen.dart):
    • Unified report tracking orders from Zomato, Swiggy, UberEats, and B2B distributor marketplaces.
    • Real-time calculation of gross revenue, platform commission deductions, and net expected bank payout.
  • Cryptographic Outlet Onboarding OTP (/api/public/outlet):
    • 6-digit SMS and email verification before branch creation to prevent unauthorized store provisioning.
    • Automated welcome email dispatch with initial admin login credentials and branch web POS URL.

25. Operations Document Modification Workflows (Oct 2026)​

  • Differential Document Revisions:
    • Dedicated high-speed screens for modifying existing Purchase Orders (purchase_modify.dart), Goods Receiving (receiving_modify.dart), Store Requests (request_modify.dart), and Stock Out notes (stock_out_modify.dart).
    • Automated differential inventory posting (delta_in, delta_out) without deleting audit history or corrupting stock ledgers.

26. Model Context Protocol (MCP) & External AI Gateway (Nov 2026)​

  • Architecture & Standards:
    • Implemented an enterprise **Model Context Protocol (MCP)**server on /api/v1/developer/mcp supporting Server-Sent Events (SSE) and JSON-RPC 2.0.
    • Direct execution bridge for OpenAI ChatGPT Actions, Claude Desktop, Google Gemini, and Cursor AI.
  • OAuth 2.0 & RFC 8414 Auto-Discovery:
    • Complete RFC 6749 OAuth 2.0 authorization server with RFC 7636 PKCE (code_challenge / code_verifier).
    • Implemented RFC 8414 metadata discovery at GET /.well-known/oauth-authorization-server allowing 1-click discovery in ChatGPT without manual parameter typing.
  • Dynamic Spec Generators:
    • Dynamic OpenAPI 3.0 specification (/api/v1/developer/mcp/chatgpt-openapi.json) reflecting active host and SSL domain.
    • Native Google Gemini Function Calling declaration schema (/api/v1/developer/mcp/gemini-tools.json).
  • Multi-Tenant Scoping Engine (resolveMcpOutletContext):
    • Enforces strict outlet-scoped access control; AI models can only access the caller's assigned outlet or linked franchise clusters.
  • 6 Production Tools:
    • analyze_sales: Period revenue, AOV, payment splits, hourly volume, and top velocity items.
    • create_order_bill: Creates POS sales bills, deducts inventory, and outputs receipts.
    • get_inventory_status: Stock levels, reorder alerts, and warehouse batch counts.
    • search_products: Multi-attribute keyword search across names, SKUs, and barcodes.
    • get_order_details: Detailed receipt breakdown by invoice number.
    • get_customer_insights: RFM loyalty score, lifetime spending, and outstanding ledger balance.

27. Universal Companion Apps Suite & QR Scan-to-Connect (Nov 2026)​

  • Instant Staff Configuration Dialog (AppSetupQrDialog.show):
    • Replaced manual IP and port configuration with 1-tap QR scan-to-connect.
    • Generates high-resolution vector QR codes encoding server host, outlet ID, and store name.
    • Staff scan the standee from any Android, iOS, or tablet device running the Waiter or Mobile Billing app to connect in under 3 seconds.
  • Customer Dining & Storefront Standees:
    • Toggle to customer mode for digital table dining, self-ordering catalogs, and clinic appointments with vector PDF counter standee printing.

28. Handheld Mobile Billing Suite & Bottom Drawers (Nov 2026)​

  • Full-Featured Mobile POS (MobileBillingAppScreen):
    • 5 dedicated tabs: High-speed barcode billing with camera scanner, order history & instant thermal reprints, milk/grocery subscriptions, real-time analytics, and workstation hardware profiles.
  • 5 Mobile Operational Sheets:
    • mobile_bill_modify_sheet.dart: In-place item modification and price updates on existing bills.
    • mobile_cash_ledger_sheet.dart: Live cash drawer balance, pay-ins, and pay-outs.
    • mobile_customer_ledger_sheet.dart: Customer credit balance ledger, debt collection, and receipt generation.
    • mobile_item_master_sheet.dart: Mobile item search and camera-based barcode tagging.
    • mobile_stock_balance_sheet.dart: Instant warehouse stock and batch audit.

29. Numbering Settings v2 & Concurrency-Safe Sequence Engine (Nov 2026)​

  • Race Condition Elimination (numberingSettingsV2.controller.ts):
    • Resolved duplicate invoice numbers during simultaneous checkout across multiple POS and mobile terminals.
    • Implemented row-level locking (transaction) and atomic increment of last_used_no.
  • Exhaustive Module Prefix Fallbacks:
    • Standardized fallback prefixes for all 12 operational modules: SALES (FAM-), TOKEN (TK-), KOT (KOT-), RECEIVING (RC-), PO (PO-), INDENT (INT-), REQUEST (REC-), DAMAGE (DMG-), CONTRA (CNT-), PAYMENT (PAY-), RECEIPT (RCT-), JOURNAL (JRN-).

30. Dynamic Server Port Resolution & Auto-Discovery (Nov 2026)​

  • Automatic Port Conflict Handling:
    • If the primary port 3000 is occupied by another process, the backend automatically binds to an available ephemeral port and records it to server_port.txt.
    • Flutter client resolveServerPort() reads the active port file, ensuring seamless local startup without manual port re-configuration.

31. Modern CI/CD Pipeline & Slim Docker Deployment (Nov 2026)​

  • GitHub Actions Web Compilation (.github/workflows/auto_deploy.yml):
    • Offloaded heavy Flutter web builds (flutter build web --release) to GitHub Actions CI runners.
  • Lightweight Node-Only Container (Dockerfile.web, render.yaml):
    • Production containers on Render.com run a slim Node.js alpine image that serves pre-built static web assets and Express APIs.
    • Reduced Docker image footprint from 2.5GB to under 250MB, dramatically cutting cold-start and deployment times.

32. Statutory GST Compliance & ITR Filing Hub (Nov 2026)​

  • Outward & Inward Tax Aggregators (taxCompliance.controller.ts):
    • Auto-computes GSTR-1 Table 4 (B2B with customer GSTIN), Table 5 (B2C Large), Table 7 (B2C Small), Table 9B (Credit Notes), and Table 12 (HSN/SAC summary).
    • Direct GSP cloud submission with mutual TLS and official government JSON export for zero-error drag-and-drop filing.
  • ITR-4 & ITR-5 Statutory Statement Mapping:
    • Implemented Section 44AD presumptive turnover splits (6% digital vs. 8% non-digital revenue).
    • Automated generation of Trading/Manufacturing P&L, Section 32 WDV depreciation schedules, and Balance Sheet capital/debt classifications.

33. HRMS Employee Self-Service Mobile Portal & Geofenced Punch (Nov 2026)​

  • Haversine Geofenced GPS Attendance (employee_portal_screen.dart, hrms.controller.ts):
    • High-precision mathematical distance validation restricting punch-in/out to the employee's assigned store or office radius.
    • Hardware device binding to eliminate buddy punching, front-camera selfie verification, and shift grace period calculations.
  • Self-Service Workplace Desk:
    • Calendar heatmap, leave applications with manager approval workflows, salary advance/loan requests, payslip PDF downloads, and email OTP password resets.

34. Logistics Fleet Driver Portal & Doorstep OTP Verification (Nov 2026)​

  • Dedicated Driver Web & Mobile Portal (driver_portal_screen.dart, transport.controller.ts):
    • Real-time trip loading manifest, turn-by-turn navigation, and customer phone dialer.
    • Doorstep verification via automated 6-digit customer OTP or touchscreen signature capture on glass under GST Rule 55.
    • Real-time GPS location beacon updates (/api/transport/driver/update-location) with reverse geocoding into readable street names and live dispatcher map tracking.

35. Mobile Damage Goods & Dockside Receiving (GRN) Sheets (Nov 2026)​

  • Mobile Damage Item Sheet (mobile_damage_item_sheet.dart):
    • Fast warehouse floor write-off for damaged, expired, or spoiled products with photo documentation and instant inventory adjustment.
  • Mobile Goods Receiving Sheet (mobile_goods_receiving_sheet.dart):
    • Dockside inbound shipment check-in, physical barcode package scanning with phone camera, and differential GRN variance logging.

36. Enterprise Cloud Migration Hardening & Backup Rules v3-v5 (Nov 2026)​

  • Migration Foreign Key Resolution (migration.controller.ts):
    • Dynamically resolves complex database foreign keys, coerces string decimals to integer columns, remaps user_id and created_by references, and preserves linked outlet clusters during cloud migrations.
  • Automated Backup Rules v3-v5:
    • Automated retention pruning, encrypted off-site cloud replication, and email OTP authorization safeguards for sensitive database restorations.

37. Full ERP MCP Tools Suite (30+ Tools & Prompts) (Nov 2026)​

  • Full Enterprise ERP Extension (backend/services/mcpErpTools.service.ts):
    • Expanded the MCP server from 6 core POS tools to 30+ full ERP toolsspanning Accounting (get_accounting_reports, manage_bank_and_capital, record_finance_entry, get_party_ledgers), Store Profile (get_outlet_profile), Procurement (create_purchase_order, approve_purchase_order, create_supplier), Hospitality (create_table_order), HRMS (get_attendance, create_employee), Loyalty & Promos (manage_loyalty_program, manage_lucky_draw_campaign, manage_pricing_and_promos, manage_sales_schemes), Master Data CRUD (create_master_record, list_master_records, update_master_record, create_tax_group, manage_payment_methods), and System/Backups (create_outlet_backup, manage_plugins, create_subscription).
  • MCP Prompts (prompts/list, prompts/get):
    • Added built-in retail_analyst and pos_cashier system prompts to prime external LLMs with domain-specific POS & ERP instructions.

38. Monthly Stock Closing Engine & Snapshot Report (Nov 2026)​

  • Automated Month-End Inventory Archival (monthlyStockClosingJob.ts, monthlyStockClosingReport.controller.ts):
    • Scheduled background job snapshots Opening, Inward, Outward, and Closing stock quantities & FIFO/Average valuations at the end of every month.
    • Added MonthlyStockClosingReportScreen with on-demand **"Run Closing Now"**execution (POST /api/reports/monthly-stock-closing/run).

39. Outlet-Scoped Master Data Purge, Retention & Hierarchy Linking (Nov 2026)​

  • Outlet-Scoped Master Data Purge (settings_screen.dart, dataRetention.service.ts):
    • Safe branch-isolated master data purge and user data deletion workflows ensuring zero cross-tenant collateral impact.
  • Outlet Hierarchy Linking UI (outlet_hierarchy_linking_screen.dart):
    • Redesigned visual multi-branch hierarchy linking screen for associating master flagship hubs with child outlets and synchronizing shared access clusters.

40. Active User Session Enforcement & Master Deduplication (Nov 2026)​

  • Real-Time Inactive User Blocking (auth.middleware.ts):
    • Enforces live is_active user status checks on authenticated API requests so deactivated staff accounts lose access immediately without waiting for JWT expiry.
  • Master Deduplication Engine (backend/utils/masterDedupe.ts):
    • Prevents duplicate master items, suppliers, and employee records during cloud imports and multi-branch synchronizations.

41. MCP Warehouse, GRN & Vendor Settlement Expansion (38 Tools) (Nov 2026)​

  • 8 New Operational ERP MCP Tools (mcpErpTools.service.ts):
    • Added create_receiving (GRN inward), create_stock_dispatch (department/branch issues), create_material_requisition, create_department_return, create_damage_entry (spoilage write-offs), create_vendor_return (debit notes), list_supplier_bills, and pay_supplier_bill (supplier settlement with ledger posting).
    • Expanded total production MCP tool suite from 30 to 38 full ERP & POS tools.

42. HRMS Fixed Salary Component & Payroll Refinements (Nov 2026)​

  • Fixed Monthly Amount Input (hrms_masters_screen.dart, payroll_screen.dart):
    • Salary components configured as Fixed now accept and display direct monthly flat currency amounts (₹<amount> / month) alongside Percentage (%) and Formula expressions.
    • Synchronized payroll calculation, office portal attendance checks, and delivery challan refinements across backend and Flutter clients.

43. Automated Payroll Scheduler Engine (payrollSchedulerJob.ts) (Nov 2026)​

  • Scheduled Auto-Payroll Execution (backend/jobs/payrollSchedulerJob.ts):
    • Runs daily at 09:05 AM server time (plus a 15-second post-startup check) via node-cron.
    • Evaluates each active outlet's outlet_settings.settings.pay_schedule (Last Day or specific day of month, respecting first_month).
    • Automatically invokes hrmsCtrl.runPayroll for the current YYYY-MM period when due, preventing duplicate runs via hr_payroll_runs checks.

44. Dining AI Chat / Voice Waiter & Reservation Dashboard Cards (Nov 2026)​

  • Dining AI Chat & Voice Waiter (table_dining_screen.dart, dining.controller.ts):
    • Integrated conversational AI chat and voice waiter support directly into the contactless QR dining portal, powered by database-synced AI API keys (propertyInfo.controller.ts).
  • Restaurant KPI & Reservation Banners (main_dashboard_screen.dart, table_reservation_screen.dart):
    • Added restaurant-specific Today Bookings, Today Events, Upcoming Bookingscards, and Today Reserved Tablesbanner, plus improved reservation release workflows and color-coded reservation status reports.

45. Clinic Slots, Prescription PDF & Operations Refinements (Nov 2026)​

  • Clinic OPD & Prescription Upgrades (clinic_dashboard_screen.dart, clinic_prescription_pdf.dart, public_appointment_booking_screen.dart):
    • Enhanced appointment time-slot scheduling, public booking UI, and prescription vector PDF rendering.
  • Inventory, Reports & Lucky Draw Refinements:
    • Synchronized purchase_report_screen.dart, stock_out_report_screen.dart, cashier_handover_report_screen.dart, night_audit_screen.dart, lucky_draw_campaign_screen.dart, and document modification screens (receiving_modify.dart, request_modify.dart) with updated backend controllers and mcpErpTools.service.ts.