@apptimate/core-lib 5.9.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
|
@@ -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
|
+
}
|
package/src/constants/menus.ts
CHANGED
|
@@ -106,6 +106,7 @@ export const MENU_ITEM_REGISTRY: RegistryItem[] = [
|
|
|
106
106
|
{ key: 'inventory__adjustments', label: 'Adjustments', path: '/inventory/adjustments', module: 'Inventory', defaultGroup: 'Operations', permission: null },
|
|
107
107
|
{ key: 'inventory__transfers', label: 'Transfers', path: '/inventory/transfers', module: 'Inventory', defaultGroup: 'Operations', permission: null },
|
|
108
108
|
{ key: 'inventory__serials', label: 'Serial Numbers', path: '/inventory/serials', module: 'Inventory', defaultGroup: 'Stock', permission: null },
|
|
109
|
+
{ key: 'inventory__settings', label: 'Settings', path: '/inventory/settings', module: 'Inventory', defaultGroup: 'Settings', permission: 'inventory_setting.view' },
|
|
109
110
|
|
|
110
111
|
// ── Sales Module ──
|
|
111
112
|
{ key: 'sales__price_lists', label: 'Price Lists', path: '/sales/price-lists', module: 'Sales', defaultGroup: 'Master Data', permission: null },
|
|
@@ -276,7 +277,7 @@ export const MENU_ITEM_REGISTRY: RegistryItem[] = [
|
|
|
276
277
|
|
|
277
278
|
{ key: 'construction__site_engineer', label: 'Site Engineer', path: '/construction/dashboard/site-engineer', module: 'Construction', defaultGroup: 'Site Execution', permission: null },
|
|
278
279
|
{ key: 'construction__dsr', label: 'Daily Site Reports', path: '/construction/site-execution/dsr', module: 'Construction', defaultGroup: 'Site Execution', permission: null },
|
|
279
|
-
{ key: '
|
|
280
|
+
{ key: 'construction__progress_updates', label: 'Progress Measurement', path: '/construction/site-execution/progress-updates', module: 'Construction', defaultGroup: 'Site Execution', permission: null },
|
|
280
281
|
{ key: 'construction__subcontractor_progress', label: 'Subcontractor Progress', path: '/construction/site-execution/subcontractor-progress', module: 'Construction', defaultGroup: 'Site Execution', permission: null },
|
|
281
282
|
{ key: 'construction__change_orders', label: 'Change Orders', path: '/construction/change-orders', module: 'Construction', defaultGroup: 'Site Execution', permission: null },
|
|
282
283
|
|
|
@@ -398,6 +399,7 @@ export const MENU_PRESETS: MenuPreset[] = [
|
|
|
398
399
|
'inventory__items', 'inventory__categories', 'inventory__brands', 'inventory__uom',
|
|
399
400
|
'inventory__stock', 'inventory__ledger',
|
|
400
401
|
'inventory__opening_stock', 'inventory__adjustments', 'inventory__transfers', 'inventory__serials',
|
|
402
|
+
'inventory__settings'
|
|
401
403
|
],
|
|
402
404
|
},
|
|
403
405
|
{
|
|
@@ -600,3 +602,130 @@ export function filterMenusByPermission(menus: MainMenuItem[], can: (code: strin
|
|
|
600
602
|
return { ...mainMenu, groups: filteredGroups };
|
|
601
603
|
}).filter(mainMenu => mainMenu.groups.length > 0);
|
|
602
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
|
+
};
|