@apptimate/core-lib 2.8.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apptimate/core-lib",
3
- "version": "2.8.0",
3
+ "version": "3.0.0",
4
4
  "main": "src/index.ts",
5
5
  "types": "src/index.ts",
6
6
  "publishConfig": {
@@ -135,6 +135,7 @@ export const MENU_ITEM_REGISTRY: RegistryItem[] = [
135
135
  { key: 'jewelry__grn', label: 'Goods Receipt', path: '/jewelry/procurement/grn', module: 'Jewelry', defaultGroup: 'Procurement' },
136
136
  { key: 'jewelry__custom_orders', label: 'Custom Orders', path: '/jewelry/custom-orders', module: 'Jewelry', defaultGroup: 'Procurement' },
137
137
  { key: 'jewelry__service_orders', label: 'Service Orders', path: '/jewelry/service-orders', module: 'Jewelry', defaultGroup: 'Procurement' },
138
+ { key: 'jewelry__opening_stock', label: 'Opening Stock', path: '/jewelry/procurement/opening_stock', module: 'Jewelry', defaultGroup: 'Procurement' },
138
139
  { key: 'jewelry__transformations', label: 'Transformations', path: '/jewelry/procurement/transformations', module: 'Jewelry', defaultGroup: 'Procurement' },
139
140
  { key: 'jewelry__old_gold_purchases', label: 'Old Material Purchases', path: '/jewelry/old-gold-purchases', module: 'Jewelry', defaultGroup: 'Buying' },
140
141
  { key: 'jewelry__sales', label: 'Sales', path: '/jewelry/sales', module: 'Jewelry', defaultGroup: 'Sales' },
@@ -196,6 +197,14 @@ export const MENU_ITEM_REGISTRY: RegistryItem[] = [
196
197
  { key: 'money_exchange__denominations', label: 'Denomination', path: '/money-exchange/denominations', module: 'Money Exchange', defaultGroup: 'Config' },
197
198
  { key: 'money_exchange__till_thresholds', label: 'Till Thresholds', path: '/money-exchange/till-thresholds', module: 'Money Exchange', defaultGroup: 'Config' },
198
199
  { key: 'money_exchange__cross_currency', label: 'Margin Rate', path: '/money-exchange/cross-currency', module: 'Money Exchange', defaultGroup: 'Config' },
200
+
201
+ // ── Reports Module (Admin/General) ──
202
+ { key: 'reports__jewelry', label: 'Jewelry', path: '/reports/jewelry', module: 'Reporting', defaultGroup: 'Dashboards' },
203
+ { key: 'reports__inventory', label: 'Inventory', path: '/reports/inventory', module: 'Reporting', defaultGroup: 'Dashboards' },
204
+ { key: 'reports__finance', label: 'Finance', path: '/reports/finance', module: 'Reporting', defaultGroup: 'Dashboards' },
205
+ { key: 'reports__all', label: 'All Reports', path: '/reports', module: 'Reporting', defaultGroup: 'General' },
206
+ { key: 'reports__builder', label: 'Report Builder', path: '/reports/admin/reports', module: 'Reporting', defaultGroup: 'Administration' },
207
+ { key: 'reports__configurator', label: 'Dashboard Configurator', path: '/reports/admin/dashboards', module: 'Reporting', defaultGroup: 'Administration' },
199
208
  ];
200
209
 
201
210
  /**
@@ -330,7 +339,7 @@ export const MENU_PRESETS: MenuPreset[] = [
330
339
  secondaryItems: [
331
340
  'jewelry__items', 'jewelry__categories',
332
341
  'jewelry__material_types', 'jewelry__purities', 'jewelry__metal_rates',
333
- 'jewelry__purchase_orders', 'jewelry__grn', 'jewelry__custom_orders', 'jewelry__service_orders', 'jewelry__transformations',
342
+ 'jewelry__purchase_orders', 'jewelry__grn', 'jewelry__opening_stock', 'jewelry__custom_orders', 'jewelry__service_orders', 'jewelry__transformations',
334
343
  'jewelry__old_gold_purchases',
335
344
  'jewelry__sales', 'jewelry__sales_returns',
336
345
  'jewelry__stock_balances', 'jewelry__stock_movements', 'jewelry__stock_transfers',
@@ -376,468 +385,25 @@ export const MENU_PRESETS: MenuPreset[] = [
376
385
  'money_exchange__cross_currency',
377
386
  ],
378
387
  },
388
+ {
389
+ id: 'reports',
390
+ label: 'Reports',
391
+ iconName: 'BarChart3',
392
+ secondaryItems: [
393
+ 'reports__jewelry', 'reports__inventory', 'reports__finance',
394
+ 'reports__all', 'reports__builder', 'reports__configurator'
395
+ ]
396
+ }
379
397
  ],
380
398
  },
381
399
  ];
382
400
 
383
401
 
384
402
  // ─── DEFAULT APP MENUS (legacy / fallback) ───────────────────────
385
- // This is the current static config, used when no custom config exists.
386
-
387
- export const APP_MENUS: MainMenuItem[] = [
388
- {
389
- id: "core",
390
- label: "Core",
391
- iconName: "Settings",
392
- groups: [
393
- {
394
- id: "core_users",
395
- label: "User Management",
396
- items: [
397
- { id: "users", label: "Users", path: "/users" },
398
- { id: "roles", label: "Roles", path: "/roles" },
399
- { id: "organizations", label: "Organizations", path: "/organizations" },
400
- { id: "parties", label: "Parties", path: "/parties" },
401
- ],
402
- },
403
- {
404
- id: "core_system",
405
- label: "System",
406
- items: [
407
- { id: "menu_config", label: "Menu Configuration", path: "/menu-config" },
408
- { id: "printables", label: "Printable Templates", path: "/system/printables" },
409
- { id: "template_groups", label: "Template Groups", path: "/system/template-groups" },
410
- ],
411
- },
412
- {
413
- id: "core_resources",
414
- label: "Resources",
415
- items: [
416
- { id: "warehouses", label: "Warehouses", path: "/warehouses" },
417
- { id: "terminals", label: "Terminals", path: "/terminals" },
418
- { id: "currencies", label: "Currencies", path: "/currencies" },
419
- ],
420
- },
421
- {
422
- id: "core_audit",
423
- label: "System Auditing",
424
- items: [
425
- { id: "activity_logs", label: "Activity Logs", path: "/activity-logs" },
426
- { id: "api_requests", label: "API Requests", path: "/system/api-requests" },
427
- { id: "feature_access_logs", label: "Feature Access Logs", path: "/system/feature-access-logs" },
428
- { id: "issue_logs", label: "Issue Logs", path: "/system/issue-logs" },
429
- { id: "feature_registry", label: "Feature Registry", path: "/system/features" },
430
- ],
431
- },
432
- {
433
- id: "core_settings",
434
- label: "Configuration",
435
- items: [
436
- { id: "currencies_settings", label: "Settings", path: "/settings" },
437
- ],
438
- },
439
- ],
440
- },
441
- {
442
- id: "inventory",
443
- label: "Inventory",
444
- iconName: "Package",
445
- groups: [
446
- {
447
- id: "inventory_catalog",
448
- label: "Catalog",
449
- items: [
450
- { id: "items", label: "Items", path: "/inventory/items" },
451
- { id: "categories", label: "Categories", path: "/inventory/categories" },
452
- { id: "brands", label: "Brands", path: "/inventory/brands" },
453
- { id: "uom", label: "Units of Measure", path: "/inventory/uom" },
454
- ],
455
- },
456
- {
457
- id: "inventory_stock",
458
- label: "Stock",
459
- items: [
460
- { id: "stock", label: "Stock Overview", path: "/inventory/stock" },
461
- { id: "ledger", label: "Stock Movements", path: "/inventory/ledger" },
462
- ],
463
- },
464
- {
465
- id: "inventory_operations",
466
- label: "Operations",
467
- items: [
468
- { id: "adjustments", label: "Adjustments", path: "/inventory/adjustments" },
469
- { id: "transfers", label: "Transfers", path: "/inventory/transfers" },
470
- { id: "serials", label: "Serial Numbers", path: "/inventory/serials" },
471
- ],
472
- },
473
- ],
474
- },
475
- {
476
- id: "sales",
477
- label: "Sales",
478
- iconName: "ShoppingCart",
479
- groups: [
480
- {
481
- id: "sales_master_data",
482
- label: "Master Data",
483
- items: [
484
- { id: "price_lists", label: "Price Lists", path: "/sales/price-lists" },
485
- ],
486
- },
487
- {
488
- id: "sales_orders",
489
- label: "Orders",
490
- items: [
491
- { id: "quotations", label: "Quotations", path: "/sales/quotations" },
492
- { id: "sales_orders", label: "Sales Orders", path: "/sales/orders" },
493
- ],
494
- },
495
- {
496
- id: "sales_fulfillment",
497
- label: "Fulfillment",
498
- items: [
499
- { id: "goods_issue_notes", label: "Goods Issue Notes", path: "/sales/delivery-notes" },
500
- ],
501
- },
502
- {
503
- id: "sales_post_sales",
504
- label: "Post-Sales",
505
- items: [
506
- { id: "returns", label: "Sales Returns", path: "/sales/returns" },
507
- { id: "credit_notes", label: "Credit Notes", path: "/sales/credit-notes" },
508
- ],
509
- },
510
- {
511
- id: "sales_pos",
512
- label: "POS",
513
- items: [
514
- { id: "pos_terminal", label: "POS Terminal", path: "/sales/pos" },
515
- { id: "pos_sessions", label: "Terminal Sessions", path: "/sales/pos/sessions" },
516
- ],
517
- },
518
- {
519
- id: "sales_analytics",
520
- label: "Analytics",
521
- items: [
522
- { id: "sales_reports", label: "Sales Reports", path: "/sales/reports" },
523
- ],
524
- },
525
- ],
526
- },
527
- {
528
- id: "procurement",
529
- label: "Procurement",
530
- iconName: "Truck",
531
- groups: [
532
- {
533
- id: "procurement_orders",
534
- label: "Orders",
535
- items: [
536
- { id: "purchase_orders", label: "Purchase Orders", path: "/procurement/orders" },
537
- ],
538
- },
539
- {
540
- id: "procurement_receiving",
541
- label: "Receiving",
542
- items: [
543
- { id: "goods_receipt", label: "Goods Receipt", path: "/procurement/grns" },
544
- ],
545
- },
546
- {
547
- id: "procurement_finance",
548
- label: "Finance",
549
- items: [
550
- { id: "ap_invoices", label: "Invoices", path: "/finance/invoices" },
551
- { id: "outgoing_payments", label: "Payments", path: "/finance/payments" },
552
- ],
553
- },
554
- ],
555
- },
556
- {
557
- id: "finance",
558
- label: "Finance",
559
- iconName: "Wallet",
560
- groups: [
561
- {
562
- id: "finance_transactions",
563
- label: "Transactions",
564
- items: [
565
- { id: "invoices", label: "Invoices", path: "/finance/invoices" },
566
- { id: "payments", label: "Payments", path: "/finance/payments" },
567
- { id: "transaction_ledger", label: "Transaction Ledger", path: "/finance/transactions" },
568
- ],
569
- },
570
- {
571
- id: "finance_accounting",
572
- label: "Accounting",
573
- items: [
574
- { id: "chart_of_accounts", label: "Chart of Accounts", path: "/finance/chart-of-accounts" },
575
- { id: "journal_entries", label: "Journal Entries", path: "/finance/journal-entries" },
576
- { id: "fiscal_years", label: "Fiscal Years", path: "/finance/fiscal-years" },
577
- ],
578
- },
579
- {
580
- id: "finance_reports",
581
- label: "Reports",
582
- items: [
583
- { id: "trial_balance", label: "Trial Balance", path: "/finance/reports/trial-balance" },
584
- { id: "profit_loss", label: "Profit & Loss", path: "/finance/reports/profit-loss" },
585
- { id: "balance_sheet", label: "Balance Sheet", path: "/finance/reports/balance-sheet" },
586
- { id: "account_ledger", label: "Account Ledger", path: "/finance/reports/account-ledger" },
587
- { id: "party_statement", label: "Party Statement", path: "/finance/reports/party-statement" },
588
- { id: "bank_statements", label: "Bank Statements", path: "/finance/bank-statements" },
589
- ],
590
- },
591
- {
592
- id: "finance_settings",
593
- label: "Settings",
594
- items: [
595
- { id: "payment_modes", label: "Payment Modes", path: "/finance/payment-modes" },
596
- { id: "bank_accounts", label: "Bank Accounts", path: "/finance/bank-accounts" },
597
- { id: "account_mappings", label: "Account Mappings", path: "/finance/account-mappings" },
598
- { id: "opening_balances", label: "Opening Balances", path: "/finance/opening-balances" },
599
- ],
600
- },
601
- ],
602
- },
603
- {
604
- id: "hr",
605
- label: "HR",
606
- iconName: "Users",
607
- groups: [
608
- {
609
- id: "hr_core",
610
- label: "Core",
611
- items: [
612
- { id: "employees", label: "Employees", path: "/hr/employees" },
613
- { id: "teams", label: "Teams", path: "/hr/teams" },
614
- ],
615
- },
616
- {
617
- id: "hr_time",
618
- label: "Time",
619
- items: [
620
- { id: "employee_calendar", label: "Employee Calendar", path: "/hr/employee-calendar" },
621
- { id: "my_calendar", label: "My Calendar", path: "/hr/my-calendar" },
622
- { id: "attendance", label: "Attendance", path: "/hr/attendance" },
623
- { id: "regularisation", label: "Regularisation", path: "/hr/regularisation" },
624
- { id: "shift_templates", label: "Shift Templates", path: "/hr/shift-templates" },
625
- { id: "rosters", label: "Roster Builder", path: "/hr/rosters" },
626
- { id: "shift_exchanges", label: "Shift Exchanges", path: "/hr/shift-exchanges" },
627
- { id: "shift_allowances", label: "Shift Allowances", path: "/hr/shift-allowances" },
628
- { id: "leave_types", label: "Leave Types", path: "/hr/leave-types" },
629
- { id: "holidays", label: "Holidays", path: "/hr/holidays" },
630
- { id: "leave", label: "Leave Management", path: "/hr/leave" },
631
- ],
632
- },
633
- {
634
- id: "hr_admin",
635
- label: "Admin",
636
- items: [
637
- { id: "designations", label: "Designations", path: "/hr/designations" },
638
- ],
639
- },
640
- {
641
- id: "hr_payroll",
642
- label: "Payroll",
643
- items: [
644
- { id: "ot", label: "Overtime", path: "/hr/ot" },
645
- { id: "ot_policies", label: "OT Policies", path: "/hr/ot-policies" },
646
- { id: "ot_rate_templates", label: "OT Rate Templates", path: "/hr/ot-rate-templates" },
647
- ],
648
- },
649
- {
650
- id: "hr_masters",
651
- label: "Masters",
652
- items: [
653
- { id: "skills", label: "Skills", path: "/hr/skills" },
654
- { id: "qualifications", label: "Qualifications", path: "/hr/qualifications" },
655
- { id: "holiday_types", label: "Holiday Types", path: "/hr/holiday-types" },
656
- { id: "break_types", label: "Break Types", path: "/hr/break-types" },
657
- { id: "option_sets", label: "Option Sets", path: "/hr/option-sets" },
658
- ],
659
- },
660
- ],
661
- },
662
- {
663
- id: "jewelry",
664
- label: "Jewelry",
665
- iconName: "Gem",
666
- groups: [
667
- {
668
- id: "jewelry_catalog",
669
- label: "Catalog",
670
- items: [
671
- { id: "jewelry_items", label: "Jewelry Items", path: "/jewelry/items" },
672
-
673
- { id: "jewelry_categories", label: "Categories", path: "/jewelry/categories" },
674
- ],
675
- },
676
- {
677
- id: "jewelry_master_data",
678
- label: "Master Data",
679
- items: [
680
- { id: "material_types", label: "Material Types", path: "/jewelry/material-types" },
681
- { id: "purities", label: "Purities", path: "/jewelry/purities" },
682
- { id: "metal_rates", label: "Metal Rates", path: "/jewelry/metal-rates" },
683
- ],
684
- },
685
- {
686
- id: "jewelry_procurement",
687
- label: "Procurement",
688
- items: [
689
- { id: "purchase_orders", label: "Purchase Orders", path: "/jewelry/procurement/orders" },
690
- { id: "goods_receipt", label: "Goods Receipt", path: "/jewelry/procurement/grn" },
691
- { id: "opening_stock", label: "Opening Stock", path: "/jewelry/procurement/opening_stock" },
692
- { id: "custom_orders", label: "Custom Orders", path: "/jewelry/custom-orders" },
693
- { id: "service_orders", label: "Service Orders", path: "/jewelry/service-orders" },
694
- { id: "transformations", label: "Transformations", path: "/jewelry/procurement/transformations" },
695
- ],
696
- },
697
- {
698
- id: "jewelry_buying",
699
- label: "Buying",
700
- items: [
701
- { id: "old_gold_purchases", label: "Old Material Purchases", path: "/jewelry/old-gold-purchases" },
702
- ],
703
- },
704
- {
705
- id: "jewelry_sales",
706
- label: "Sales",
707
- items: [
708
- { id: "jewelry_sales_main", label: "Sales", path: "/jewelry/sales" },
709
- { id: "jewelry_sales_returns", label: "Sales Returns", path: "/jewelry/sales-returns" },
710
- ],
711
- },
712
- {
713
- id: "jewelry_stock",
714
- label: "Stock",
715
- items: [
716
- { id: "stock_balances", label: "Stock Balances", path: "/jewelry/stock/balances" },
717
- { id: "stock_movements", label: "Stock Movements", path: "/jewelry/stock/movements" },
718
- { id: "stock_transfers", label: "Transfers", path: "/jewelry/stock-transfers" },
719
- ],
720
- },
721
- {
722
- id: "jewelry_karigar",
723
- label: "Karigar",
724
- items: [
725
- { id: "party_transactions", label: "Party Transactions", path: "/jewelry/party-transactions" },
726
-
727
- { id: "karigar_making_charges", label: "Making Charges", path: "/jewelry/karigar-making-charges" },
728
- { id: "party_metal_balances", label: "Party Metal Balances", path: "/jewelry/party-metal-balances" },
729
- { id: "metal_settlements", label: "Metal Settlements", path: "/jewelry/metal-settlements" },
730
- ],
731
- },
732
- {
733
- id: "jewelry_analytics",
734
- label: "Analytics",
735
- items: [
736
- { id: "jewelry_reports", label: "Reports & Dashboards", path: "/reports/jewelry" },
737
- ],
738
- },
739
- {
740
- id: "jewelry_configuration",
741
- label: "Configuration",
742
- items: [
743
- { id: "jewelry_settings", label: "Settings", path: "/jewelry/settings" },
744
- { id: "jewelry_billing_templates", label: "Billing Templates", path: "/jewelry/billing-templates" },
745
- ],
746
- },
747
- ],
748
- },
749
- {
750
- id: "reports",
751
- label: "Reports",
752
- iconName: "BarChart3",
753
- groups: [
754
- {
755
- id: "reports_dashboards",
756
- label: "Dashboards",
757
- items: [
758
- { id: "reports_jewelry", label: "Jewelry", path: "/reports/jewelry" },
759
- { id: "reports_inventory", label: "Inventory", path: "/reports/inventory" },
760
- { id: "reports_finance", label: "Finance", path: "/reports/finance" },
761
- ],
762
- },
763
- {
764
- id: "reports_home",
765
- label: "General",
766
- items: [
767
- { id: "reports_all", label: "All Reports", path: "/reports" },
768
- ],
769
- },
770
- {
771
- id: "reports_admin",
772
- label: "Administration",
773
- items: [
774
- { id: "reports_builder", label: "Report Builder", path: "/reports/admin/reports" },
775
- { id: "reports_configurator", label: "Dashboard Configurator", path: "/reports/admin/dashboards" },
776
- ],
777
- },
778
- ],
779
- },
780
- {
781
- id: "money_exchange",
782
- label: "Money Exchange",
783
- iconName: "Banknote",
784
- groups: [
785
- {
786
- id: "money_exchange_overview",
787
- label: "Overview",
788
- items: [
789
- { id: "money_exchange_dashboard", label: "Dashboard", path: "/money-exchange" },
790
- { id: "money_exchange_rates", label: "Rates Management", path: "/money-exchange/rates" },
791
- ],
792
- },
793
- {
794
- id: "money_exchange_operations",
795
- label: "Operations",
796
- items: [
797
- { id: "money_exchange_pos", label: "Point of Sale", path: "/money-exchange/pos" },
798
- { id: "money_exchange_transactions", label: "Transactions", path: "/money-exchange/transactions" },
799
- ],
800
- },
801
- {
802
- id: "money_exchange_inventory",
803
- label: "Inventory & Stock",
804
- items: [
805
- { id: "money_exchange_till", label: "Till", path: "/money-exchange/till" },
806
- { id: "money_exchange_branch_stock", label: "Vault", path: "/money-exchange/branch-stock" },
807
- { id: "money_exchange_internal_transfers", label: "Internal Transfers", path: "/money-exchange/internal-transfers" },
808
- ],
809
- },
810
- {
811
- id: "money_exchange_wholesale",
812
- label: "Wholesale",
813
- items: [
814
- { id: "money_exchange_wholesale", label: "Wholesale Operations", path: "/money-exchange/wholesale" },
815
- { id: "money_exchange_suppliers", label: "Supplier Registry", path: "/money-exchange/suppliers" },
816
- ],
817
- },
818
- // {
819
- // id: "money_exchange_remittances",
820
- // label: "Remittances",
821
- // items: [
822
- // { id: "money_exchange_remittance_agents", label: "Agent Registry", path: "/money-exchange/agents" },
823
- // { id: "money_exchange_remittance_corridors", label: "Corridors", path: "/money-exchange/corridors" },
824
- // { id: "money_exchange_remittances", label: "Transactions", path: "/money-exchange/remittances" },
825
- // { id: "money_exchange_remittance_settlements", label: "Settlements", path: "/money-exchange/settlements" },
826
- // ],
827
- // },
828
- {
829
- id: "money_exchange_config",
830
- label: "Config",
831
- items: [
832
- { id: "money_exchange_denominations", label: "Denomination", path: "/money-exchange/denominations" },
833
- { id: "money_exchange_till_thresholds", label: "Till Thresholds", path: "/money-exchange/till-thresholds" },
834
- { id: "money_exchange_cross_currency", label: "Margin Rate", path: "/money-exchange/cross-currency" },
835
- { id: "money_exchange_opening_stock", label: "Opening Stock", path: "/money-exchange/opening-stock" },
836
- ],
837
- },
838
- ],
839
- },
840
- ];
403
+ // This is dynamically generated from the default preset!
404
+ export const APP_MENUS: MainMenuItem[] = buildMenusFromConfig({
405
+ primaryMenus: MENU_PRESETS[0].primaryMenus
406
+ });
841
407
 
842
408
  /**
843
409
  * Builds MainMenuItem[] from a saved menu config (from the API).