{
  "product": "Lensnew Optical BOS",
  "version": "2.0.0",
  "last_updated": "2026-08-13",
  "description": "Lensnew Optical BOS is India's leading offline-first Optical ERP, POS, and Lab Workflow Management System. Built for retail optical stores, prescription lens laboratories, and B2B optical wholesalers who need complete control over their data and operations.",
  "modules": [
    {
      "id": "pos-retail-billing",
      "name": "Retail POS Billing",
      "category": "POS & Billing",
      "status": "IMPLEMENTED",
      "description": "Full-featured retail point-of-sale built for Indian optical stores. Generate GST-compliant tax invoices in seconds, accept split payments (cash, card, UPI, wallet), apply item-level or bill-level discounts, and print instantly on 58mm or 80mm thermal paper. Every sale links automatically to customer prescription history and inventory.",
      "route": "/billing",
      "segment": "retail",
      "user_roles": ["admin", "salesperson", "manager", "cashier"],
      "plans": ["free", "basic", "lite", "pro", "enterprise"],
      "key_capabilities": [
        "GST Tax Invoice (A4/A5) with auto HSN/SAC",
        "Multiple Payment Modes — Cash, Card, UPI, Wallet, Split",
        "Barcode/QR Code Scanning for fast product entry",
        "Item-level & Bill-level Discounts with rules",
        "Walk-in & Registered Customer Billing",
        "Prescription-linked Billing (auto-fetch latest Rx)",
        "Instant Thermal Receipt (58mm/80mm ESC-POS)",
        "Invoice Sharing via WhatsApp, SMS, Email",
        "Round-off & GST Auto-calculation (5/12/18/28%)",
        "Invoice Customization — Logo, Terms, Footer",
        "Hold/Recall Bills for busy counters",
        "Refund & Exchange Handling with stock restore"
      ],
      "dependencies": ["customers", "inventory", "prescriptions"],
      "backend": "Dexie IndexedDB (offline-first), PocketBase sync",
      "offline_support": true,
      "sync_support": true
    },
    {
      "id": "prescription-management",
      "name": "Prescription & Clinical History Engine",
      "category": "Clinical",
      "status": "IMPLEMENTED",
      "description": "Complete optical prescription management designed for Indian optometry practice. Record SPH, CYL, AXIS, ADD, PD, Prism for both eyes, plus contact lens Base Curve and Diameter. Track lens material (CR39, Poly, Trivex, High Index 1.56–1.74), coatings (Blue Cut, AR, Photochromic, Mirror), and clinical notes per visit. Full history timeline with expiry alerts.",
      "route": "/billing, /customers",
      "segment": "retail",
      "user_roles": ["admin", "optometrist", "salesperson"],
      "plans": ["free", "basic", "lite", "pro", "enterprise"],
      "key_capabilities": [
        "SPH, CYL, AXIS, ADD, PD, Prism — Right & Left Eye",
        "Contact Lens BC/DIA Support",
        "Lens Material: CR39, Polycarbonate, Trivex, High Index",
        "Lens Index Options: 1.56, 1.61, 1.67, 1.74",
        "Coatings: Blue Cut, Anti-Reflective, Photochromic, Mirror, Tint",
        "Prescription History Timeline per Customer",
        "Prescription Expiry Alerts (configurable)",
        "Clinical Notes per Visit",
        "Digital Signature Support for Optometrist",
        "Auto-populate Rx into POS Billing"
      ],
      "dependencies": ["customers"],
      "backend": "Dexie prescriptions table v22, PocketBase prescriptions collection",
      "offline_support": true,
      "sync_support": true
    },
    {
      "id": "optometrist-appointments",
      "name": "Optometrist Appointments & Slot Scheduling",
      "category": "Clinical",
      "status": "IMPLEMENTED",
      "description": "30-minute slot grid from 10 AM to 8 PM with multi-optometrist support. Book Refraction, Contact Lens Fitting, Glaucoma Test, or General Checkup. Walk-in registration for new patients, existing customer lookup by name/phone. One-click 'Create Rx & Bill' jumps straight to POS with patient pre-loaded. Status tracking: Booked, Completed, No-show, Cancelled.",
      "route": "/appointments",
      "segment": "retail",
      "user_roles": ["admin", "optometrist", "salesperson", "receptionist"],
      "plans": ["free", "basic", "lite", "pro", "enterprise"],
      "key_capabilities": [
        "30-min Slot Grid (10:00–20:00) — Daily/Weekly/Monthly Views",
        "Multi-optometrist Calendar with Color Coding",
        "Exam Types: Refraction, CL Fitting, Glaucoma, General",
        "Walk-in Quick Registration (Name, Phone, Age)",
        "Existing Customer Lookup & Auto-fill",
        "1-Click 'Create Rx & Bill' → POS with Patient Pre-loaded",
        "Appointment Status: Booked/Completed/No-show/Cancelled",
        "SMS/WhatsApp Appointment Reminders",
        "Block Slots for Doctor Breaks/Lunch",
        "Daily Appointment Summary Report"
      ],
      "dependencies": ["customers", "prescriptions"],
      "backend": "Dexie appointments table v22",
      "offline_support": true,
      "sync_support": true
    },
    {
      "id": "warranty-repair-job-cards",
      "name": "Warranty Claim & Frame/Lens Repair Job Cards",
      "category": "Lab & After-Sales",
      "status": "IMPLEMENTED",
      "description": "End-to-end repair tracking for broken temples, scratched lenses, coating peeling, loose screws, nosepad replacements. Free warranty claims linked to original bill/serial number with supplier warranty tracking. Print professional repair receipt slips with disclaimer terms. Status pipeline from Received → In Progress → Ready → Delivered with customer notifications.",
      "route": "/lab-jobs",
      "segment": "lab",
      "user_roles": ["admin", "lab_operator", "fitter", "salesperson"],
      "plans": ["basic", "lite", "pro", "enterprise"],
      "key_capabilities": [
        "Defect Categories: Temple Broken, Hinge Snap, Lens Scratched, Coating Defect, Screw/Nosepad",
        "Free Warranty Claim Tagging with Bill/Serial Lookup",
        "Supplier Warranty Tracking & Claim Status",
        "Active Repair Tickets Dashboard",
        "Printable Warranty & Repair Receipt Slip with Disclaimer",
        "Repair Status Pipeline: Received → In Progress → Ready → Delivered",
        "Customer Notification on Ready (WhatsApp/SMS)",
        "Cost Estimation & Customer Approval Workflow",
        "Repair History per Customer/Frame",
        "Photo Attachments for Damage Documentation"
      ],
      "dependencies": ["customers", "inventory", "lab_jobs"],
      "backend": "Dexie repairJobs table v22",
      "offline_support": true,
      "sync_support": true
    },
    {
      "id": "automated-4-trigger-crm",
      "name": "Automated 4-Trigger CRM Recalls & WhatsApp Nudges",
      "category": "CRM & Retention",
      "status": "IMPLEMENTED",
      "description": "Hands-free customer retention engine. Runs daily auto-scan across your database for four triggers: 12-month annual eye exams due, contact lens expiry (daily/monthly disposables), birthday greetings with loyalty discounts, and completed orders ready for pickup. One-click WhatsApp direct chat with pre-filled personalized message — no copy-paste. Track recall completion and opt-outs.",
      "route": "/recalls",
      "segment": "retail",
      "user_roles": ["admin", "salesperson", "manager"],
      "plans": ["lite", "pro", "enterprise"],
      "key_capabilities": [
        "Trigger 1: 12-Month Annual Eye Exam Due",
        "Trigger 2: Contact Lens Expiry & Renewal (Daily/Monthly)",
        "Trigger 3: Birthday Greetings with Loyalty Discount Coupon",
        "Trigger 4: Order Pickup Ready (Completed Glasses Awaiting Collection)",
        "Auto-scan Scheduler (Daily/Weekly/Manual)",
        "1-Click WhatsApp Direct — Pre-filled Personalized Message",
        "Custom Message Templates per Trigger",
        "Recall History & Status Tracking (Pending/Sent/Completed/Opt-out)",
        "Opt-out Management (DND Compliance)",
        "Campaign Analytics — Open Rate, Conversion, Revenue Attribution"
      ],
      "dependencies": ["customers", "prescriptions", "orders"],
      "backend": "Dexie customers/prescriptions/orders querying engine",
      "offline_support": true,
      "sync_support": true
    },
    {
      "id": "8-stage-lab-work-orders",
      "name": "8-Stage Lens Lab Work Order QR Tracking",
      "category": "Lens Laboratory",
      "status": "IMPLEMENTED",
      "description": "Complete optical lab workflow from order to dispatch. Eight stages: Sales Order Received → Surface Recipe Creation → Lens Cutting/Surfacing → Edging & Beveling → Coating (AR, Blue Cut, Tint, Mirror) → Fitting QA Inspection → Ready for Dispatch → Dispatched to Store. Each job gets a scannable QR sticker for tray tracking. Real-time status updates, lab operator assignment, SLA tracking per stage, defect logging with remake handling.",
      "route": "/lab-jobs",
      "segment": "lab",
      "user_roles": ["admin", "lab_operator", "fitter", "manager"],
      "plans": ["lite", "pro", "enterprise"],
      "key_capabilities": [
        "Stage 1: Sales Order Received (auto from POS)",
        "Stage 2: Surface Recipe Creation (Base Curve, Power, Add)",
        "Stage 3: Lens Cutting/Surfacing (Generator/CNC)",
        "Stage 4: Edging & Beveling (Frame Shape Matching)",
        "Stage 5: Coating — AR, Blue Cut, Tint, Mirror, Hydrophobic",
        "Stage 6: Fitting & QA Inspection (Power, Axis, Prism, Cosmetic)",
        "Stage 7: Ready for Dispatch (Final QC Pass)",
        "Stage 8: Dispatched to Store (Delivery Tracking)",
        "QR Sticker Printing for Lens Trays (Scan at Each Stage)",
        "Real-time Status Updates via Dashboard",
        "Lab Operator Assignment per Stage",
        "SLA Tracking per Stage with Alerts",
        "Defect Logging & Remake Handling",
        "Customer Pickup Notification (WhatsApp/SMS)"
      ],
      "dependencies": ["customers", "prescriptions", "inventory", "bom"],
      "backend": "Dexie labJobs table v22",
      "offline_support": true,
      "sync_support": true
    },
    {
      "id": "b2b-wholesale-erp",
      "name": "B2B Wholesale Distribution ERP & Dealer Tiers",
      "category": "Wholesale Distribution",
      "status": "IMPLEMENTED",
      "description": "Complete B2B document suite for optical wholesalers and distributors. Sales Orders with multi-level approval, Proforma Invoices, GST Tax Invoices, Delivery Challans, Debit Notes, Credit Notes, Sales Returns, Purchase Orders. Dealer pricing tiers with volume slabs, field sales rep visit tracking, dealer credit ledger with ageing, outstanding reports. Dealer self-service portal (shop/:shopKey) for catalog browsing, order placement, ledger view, invoice download.",
      "route": "/wholesale-billing, /wholesale-ledger, /shop/:shopKey",
      "segment": "wholesale",
      "user_roles": ["admin", "wholesale_manager", "field_sales", "accountant", "dealer"],
      "plans": ["pro", "enterprise"],
      "key_capabilities": [
        "Sales Orders with Multi-level Approval Workflow",
        "Proforma Invoices for Quotation",
        "B2B GST Tax Invoices with GSTIN Validation",
        "Delivery Challans for Stock Movement",
        "Debit Notes & Credit Notes (GST Compliant)",
        "Sales Returns Processing with Stock Restore",
        "Purchase Orders to Suppliers with GRN Matching",
        "Dealer Pricing Tiers — Volume-based Slabs",
        "Field Sales Visit Tracking (GPS Check-in/out)",
        "Dealer Credit Ledger & Limit Management",
        "Outstanding & Ageing Reports (0-30/31-60/61-90/90+)",
        "Monthly Invoice Consolidation per Dealer",
        "GSTR-1 B2B Export (JSON Audit Ready)",
        "Dealer Portal — Self-service Ordering & Ledger"
      ],
      "dependencies": ["inventory", "vendors", "customers"],
      "backend": "Dexie wholesale tables v22, PocketBase sync",
      "offline_support": true,
      "sync_support": true
    },
    {
      "id": "multi-format-thermal-printing",
      "name": "Multi-Format Printing & ESC-POS Thermal Receipts",
      "category": "Printing & Documentation",
      "status": "IMPLEMENTED",
      "description": "Print everything from one screen. 58mm (2-inch) and 80mm (3-inch) ESC-POS thermal receipts for POS counters. A4 GST Tax Invoices for retail and B2B. A5 Compact Invoices for quick handover. Clinical Prescription prints in standard Rx format. Lab Job Cards with QR stickers. Warranty Repair Receipts with disclaimers. Delivery Challans, Purchase Orders. Custom template editor for layout tweaks. Works with Bluetooth, USB, and network thermal printers.",
      "route": "/billing, /lab-jobs, /wholesale-billing",
      "segment": "all",
      "user_roles": ["admin", "salesperson", "lab_operator", "cashier"],
      "plans": ["free", "basic", "lite", "pro", "enterprise"],
      "key_capabilities": [
        "58mm (2-inch) ESC-POS Thermal Receipt",
        "80mm (3-inch) ESC-POS Thermal Receipt",
        "A4 GST Tax Invoice — Retail & B2B Formats",
        "A5 Compact Invoice for Quick Handover",
        "Clinical Prescription Print (Standard Rx Format)",
        "Lab Job Card & QR Sticker Print",
        "Warranty Repair Receipt Slip with Disclaimer",
        "Delivery Challan Print",
        "Purchase Order Print",
        "Custom Print Template Editor",
        "Bluetooth / USB / Network Printer Support",
        "Print Preview Before Sending"
      ],
      "dependencies": [],
      "backend": "Browser Print API, html2pdf.js, ESC-POS Commands",
      "offline_support": true,
      "sync_support": false
    },
    {
      "id": "gst-compliance",
      "name": "GST Compliance & GSTR Returns",
      "category": "Accounting & Compliance",
      "status": "IMPLEMENTED",
      "description": "Indian GST made simple. Auto-calculate 5%, 12%, 18%, 28% GST on every invoice. HSN/SAC code master per product. B2B GSTIN validation via GST Portal API. Generate GSTR-1 JSON (B2B, B2C, CDNR, EXP sections) and GSTR-3B summary ready for portal upload. E-invoice IRN-ready format. HSN-wise summary, tax liability register, ITC reconciliation. Annual return (GSTR-9) data preparation. All offline-first — generate returns without internet.",
      "route": "/gst-returns",
      "segment": "all",
      "user_roles": ["admin", "accountant"],
      "plans": ["basic", "lite", "pro", "enterprise"],
      "key_capabilities": [
        "Auto GST Calculation (5, 12, 18, 28%) per Line Item",
        "HSN/SAC Code Master Management",
        "B2B GSTIN Validation (GST Portal API Integration)",
        "GSTR-1 JSON Export — B2B, B2C, CDNR, EXP Sections",
        "GSTR-3B Summary Computation (Auto-filled)",
        "E-invoice IRN Ready Format (NIC/Einvoice1 Portal)",
        "HSN-wise Summary Report",
        "Tax Liability Register (Monthly/Quarterly)",
        "Input Tax Credit Reconciliation",
        "Annual Return GSTR-9 Data Preparation"
      ],
      "dependencies": ["billing", "wholesale_billing", "purchase_orders"],
      "backend": "Dexie transactions, PocketBase sync",
      "offline_support": true,
      "sync_support": true
    },
    {
      "id": "inventory-management",
      "name": "Stock & Product Inventory Management",
      "category": "Inventory",
      "status": "IMPLEMENTED",
      "description": "Optical-specific inventory built for frames, lenses, contact lenses, and accessories. Barcode/QR generation and scanning. Multi-unit support (PCS, BOX, PAIR). Stock adjustments, inter-store transfers, low stock alerts, valuation (FIFO/Weighted Average). Dead stock and slow-moving analysis. GRN vs PO three-way matching. Batch and serial tracking for lenses. Contact lens expiry management. Supplier-wise stock view. Physical count sheets. ABC analysis.",
      "route": "/inventory",
      "segment": "all",
      "user_roles": ["admin", "store_manager", "salesperson", "inventory_manager"],
      "plans": ["free", "basic", "lite", "pro", "enterprise"],
      "key_capabilities": [
        "Product Master — Frames, Lenses, Contacts, Accessories",
        "Barcode/QR Code Generation & Scanning",
        "Multi-unit Support (PCS, BOX, PAIR, SET)",
        "Stock Adjustment — In/Out/Write-off with Reason",
        "Inter-store Stock Transfers with Dispatch/Receipt",
        "Low Stock & Reorder Alerts (Configurable Thresholds)",
        "Stock Valuation — FIFO / Weighted Average",
        "Dead Stock & Slow-moving Report (Custom Days)",
        "GRN (Goods Receipt Note) vs PO 3-way Matching",
        "Batch & Serial Number Tracking (Lenses)",
        "Expiry Management (Contact Lenses)",
        "Supplier-wise Stock View",
        "Physical Stock Count Sheet Generation",
        "ABC Analysis (Fast/Slow/Non-moving)"
      ],
      "dependencies": ["vendors", "purchase_orders"],
      "backend": "Dexie inventory tables v22, PocketBase sync",
      "offline_support": true,
      "sync_support": true
    },
    {
      "id": "customer-database",
      "name": "Customer Database & Rx History",
      "category": "CRM",
      "status": "IMPLEMENTED",
      "description": "Complete customer 360. Profile with name, phone, email, address, DOB, anniversary. Full prescription history timeline with clinical notes. Order and invoice history with payment status. Loyalty points balance and transactions. Communication log (SMS, WhatsApp, Call, Visit). Segmentation: VIP, Regular, Dormant, Lost. Document attachments (KYC, prescription scans). Family/group linking. Preferred optometrist/store tagging. Marketing consent management.",
      "route": "/customers",
      "segment": "all",
      "user_roles": ["admin", "salesperson", "optometrist", "manager"],
      "plans": ["free", "basic", "lite", "pro", "enterprise"],
      "key_capabilities": [
        "Customer Profile — Name, Phone, Email, Address, DOB, Anniversary",
        "Prescription History Timeline with Clinical Notes",
        "Order & Invoice History with Payment Status",
        "Loyalty Points Balance & Transaction History",
        "Communication Log — SMS, WhatsApp, Call, Visit",
        "Segmentation: VIP, Regular, Dormant, Lost",
        "Document Attachments — KYC, Prescription Scans, IDs",
        "Family/Group Linking (Shared History)",
        "Preferred Optometrist/Store Tagging",
        "Marketing Consent Management (DND/TCPA)"
      ],
      "dependencies": ["prescriptions", "orders", "loyalty"],
      "backend": "Dexie customers table v22, PocketBase sync",
      "offline_support": true,
      "sync_support": true
    },
    {
      "id": "order-history",
      "name": "Order History & Invoices",
      "category": "POS",
      "status": "IMPLEMENTED",
      "description": "Chronological order timeline for every customer and store-wide. Reprint any invoice (A4, A5, Thermal). Track payment status and mode. Delivery and ready-for-pickup status. Return and refund history. Warranty status per order item. Lab job linkage. Search and filter by date, customer, status, amount. Export to Excel/PDF for accountants.",
      "route": "/history",
      "segment": "all",
      "user_roles": ["admin", "salesperson", "customer_support"],
      "plans": ["free", "basic", "lite", "pro", "enterprise"],
      "key_capabilities": [
        "Chronological Order Timeline (Store & Customer-level)",
        "Invoice Reprint — A4, A5, Thermal Formats",
        "Payment Status & Mode Tracking",
        "Delivery / Ready-for-Pickup Status",
        "Return & Refund History",
        "Warranty Status per Order Item",
        "Lab Job Linkage (View Lab Status from Order)",
        "Search & Filter — Date, Customer, Status, Amount",
        "Export to Excel/PDF for Accounting"
      ],
      "dependencies": ["billing", "customers", "inventory"],
      "backend": "Dexie orders table v22",
      "offline_support": true,
      "sync_support": true
    },
    {
      "id": "expenses-tracking",
      "name": "Expenses & Supplier Ledgers",
      "category": "Accounting",
      "status": "IMPLEMENTED",
      "description": "Record every business expense with categories (Rent, Utilities, Salary, Marketing, Professional Fees, etc.). Supplier/ledger-wise tracking with payment status. Recurring expense scheduler for rent, salaries, subscriptions. Receipt attachment (photo/PDF). Expense vs budget reports. Monthly/quarterly/yearly P&L integration. TDS deduction tracking per expense. Expense approval workflow for multi-user teams.",
      "route": "/expenses",
      "segment": "all",
      "user_roles": ["admin", "accountant", "store_manager"],
      "plans": ["basic", "lite", "pro", "enterprise"],
      "key_capabilities": [
        "Expense Categories — Rent, Utilities, Salary, Marketing, etc.",
        "Supplier/Ledger-wise Tracking with Payment Status",
        "Recurring Expense Scheduler (Monthly/Quarterly)",
        "Receipt Attachment — Photo/PDF",
        "Expense vs Budget Reports",
        "Monthly/Quarterly/Yearly P&L Integration",
        "TDS Deduction Tracking per Expense",
        "Expense Approval Workflow (Multi-level)"
      ],
      "dependencies": ["vendors"],
      "backend": "Dexie expenses table v22",
      "offline_support": true,
      "sync_support": true
    },
    {
      "id": "reports-analytics",
      "name": "Category P&L & Dead Stock Reports",
      "category": "Reports & Analytics",
      "status": "IMPLEMENTED",
      "description": "Business intelligence for optical retail. Category-wise P&L breakdown — Frames vs Lenses vs Contact Lenses gross margin %. Dead stock and slow-moving inventory report with custom aging. Sales trend analysis (daily/weekly/monthly/yearly). Top selling products. Customer lifetime value. Optometrist performance. Lab efficiency and turnaround time. GST summary reports. Outstanding and ageing. Custom report builder. Scheduled email reports.",
      "route": "/reports",
      "segment": "all",
      "user_roles": ["admin", "manager", "accountant"],
      "plans": ["lite", "pro", "enterprise"],
      "key_capabilities": [
        "Category P&L — Frames/Lenses/Contacts Gross Margin %",
        "Dead Stock & Slow-moving Inventory (Custom Aging)",
        "Sales Trend Analysis — Daily/Weekly/Monthly/Yearly",
        "Top Selling Products by Revenue & Quantity",
        "Customer Lifetime Value & Retention Cohorts",
        "Optometrist Performance (Exams, Conversion, Revenue)",
        "Lab Efficiency & Turnaround Time per Stage",
        "GST Summary Reports (GSTR-1/3B Reconciliation)",
        "Outstanding & Ageing Reports",
        "Custom Report Builder (Drag-drop Fields)",
        "Scheduled Email Reports (Daily/Weekly/Monthly)"
      ],
      "dependencies": ["billing", "inventory", "customers", "lab_jobs"],
      "backend": "Dexie aggregated queries, Recharts visualization",
      "offline_support": true,
      "sync_support": true
    },
    {
      "id": "multi-shop-management",
      "name": "Multi-Shop / Branch Management",
      "category": "Admin & Operations",
      "status": "IMPLEMENTED",
      "description": "Run multiple branches from one account. Centralized inventory with branch-wise stock. Inter-branch transfers with dispatch/recieve tracking. Consolidated and branch-wise reports. Role-based access per branch (manager sees only their branch). Unified customer database across branches. Centralized billing with branch-specific invoice series. Branch performance comparison dashboard.",
      "route": "/shops",
      "segment": "all",
      "user_roles": ["admin", "area_manager"],
      "plans": ["pro", "enterprise"],
      "key_capabilities": [
        "Multi-branch Setup with Independent Settings",
        "Branch-wise Inventory & Stock Levels",
        "Inter-branch Stock Transfers with Tracking",
        "Consolidated & Branch-wise Reports",
        "Role-based Access per Branch",
        "Centralized Customer Database (Shared/Isolated)",
        "Unified Billing with Branch-specific Invoice Series",
        "Branch Performance Comparison Dashboard"
      ],
      "dependencies": ["inventory", "stock_transfers", "users"],
      "backend": "Dexie shops table v22, PocketBase sync",
      "offline_support": true,
      "sync_support": true
    },
    {
      "id": "vendor-management",
      "name": "Vendor & Supplier Management",
      "category": "Procurement",
      "status": "IMPLEMENTED",
      "description": "Supplier master with GSTIN, contact person, payment terms, credit limit, performance rating. Purchase order creation and tracking. GRN (Goods Receipt Note) matching with 3-way PO+GRN+Invoice verification. Supplier credit ledger with ageing. Price comparison and negotiation history. Supplier performance dashboard (on-time delivery, quality, price variance). Auto PO generation from reorder levels. TDS and GST compliance per supplier.",
      "route": "/vendors",
      "segment": "all",
      "user_roles": ["admin", "purchase_manager", "store_manager"],
      "plans": ["basic", "lite", "pro", "enterprise"],
      "key_capabilities": [
        "Supplier Master — GSTIN, Contact, Payment Terms, Rating",
        "Purchase Order Creation & Tracking",
        "GRN (Goods Receipt Note) 3-way Matching (PO+GRN+Invoice)",
        "Supplier Credit Ledger & Ageing",
        "Price Comparison & Negotiation History",
        "Supplier Performance Dashboard (OTD, Quality, Cost)",
        "Auto PO from Reorder Levels",
        "TDS & GST Compliance per Supplier"
      ],
      "dependencies": ["purchase_orders", "inventory", "expenses"],
      "backend": "Dexie vendors table v22",
      "offline_support": true,
      "sync_support": true
    },
    {
      "id": "purchase-orders",
      "name": "Purchase Orders",
      "category": "Procurement",
      "status": "IMPLEMENTED",
      "description": "Complete PO lifecycle. Create from reorder alerts or manually. Multi-level approval workflow. Email/WhatsApp dispatch to supplier. GRN matching with 3-way verification (PO + GRN + Supplier Invoice). Partial receipt handling. Invoice verification and dispute logging. Payment schedule and tracking. PO analytics: lead time, fill rate, cost variance.",
      "route": "/purchase-orders",
      "segment": "all",
      "user_roles": ["admin", "purchase_manager"],
      "plans": ["basic", "lite", "pro", "enterprise"],
      "key_capabilities": [
        "PO Creation from Reorder Alerts or Manual Entry",
        "Multi-level Approval Workflow",
        "Email/WhatsApp Dispatch to Supplier",
        "GRN 3-way Matching (PO + GRN + Invoice)",
        "Partial Receipt Handling",
        "Invoice Verification & Dispute Logging",
        "Payment Schedule & Tracking",
        "PO Analytics — Lead Time, Fill Rate, Cost Variance"
      ],
      "dependencies": ["vendors", "inventory"],
      "backend": "Dexie purchaseOrders table v22",
      "offline_support": true,
      "sync_support": true
    },
    {
      "id": "stock-transfers",
      "name": "Stock Transfers",
      "category": "Inventory",
      "status": "IMPLEMENTED",
      "description": "Move stock between branches/warehouses with full traceability. Transfer request creation with item details. Dispatch with barcode verification. In-transit tracking. Receipt verification with discrepancy log. Transfer cost allocation. Transfer history and reports. Auto stock update on receipt confirmation.",
      "route": "/stock-transfers",
      "segment": "all",
      "user_roles": ["admin", "store_manager", "inventory_manager"],
      "plans": ["lite", "pro", "enterprise"],
      "key_capabilities": [
        "Transfer Request Creation with Item Details",
        "Dispatch with Barcode Verification",
        "In-Transit Tracking",
        "Receipt Verification & Discrepancy Log",
        "Transfer Cost Allocation",
        "Transfer History & Reports",
        "Auto Stock Update on Receipt Confirmation"
      ],
      "dependencies": ["inventory", "shops"],
      "backend": "Dexie stockTransfers table v22",
      "offline_support": true,
      "sync_support": true
    },
    {
      "id": "dealer-pricing",
      "name": "Dealer Pricing Rules",
      "category": "Wholesale",
      "status": "IMPLEMENTED",
      "description": "Flexible B2B pricing engine. Volume-based slab pricing (buy 50+ get 10% off). Category-wise discount rules (frames 15%, lenses 10%, contacts 5%). Dealer-specific custom pricing for key accounts. Promotional/seasonal pricing with date ranges. Auto-apply on B2B portal orders. Pricing version control with rollback. Margin protection alerts. Price list export for dealer communication.",
      "route": "/pricing",
      "segment": "wholesale",
      "user_roles": ["admin", "wholesale_manager"],
      "plans": ["pro", "enterprise"],
      "key_capabilities": [
        "Volume-based Slab Pricing (Qty Breaks)",
        "Category-wise Discount Rules",
        "Dealer-specific Custom Pricing (Key Accounts)",
        "Promotional/Seasonal Pricing with Date Ranges",
        "Auto-apply on B2B Portal Orders",
        "Pricing Version Control with Rollback",
        "Margin Protection Alerts (Below Cost Warning)",
        "Price List Export (Excel/PDF) for Dealers"
      ],
      "dependencies": ["wholesale_billing", "customers"],
      "backend": "Dexie pricingRules table v22",
      "offline_support": true,
      "sync_support": true
    },
    {
      "id": "bom-recipes",
      "name": "BOM / Lens Surface Recipes",
      "category": "Lens Laboratory",
      "status": "IMPLEMENTED",
      "description": "Bill of Materials for lens manufacturing. Surface curve library (base curves, toric, progressive designs). Lens material specifications. Coating recipe management (AR, Blue Cut, Tint, Mirror parameters). Edging parameters per frame shape. Tooling and consumable BOM per recipe. Cost per recipe calculation. Recipe versioning and approval workflow. Lab operator recipe selection from dropdown.",
      "route": "/bom",
      "segment": "lab",
      "user_roles": ["admin", "lab_manager", "lab_operator"],
      "plans": ["pro", "enterprise"],
      "key_capabilities": [
        "Surface Curve Library — Base Curves, Toric, Progressive",
        "Lens Material Specifications (Index, Abbe, Density)",
        "Coating Recipe Management (AR, Blue Cut, Tint, Mirror)",
        "Edging Parameters per Frame Shape",
        "Tooling & Consumable BOM per Recipe",
        "Cost per Recipe Calculation",
        "Recipe Versioning & Approval Workflow",
        "Lab Operator Recipe Selection from Dropdown"
      ],
      "dependencies": ["lab_jobs", "inventory"],
      "backend": "Dexie bom table v22",
      "offline_support": true,
      "sync_support": true
    },
    {
      "id": "quality-qa",
      "name": "Quality / QA Workflow",
      "category": "Lens Laboratory",
      "status": "IMPLEMENTED",
      "description": "Quality assurance at every lab stage. Stage-wise inspection checklists. Optical tolerance verification (power ±0.12D, axis ±2°, prism ±0.5Δ). Surface quality inspection (scratch, bubble, inclusion per ANSI Z80). Coating quality (AR reflectance <0.5%, tint uniformity). Edging accuracy (shape, size, bevel). Defect classification with root cause. Remake/rework tracking. QA sign-off with digital signature. Quality trends and CAPA.",
      "route": "/quality",
      "segment": "lab",
      "user_roles": ["admin", "lab_manager", "qa_inspector"],
      "plans": ["pro", "enterprise"],
      "key_capabilities": [
        "Stage-wise Inspection Checklists",
        "Optical Tolerance Verification (Power, Axis, Prism)",
        "Surface Quality Inspection (Scratch, Bubble, Inclusion)",
        "Coating Quality — AR Reflectance, Tint Uniformity",
        "Edging Accuracy (Shape, Size, Bevel)",
        "Defect Classification & Root Cause Analysis",
        "Remake/Rework Tracking",
        "QA Sign-off with Digital Signature",
        "Quality Trends & CAPA (Corrective/Preventive Actions)"
      ],
      "dependencies": ["lab_jobs", "bom"],
      "backend": "Dexie qualityChecks table v22",
      "offline_support": true,
      "sync_support": true
    },
    {
      "id": "outstanding-receivables",
      "name": "Outstanding & Receivables Management",
      "category": "Accounting",
      "status": "IMPLEMENTED",
      "description": "Track every rupee owed. Customer-wise and dealer-wise outstanding ledgers. Ageing buckets (0-30, 31-60, 61-90, 90+ days). Automated payment reminders via WhatsApp/SMS. Collection agent assignment with targets. Payment plan/installment tracking. Bad debt identification and provisioning. Outstanding summary reports. DSO (Days Sales Outstanding) metrics.",
      "route": "/outstanding",
      "segment": "all",
      "user_roles": ["admin", "accountant", "collection_agent"],
      "plans": ["basic", "lite", "pro", "enterprise"],
      "key_capabilities": [
        "Customer-wise Outstanding Ledger",
        "Dealer-wise Outstanding (Wholesale)",
        "Ageing Buckets — 0-30, 31-60, 61-90, 90+ Days",
        "Automated Payment Reminders (WhatsApp/SMS)",
        "Collection Agent Assignment & Targets",
        "Payment Plan / Installment Tracking",
        "Bad Debt Identification & Provisioning",
        "Outstanding Summary Reports",
        "DSO (Days Sales Outstanding) Metrics"
      ],
      "dependencies": ["customers", "billing", "wholesale_billing"],
      "backend": "Dexie transactions/outstanding tables v22",
      "offline_support": true,
      "sync_support": true
    },
    {
      "id": "loyalty-program",
      "name": "Loyalty Points Program",
      "category": "CRM & Marketing",
      "status": "IMPLEMENTED",
      "description": "Retain customers with points. Earn on every purchase (₹100 = 1 point), visits, birthdays. Tier system: Silver, Gold, Platinum, Diamond with escalating benefits. Redeem for bill discounts, free frames, free lenses, accessories. Points expiry management (configurable). Referral bonus program. Family pooling — transfer points between family members. Loyalty analytics: enrollment rate, redemption rate, LTV impact.",
      "route": "/loyalty",
      "segment": "retail",
      "user_roles": ["admin", "salesperson", "manager"],
      "plans": ["lite", "pro", "enterprise"],
      "key_capabilities": [
        "Points Earning Rules — Per ₹ Spend, Per Visit, Birthday",
        "Tier System — Silver, Gold, Platinum, Diamond",
        "Redemption — Bill Discount, Free Frame, Free Lens, Accessories",
        "Points Expiry Management (Configurable)",
        "Referral Bonus Program",
        "Family Points Pooling (Transfer Between Members)",
        "Loyalty Analytics — Enrollment, Redemption Rate, LTV Impact"
      ],
      "dependencies": ["customers", "billing"],
      "backend": "Dexie loyalty table v22",
      "offline_support": true,
      "sync_support": true
    },
    {
      "id": "debit-notes",
      "name": "Debit Notes",
      "category": "Wholesale",
      "status": "IMPLEMENTED",
      "description": "GST-compliant debit notes for price adjustments, quantity discrepancies, quality claims, and return-to-vendor scenarios. Link to original invoice/PO. Auto-update dealer ledger. Approval workflow. Debit note register and reporting.",
      "route": "/debit-notes",
      "segment": "wholesale",
      "user_roles": ["admin", "wholesale_manager", "accountant"],
      "plans": ["pro", "enterprise"],
      "key_capabilities": [
        "Debit Note Types — Price Diff, Qty Diff, Quality, RTV",
        "Link to Original Invoice/PO",
        "GST-compliant Debit Note Format",
        "Auto-update Dealer Ledger",
        "Approval Workflow",
        "Debit Note Register & Reporting"
      ],
      "dependencies": ["wholesale_billing", "vendors"],
      "backend": "Dexie debitNotes table v22",
      "offline_support": true,
      "sync_support": true
    },
    {
      "id": "sales-returns",
      "name": "Sales Returns",
      "category": "Wholesale",
      "status": "IMPLEMENTED",
      "description": "Process returns from retail customers and wholesale dealers. Return reason coding. Quality inspection on receipt. Credit note auto-generation. Stock restoration (saleable vs damaged). GST reversal (GSTR-1 CDNR section). Return policy enforcement (time limits, condition). Return analytics and trend reports.",
      "route": "/sales-returns",
      "segment": "wholesale",
      "user_roles": ["admin", "salesperson", "store_manager", "accountant"],
      "plans": ["pro", "enterprise"],
      "key_capabilities": [
        "Return Initiation — Customer/Dealer",
        "Return Reason Coding",
        "Quality Inspection on Receipt",
        "Credit Note Auto-generation",
        "Stock Restoration — Saleable/Damaged",
        "GST Reversal (GSTR-1 CDNR)",
        "Return Policy Enforcement (Time Limits, Condition)",
        "Return Analytics & Trend Reports"
      ],
      "dependencies": ["wholesale_billing", "inventory", "customers"],
      "backend": "Dexie salesReturns table v22",
      "offline_support": true,
      "sync_support": true
    },
    {
      "id": "field-sales",
      "name": "Field Sales Tracking",
      "category": "Wholesale",
      "status": "IMPLEMENTED",
      "description": "Manage field sales reps end-to-end. Beat/route planning with optimization. Visit check-in/check-out with GPS. Activity logging (meeting, demo, order, collection). On-field order booking (offline-capable). Collection recording with receipt print. Expense reporting per visit. Dealer feedback surveys. Rep performance dashboard (calls, orders, collection, conversion). Leave and attendance integration.",
      "route": "/field-sales",
      "segment": "wholesale",
      "user_roles": ["admin", "field_sales_manager", "field_sales_rep"],
      "plans": ["pro", "enterprise"],
      "key_capabilities": [
        "Beat/Route Planning & Optimization",
        "Visit Check-in/Check-out with GPS",
        "Activity Logging — Meeting, Demo, Order, Collection",
        "On-field Order Booking (Offline-capable)",
        "Collection Recording & Receipt Print",
        "Expense Reporting per Visit",
        "Dealer Feedback & Survey",
        "Rep Performance Dashboard (Calls, Orders, Collection, Conversion)",
        "Leave & Attendance Integration"
      ],
      "dependencies": ["customers", "wholesale_billing", "outstanding"],
      "backend": "Dexie fieldVisits table v22",
      "offline_support": true,
      "sync_support": true
    },
    {
      "id": "b2b-orders-portal",
      "name": "B2B Orders Portal (Dealer Self-Service)",
      "category": "Wholesale",
      "status": "IMPLEMENTED",
      "description": "Dealer portal at shop/:shopKey. Dealers login to browse catalog with their pricing, place orders, track delivery, view ledger, download invoices, raise returns. Promotional banner display. Reduces wholesale team workload — dealers self-serve 24/7.",
      "route": "/shop/:shopKey, /b2b-orders",
      "segment": "wholesale",
      "user_roles": ["dealer", "wholesale_manager"],
      "plans": ["pro", "enterprise"],
      "key_capabilities": [
        "Dealer Login & Dashboard",
        "Catalog Browsing with Dealer-specific Pricing",
        "Cart & Order Placement",
        "Order Status Tracking",
        "Delivery Challan & Invoice Download",
        "Ledger & Outstanding View",
        "Return/Complaint Raising",
        "Payment History & Receipts",
        "Promotional Banner Display"
      ],
      "dependencies": ["wholesale_billing", "dealer_pricing", "customers"],
      "backend": "Dexie B2BOrders table v22, PocketBase auth",
      "offline_support": true,
      "sync_support": true
    },
    {
      "id": "vendor-sku-mapper",
      "name": "Vendor SKU Mapper",
      "category": "Procurement",
      "status": "IMPLEMENTED",
      "description": "Map internal SKUs to vendor SKUs for automated PO generation, invoice matching, and catalog sync. Multi-vendor per SKU support. Auto-populate PO lines from mapping. Invoice line auto-matching during GRN. Catalog sync from vendor feeds (Excel/API). Mapping conflict resolution. Bulk import/export via Excel.",
      "route": "/vendor-sku-mapper",
      "segment": "wholesale",
      "user_roles": ["admin", "purchase_manager"],
      "plans": ["pro", "enterprise"],
      "key_capabilities": [
        "Internal SKU ↔ Vendor SKU Mapping",
        "Multi-vendor per SKU Support",
        "Auto PO Line Population from Mapping",
        "Invoice Line Auto-matching during GRN",
        "Catalog Sync from Vendor Feeds",
        "Mapping Conflict Resolution",
        "Bulk Import/Export (Excel)"
      ],
      "dependencies": ["purchase_orders", "vendors", "inventory"],
      "backend": "Dexie skuMapping table v22",
      "offline_support": true,
      "sync_support": true
    },
    {
      "id": "coupon-management",
      "name": "Coupon Management",
      "category": "Marketing",
      "status": "IMPLEMENTED",
      "description": "Create coupons for % off, ₹ off, free item, combo offers, free upgrades. Validity periods, usage limits, customer segment targeting. Auto-apply or code-based. Campaign tracking with ROI. WhatsApp/SMS sharing. Fraud prevention (one-time use, per-customer limits).",
      "route": "/coupons",
      "segment": "retail",
      "user_roles": ["admin", "marketing_manager"],
      "plans": ["lite", "pro", "enterprise"],
      "key_capabilities": [
        "Coupon Types — % Off, ₹ Off, Free Item, Combo, Free Upgrade",
        "Validity Period & Usage Limits",
        "Customer Segment Targeting",
        "Auto-apply / Code-based",
        "Campaign Tracking & ROI",
        "Coupon Sharing (WhatsApp/SMS)",
        "Fraud Prevention — One-time, Per Customer"
      ],
      "dependencies": ["billing", "customers"],
      "backend": "Dexie coupons table v22",
      "offline_support": true,
      "sync_support": true
    },
    {
      "id": "data-migration",
      "name": "Data Import / Migration",
      "category": "Admin & Setup",
      "status": "IMPLEMENTED",
      "description": "Switch from OptoSoft, RetaPOS, or spreadsheets without data loss. Import customers, products, prescriptions, opening stock, outstanding balances from Excel/CSV. Template download with validation rules. Dry-run preview before commit. Rollback on error. Migration progress tracking. Support for custom formats.",
      "route": "/migration",
      "segment": "all",
      "user_roles": ["admin"],
      "plans": ["pro", "enterprise"],
      "key_capabilities": [
        "Customer Master Import (Excel/CSV)",
        "Product Master Import",
        "Prescription History Import",
        "Opening Stock Import",
        "Outstanding Balance Import",
        "Template Download & Validation",
        "Dry-run Preview Before Commit",
        "Rollback on Error",
        "Migration Progress Tracking",
        "Support for OptoSoft, RetaPOS, Custom Formats"
      ],
      "dependencies": ["customers", "inventory", "prescriptions", "outstanding"],
      "backend": "SheetJS (xlsx), CSV Parser, Dexie Bulk Ops",
      "offline_support": true,
      "sync_support": false
    },
    {
      "id": "offline-architecture",
      "name": "Offline-First Dexie IndexedDB Architecture",
      "category": "Platform",
      "status": "IMPLEMENTED",
      "description": "The foundation — 100% offline-capable PWA. All data lives in IndexedDB (Dexie v22) on the user's device. Service Worker (Workbox) caches all assets. Background sync to PocketBase when online. Optimistic UI with conflict resolution. Auto-retry on network restore. Cross-tab sync broadcast. Storage quota management. Export/backup to Google Drive/Google Sheets. PWA install prompt. Offline indicator with sync queue status. Zero data loss guarantee.",
      "route": "All routes",
      "segment": "all",
      "user_roles": ["all"],
      "plans": ["free", "basic", "lite", "pro", "enterprise"],
      "key_capabilities": [
        "IndexedDB v22 (Dexie) — All Data Local",
        "Service Worker (Workbox) — Asset Caching",
        "Background Sync to PocketBase",
        "Optimistic UI with Conflict Resolution",
        "Auto-retry on Network Restore",
        "Cross-tab Sync Broadcast",
        "Storage Quota Management",
        "Export/Backup to Google Drive/Google Sheets",
        "PWA Install Prompt",
        "Offline Indicator & Sync Queue Status"
      ],
      "dependencies": [],
      "backend": "Dexie.js, Workbox, PocketBase",
      "offline_support": true,
      "sync_support": true
    }
  ]
}