@apptimate/core-lib 4.3.0 → 4.4.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,15 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apptimate/core-lib",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.0",
|
|
4
4
|
"main": "src/index.ts",
|
|
5
5
|
"types": "src/index.ts",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"js-cookie": "^3.0.5",
|
|
11
10
|
"clsx": "^2.1.1",
|
|
12
|
-
"
|
|
11
|
+
"js-cookie": "^3.0.5",
|
|
12
|
+
"tailwind-merge": "^3.5.0",
|
|
13
|
+
"zod": "^4.4.3"
|
|
13
14
|
},
|
|
14
15
|
"devDependencies": {
|
|
15
16
|
"@types/js-cookie": "^3.0.6"
|
package/src/client.ts
CHANGED
|
@@ -90,7 +90,7 @@ export const ICON_REGISTRY: { name: string; category: string }[] = [
|
|
|
90
90
|
{ name: 'Building2', category: 'People' },
|
|
91
91
|
{ name: 'Building', category: 'People' },
|
|
92
92
|
{ name: 'Briefcase', category: 'People' },
|
|
93
|
-
{ name: '
|
|
93
|
+
{ name: 'Crane', category: 'People' },
|
|
94
94
|
{ name: 'GraduationCap', category: 'People' },
|
|
95
95
|
|
|
96
96
|
// Settings / System
|
package/src/constants/menus.ts
CHANGED
|
@@ -108,6 +108,7 @@ export const MENU_ITEM_REGISTRY: RegistryItem[] = [
|
|
|
108
108
|
// ── Procurement Module ──
|
|
109
109
|
{ key: 'procurement__orders', label: 'Purchase Orders', path: '/procurement/orders', module: 'Procurement', defaultGroup: 'Orders', permission: null },
|
|
110
110
|
{ key: 'procurement__grn', label: 'Goods Receipt', path: '/procurement/grns', module: 'Procurement', defaultGroup: 'Receiving', permission: null },
|
|
111
|
+
{ key: 'procurement__settings', label: 'Settings', path: '/procurement/settings', module: 'Procurement', defaultGroup: 'Configuration', permission: 'procurement_setting.view' },
|
|
111
112
|
{ key: 'procurement__invoices', label: 'Invoices', path: '/finance/invoices', module: 'Procurement', defaultGroup: 'Finance', permission: null },
|
|
112
113
|
{ key: 'procurement__payments', label: 'Payments', path: '/finance/payments', module: 'Procurement', defaultGroup: 'Finance', permission: null },
|
|
113
114
|
|
|
@@ -244,7 +245,9 @@ export const MENU_ITEM_REGISTRY: RegistryItem[] = [
|
|
|
244
245
|
{ key: 'construction__shifts', label: 'Shift Master', path: '/construction/shifts', module: 'Construction', defaultGroup: 'Workforce', permission: null },
|
|
245
246
|
{ key: 'construction__attendance', label: 'Attendance & Timesheets', path: '/construction/attendance', module: 'Construction', defaultGroup: 'Workforce', permission: null },
|
|
246
247
|
|
|
248
|
+
{ key: 'construction__equipment_types', label: 'Equipment Types', path: '/construction/equipment/types', module: 'Construction', defaultGroup: 'Equipment & Plant', permission: null },
|
|
247
249
|
{ key: 'construction__equipment', label: 'Equipment Master', path: '/construction/equipment', module: 'Construction', defaultGroup: 'Equipment & Plant', permission: null },
|
|
250
|
+
{ key: 'construction__equipment_allocation', label: 'Equipment Allocation', path: '/construction/equipment/allocation', module: 'Construction', defaultGroup: 'Equipment & Plant', permission: null },
|
|
248
251
|
{ key: 'construction__fuel_logs', label: 'Fuel Logs', path: '/construction/equipment/fuel-logs', module: 'Construction', defaultGroup: 'Equipment & Plant', permission: null },
|
|
249
252
|
{ key: 'construction__maintenance', label: 'Maintenance', path: '/construction/equipment/maintenance', module: 'Construction', defaultGroup: 'Equipment & Plant', permission: null },
|
|
250
253
|
|
|
@@ -257,9 +260,9 @@ export const MENU_ITEM_REGISTRY: RegistryItem[] = [
|
|
|
257
260
|
|
|
258
261
|
{ key: 'construction__dsr', label: 'Daily Site Reports', path: '/construction/site-execution/dsr', module: 'Construction', defaultGroup: 'Site Execution', permission: null },
|
|
259
262
|
{ key: 'construction__progress', label: 'Progress Measurement', path: '/construction/site-execution/progress', module: 'Construction', defaultGroup: 'Site Execution', permission: null },
|
|
263
|
+
{ key: 'construction__subcontractor_progress', label: 'Subcontractor Progress', path: '/construction/site-execution/subcontractor-progress', module: 'Construction', defaultGroup: 'Site Execution', permission: null },
|
|
260
264
|
|
|
261
265
|
{ key: 'construction__drawings', label: 'Drawing Register', path: '/construction/document-control/drawings', module: 'Construction', defaultGroup: 'Document Control', permission: null },
|
|
262
|
-
{ key: 'construction__transmittals', label: 'Transmittals', path: '/construction/document-control/transmittals', module: 'Construction', defaultGroup: 'Document Control', permission: null },
|
|
263
266
|
{ key: 'construction__rfis', label: 'RFIs', path: '/construction/document-control/rfis', module: 'Construction', defaultGroup: 'Document Control', permission: null },
|
|
264
267
|
|
|
265
268
|
{ key: 'construction__quality_ir', label: 'Inspection Requests', path: '/construction/quality/ir', module: 'Construction', defaultGroup: 'Quality', permission: null },
|
|
@@ -270,6 +273,10 @@ export const MENU_ITEM_REGISTRY: RegistryItem[] = [
|
|
|
270
273
|
{ key: 'construction__safety_incidents', label: 'Incident Log', path: '/construction/safety/incidents', module: 'Construction', defaultGroup: 'Safety', permission: null },
|
|
271
274
|
{ key: 'construction__ptw', label: 'Permit to Work', path: '/construction/safety/ptw', module: 'Construction', defaultGroup: 'Safety', permission: null },
|
|
272
275
|
|
|
276
|
+
{ key: 'construction__approval_workflows', label: 'Approval Workflows', path: '/construction/settings/approvals', module: 'Construction', defaultGroup: 'Configuration', permission: null },
|
|
277
|
+
{ key: 'construction__test_types', label: 'Test Types', path: '/construction/settings/test-types', module: 'Construction', defaultGroup: 'Configuration', permission: null },
|
|
278
|
+
{ key: 'construction__settings', label: 'Settings', path: '/construction/settings', module: 'Construction', defaultGroup: 'Configuration', permission: null },
|
|
279
|
+
|
|
273
280
|
// ── CRM Module ──
|
|
274
281
|
{ key: 'crm__dashboard', label: 'Overview', path: '/crm', module: 'CRM', defaultGroup: 'Overview', permission: null },
|
|
275
282
|
{ key: 'crm__customers', label: 'Customers', path: '/crm/customers', module: 'CRM', defaultGroup: 'Core', permission: null },
|
|
@@ -389,6 +396,7 @@ export const MENU_PRESETS: MenuPreset[] = [
|
|
|
389
396
|
secondaryItems: [
|
|
390
397
|
'procurement__orders', 'procurement__grn',
|
|
391
398
|
'procurement__invoices', 'procurement__payments',
|
|
399
|
+
'procurement__settings',
|
|
392
400
|
],
|
|
393
401
|
},
|
|
394
402
|
{
|
|
@@ -483,7 +491,7 @@ export const MENU_PRESETS: MenuPreset[] = [
|
|
|
483
491
|
{
|
|
484
492
|
id: 'construction',
|
|
485
493
|
label: 'Construction',
|
|
486
|
-
iconName: '
|
|
494
|
+
iconName: 'Crane',
|
|
487
495
|
secondaryItems: [
|
|
488
496
|
'construction__dashboard',
|
|
489
497
|
'construction__projects',
|
|
@@ -500,7 +508,9 @@ export const MENU_PRESETS: MenuPreset[] = [
|
|
|
500
508
|
'construction__workforce',
|
|
501
509
|
'construction__shifts',
|
|
502
510
|
'construction__attendance',
|
|
511
|
+
'construction__equipment_types',
|
|
503
512
|
'construction__equipment',
|
|
513
|
+
'construction__equipment_allocation',
|
|
504
514
|
'construction__fuel_logs',
|
|
505
515
|
'construction__maintenance',
|
|
506
516
|
'construction__schedule_tasks',
|
|
@@ -510,6 +520,7 @@ export const MENU_PRESETS: MenuPreset[] = [
|
|
|
510
520
|
'construction__ipcs',
|
|
511
521
|
'construction__dsr',
|
|
512
522
|
'construction__progress',
|
|
523
|
+
'construction__subcontractor_progress',
|
|
513
524
|
'construction__drawings',
|
|
514
525
|
'construction__transmittals',
|
|
515
526
|
'construction__rfis',
|
|
@@ -519,6 +530,9 @@ export const MENU_PRESETS: MenuPreset[] = [
|
|
|
519
530
|
'construction__material_testing',
|
|
520
531
|
'construction__safety_incidents',
|
|
521
532
|
'construction__ptw',
|
|
533
|
+
'construction__approval_workflows',
|
|
534
|
+
'construction__test_types',
|
|
535
|
+
'construction__settings',
|
|
522
536
|
],
|
|
523
537
|
},
|
|
524
538
|
{
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
export const approvalStepSchema = z.object({
|
|
4
|
+
step_order: z.number().int().positive(),
|
|
5
|
+
approver_type: z.enum(["user", "role"]),
|
|
6
|
+
approver_id: z.string().min(1, "Approver is required")
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export const approvalWorkflowSchema = z.object({
|
|
10
|
+
entity_type: z.string().min(1, "Entity Type is required"),
|
|
11
|
+
workflow_name: z.string().min(1, "Workflow Name is required"),
|
|
12
|
+
description: z.string().optional(),
|
|
13
|
+
steps: z.array(approvalStepSchema).min(1, "At least one approval step is required")
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export type ApprovalStep = z.infer<typeof approvalStepSchema>;
|
|
17
|
+
export type ApprovalWorkflowFormData = z.infer<typeof approvalWorkflowSchema>;
|