@apptimate/core-lib 4.2.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
|
|
|
@@ -222,8 +223,64 @@ export const MENU_ITEM_REGISTRY: RegistryItem[] = [
|
|
|
222
223
|
{ key: 'ai_analytics__usage', label: 'Usage Analytics', path: '/ai-analytics/usage', module: 'AI Analytics', defaultGroup: 'Insights', permission: null },
|
|
223
224
|
{ key: 'ai_analytics__forecasting', label: 'Forecasting', path: '/ai-analytics/forecasting', module: 'AI Analytics', defaultGroup: 'Advanced Models', permission: null },
|
|
224
225
|
{ key: 'ai_analytics__anomalies', label: 'Anomaly Detection', path: '/ai-analytics/anomalies', module: 'AI Analytics', defaultGroup: 'Advanced Models', permission: null },
|
|
225
|
-
{ key: 'ai_analytics__customer_intel', label: 'Customer Intel', path: '/ai-analytics/customer-intel', module: 'AI Analytics', defaultGroup: 'Intelligence', permission: null },
|
|
226
226
|
{ key: 'ai_analytics__pricing_intel', label: 'Pricing Intel', path: '/ai-analytics/pricing-intel', module: 'AI Analytics', defaultGroup: 'Intelligence', permission: null },
|
|
227
|
+
|
|
228
|
+
// ── Construction Module ──
|
|
229
|
+
{ key: 'construction__dashboard', label: 'Overview', path: '/construction', module: 'Construction', defaultGroup: 'Overview', permission: null },
|
|
230
|
+
{ key: 'construction__projects', label: 'Projects', path: '/construction/projects', module: 'Construction', defaultGroup: 'Core', permission: null },
|
|
231
|
+
{ key: 'construction__mtrs', label: 'Transfer Requests', path: '/construction/procurement/mtrs', module: 'Construction', defaultGroup: 'Procurement', permission: null },
|
|
232
|
+
{ key: 'construction__prs', label: 'Purchase Requisitions', path: '/construction/procurement/prs', module: 'Construction', defaultGroup: 'Procurement', permission: null },
|
|
233
|
+
{ key: 'construction__pos', label: 'Purchase Orders', path: '/construction/procurement/pos', module: 'Construction', defaultGroup: 'Procurement', permission: null },
|
|
234
|
+
{ key: 'construction__grns', label: 'Goods Receipt', path: '/construction/procurement/grns', module: 'Construction', defaultGroup: 'Procurement', permission: null },
|
|
235
|
+
|
|
236
|
+
{ key: 'construction__site_ledger', label: 'Site Ledger', path: '/construction/site-inventory/ledger', module: 'Construction', defaultGroup: 'Site Inventory', permission: null },
|
|
237
|
+
{ key: 'construction__site_issues', label: 'Site Issues', path: '/construction/site-inventory/issues', module: 'Construction', defaultGroup: 'Site Inventory', permission: null },
|
|
238
|
+
{ key: 'construction__wastage_returns', label: 'Wastage & Returns', path: '/construction/site-inventory/wastage-returns', module: 'Construction', defaultGroup: 'Site Inventory', permission: null },
|
|
239
|
+
|
|
240
|
+
{ key: 'construction__boq', label: 'BOQ Master', path: '/construction/boq', module: 'Construction', defaultGroup: 'Bill of Quantities', permission: null },
|
|
241
|
+
{ key: 'construction__boq_revisions', label: 'BOQ Revisions', path: '/construction/boq/revisions', module: 'Construction', defaultGroup: 'Bill of Quantities', permission: null },
|
|
242
|
+
{ key: 'construction__variations', label: 'Subcontractor Variations', path: '/construction/variations', module: 'Construction', defaultGroup: 'Subcontractor Variations', permission: null },
|
|
243
|
+
|
|
244
|
+
{ key: 'construction__workforce', label: 'Workforce Master', path: '/construction/workforce', module: 'Construction', defaultGroup: 'Workforce', permission: null },
|
|
245
|
+
{ key: 'construction__shifts', label: 'Shift Master', path: '/construction/shifts', module: 'Construction', defaultGroup: 'Workforce', permission: null },
|
|
246
|
+
{ key: 'construction__attendance', label: 'Attendance & Timesheets', path: '/construction/attendance', module: 'Construction', defaultGroup: 'Workforce', permission: null },
|
|
247
|
+
|
|
248
|
+
{ key: 'construction__equipment_types', label: 'Equipment Types', path: '/construction/equipment/types', module: 'Construction', defaultGroup: 'Equipment & Plant', permission: null },
|
|
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 },
|
|
251
|
+
{ key: 'construction__fuel_logs', label: 'Fuel Logs', path: '/construction/equipment/fuel-logs', module: 'Construction', defaultGroup: 'Equipment & Plant', permission: null },
|
|
252
|
+
{ key: 'construction__maintenance', label: 'Maintenance', path: '/construction/equipment/maintenance', module: 'Construction', defaultGroup: 'Equipment & Plant', permission: null },
|
|
253
|
+
|
|
254
|
+
{ key: 'construction__schedule_tasks', label: 'Schedule Tasks', path: '/construction/scheduling/tasks', module: 'Construction', defaultGroup: 'Scheduling', permission: null },
|
|
255
|
+
{ key: 'construction__schedule_calendar', label: 'Resource Calendar', path: '/construction/scheduling/calendar', module: 'Construction', defaultGroup: 'Scheduling', permission: null },
|
|
256
|
+
|
|
257
|
+
{ key: 'construction__main_contract', label: 'Main Contract', path: '/construction/contracts/main-contract', module: 'Construction', defaultGroup: 'Contracts', permission: null },
|
|
258
|
+
{ key: 'construction__subcontractors', label: 'Subcontractors', path: '/construction/contracts/subcontractors', module: 'Construction', defaultGroup: 'Contracts', permission: null },
|
|
259
|
+
{ key: 'construction__ipcs', label: 'Progress Billing', path: '/construction/contracts/ipcs', module: 'Construction', defaultGroup: 'Contracts', permission: null },
|
|
260
|
+
|
|
261
|
+
{ key: 'construction__dsr', label: 'Daily Site Reports', path: '/construction/site-execution/dsr', module: 'Construction', defaultGroup: 'Site Execution', permission: null },
|
|
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 },
|
|
264
|
+
|
|
265
|
+
{ key: 'construction__drawings', label: 'Drawing Register', path: '/construction/document-control/drawings', module: 'Construction', defaultGroup: 'Document Control', permission: null },
|
|
266
|
+
{ key: 'construction__rfis', label: 'RFIs', path: '/construction/document-control/rfis', module: 'Construction', defaultGroup: 'Document Control', permission: null },
|
|
267
|
+
|
|
268
|
+
{ key: 'construction__quality_ir', label: 'Inspection Requests', path: '/construction/quality/ir', module: 'Construction', defaultGroup: 'Quality', permission: null },
|
|
269
|
+
{ key: 'construction__quality_ncr', label: 'Non-Conformance Reports', path: '/construction/quality/ncr', module: 'Construction', defaultGroup: 'Quality', permission: null },
|
|
270
|
+
{ key: 'construction__punch_list', label: 'Snag List', path: '/construction/quality/punch-list', module: 'Construction', defaultGroup: 'Quality', permission: null },
|
|
271
|
+
{ key: 'construction__material_testing', label: 'Material Testing', path: '/construction/quality/material-testing', module: 'Construction', defaultGroup: 'Quality', permission: null },
|
|
272
|
+
|
|
273
|
+
{ key: 'construction__safety_incidents', label: 'Incident Log', path: '/construction/safety/incidents', module: 'Construction', defaultGroup: 'Safety', permission: null },
|
|
274
|
+
{ key: 'construction__ptw', label: 'Permit to Work', path: '/construction/safety/ptw', module: 'Construction', defaultGroup: 'Safety', permission: null },
|
|
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
|
+
|
|
280
|
+
// ── CRM Module ──
|
|
281
|
+
{ key: 'crm__dashboard', label: 'Overview', path: '/crm', module: 'CRM', defaultGroup: 'Overview', permission: null },
|
|
282
|
+
{ key: 'crm__customers', label: 'Customers', path: '/crm/customers', module: 'CRM', defaultGroup: 'Core', permission: null },
|
|
283
|
+
{ key: 'crm__leads', label: 'Leads', path: '/crm/leads', module: 'CRM', defaultGroup: 'Sales', permission: null },
|
|
227
284
|
];
|
|
228
285
|
|
|
229
286
|
/**
|
|
@@ -339,6 +396,7 @@ export const MENU_PRESETS: MenuPreset[] = [
|
|
|
339
396
|
secondaryItems: [
|
|
340
397
|
'procurement__orders', 'procurement__grn',
|
|
341
398
|
'procurement__invoices', 'procurement__payments',
|
|
399
|
+
'procurement__settings',
|
|
342
400
|
],
|
|
343
401
|
},
|
|
344
402
|
{
|
|
@@ -429,6 +487,63 @@ export const MENU_PRESETS: MenuPreset[] = [
|
|
|
429
487
|
'ai_analytics__customer_intel',
|
|
430
488
|
'ai_analytics__pricing_intel',
|
|
431
489
|
],
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
id: 'construction',
|
|
493
|
+
label: 'Construction',
|
|
494
|
+
iconName: 'Crane',
|
|
495
|
+
secondaryItems: [
|
|
496
|
+
'construction__dashboard',
|
|
497
|
+
'construction__projects',
|
|
498
|
+
'construction__mtrs',
|
|
499
|
+
'construction__prs',
|
|
500
|
+
'construction__pos',
|
|
501
|
+
'construction__grns',
|
|
502
|
+
'construction__site_ledger',
|
|
503
|
+
'construction__site_issues',
|
|
504
|
+
'construction__wastage_returns',
|
|
505
|
+
'construction__boq',
|
|
506
|
+
'construction__boq_revisions',
|
|
507
|
+
'construction__variations',
|
|
508
|
+
'construction__workforce',
|
|
509
|
+
'construction__shifts',
|
|
510
|
+
'construction__attendance',
|
|
511
|
+
'construction__equipment_types',
|
|
512
|
+
'construction__equipment',
|
|
513
|
+
'construction__equipment_allocation',
|
|
514
|
+
'construction__fuel_logs',
|
|
515
|
+
'construction__maintenance',
|
|
516
|
+
'construction__schedule_tasks',
|
|
517
|
+
'construction__schedule_calendar',
|
|
518
|
+
'construction__main_contract',
|
|
519
|
+
'construction__subcontractors',
|
|
520
|
+
'construction__ipcs',
|
|
521
|
+
'construction__dsr',
|
|
522
|
+
'construction__progress',
|
|
523
|
+
'construction__subcontractor_progress',
|
|
524
|
+
'construction__drawings',
|
|
525
|
+
'construction__transmittals',
|
|
526
|
+
'construction__rfis',
|
|
527
|
+
'construction__quality_ir',
|
|
528
|
+
'construction__quality_ncr',
|
|
529
|
+
'construction__punch_list',
|
|
530
|
+
'construction__material_testing',
|
|
531
|
+
'construction__safety_incidents',
|
|
532
|
+
'construction__ptw',
|
|
533
|
+
'construction__approval_workflows',
|
|
534
|
+
'construction__test_types',
|
|
535
|
+
'construction__settings',
|
|
536
|
+
],
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
id: 'crm',
|
|
540
|
+
label: 'CRM',
|
|
541
|
+
iconName: 'UsersRound',
|
|
542
|
+
secondaryItems: [
|
|
543
|
+
'crm__dashboard',
|
|
544
|
+
'crm__customers',
|
|
545
|
+
'crm__leads',
|
|
546
|
+
],
|
|
432
547
|
}
|
|
433
548
|
],
|
|
434
549
|
},
|
|
@@ -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>;
|