@apptimate/core-lib 6.0.0 → 6.1.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": "6.0.0",
3
+ "version": "6.1.0",
4
4
  "main": "src/index.ts",
5
5
  "types": "src/index.ts",
6
6
  "publishConfig": {
@@ -71,3 +71,8 @@ export async function createGoodsReceiptNote(data: any): Promise<IApiResponse> {
71
71
  const response = await sendRequest({ url: `${BASE}/grn`, method: "POST", data });
72
72
  return response.responseData as IApiResponse;
73
73
  }
74
+
75
+ export async function cancelGoodsReceiptNote(id: number): Promise<IApiResponse> {
76
+ const response = await sendRequest({ url: `${BASE}/grn/${id}/cancel`, method: "POST" });
77
+ return response.responseData as IApiResponse;
78
+ }
@@ -277,7 +277,7 @@ export const MENU_ITEM_REGISTRY: RegistryItem[] = [
277
277
 
278
278
  { key: 'construction__site_engineer', label: 'Site Engineer', path: '/construction/dashboard/site-engineer', module: 'Construction', defaultGroup: 'Site Execution', permission: null },
279
279
  { key: 'construction__dsr', label: 'Daily Site Reports', path: '/construction/site-execution/dsr', module: 'Construction', defaultGroup: 'Site Execution', permission: null },
280
- { key: 'construction__progress', label: 'Progress Measurement', path: '/construction/site-execution/progress', module: 'Construction', defaultGroup: 'Site Execution', permission: null },
280
+ { key: 'construction__progress_updates', label: 'Progress Measurement', path: '/construction/site-execution/progress-updates', module: 'Construction', defaultGroup: 'Site Execution', permission: null },
281
281
  { key: 'construction__subcontractor_progress', label: 'Subcontractor Progress', path: '/construction/site-execution/subcontractor-progress', module: 'Construction', defaultGroup: 'Site Execution', permission: null },
282
282
  { key: 'construction__change_orders', label: 'Change Orders', path: '/construction/change-orders', module: 'Construction', defaultGroup: 'Site Execution', permission: null },
283
283
 
@@ -602,3 +602,130 @@ export function filterMenusByPermission(menus: MainMenuItem[], can: (code: strin
602
602
  return { ...mainMenu, groups: filteredGroups };
603
603
  }).filter(mainMenu => mainMenu.groups.length > 0);
604
604
  }
605
+
606
+ const PROJECT_KEY_MAPPING: Record<string, string> = {
607
+ 'project_home': 'construction__dashboard',
608
+ 'project_hierarchy': 'construction__hierarchy',
609
+ 'project_team': 'construction__team',
610
+ 'project_budget': 'construction__budget',
611
+ 'project_resource_calendar': 'construction__schedule_calendar',
612
+ 'project_progress_billing': 'construction__ipcs',
613
+ 'project_variations': 'construction__variations',
614
+ 'project_boq': 'construction__boq',
615
+ 'project_boq_revisions': 'construction__boq_revisions',
616
+ 'project_drawings': 'construction__drawings',
617
+ 'project_rfis': 'construction__rfis',
618
+ 'project_dsr': 'construction__dsr',
619
+ 'project_progress_updates': 'construction__progress_updates',
620
+ 'project_subcontractor_progress': 'construction__subcontractor_progress',
621
+ 'project_attendance': 'construction__attendance',
622
+ 'project_change_orders': 'construction__change_orders',
623
+ 'project_ir': 'construction__quality_ir',
624
+ 'project_ncr': 'construction__quality_ncr',
625
+ 'project_punch_list': 'construction__punch_list',
626
+ 'project_material_testing': 'construction__material_testing',
627
+ 'project_incidents': 'construction__safety_incidents',
628
+ 'project_ptw': 'construction__ptw',
629
+ 'project_workforce_allocation': 'construction__workforce_allocation',
630
+ 'project_equipment_allocation': 'construction__equipment_allocation',
631
+ 'project_fuel_logs': 'construction__fuel_logs',
632
+ 'project_maintenance': 'construction__maintenance',
633
+ };
634
+
635
+ export const getProjectConstructionGroups = (projectId: string | number): MainMenuItem['groups'] => {
636
+ const groups: MainMenuItem['groups'] = [
637
+ {
638
+ id: 'project_overview',
639
+ label: 'Overview',
640
+ items: [
641
+ { id: 'project_home', label: 'Dashboard', path: `/construction/projects/${projectId}` },
642
+ ]
643
+ },
644
+ {
645
+ id: 'project_planning',
646
+ label: 'Planning & Setup',
647
+ items: [
648
+ { id: 'project_hierarchy', label: 'Hierarchy', path: `/construction/projects/${projectId}/hierarchy` },
649
+ { id: 'project_team', label: 'Team', path: `/construction/projects/${projectId}/team` },
650
+ { id: 'project_budget', label: 'Budget', path: `/construction/projects/${projectId}/budget` },
651
+ { id: 'project_resource_calendar', label: 'Resource Calendar', path: `/construction/projects/${projectId}/resource-calendar` },
652
+ ]
653
+ },
654
+ {
655
+ id: 'project_contracts_billing',
656
+ label: 'Contracts & Billing',
657
+ items: [
658
+ { id: 'project_progress_billing', label: 'Progress Billing', path: `/construction/projects/${projectId}/progress-billing` },
659
+ { id: 'project_variations', label: 'Subcontractor Variations', path: `/construction/projects/${projectId}/variations` },
660
+ ]
661
+ },
662
+ {
663
+ id: 'project_commercials',
664
+ label: 'Commercials & BOQ',
665
+ items: [
666
+ { id: 'project_boq', label: 'Bill of Quantities (BOQ)', path: `/construction/projects/${projectId}/boq` },
667
+ { id: 'project_boq_revisions', label: 'BOQ Revisions', path: `/construction/projects/${projectId}/boq/revisions` },
668
+ ]
669
+ },
670
+ {
671
+ id: 'project_document_control',
672
+ label: 'Document Control',
673
+ items: [
674
+ { id: 'project_drawings', label: 'Drawing Register', path: `/construction/projects/${projectId}/drawings` },
675
+ { id: 'project_rfis', label: 'RFIs', path: `/construction/projects/${projectId}/rfis` },
676
+ ]
677
+ },
678
+ {
679
+ id: 'project_execution',
680
+ label: 'Site Execution',
681
+ items: [
682
+ { id: 'project_dsr', label: 'Daily Site Reports', path: `/construction/projects/${projectId}/dsr` },
683
+ { id: 'project_progress_updates', label: 'Progress Measurement', path: `/construction/projects/${projectId}/progress-updates` },
684
+ { id: 'project_subcontractor_progress', label: 'Subcontractor Progress', path: `/construction/projects/${projectId}/subcontractor-progress` },
685
+ { id: 'project_attendance', label: 'Attendance & Timesheets', path: `/construction/projects/${projectId}/attendance` },
686
+ { id: 'project_change_orders', label: 'Change Orders', path: `/construction/projects/${projectId}/change-orders` },
687
+ ]
688
+ },
689
+ {
690
+ id: 'project_quality_safety',
691
+ label: 'Quality & Safety',
692
+ items: [
693
+ { id: 'project_ir', label: 'Inspection Requests', path: `/construction/projects/${projectId}/ir` },
694
+ { id: 'project_ncr', label: 'Non-Conformance Reports', path: `/construction/projects/${projectId}/ncr` },
695
+ { id: 'project_punch_list', label: 'Snag List', path: `/construction/projects/${projectId}/punch-list` },
696
+ { id: 'project_material_testing', label: 'Material Testing', path: `/construction/projects/${projectId}/material-testing` },
697
+ { id: 'project_incidents', label: 'Incident Log', path: `/construction/projects/${projectId}/incidents` },
698
+ { id: 'project_ptw', label: 'Permit to Work', path: `/construction/projects/${projectId}/ptw` },
699
+ ]
700
+ },
701
+ {
702
+ id: 'project_workforce',
703
+ label: 'Workforce',
704
+ items: [
705
+ { id: 'project_workforce_allocation', label: 'Workforce Allocation', path: `/construction/projects/${projectId}/workforce/allocation` },
706
+ ]
707
+ },
708
+ {
709
+ id: 'project_equipment',
710
+ label: 'Equipment & Plant',
711
+ items: [
712
+ { id: 'project_equipment_allocation', label: 'Equipment Allocation', path: `/construction/projects/${projectId}/equipment/allocation` },
713
+ { id: 'project_fuel_logs', label: 'Fuel Logs', path: `/construction/projects/${projectId}/equipment/fuel-logs` },
714
+ { id: 'project_maintenance', label: 'Maintenance', path: `/construction/projects/${projectId}/equipment/maintenance` },
715
+ ]
716
+ }
717
+ ];
718
+
719
+ return groups.map(group => ({
720
+ ...group,
721
+ items: group.items.map(item => {
722
+ const registryKey = PROJECT_KEY_MAPPING[item.id] || item.id;
723
+ const registryItem = MENU_ITEM_REGISTRY.find(r => r.key === registryKey);
724
+ return {
725
+ ...item,
726
+ id: registryKey,
727
+ permission: registryItem?.permission || null,
728
+ };
729
+ })
730
+ }));
731
+ };