vms-nest-prisma-api-document 1.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/dist/index.cjs ADDED
@@ -0,0 +1,1511 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ AdminRole: () => AdminRole,
24
+ AlertSubType: () => AlertSubType,
25
+ AlertType: () => AlertType,
26
+ BaseQuerySchema: () => BaseQuerySchema,
27
+ BillingStatus: () => BillingStatus,
28
+ BooleanType: () => BooleanType,
29
+ DefaultBaseFindParams: () => DefaultBaseFindParams,
30
+ DeviceStatus: () => DeviceStatus,
31
+ DeviceType: () => DeviceType,
32
+ DocumentStatus: () => DocumentStatus,
33
+ DocumentType: () => DocumentType,
34
+ DocumentValidityStatus: () => DocumentValidityStatus,
35
+ DoorSensorStatus: () => DoorSensorStatus,
36
+ ExpenseCategory: () => ExpenseCategory,
37
+ FileType: () => FileType,
38
+ FleetSize: () => FleetSize,
39
+ GPSFuelApproveStatus: () => GPSFuelApproveStatus,
40
+ GPSSource: () => GPSSource,
41
+ GPSType: () => GPSType,
42
+ GeofencePurposeType: () => GeofencePurposeType,
43
+ GeofenceStatusType: () => GeofenceStatusType,
44
+ GeofenceType: () => GeofenceType,
45
+ InspectionActionStatus: () => InspectionActionStatus,
46
+ InspectionStatus: () => InspectionStatus,
47
+ InspectionType: () => InspectionType,
48
+ Is12AM: () => Is12AM,
49
+ IssueSeverity: () => IssueSeverity,
50
+ IssueSource: () => IssueSource,
51
+ IssueStatus: () => IssueStatus,
52
+ JobCardStatus: () => JobCardStatus,
53
+ LifeExpiry: () => LifeExpiry,
54
+ LinkStatus: () => LinkStatus,
55
+ LinkType: () => LinkType,
56
+ LoadChild: () => LoadChild,
57
+ LoadChildCount: () => LoadChildCount,
58
+ LoadParents: () => LoadParents,
59
+ LoginFrom: () => LoginFrom,
60
+ MasterDeviceManufacturerQuerySchema: () => MasterDeviceManufacturerQuerySchema,
61
+ MasterDeviceManufacturerSchema: () => MasterDeviceManufacturerSchema,
62
+ MasterDeviceModelQuerySchema: () => MasterDeviceModelQuerySchema,
63
+ MasterDeviceModelSchema: () => MasterDeviceModelSchema,
64
+ MasterDeviceTypeQuerySchema: () => MasterDeviceTypeQuerySchema,
65
+ MasterDeviceTypeSchema: () => MasterDeviceTypeSchema,
66
+ MenuType: () => MenuType,
67
+ Module: () => Module,
68
+ MongoBaseQuerySchema: () => MongoBaseQuerySchema,
69
+ NightDriving: () => NightDriving,
70
+ NotificationType: () => NotificationType,
71
+ OdometerSource: () => OdometerSource,
72
+ OrderBy: () => OrderBy,
73
+ OrderBySchema: () => OrderBySchema,
74
+ OverSpeed: () => OverSpeed,
75
+ PAGING: () => PAGING,
76
+ PaymentStatus: () => PaymentStatus,
77
+ Priority: () => Priority,
78
+ PurchaseOrderStatus: () => PurchaseOrderStatus,
79
+ PurchaseType: () => PurchaseType,
80
+ PurchaseVehicleType: () => PurchaseVehicleType,
81
+ RecurrenceInterval: () => RecurrenceInterval,
82
+ ReminderSource: () => ReminderSource,
83
+ ReminderStatus: () => ReminderStatus,
84
+ ReminderTriggerType: () => ReminderTriggerType,
85
+ RequestType: () => RequestType,
86
+ RetreadingMethod: () => RetreadingMethod,
87
+ ScheduleStatus: () => ScheduleStatus,
88
+ ScheduleType: () => ScheduleType,
89
+ ServiceType: () => ServiceType,
90
+ SimStatus: () => SimStatus,
91
+ Status: () => Status,
92
+ StockType: () => StockType,
93
+ SubModule: () => SubModule,
94
+ TicketStatus: () => TicketStatus,
95
+ TimeSlot: () => TimeSlot,
96
+ TrackHistoryLinkStatus: () => TrackHistoryLinkStatus,
97
+ TyreStatus: () => TyreStatus,
98
+ VerifyStatus: () => VerifyStatus,
99
+ YesNo: () => YesNo,
100
+ apiDelete: () => apiDelete,
101
+ apiGet: () => apiGet,
102
+ apiPatch: () => apiPatch,
103
+ apiPost: () => apiPost,
104
+ booleanMandatory: () => booleanMandatory,
105
+ booleanOptional: () => booleanOptional,
106
+ createMasterDeviceManufacturer: () => createMasterDeviceManufacturer,
107
+ createMasterDeviceModel: () => createMasterDeviceModel,
108
+ createMasterDeviceType: () => createMasterDeviceType,
109
+ dateMandatory: () => dateMandatory,
110
+ dateOptional: () => dateOptional,
111
+ dateTimeMandatory: () => dateTimeMandatory,
112
+ dateTimeOptional: () => dateTimeOptional,
113
+ deleteMasterDeviceManufacturer: () => deleteMasterDeviceManufacturer,
114
+ deleteMasterDeviceModel: () => deleteMasterDeviceModel,
115
+ deleteMasterDeviceType: () => deleteMasterDeviceType,
116
+ doubleMandatory: () => doubleMandatory,
117
+ doubleMandatoryAmount: () => doubleMandatoryAmount,
118
+ doubleMandatoryLatLng: () => doubleMandatoryLatLng,
119
+ doubleOptional: () => doubleOptional,
120
+ doubleOptionalAmount: () => doubleOptionalAmount,
121
+ doubleOptionalLatLng: () => doubleOptionalLatLng,
122
+ dynamicJsonSchema: () => dynamicJsonSchema,
123
+ enumArrayMandatory: () => enumArrayMandatory,
124
+ enumArrayOptional: () => enumArrayOptional,
125
+ enumMandatory: () => enumMandatory,
126
+ enumOptional: () => enumOptional,
127
+ findMasterDeviceManufacturers: () => findMasterDeviceManufacturers,
128
+ findMasterDeviceModels: () => findMasterDeviceModels,
129
+ findMasterDeviceTypes: () => findMasterDeviceTypes,
130
+ getAllEnums: () => getAllEnums,
131
+ getMasterDeviceManufacturerCache: () => getMasterDeviceManufacturerCache,
132
+ getMasterDeviceManufacturerCacheChild: () => getMasterDeviceManufacturerCacheChild,
133
+ getMasterDeviceManufacturerCacheCount: () => getMasterDeviceManufacturerCacheCount,
134
+ getMasterDeviceModelCache: () => getMasterDeviceModelCache,
135
+ getMasterDeviceModelCacheChild: () => getMasterDeviceModelCacheChild,
136
+ getMasterDeviceModelCacheCount: () => getMasterDeviceModelCacheCount,
137
+ getMasterDeviceTypeCache: () => getMasterDeviceTypeCache,
138
+ getMasterDeviceTypeCacheChild: () => getMasterDeviceTypeCacheChild,
139
+ getMasterDeviceTypeCacheCount: () => getMasterDeviceTypeCacheCount,
140
+ multi_select_mandatory: () => multi_select_mandatory,
141
+ multi_select_optional: () => multi_select_optional,
142
+ nestedArrayOfObjectMandatory: () => nestedArrayOfObjectMandatory,
143
+ nestedArrayOfObjectsOptional: () => nestedArrayOfObjectsOptional,
144
+ nestedObjectMandatory: () => nestedObjectMandatory,
145
+ nestedObjectOptional: () => nestedObjectOptional,
146
+ newMasterDeviceManufacturerPayload: () => newMasterDeviceManufacturerPayload,
147
+ newMasterDeviceModelPayload: () => newMasterDeviceModelPayload,
148
+ newMasterDeviceTypePayload: () => newMasterDeviceTypePayload,
149
+ numberArrayMandatory: () => numberArrayMandatory,
150
+ numberArrayOptional: () => numberArrayOptional,
151
+ numberMandatory: () => numberMandatory,
152
+ numberOptional: () => numberOptional,
153
+ r_log: () => r_log,
154
+ setupSdk: () => setAxiosInstance,
155
+ single_select_mandatory: () => single_select_mandatory,
156
+ single_select_optional: () => single_select_optional,
157
+ stringArrayMandatory: () => stringArrayMandatory,
158
+ stringArrayOptional: () => stringArrayOptional,
159
+ stringMandatory: () => stringMandatory,
160
+ stringOptional: () => stringOptional,
161
+ stringUUIDMandatory: () => stringUUIDMandatory,
162
+ toMasterDeviceManufacturerPayload: () => toMasterDeviceManufacturerPayload,
163
+ toMasterDeviceModelPayload: () => toMasterDeviceModelPayload,
164
+ toMasterDeviceTypePayload: () => toMasterDeviceTypePayload,
165
+ updateMasterDeviceManufacturer: () => updateMasterDeviceManufacturer,
166
+ updateMasterDeviceModel: () => updateMasterDeviceModel,
167
+ updateMasterDeviceType: () => updateMasterDeviceType,
168
+ withDefaults: () => withDefaults
169
+ });
170
+ module.exports = __toCommonJS(index_exports);
171
+
172
+ // src/sdk-config.ts
173
+ var axiosInstance;
174
+ var setAxiosInstance = (instance) => {
175
+ axiosInstance = instance;
176
+ };
177
+ var getAxiosInstance = () => {
178
+ if (!axiosInstance) {
179
+ throw new Error("\u274C Axios instance not configured. Call setupSdk() first.");
180
+ }
181
+ return axiosInstance;
182
+ };
183
+
184
+ // src/core/Enums.ts
185
+ var PAGING = /* @__PURE__ */ ((PAGING2) => {
186
+ PAGING2["Yes"] = "Yes";
187
+ PAGING2["No"] = "No";
188
+ return PAGING2;
189
+ })(PAGING || {});
190
+ var LoadParents = /* @__PURE__ */ ((LoadParents2) => {
191
+ LoadParents2["Yes"] = "Yes";
192
+ LoadParents2["No"] = "No";
193
+ LoadParents2["Custom"] = "Custom";
194
+ return LoadParents2;
195
+ })(LoadParents || {});
196
+ var LoadChild = /* @__PURE__ */ ((LoadChild2) => {
197
+ LoadChild2["No"] = "No";
198
+ LoadChild2["Yes"] = "Yes";
199
+ LoadChild2["Count"] = "Count";
200
+ LoadChild2["Custom"] = "Custom";
201
+ LoadChild2["Direct"] = "Direct";
202
+ return LoadChild2;
203
+ })(LoadChild || {});
204
+ var LoadChildCount = /* @__PURE__ */ ((LoadChildCount2) => {
205
+ LoadChildCount2["No"] = "No";
206
+ LoadChildCount2["Yes"] = "Yes";
207
+ LoadChildCount2["Custom"] = "Custom";
208
+ return LoadChildCount2;
209
+ })(LoadChildCount || {});
210
+ var OrderBy = /* @__PURE__ */ ((OrderBy2) => {
211
+ OrderBy2["asc"] = "asc";
212
+ OrderBy2["desc"] = "desc";
213
+ return OrderBy2;
214
+ })(OrderBy || {});
215
+ var AdminRole = /* @__PURE__ */ ((AdminRole2) => {
216
+ AdminRole2["MasterAdmin"] = "MasterAdmin";
217
+ AdminRole2["Admin"] = "Admin";
218
+ return AdminRole2;
219
+ })(AdminRole || {});
220
+ var LoginFrom = /* @__PURE__ */ ((LoginFrom2) => {
221
+ LoginFrom2["Web"] = "Web";
222
+ LoginFrom2["Android"] = "Android";
223
+ LoginFrom2["IPhone"] = "IPhone";
224
+ return LoginFrom2;
225
+ })(LoginFrom || {});
226
+ var Status = /* @__PURE__ */ ((Status2) => {
227
+ Status2["Active"] = "Active";
228
+ Status2["Inactive"] = "Inactive";
229
+ return Status2;
230
+ })(Status || {});
231
+ var ExpenseCategory = /* @__PURE__ */ ((ExpenseCategory2) => {
232
+ ExpenseCategory2["Main"] = "Main";
233
+ ExpenseCategory2["Document"] = "Document";
234
+ ExpenseCategory2["Daily"] = "Daily";
235
+ ExpenseCategory2["Incident"] = "Incident";
236
+ ExpenseCategory2["Other"] = "Other";
237
+ return ExpenseCategory2;
238
+ })(ExpenseCategory || {});
239
+ var DoorSensorStatus = /* @__PURE__ */ ((DoorSensorStatus2) => {
240
+ DoorSensorStatus2["Open"] = "Open";
241
+ DoorSensorStatus2["Close"] = "Close";
242
+ return DoorSensorStatus2;
243
+ })(DoorSensorStatus || {});
244
+ var LifeExpiry = /* @__PURE__ */ ((LifeExpiry2) => {
245
+ LifeExpiry2["No"] = "No";
246
+ LifeExpiry2["Expiring"] = "Expiring";
247
+ LifeExpiry2["Expired"] = "Expired";
248
+ return LifeExpiry2;
249
+ })(LifeExpiry || {});
250
+ var PurchaseVehicleType = /* @__PURE__ */ ((PurchaseVehicleType2) => {
251
+ PurchaseVehicleType2["New"] = "New";
252
+ PurchaseVehicleType2["Used"] = "Used";
253
+ return PurchaseVehicleType2;
254
+ })(PurchaseVehicleType || {});
255
+ var PurchaseType = /* @__PURE__ */ ((PurchaseType2) => {
256
+ PurchaseType2["Loan"] = "Loan";
257
+ PurchaseType2["Lease"] = "Lease";
258
+ PurchaseType2["NoFinance"] = "NoFinance";
259
+ return PurchaseType2;
260
+ })(PurchaseType || {});
261
+ var FileType = /* @__PURE__ */ ((FileType2) => {
262
+ FileType2["NoFile"] = "NoFile";
263
+ FileType2["Image"] = "Image";
264
+ FileType2["Video"] = "Video";
265
+ FileType2["PDF"] = "PDF";
266
+ return FileType2;
267
+ })(FileType || {});
268
+ var DocumentValidityStatus = /* @__PURE__ */ ((DocumentValidityStatus2) => {
269
+ DocumentValidityStatus2["Valid"] = "Valid";
270
+ DocumentValidityStatus2["Expiring"] = "Expiring";
271
+ DocumentValidityStatus2["Expired"] = "Expired";
272
+ return DocumentValidityStatus2;
273
+ })(DocumentValidityStatus || {});
274
+ var DocumentStatus = /* @__PURE__ */ ((DocumentStatus2) => {
275
+ DocumentStatus2["Active"] = "Active";
276
+ DocumentStatus2["Inactive"] = "Inactive";
277
+ DocumentStatus2["Old"] = "Old";
278
+ return DocumentStatus2;
279
+ })(DocumentStatus || {});
280
+ var YesNo = /* @__PURE__ */ ((YesNo2) => {
281
+ YesNo2["Yes"] = "Yes";
282
+ YesNo2["No"] = "No";
283
+ return YesNo2;
284
+ })(YesNo || {});
285
+ var IssueSource = /* @__PURE__ */ ((IssueSource2) => {
286
+ IssueSource2["Direct"] = "Direct";
287
+ IssueSource2["Inspection"] = "Inspection";
288
+ IssueSource2["Incident"] = "Incident";
289
+ IssueSource2["Service"] = "Service";
290
+ IssueSource2["Other"] = "Other";
291
+ return IssueSource2;
292
+ })(IssueSource || {});
293
+ var OdometerSource = /* @__PURE__ */ ((OdometerSource2) => {
294
+ OdometerSource2["Direct"] = "Direct";
295
+ OdometerSource2["Inspection"] = "Inspection";
296
+ OdometerSource2["Incident"] = "Incident";
297
+ OdometerSource2["Service"] = "Service";
298
+ OdometerSource2["Issue"] = "Issue";
299
+ OdometerSource2["Other"] = "Other";
300
+ return OdometerSource2;
301
+ })(OdometerSource || {});
302
+ var IssueStatus = /* @__PURE__ */ ((IssueStatus2) => {
303
+ IssueStatus2["Open"] = "Open";
304
+ IssueStatus2["Closed"] = "Closed";
305
+ IssueStatus2["Resolved"] = "Resolved";
306
+ IssueStatus2["OverDue"] = "OverDue";
307
+ IssueStatus2["Reopen"] = "Reopen";
308
+ return IssueStatus2;
309
+ })(IssueStatus || {});
310
+ var Priority = /* @__PURE__ */ ((Priority2) => {
311
+ Priority2["Critical"] = "Critical";
312
+ Priority2["High"] = "High";
313
+ Priority2["Medium"] = "Medium";
314
+ Priority2["Low"] = "Low";
315
+ Priority2["NoPriority"] = "NoPriority";
316
+ return Priority2;
317
+ })(Priority || {});
318
+ var IssueSeverity = /* @__PURE__ */ ((IssueSeverity2) => {
319
+ IssueSeverity2["Minor"] = "Minor";
320
+ IssueSeverity2["Moderate"] = "Moderate";
321
+ IssueSeverity2["Severe"] = "Severe";
322
+ IssueSeverity2["Critical"] = "Critical";
323
+ return IssueSeverity2;
324
+ })(IssueSeverity || {});
325
+ var RequestType = /* @__PURE__ */ ((RequestType2) => {
326
+ RequestType2["Lock"] = "Lock";
327
+ RequestType2["Unlock"] = "Unlock";
328
+ return RequestType2;
329
+ })(RequestType || {});
330
+ var VerifyStatus = /* @__PURE__ */ ((VerifyStatus2) => {
331
+ VerifyStatus2["Pending"] = "Pending";
332
+ VerifyStatus2["Approved"] = "Approved";
333
+ VerifyStatus2["Expired"] = "Expired";
334
+ return VerifyStatus2;
335
+ })(VerifyStatus || {});
336
+ var DeviceType = /* @__PURE__ */ ((DeviceType2) => {
337
+ DeviceType2["Android"] = "Android";
338
+ DeviceType2["IPhone"] = "IPhone";
339
+ DeviceType2["Web"] = "Web";
340
+ return DeviceType2;
341
+ })(DeviceType || {});
342
+ var NotificationType = /* @__PURE__ */ ((NotificationType2) => {
343
+ NotificationType2["Whatsapp"] = "Whatsapp";
344
+ NotificationType2["Message"] = "Message";
345
+ NotificationType2["Email"] = "Email";
346
+ return NotificationType2;
347
+ })(NotificationType || {});
348
+ var GeofenceType = /* @__PURE__ */ ((GeofenceType2) => {
349
+ GeofenceType2["Polygon"] = "Polygon";
350
+ GeofenceType2["Circle"] = "Circle";
351
+ return GeofenceType2;
352
+ })(GeofenceType || {});
353
+ var GeofenceStatusType = /* @__PURE__ */ ((GeofenceStatusType2) => {
354
+ GeofenceStatusType2["Enter"] = "Enter";
355
+ GeofenceStatusType2["Exit"] = "Exit";
356
+ return GeofenceStatusType2;
357
+ })(GeofenceStatusType || {});
358
+ var LinkType = /* @__PURE__ */ ((LinkType2) => {
359
+ LinkType2["CurrentLocation"] = "CurrentLocation";
360
+ LinkType2["LiveLocation"] = "LiveLocation";
361
+ LinkType2["Trip"] = "Trip";
362
+ return LinkType2;
363
+ })(LinkType || {});
364
+ var LinkStatus = /* @__PURE__ */ ((LinkStatus2) => {
365
+ LinkStatus2["Active"] = "Active";
366
+ LinkStatus2["Inactive"] = "Inactive";
367
+ LinkStatus2["Expired"] = "Expired";
368
+ LinkStatus2["TripEnded"] = "TripEnded";
369
+ return LinkStatus2;
370
+ })(LinkStatus || {});
371
+ var InspectionStatus = /* @__PURE__ */ ((InspectionStatus2) => {
372
+ InspectionStatus2["Pending"] = "Pending";
373
+ InspectionStatus2["Completed"] = "Completed";
374
+ InspectionStatus2["Missed"] = "Missed";
375
+ InspectionStatus2["Cancelled"] = "Cancelled";
376
+ InspectionStatus2["Failed"] = "Failed";
377
+ return InspectionStatus2;
378
+ })(InspectionStatus || {});
379
+ var ScheduleType = /* @__PURE__ */ ((ScheduleType2) => {
380
+ ScheduleType2["OneTime"] = "OneTime";
381
+ ScheduleType2["Recurring"] = "Recurring";
382
+ return ScheduleType2;
383
+ })(ScheduleType || {});
384
+ var RecurrenceInterval = /* @__PURE__ */ ((RecurrenceInterval2) => {
385
+ RecurrenceInterval2["Daily"] = "Daily";
386
+ RecurrenceInterval2["Weekly"] = "Weekly";
387
+ RecurrenceInterval2["Monthly"] = "Monthly";
388
+ RecurrenceInterval2["CustomInterval"] = "CustomInterval";
389
+ return RecurrenceInterval2;
390
+ })(RecurrenceInterval || {});
391
+ var InspectionType = /* @__PURE__ */ ((InspectionType2) => {
392
+ InspectionType2["Regular"] = "Regular";
393
+ InspectionType2["VehicleHandover"] = "VehicleHandover";
394
+ InspectionType2["VehicleReturn"] = "VehicleReturn";
395
+ InspectionType2["TripPreCheckList"] = "TripPreCheckList";
396
+ InspectionType2["TripPostCheckList"] = "TripPostCheckList";
397
+ InspectionType2["ServiceBefore"] = "ServiceBefore";
398
+ InspectionType2["ServiceAfter"] = "ServiceAfter";
399
+ return InspectionType2;
400
+ })(InspectionType || {});
401
+ var InspectionActionStatus = /* @__PURE__ */ ((InspectionActionStatus2) => {
402
+ InspectionActionStatus2["Pending"] = "Pending";
403
+ InspectionActionStatus2["Approved"] = "Approved";
404
+ InspectionActionStatus2["Rejected"] = "Rejected";
405
+ InspectionActionStatus2["Escalated"] = "Escalated";
406
+ return InspectionActionStatus2;
407
+ })(InspectionActionStatus || {});
408
+ var ScheduleStatus = /* @__PURE__ */ ((ScheduleStatus2) => {
409
+ ScheduleStatus2["Scheduled"] = "Scheduled";
410
+ ScheduleStatus2["ServiceInitiated"] = "ServiceInitiated";
411
+ ScheduleStatus2["ServiceInProgress"] = "ServiceInProgress";
412
+ ScheduleStatus2["Overdue"] = "Overdue";
413
+ ScheduleStatus2["Missed"] = "Missed";
414
+ ScheduleStatus2["Completed"] = "Completed";
415
+ return ScheduleStatus2;
416
+ })(ScheduleStatus || {});
417
+ var JobCardStatus = /* @__PURE__ */ ((JobCardStatus2) => {
418
+ JobCardStatus2["Pending"] = "Pending";
419
+ JobCardStatus2["InProgress"] = "InProgress";
420
+ JobCardStatus2["OnHold"] = "OnHold";
421
+ JobCardStatus2["Cancelled"] = "Cancelled";
422
+ JobCardStatus2["Completed"] = "Completed";
423
+ return JobCardStatus2;
424
+ })(JobCardStatus || {});
425
+ var ServiceType = /* @__PURE__ */ ((ServiceType2) => {
426
+ ServiceType2["Preventive"] = "Preventive";
427
+ ServiceType2["Corrective"] = "Corrective";
428
+ ServiceType2["Emergency"] = "Emergency";
429
+ return ServiceType2;
430
+ })(ServiceType || {});
431
+ var PaymentStatus = /* @__PURE__ */ ((PaymentStatus2) => {
432
+ PaymentStatus2["Pending"] = "Pending";
433
+ PaymentStatus2["Paid"] = "Paid";
434
+ PaymentStatus2["PartiallyPaid"] = "PartiallyPaid";
435
+ PaymentStatus2["Failed"] = "Failed";
436
+ PaymentStatus2["Refunded"] = "Refunded";
437
+ return PaymentStatus2;
438
+ })(PaymentStatus || {});
439
+ var DocumentType = /* @__PURE__ */ ((DocumentType2) => {
440
+ DocumentType2["PurchaseOrder"] = "PurchaseOrder";
441
+ DocumentType2["Invoice"] = "Invoice";
442
+ DocumentType2["TaxDocument"] = "TaxDocument";
443
+ DocumentType2["Contract"] = "Contract";
444
+ DocumentType2["License"] = "License";
445
+ DocumentType2["Registration"] = "Registration";
446
+ DocumentType2["InsurancePolicy"] = "InsurancePolicy";
447
+ DocumentType2["Warranty"] = "Warranty";
448
+ DocumentType2["Quotation"] = "Quotation";
449
+ DocumentType2["DeliveryChallan"] = "DeliveryChallan";
450
+ DocumentType2["PerformanceReport"] = "PerformanceReport";
451
+ DocumentType2["BankDetails"] = "BankDetails";
452
+ DocumentType2["ComplianceDocument"] = "ComplianceDocument";
453
+ DocumentType2["Certification"] = "Certification";
454
+ DocumentType2["Agreement"] = "Agreement";
455
+ DocumentType2["Other"] = "Other";
456
+ return DocumentType2;
457
+ })(DocumentType || {});
458
+ var PurchaseOrderStatus = /* @__PURE__ */ ((PurchaseOrderStatus2) => {
459
+ PurchaseOrderStatus2["Draft"] = "Draft";
460
+ PurchaseOrderStatus2["Pending"] = "Pending";
461
+ PurchaseOrderStatus2["Approved"] = "Approved";
462
+ PurchaseOrderStatus2["Rejected"] = "Rejected";
463
+ PurchaseOrderStatus2["Ordered"] = "Ordered";
464
+ PurchaseOrderStatus2["Delivered"] = "Delivered";
465
+ PurchaseOrderStatus2["Cancelled"] = "Cancelled";
466
+ PurchaseOrderStatus2["StockReceived"] = "StockReceived";
467
+ return PurchaseOrderStatus2;
468
+ })(PurchaseOrderStatus || {});
469
+ var StockType = /* @__PURE__ */ ((StockType2) => {
470
+ StockType2["Consumable"] = "Consumable";
471
+ StockType2["NonConsumable"] = "NonConsumable";
472
+ return StockType2;
473
+ })(StockType || {});
474
+ var ReminderSource = /* @__PURE__ */ ((ReminderSource2) => {
475
+ ReminderSource2["VehicleManagement"] = "VehicleManagement";
476
+ ReminderSource2["DriverManagement"] = "DriverManagement";
477
+ ReminderSource2["InspectionManagement"] = "InspectionManagement";
478
+ ReminderSource2["IssueManagement"] = "IssueManagement";
479
+ ReminderSource2["ServiceManagement"] = "ServiceManagement";
480
+ ReminderSource2["SparePartsManagement"] = "SparePartsManagement";
481
+ ReminderSource2["VendorManagement"] = "VendorManagement";
482
+ ReminderSource2["PartyManagement"] = "PartyManagement";
483
+ ReminderSource2["WorkshopManagement"] = "WorkshopManagement";
484
+ ReminderSource2["GPSModule"] = "GPSModule";
485
+ ReminderSource2["Other"] = "Other";
486
+ return ReminderSource2;
487
+ })(ReminderSource || {});
488
+ var ReminderStatus = /* @__PURE__ */ ((ReminderStatus2) => {
489
+ ReminderStatus2["Pending"] = "Pending";
490
+ ReminderStatus2["Completed"] = "Completed";
491
+ ReminderStatus2["Overdue"] = "Overdue";
492
+ ReminderStatus2["Dismissed"] = "Dismissed";
493
+ return ReminderStatus2;
494
+ })(ReminderStatus || {});
495
+ var ReminderTriggerType = /* @__PURE__ */ ((ReminderTriggerType2) => {
496
+ ReminderTriggerType2["TimeBased"] = "TimeBased";
497
+ ReminderTriggerType2["UsageBased"] = "UsageBased";
498
+ ReminderTriggerType2["ConditionBased"] = "ConditionBased";
499
+ ReminderTriggerType2["Custom"] = "Custom";
500
+ return ReminderTriggerType2;
501
+ })(ReminderTriggerType || {});
502
+ var GPSFuelApproveStatus = /* @__PURE__ */ ((GPSFuelApproveStatus2) => {
503
+ GPSFuelApproveStatus2["Pending"] = "Pending";
504
+ GPSFuelApproveStatus2["Approved"] = "Approved";
505
+ GPSFuelApproveStatus2["Rejected"] = "Rejected";
506
+ return GPSFuelApproveStatus2;
507
+ })(GPSFuelApproveStatus || {});
508
+ var RetreadingMethod = /* @__PURE__ */ ((RetreadingMethod2) => {
509
+ RetreadingMethod2["PreCure"] = "PreCure";
510
+ RetreadingMethod2["MoldCure"] = "MoldCure";
511
+ RetreadingMethod2["ColdRetread"] = "ColdRetread";
512
+ RetreadingMethod2["HotRetread"] = "HotRetread";
513
+ RetreadingMethod2["CustomRetread"] = "CustomRetread";
514
+ RetreadingMethod2["Other"] = "Other";
515
+ return RetreadingMethod2;
516
+ })(RetreadingMethod || {});
517
+ var TyreStatus = /* @__PURE__ */ ((TyreStatus2) => {
518
+ TyreStatus2["Instock"] = "Instock";
519
+ TyreStatus2["Installed"] = "Installed";
520
+ TyreStatus2["Retired"] = "Retired";
521
+ TyreStatus2["UnderRepair"] = "UnderRepair";
522
+ TyreStatus2["Retreading"] = "Retreading";
523
+ TyreStatus2["Scrapped"] = "Scrapped";
524
+ return TyreStatus2;
525
+ })(TyreStatus || {});
526
+ var GPSSource = /* @__PURE__ */ ((GPSSource2) => {
527
+ GPSSource2["Traccar"] = "Traccar";
528
+ GPSSource2["API"] = "API";
529
+ GPSSource2["Protocol"] = "Protocol";
530
+ GPSSource2["NoDevice"] = "NoDevice";
531
+ return GPSSource2;
532
+ })(GPSSource || {});
533
+ var TicketStatus = /* @__PURE__ */ ((TicketStatus2) => {
534
+ TicketStatus2["Open"] = "Open";
535
+ TicketStatus2["InProgress"] = "InProgress";
536
+ TicketStatus2["Resolved"] = "Resolved";
537
+ TicketStatus2["Closed"] = "Closed";
538
+ TicketStatus2["Cancelled"] = "Cancelled";
539
+ TicketStatus2["Reopen"] = "Reopen";
540
+ return TicketStatus2;
541
+ })(TicketStatus || {});
542
+ var MenuType = /* @__PURE__ */ ((MenuType2) => {
543
+ MenuType2["Group"] = "Group";
544
+ MenuType2["Item"] = "Item";
545
+ return MenuType2;
546
+ })(MenuType || {});
547
+ var Module = /* @__PURE__ */ ((Module2) => {
548
+ Module2["ABC"] = "ABC";
549
+ return Module2;
550
+ })(Module || {});
551
+ var SubModule = /* @__PURE__ */ ((SubModule2) => {
552
+ SubModule2["ABC"] = "ABC";
553
+ return SubModule2;
554
+ })(SubModule || {});
555
+ var AlertType = /* @__PURE__ */ ((AlertType2) => {
556
+ AlertType2["ABC"] = "ABC";
557
+ return AlertType2;
558
+ })(AlertType || {});
559
+ var AlertSubType = /* @__PURE__ */ ((AlertSubType2) => {
560
+ AlertSubType2["ABC"] = "ABC";
561
+ return AlertSubType2;
562
+ })(AlertSubType || {});
563
+ var SimStatus = /* @__PURE__ */ ((SimStatus2) => {
564
+ SimStatus2["New"] = "New";
565
+ SimStatus2["Used"] = "Used";
566
+ SimStatus2["Removed"] = "Removed";
567
+ return SimStatus2;
568
+ })(SimStatus || {});
569
+ var DeviceStatus = /* @__PURE__ */ ((DeviceStatus2) => {
570
+ DeviceStatus2["New"] = "New";
571
+ DeviceStatus2["Used"] = "Used";
572
+ DeviceStatus2["Removed"] = "Removed";
573
+ return DeviceStatus2;
574
+ })(DeviceStatus || {});
575
+ var BillingStatus = /* @__PURE__ */ ((BillingStatus2) => {
576
+ BillingStatus2["New"] = "New";
577
+ BillingStatus2["Activated"] = "Activated";
578
+ BillingStatus2["Deactivated"] = "Deactivated";
579
+ return BillingStatus2;
580
+ })(BillingStatus || {});
581
+ var FleetSize = /* @__PURE__ */ ((FleetSize2) => {
582
+ FleetSize2["Fleet_1_to_50_Vehicles"] = "Fleet_1_to_50_Vehicles";
583
+ FleetSize2["Fleet_51_to_100_Vehicles"] = "Fleet_51_to_100_Vehicles";
584
+ FleetSize2["Fleet_101_to_500_Vehicles"] = "Fleet_101_to_500_Vehicles";
585
+ FleetSize2["Fleet_501_to_1000_Vehicles"] = "Fleet_501_to_1000_Vehicles";
586
+ FleetSize2["Fleet_1001_to_5000_Vehicles"] = "Fleet_1001_to_5000_Vehicles";
587
+ FleetSize2["Fleet_5000Plus_Vehicles"] = "Fleet_5000Plus_Vehicles";
588
+ return FleetSize2;
589
+ })(FleetSize || {});
590
+ var TrackHistoryLinkStatus = /* @__PURE__ */ ((TrackHistoryLinkStatus2) => {
591
+ TrackHistoryLinkStatus2["Active"] = "Active";
592
+ TrackHistoryLinkStatus2["Inactive"] = "Inactive";
593
+ TrackHistoryLinkStatus2["Expired"] = "Expired";
594
+ return TrackHistoryLinkStatus2;
595
+ })(TrackHistoryLinkStatus || {});
596
+ var GeofencePurposeType = /* @__PURE__ */ ((GeofencePurposeType2) => {
597
+ GeofencePurposeType2["TripSourceLocation"] = "TripSourceLocation";
598
+ GeofencePurposeType2["TripEndLocation"] = "TripEndLocation";
599
+ GeofencePurposeType2["IntermediateStop"] = "IntermediateStop";
600
+ GeofencePurposeType2["LoadingPoint"] = "LoadingPoint";
601
+ GeofencePurposeType2["UnloadingPoint"] = "UnloadingPoint";
602
+ GeofencePurposeType2["Warehouse"] = "Warehouse";
603
+ GeofencePurposeType2["Plant"] = "Plant";
604
+ GeofencePurposeType2["DistributionHub"] = "DistributionHub";
605
+ GeofencePurposeType2["CustomerLocation"] = "CustomerLocation";
606
+ GeofencePurposeType2["VendorLocation"] = "VendorLocation";
607
+ GeofencePurposeType2["ParkingYard"] = "ParkingYard";
608
+ GeofencePurposeType2["Depot"] = "Depot";
609
+ GeofencePurposeType2["LogisticsPark"] = "LogisticsPark";
610
+ GeofencePurposeType2["Factory"] = "Factory";
611
+ GeofencePurposeType2["Port"] = "Port";
612
+ GeofencePurposeType2["AirportCargoZone"] = "AirportCargoZone";
613
+ GeofencePurposeType2["WeighBridge"] = "WeighBridge";
614
+ GeofencePurposeType2["SecurityGate"] = "SecurityGate";
615
+ GeofencePurposeType2["ScrapYard"] = "ScrapYard";
616
+ GeofencePurposeType2["Checkpost"] = "Checkpost";
617
+ GeofencePurposeType2["TollBooth"] = "TollBooth";
618
+ GeofencePurposeType2["BusStop"] = "BusStop";
619
+ GeofencePurposeType2["BusDepot"] = "BusDepot";
620
+ GeofencePurposeType2["CabPickupPoint"] = "CabPickupPoint";
621
+ GeofencePurposeType2["CabDropPoint"] = "CabDropPoint";
622
+ GeofencePurposeType2["SchoolPickupZone"] = "SchoolPickupZone";
623
+ GeofencePurposeType2["SchoolDropZone"] = "SchoolDropZone";
624
+ GeofencePurposeType2["Terminal"] = "Terminal";
625
+ GeofencePurposeType2["Station"] = "Station";
626
+ GeofencePurposeType2["Office"] = "Office";
627
+ GeofencePurposeType2["ResidentialArea"] = "ResidentialArea";
628
+ GeofencePurposeType2["ColdStorage"] = "ColdStorage";
629
+ GeofencePurposeType2["TemperatureSensitiveZone"] = "TemperatureSensitiveZone";
630
+ GeofencePurposeType2["PharmaDeliveryPoint"] = "PharmaDeliveryPoint";
631
+ GeofencePurposeType2["VaccineDropLocation"] = "VaccineDropLocation";
632
+ GeofencePurposeType2["ChargingStation"] = "ChargingStation";
633
+ GeofencePurposeType2["BatterySwapStation"] = "BatterySwapStation";
634
+ GeofencePurposeType2["FuelStation"] = "FuelStation";
635
+ GeofencePurposeType2["ServiceCenter"] = "ServiceCenter";
636
+ GeofencePurposeType2["MaintenanceBay"] = "MaintenanceBay";
637
+ GeofencePurposeType2["RestrictedArea"] = "RestrictedArea";
638
+ GeofencePurposeType2["SpeedLimitZone"] = "SpeedLimitZone";
639
+ GeofencePurposeType2["NoParkingZone"] = "NoParkingZone";
640
+ GeofencePurposeType2["AccidentProneZone"] = "AccidentProneZone";
641
+ GeofencePurposeType2["SchoolZone"] = "SchoolZone";
642
+ GeofencePurposeType2["Farm"] = "Farm";
643
+ GeofencePurposeType2["CollectionCenter"] = "CollectionCenter";
644
+ GeofencePurposeType2["RuralDeliveryPoint"] = "RuralDeliveryPoint";
645
+ GeofencePurposeType2["MiningZone"] = "MiningZone";
646
+ GeofencePurposeType2["Quarry"] = "Quarry";
647
+ GeofencePurposeType2["MaterialPickup"] = "MaterialPickup";
648
+ GeofencePurposeType2["MaterialDumpingZone"] = "MaterialDumpingZone";
649
+ GeofencePurposeType2["BorderCheckpost"] = "BorderCheckpost";
650
+ GeofencePurposeType2["PoliceStation"] = "PoliceStation";
651
+ GeofencePurposeType2["FireStation"] = "FireStation";
652
+ GeofencePurposeType2["EmergencyResponseZone"] = "EmergencyResponseZone";
653
+ GeofencePurposeType2["Custom"] = "Custom";
654
+ return GeofencePurposeType2;
655
+ })(GeofencePurposeType || {});
656
+ var OverSpeed = /* @__PURE__ */ ((OverSpeed2) => {
657
+ OverSpeed2["Over_Speed_60KM"] = "Over_Speed_60KM";
658
+ OverSpeed2["Over_Speed_70KM"] = "Over_Speed_70KM";
659
+ OverSpeed2["Over_Speed_80KM"] = "Over_Speed_80KM";
660
+ OverSpeed2["Over_Speed_90KM"] = "Over_Speed_90KM";
661
+ OverSpeed2["Over_Speed_100KM"] = "Over_Speed_100KM";
662
+ OverSpeed2["Over_Speed_110KM"] = "Over_Speed_110KM";
663
+ OverSpeed2["Over_Speed_120KM"] = "Over_Speed_120KM";
664
+ OverSpeed2["Over_Speed_130KM"] = "Over_Speed_130KM";
665
+ return OverSpeed2;
666
+ })(OverSpeed || {});
667
+ var TimeSlot = /* @__PURE__ */ ((TimeSlot2) => {
668
+ TimeSlot2["TIME_SLOT_12AM_TO_12AM"] = "TIME_SLOT_12AM_TO_12AM";
669
+ TimeSlot2["TIME_SLOT_1AM_TO_1AM"] = "TIME_SLOT_1AM_TO_1AM";
670
+ TimeSlot2["TIME_SLOT_2AM_TO_2AM"] = "TIME_SLOT_2AM_TO_2AM";
671
+ TimeSlot2["TIME_SLOT_3AM_TO_3AM"] = "TIME_SLOT_3AM_TO_3AM";
672
+ TimeSlot2["TIME_SLOT_4AM_TO_4AM"] = "TIME_SLOT_4AM_TO_4AM";
673
+ TimeSlot2["TIME_SLOT_5AM_TO_5AM"] = "TIME_SLOT_5AM_TO_5AM";
674
+ TimeSlot2["TIME_SLOT_6AM_TO_6AM"] = "TIME_SLOT_6AM_TO_6AM";
675
+ TimeSlot2["TIME_SLOT_7AM_TO_7AM"] = "TIME_SLOT_7AM_TO_7AM";
676
+ TimeSlot2["TIME_SLOT_8AM_TO_8AM"] = "TIME_SLOT_8AM_TO_8AM";
677
+ TimeSlot2["TIME_SLOT_9AM_TO_9AM"] = "TIME_SLOT_9AM_TO_9AM";
678
+ TimeSlot2["TIME_SLOT_10AM_TO_10AM"] = "TIME_SLOT_10AM_TO_10AM";
679
+ TimeSlot2["TIME_SLOT_11AM_TO_11AM"] = "TIME_SLOT_11AM_TO_11AM";
680
+ TimeSlot2["TIME_SLOT_12PM_TO_12PM"] = "TIME_SLOT_12PM_TO_12PM";
681
+ return TimeSlot2;
682
+ })(TimeSlot || {});
683
+ var NightDriving = /* @__PURE__ */ ((NightDriving2) => {
684
+ NightDriving2["Night_Driving_8PM_2AM"] = "Night_Driving_8PM_2AM";
685
+ NightDriving2["Night_Driving_8PM_3AM"] = "Night_Driving_8PM_3AM";
686
+ NightDriving2["Night_Driving_8PM_4AM"] = "Night_Driving_8PM_4AM";
687
+ NightDriving2["Night_Driving_8PM_5AM"] = "Night_Driving_8PM_5AM";
688
+ NightDriving2["Night_Driving_9PM_2AM"] = "Night_Driving_9PM_2AM";
689
+ NightDriving2["Night_Driving_9PM_3AM"] = "Night_Driving_9PM_3AM";
690
+ NightDriving2["Night_Driving_9PM_4AM"] = "Night_Driving_9PM_4AM";
691
+ NightDriving2["Night_Driving_9PM_5AM"] = "Night_Driving_9PM_5AM";
692
+ NightDriving2["Night_Driving_10PM_2AM"] = "Night_Driving_10PM_2AM";
693
+ NightDriving2["Night_Driving_10PM_3AM"] = "Night_Driving_10PM_3AM";
694
+ NightDriving2["Night_Driving_10PM_4AM"] = "Night_Driving_10PM_4AM";
695
+ NightDriving2["Night_Driving_10PM_5AM"] = "Night_Driving_10PM_5AM";
696
+ NightDriving2["Night_Driving_11PM_2AM"] = "Night_Driving_11PM_2AM";
697
+ NightDriving2["Night_Driving_11PM_3AM"] = "Night_Driving_11PM_3AM";
698
+ NightDriving2["Night_Driving_11PM_4AM"] = "Night_Driving_11PM_4AM";
699
+ NightDriving2["Night_Driving_11PM_5AM"] = "Night_Driving_11PM_5AM";
700
+ return NightDriving2;
701
+ })(NightDriving || {});
702
+ var GPSType = /* @__PURE__ */ ((GPSType2) => {
703
+ GPSType2["Ignition"] = "Ignition";
704
+ GPSType2["Stoppage"] = "Stoppage";
705
+ GPSType2["Genset"] = "Genset";
706
+ GPSType2["Door"] = "Door";
707
+ return GPSType2;
708
+ })(GPSType || {});
709
+ var BooleanType = /* @__PURE__ */ ((BooleanType2) => {
710
+ BooleanType2["Both"] = "Both";
711
+ BooleanType2["True"] = "True";
712
+ BooleanType2["False"] = "False";
713
+ return BooleanType2;
714
+ })(BooleanType || {});
715
+ var Is12AM = /* @__PURE__ */ ((Is12AM2) => {
716
+ Is12AM2["Yes"] = "Yes";
717
+ Is12AM2["No"] = "No";
718
+ return Is12AM2;
719
+ })(Is12AM || {});
720
+
721
+ // src/core/BaseRequest.ts
722
+ var DefaultBaseFindParams = {
723
+ search: "",
724
+ status: "Active,Inactive",
725
+ load_child: "No" /* No */,
726
+ load_parents: "No" /* No */,
727
+ paging: "Yes" /* Yes */,
728
+ page_index: 0,
729
+ page_count: 100
730
+ };
731
+ var withDefaults = (defaults, overrides = {}) => {
732
+ return { ...defaults, ...overrides };
733
+ };
734
+
735
+ // src/core/BaseResponse.ts
736
+ var r_log = (data = {}) => {
737
+ return data;
738
+ };
739
+
740
+ // src/apiCall.ts
741
+ var apiGet = async (url, params) => {
742
+ const response = await getAxiosInstance().get(url, { params });
743
+ return response.data;
744
+ };
745
+ var apiPost = async (url, data) => {
746
+ const response = await getAxiosInstance().post(url, data);
747
+ return response.data;
748
+ };
749
+ var apiPatch = async (url, data) => {
750
+ const response = await getAxiosInstance().patch(url, data);
751
+ return response.data;
752
+ };
753
+ var apiDelete = async (url) => {
754
+ const response = await getAxiosInstance().delete(url);
755
+ return response.data;
756
+ };
757
+
758
+ // src/zod/zod_utils.ts
759
+ var import_zod = require("zod");
760
+ var handleNullOrUndefined = (value) => typeof value === "string" ? value : "";
761
+ var stringUUIDMandatory = (fieldName) => {
762
+ const schema = import_zod.z.string().trim().uuid({ message: `${fieldName} must be a valid UUID` }).nonempty(`${fieldName} is required.`).transform(handleNullOrUndefined);
763
+ return schema;
764
+ };
765
+ var stringMandatory = (fieldName, min = 1, max = 100) => {
766
+ const schema = import_zod.z.string().trim().min(min, `${fieldName} must be at least ${min} characters.`).max(max, `${fieldName} must be at most ${max} characters.`).nonempty(`${fieldName} is required.`).transform(handleNullOrUndefined);
767
+ return schema;
768
+ };
769
+ var stringOptional = (fieldName, min = 0, max = 255, defaultValue = "") => {
770
+ const schema = import_zod.z.string().trim().min(min, `${fieldName} must be at least ${min} characters.`).max(max, `${fieldName} must be at most ${max} characters.`).transform(handleNullOrUndefined).default(defaultValue);
771
+ return schema;
772
+ };
773
+ var handleNullOrUndefinedStringArray = (value, defaultValue) => Array.isArray(value) ? value : defaultValue;
774
+ var stringArrayMandatory = (fieldName, min = 1, max = 100, unique = false) => {
775
+ const schema = import_zod.z.array(import_zod.z.string().trim(), {
776
+ invalid_type_error: `${fieldName} must be an array of strings.`
777
+ }).min(min, `${fieldName} must contain at least ${min} items.`).max(max, `${fieldName} must contain at most ${max} items.`);
778
+ if (unique) {
779
+ schema.refine(
780
+ (arr) => new Set(arr).size === arr.length,
781
+ `${fieldName} must contain unique values.`
782
+ );
783
+ }
784
+ return schema.transform((val) => handleNullOrUndefinedStringArray(val, []));
785
+ };
786
+ var stringArrayOptional = (fieldName, min = 0, max = 100, defaultValue = [], unique = false) => {
787
+ const schema = import_zod.z.array(import_zod.z.string().trim(), {
788
+ invalid_type_error: `${fieldName} must be an array of strings.`
789
+ }).min(min, `${fieldName} must contain at least ${min} items.`).max(max, `${fieldName} must contain at most ${max} items.`);
790
+ if (unique) {
791
+ schema.refine(
792
+ (arr) => new Set(arr).size === arr.length,
793
+ `${fieldName} must contain unique values.`
794
+ );
795
+ }
796
+ return schema.optional().default(defaultValue);
797
+ };
798
+ var numberMandatory = (fieldName, min = 1, max = 1e9, defaultValue = 0) => {
799
+ return import_zod.z.preprocess(
800
+ (val) => {
801
+ if (val === null || val === void 0 || val === "") {
802
+ return defaultValue;
803
+ }
804
+ if (typeof val === "string" && !isNaN(Number(val))) {
805
+ return Number(val);
806
+ }
807
+ return val;
808
+ },
809
+ import_zod.z.number({ invalid_type_error: `${fieldName} must be a number.` }).min(min, `${fieldName} must be at least ${min}.`).max(max, `${fieldName} must be at most ${max}.`)
810
+ );
811
+ };
812
+ var numberOptional = (fieldName, min = 0, max = 1e9, defaultValue = 0) => {
813
+ return import_zod.z.preprocess(
814
+ (val) => typeof val === "string" && val.trim() !== "" ? Number(val) : val,
815
+ import_zod.z.number({ invalid_type_error: `${fieldName} must be a number.` }).min(min, `${fieldName} must be at least ${min}.`).max(max, `${fieldName} must be at most ${max}.`).optional().default(defaultValue)
816
+ );
817
+ };
818
+ var handleNullOrUndefinedNumberArray = (value, defaultValue) => Array.isArray(value) ? value : defaultValue;
819
+ var numberArrayMandatory = (fieldName, min = 1, max = 100, unique = false) => {
820
+ const schema = import_zod.z.array(
821
+ import_zod.z.number({
822
+ invalid_type_error: `${fieldName} must be an array of numbers.`
823
+ })
824
+ ).min(min, `${fieldName} must contain at least ${min} items.`).max(max, `${fieldName} must contain at most ${max} items.`);
825
+ if (unique) {
826
+ schema.refine(
827
+ (arr) => new Set(arr).size === arr.length,
828
+ `${fieldName} must contain unique values.`
829
+ );
830
+ }
831
+ return schema.transform((val) => handleNullOrUndefinedNumberArray(val, []));
832
+ };
833
+ var numberArrayOptional = (fieldName, min = 0, max = 100, defaultValue = [], unique = false) => {
834
+ const schema = import_zod.z.array(
835
+ import_zod.z.number({
836
+ invalid_type_error: `${fieldName} must be an array of numbers.`
837
+ })
838
+ ).min(min, `${fieldName} must contain at least ${min} items.`).max(max, `${fieldName} must contain at most ${max} items.`);
839
+ if (unique) {
840
+ schema.refine(
841
+ (arr) => new Set(arr).size === arr.length,
842
+ `${fieldName} must contain unique values.`
843
+ );
844
+ }
845
+ return schema.optional().default(defaultValue);
846
+ };
847
+ var doubleMandatory = (fieldName, min = 0.1, max = 1e6, decimalPlaces = 2, defaultValue = 0) => {
848
+ return import_zod.z.preprocess(
849
+ (val) => {
850
+ if (typeof val === "string") {
851
+ val = parseFloat(val);
852
+ }
853
+ if (typeof val === "number") {
854
+ return parseFloat(val.toFixed(decimalPlaces));
855
+ }
856
+ return val;
857
+ },
858
+ import_zod.z.number({ invalid_type_error: `${fieldName} must be a number.` }).min(min, `${fieldName} must be at least ${min}.`).max(max, `${fieldName} must be at most ${max}.`).default(defaultValue)
859
+ );
860
+ };
861
+ var doubleMandatoryLatLng = (fieldName, defaultValue = 0) => {
862
+ return import_zod.z.preprocess(
863
+ (val) => {
864
+ if (typeof val === "string") {
865
+ val = parseFloat(val);
866
+ }
867
+ if (typeof val === "number") {
868
+ return parseFloat(val.toFixed(6));
869
+ }
870
+ return val;
871
+ },
872
+ import_zod.z.number({ invalid_type_error: `${fieldName} must be a number.` }).min(-180, `${fieldName} must be at least -180.`).max(180, `${fieldName} must be at most 180.`).default(defaultValue)
873
+ );
874
+ };
875
+ var doubleMandatoryAmount = (fieldName, defaultValue = 0) => {
876
+ return import_zod.z.preprocess((val) => {
877
+ if (typeof val === "string") {
878
+ val = parseFloat(val);
879
+ }
880
+ if (typeof val === "number") {
881
+ return parseFloat(val.toFixed(6));
882
+ }
883
+ return val;
884
+ }, import_zod.z.number({ invalid_type_error: `${fieldName} must be a number.` }).default(defaultValue));
885
+ };
886
+ var doubleOptional = (fieldName, min = 0, max = 1e6, decimalPlaces = 2, defaultValue = 0) => {
887
+ return import_zod.z.preprocess(
888
+ (val) => {
889
+ if (typeof val === "string") {
890
+ val = parseFloat(val);
891
+ }
892
+ if (typeof val === "number") {
893
+ return parseFloat(val.toFixed(decimalPlaces));
894
+ }
895
+ return val;
896
+ },
897
+ import_zod.z.number({ invalid_type_error: `${fieldName} must be a number.` }).min(min, `${fieldName} must be at least ${min}.`).max(max, `${fieldName} must be at most ${max}.`).default(defaultValue)
898
+ ).optional();
899
+ };
900
+ var doubleOptionalLatLng = (fieldName, defaultValue = 0) => {
901
+ return import_zod.z.preprocess(
902
+ (val) => {
903
+ if (typeof val === "string") {
904
+ val = parseFloat(val);
905
+ }
906
+ if (typeof val === "number") {
907
+ return parseFloat(val.toFixed(6));
908
+ }
909
+ return val;
910
+ },
911
+ import_zod.z.number({ invalid_type_error: `${fieldName} must be a number.` }).min(-180, `${fieldName} must be at least -180.`).max(180, `${fieldName} must be at most 180.`).default(defaultValue)
912
+ ).optional();
913
+ };
914
+ var doubleOptionalAmount = (fieldName, defaultValue = 0) => {
915
+ return import_zod.z.preprocess((val) => {
916
+ if (typeof val === "string") {
917
+ val = parseFloat(val);
918
+ }
919
+ if (typeof val === "number") {
920
+ return parseFloat(val.toFixed(6));
921
+ }
922
+ return val;
923
+ }, import_zod.z.number({ invalid_type_error: `${fieldName} must be a number.` }).default(defaultValue)).optional();
924
+ };
925
+ var handleNullOrUndefinedBoolean = (value, defaultValue) => typeof value === "boolean" ? value : defaultValue;
926
+ var booleanMandatory = (fieldName, defaultValue = false) => {
927
+ return import_zod.z.boolean({ invalid_type_error: `${fieldName} must be true or false.` }).transform((val) => handleNullOrUndefinedBoolean(val, defaultValue));
928
+ };
929
+ var booleanOptional = (fieldName, defaultValue = false) => {
930
+ return import_zod.z.boolean({ invalid_type_error: `${fieldName} must be true or false.` }).optional().default(defaultValue);
931
+ };
932
+ var enumMandatory = (fieldName, enumType, defaultValue) => {
933
+ return import_zod.z.union([
934
+ import_zod.z.nativeEnum(enumType, {
935
+ invalid_type_error: `${fieldName} should be one of the following values: ${Object.values(
936
+ enumType
937
+ ).join(", ")}.`
938
+ }),
939
+ import_zod.z.string().refine((val) => Object.values(enumType).includes(val), {
940
+ message: `${fieldName} should be one of the following values: ${Object.values(
941
+ enumType
942
+ ).join(", ")}.`
943
+ })
944
+ ]).default(defaultValue).refine((val) => val !== "", {
945
+ message: `Please select ${fieldName}.`
946
+ });
947
+ };
948
+ var enumOptional = (fieldName, enumType, defaultValue) => {
949
+ return import_zod.z.nativeEnum(enumType, {
950
+ invalid_type_error: `${fieldName} must be an array containing only the following values: ${Object.values(
951
+ enumType
952
+ ).join(", ")}.`
953
+ }).optional().default(() => defaultValue);
954
+ };
955
+ var handleNullOrUndefinedEnumArray = (value, defaultValue) => Array.isArray(value) ? value : defaultValue;
956
+ var getAllEnums = (enumType) => {
957
+ return Object.values(enumType);
958
+ };
959
+ var enumArrayMandatory = (fieldName, enumType, defaultValue = getAllEnums(enumType), min = 1, max = 100, unique = false) => {
960
+ const schema = import_zod.z.array(import_zod.z.nativeEnum(enumType), {
961
+ invalid_type_error: `${fieldName} must be an array containing only the following values: ${Object.values(
962
+ enumType
963
+ ).join(", ")}.`
964
+ }).min(min, `${fieldName} must contain at least ${min} items.`).max(max, `${fieldName} must contain at most ${max} items.`);
965
+ if (unique) {
966
+ schema.refine(
967
+ (arr) => new Set(arr).size === arr.length,
968
+ `${fieldName} must contain unique values.`
969
+ );
970
+ }
971
+ schema.transform((val) => handleNullOrUndefinedEnumArray(val, []));
972
+ return schema.default(() => defaultValue);
973
+ };
974
+ var enumArrayOptional = (fieldName, enumType, defaultValue = getAllEnums(enumType), min = 0, max = 100, unique = false) => {
975
+ const schema = import_zod.z.array(import_zod.z.nativeEnum(enumType), {
976
+ invalid_type_error: `${fieldName} must be an array containing only the following values: ${Object.values(
977
+ enumType
978
+ ).join(", ")}.`
979
+ }).min(min, `${fieldName} must contain at least ${min} items.`).max(max, `${fieldName} must contain at most ${max} items.`);
980
+ if (unique) {
981
+ schema.refine(
982
+ (arr) => new Set(arr).size === arr.length,
983
+ `${fieldName} must contain unique values.`
984
+ );
985
+ }
986
+ return schema.optional().default(() => defaultValue);
987
+ };
988
+ var handleNullOrUndefinedDate = (value, defaultValue) => {
989
+ if (typeof value === "string" && !isNaN(Date.parse(value))) {
990
+ return value;
991
+ }
992
+ return defaultValue;
993
+ };
994
+ var dateMandatory = (fieldName, minDate, maxDate, defaultValue = (/* @__PURE__ */ new Date()).toISOString()) => {
995
+ const schema = import_zod.z.string().refine((val) => !isNaN(Date.parse(val)), {
996
+ message: `${fieldName} must be a valid ISO date.`
997
+ }).transform((val) => handleNullOrUndefinedDate(val, defaultValue));
998
+ if (minDate) {
999
+ schema.refine((val) => new Date(val) >= new Date(minDate), {
1000
+ message: `${fieldName} must be after ${minDate}.`
1001
+ });
1002
+ }
1003
+ if (maxDate) {
1004
+ schema.refine((val) => new Date(val) <= new Date(maxDate), {
1005
+ message: `${fieldName} must be before ${maxDate}.`
1006
+ });
1007
+ }
1008
+ return schema;
1009
+ };
1010
+ var dateOptional = (fieldName, minDate, maxDate, defaultValue = (/* @__PURE__ */ new Date()).toISOString()) => {
1011
+ const schema = import_zod.z.string().refine((val) => !isNaN(Date.parse(val)), {
1012
+ message: `${fieldName} must be a valid ISO date.`
1013
+ }).optional().default(defaultValue);
1014
+ if (minDate) {
1015
+ schema.refine((val) => new Date(val) >= new Date(minDate), {
1016
+ message: `${fieldName} must be after ${minDate}.`
1017
+ });
1018
+ }
1019
+ if (maxDate) {
1020
+ schema.refine((val) => new Date(val) <= new Date(maxDate), {
1021
+ message: `${fieldName} must be before ${maxDate}.`
1022
+ });
1023
+ }
1024
+ return schema;
1025
+ };
1026
+ var dateTimeMandatory = (fieldName, minDate, maxDate, defaultValue = (/* @__PURE__ */ new Date()).toISOString()) => {
1027
+ const schema = import_zod.z.string().refine((val) => !isNaN(Date.parse(val)), {
1028
+ message: `${fieldName} must be a valid ISO date.`
1029
+ }).transform((val) => handleNullOrUndefinedDate(val, defaultValue));
1030
+ if (minDate) {
1031
+ schema.refine((val) => new Date(val) >= new Date(minDate), {
1032
+ message: `${fieldName} must be after ${minDate}.`
1033
+ });
1034
+ }
1035
+ if (maxDate) {
1036
+ schema.refine((val) => new Date(val) <= new Date(maxDate), {
1037
+ message: `${fieldName} must be before ${maxDate}.`
1038
+ });
1039
+ }
1040
+ return schema;
1041
+ };
1042
+ var dateTimeOptional = (fieldName, minDate, maxDate, defaultValue = (/* @__PURE__ */ new Date()).toISOString()) => {
1043
+ const schema = import_zod.z.string().refine((val) => !isNaN(Date.parse(val)), {
1044
+ message: `${fieldName} must be a valid ISO date.`
1045
+ }).optional().default(defaultValue);
1046
+ if (minDate) {
1047
+ schema.refine((val) => new Date(val) >= new Date(minDate), {
1048
+ message: `${fieldName} must be after ${minDate}.`
1049
+ });
1050
+ }
1051
+ if (maxDate) {
1052
+ schema.refine((val) => new Date(val) <= new Date(maxDate), {
1053
+ message: `${fieldName} must be before ${maxDate}.`
1054
+ });
1055
+ }
1056
+ return schema;
1057
+ };
1058
+ var nestedObjectMandatory = (fieldName, schema, defaultValue) => {
1059
+ return schema.default(() => defaultValue);
1060
+ };
1061
+ var nestedObjectOptional = (fieldName, schema, defaultValue) => {
1062
+ return schema.optional().default(() => defaultValue);
1063
+ };
1064
+ var dynamicJsonSchema = (fieldName, defaultValue = {}) => import_zod.z.record(import_zod.z.any()).optional().default(() => defaultValue);
1065
+ var nestedArrayOfObjectMandatory = (fieldName, schema, defaultValue = [], min = 1, max) => {
1066
+ let arraySchema = import_zod.z.array(schema, {
1067
+ invalid_type_error: `${fieldName} must be an array of objects.`
1068
+ }).min(min, `${fieldName} must contain at least ${min} items.`);
1069
+ if (max !== void 0) {
1070
+ arraySchema = arraySchema.max(
1071
+ max,
1072
+ `${fieldName} must contain at most ${max} items.`
1073
+ );
1074
+ }
1075
+ return arraySchema.default(() => defaultValue);
1076
+ };
1077
+ var nestedArrayOfObjectsOptional = (fieldName, schema, defaultValue = [], min = 0, max) => {
1078
+ let arraySchema = import_zod.z.array(schema, {
1079
+ invalid_type_error: `${fieldName} must be an array of objects.`
1080
+ }).min(min, `${fieldName} must contain at least ${min} items.`);
1081
+ if (max !== void 0) {
1082
+ arraySchema = arraySchema.max(
1083
+ max,
1084
+ `${fieldName} must contain at most ${max} items.`
1085
+ );
1086
+ }
1087
+ return arraySchema.optional().default(() => defaultValue);
1088
+ };
1089
+ var single_select_mandatory = (fieldName) => {
1090
+ const schema = import_zod.z.string().trim().nonempty(`Please select ${fieldName}.`).transform(handleNullOrUndefined);
1091
+ return schema;
1092
+ };
1093
+ var single_select_optional = (fieldName) => {
1094
+ r_log(fieldName);
1095
+ const schema = import_zod.z.string().trim().transform(handleNullOrUndefined);
1096
+ return schema;
1097
+ };
1098
+ var multi_select_mandatory = (fieldName, min = 1, max = 100, defaultValue = []) => {
1099
+ const schema = import_zod.z.array(
1100
+ import_zod.z.string({
1101
+ invalid_type_error: `${fieldName} must be an array of strings.`
1102
+ })
1103
+ ).min(
1104
+ min,
1105
+ `Please select at least ${min} ${fieldName}${min > 1 ? "s" : ""}.`
1106
+ ).max(
1107
+ max,
1108
+ `Please select at most ${max} ${fieldName}${max > 1 ? "s" : ""}.`
1109
+ );
1110
+ return schema.optional().default(defaultValue);
1111
+ };
1112
+ var multi_select_optional = (fieldName, max = 1e3, defaultValue = []) => {
1113
+ const schema = import_zod.z.array(
1114
+ import_zod.z.string({
1115
+ invalid_type_error: `${fieldName} must be an array of strings.`
1116
+ })
1117
+ ).max(
1118
+ max,
1119
+ `Please select at most ${max} ${fieldName}${max > 1 ? "s" : ""}.`
1120
+ );
1121
+ return schema.optional().default(defaultValue);
1122
+ };
1123
+
1124
+ // src/zod/zod_base_schema.ts
1125
+ var import_zod2 = require("zod");
1126
+ var OrderBySchema = import_zod2.z.array(
1127
+ import_zod2.z.object({
1128
+ name: stringMandatory("Order Field Name", 0, 255),
1129
+ field: stringMandatory("Order Field Name", 0, 255),
1130
+ direction: enumMandatory("Order Direction", OrderBy, "asc" /* asc */)
1131
+ })
1132
+ );
1133
+ var BaseQuerySchema = import_zod2.z.object({
1134
+ search: stringOptional("Search", 0, 255, ""),
1135
+ status: enumArrayOptional("Status", Status, getAllEnums(Status), 0, 10, true),
1136
+ paging: enumOptional("Paging", PAGING, "Yes" /* Yes */),
1137
+ page_count: numberOptional("Page Count", 0, 1e3, 100),
1138
+ page_index: numberOptional("Page Index", 0, 1e3, 0),
1139
+ load_parents: enumOptional("Load Parents", LoadParents, "No" /* No */),
1140
+ load_parents_list: stringArrayOptional("Load Parents List"),
1141
+ load_child: enumOptional("Load Child", LoadChild, "No" /* No */),
1142
+ load_child_list: stringArrayOptional("Load Child List"),
1143
+ load_child_count: enumOptional(
1144
+ "Load Child",
1145
+ LoadChildCount,
1146
+ "No" /* No */
1147
+ ),
1148
+ load_child_count_list: stringArrayOptional("Load Child List"),
1149
+ include_details: dynamicJsonSchema("Include Details", {}),
1150
+ where_relations: dynamicJsonSchema("Where Relations", {}),
1151
+ order_by: OrderBySchema.optional().default([]),
1152
+ include_master_data: enumOptional("Include Master Data", YesNo, "No" /* No */),
1153
+ date_format_id: single_select_optional("MasterMainDateFormat"),
1154
+ time_zone_id: single_select_optional("MasterMainTimeZone")
1155
+ });
1156
+ var MongoBaseQuerySchema = import_zod2.z.object({
1157
+ search: stringOptional("Search", 0, 255, ""),
1158
+ paging: enumOptional("Paging", PAGING, "Yes" /* Yes */),
1159
+ page_count: numberOptional("Page Count", 0, 1e3, 100),
1160
+ page_index: numberOptional("Page Index", 0, 1e3, 0),
1161
+ login_from: enumMandatory("Login From", LoginFrom, "Web" /* Web */),
1162
+ date_format_id: single_select_optional("MasterMainDateFormat"),
1163
+ // ✅ Single-selection -> MasterMainDateFormat
1164
+ time_zone_id: single_select_optional("MasterMainTimeZone")
1165
+ // ✅ Single-selection -> MasterMainTimeZone
1166
+ });
1167
+
1168
+ // src/services/master/device/master_device_manufacturer_service.ts
1169
+ var import_zod3 = require("zod");
1170
+ var import_zod_utils2 = require("zod/zod_utils");
1171
+ var import_zod_base_schema = require("zod/zod_base_schema");
1172
+ var URL = "master/device/manufacturer";
1173
+ var ENDPOINTS = {
1174
+ find: `${URL}/search`,
1175
+ create: URL,
1176
+ update: (id) => `${URL}/${id}`,
1177
+ delete: (id) => `${URL}/${id}`,
1178
+ cache: `${URL}/cache`,
1179
+ cache_count: `${URL}/cache_count`,
1180
+ cache_child: `${URL}/cache_child`
1181
+ };
1182
+ var MasterDeviceManufacturerSchema = import_zod3.z.object({
1183
+ device_manufacturer_name: (0, import_zod_utils2.stringMandatory)("Device Manufacturer Name", 3, 100),
1184
+ device_manufacturer_code: (0, import_zod_utils2.stringOptional)("Device Manufacturer Code", 0, 100),
1185
+ status: (0, import_zod_utils2.enumMandatory)("Status", Status, "Active" /* Active */)
1186
+ });
1187
+ var MasterDeviceManufacturerQuerySchema = import_zod_base_schema.BaseQuerySchema.extend({
1188
+ device_manufacturer_ids: (0, import_zod_utils2.multi_select_optional)("Device Manufacturer")
1189
+ // ✅ Multi-selection -> MasterDeviceManufacturer
1190
+ });
1191
+ var toMasterDeviceManufacturerPayload = (manufacturer) => {
1192
+ var _a;
1193
+ return {
1194
+ device_manufacturer_name: manufacturer.device_manufacturer_name,
1195
+ device_manufacturer_code: (_a = manufacturer.device_manufacturer_code) != null ? _a : "",
1196
+ status: manufacturer.status
1197
+ };
1198
+ };
1199
+ var newMasterDeviceManufacturerPayload = () => ({
1200
+ device_manufacturer_name: "",
1201
+ device_manufacturer_code: "",
1202
+ status: "Active" /* Active */
1203
+ });
1204
+ var findMasterDeviceManufacturers = async (data) => {
1205
+ return apiPost(ENDPOINTS.find, data);
1206
+ };
1207
+ var createMasterDeviceManufacturer = async (data) => {
1208
+ return apiPost(ENDPOINTS.create, data);
1209
+ };
1210
+ var updateMasterDeviceManufacturer = async (id, data) => {
1211
+ return apiPatch(ENDPOINTS.update(id), data);
1212
+ };
1213
+ var deleteMasterDeviceManufacturer = async (id) => {
1214
+ return apiDelete(ENDPOINTS.delete(id));
1215
+ };
1216
+ var getMasterDeviceManufacturerCache = async () => {
1217
+ return apiGet(ENDPOINTS.cache);
1218
+ };
1219
+ var getMasterDeviceManufacturerCacheCount = async () => {
1220
+ return apiGet(ENDPOINTS.cache_count);
1221
+ };
1222
+ var getMasterDeviceManufacturerCacheChild = async () => {
1223
+ return apiGet(ENDPOINTS.cache_child);
1224
+ };
1225
+
1226
+ // src/services/master/device/master_device_model_service.ts
1227
+ var import_zod4 = require("zod");
1228
+ var import_zod_utils3 = require("zod/zod_utils");
1229
+ var import_zod_base_schema2 = require("zod/zod_base_schema");
1230
+ var URL2 = "master/device/model";
1231
+ var ENDPOINTS2 = {
1232
+ find: `${URL2}/search`,
1233
+ create: URL2,
1234
+ update: (id) => `${URL2}/${id}`,
1235
+ delete: (id) => `${URL2}/${id}`,
1236
+ cache: (device_manufacturer_id) => `${URL2}/cache?device_manufacturer_id=${device_manufacturer_id || ""}`,
1237
+ cache_count: (device_manufacturer_id) => `${URL2}/cache_count?device_manufacturer_id=${device_manufacturer_id || ""}`,
1238
+ cache_child: (device_manufacturer_id) => `${URL2}/cache_child?device_manufacturer_id=${device_manufacturer_id || ""}`
1239
+ };
1240
+ var MasterDeviceModelSchema = import_zod4.z.object({
1241
+ device_manufacturer_id: (0, import_zod_utils3.single_select_mandatory)("Device Manufacturer"),
1242
+ // ✅ Single-selection -> MasterDeviceManufacturer
1243
+ device_model_name: (0, import_zod_utils3.stringMandatory)("Device Model Name", 3, 100),
1244
+ device_model_code: (0, import_zod_utils3.stringOptional)("Device Model Code", 0, 100),
1245
+ status: (0, import_zod_utils3.enumMandatory)("Status", Status, "Active" /* Active */)
1246
+ });
1247
+ var MasterDeviceModelQuerySchema = import_zod_base_schema2.BaseQuerySchema.extend({
1248
+ device_manufacturer_ids: (0, import_zod_utils3.multi_select_optional)("Device Manufacturer"),
1249
+ // ✅ Multi-selection -> MasterDeviceManufacturer
1250
+ device_model_ids: (0, import_zod_utils3.multi_select_optional)("Device Model")
1251
+ // ✅ Multi-selection -> MasterDeviceModel
1252
+ });
1253
+ var toMasterDeviceModelPayload = (deviceModel) => {
1254
+ var _a;
1255
+ return {
1256
+ device_manufacturer_id: deviceModel.device_manufacturer_id,
1257
+ device_model_name: deviceModel.device_model_name,
1258
+ device_model_code: (_a = deviceModel.device_model_code) != null ? _a : "",
1259
+ status: deviceModel.status
1260
+ };
1261
+ };
1262
+ var newMasterDeviceModelPayload = () => ({
1263
+ device_manufacturer_id: "",
1264
+ device_model_name: "",
1265
+ device_model_code: "",
1266
+ status: "Active" /* Active */
1267
+ });
1268
+ var findMasterDeviceModels = async (data) => {
1269
+ return apiPost(ENDPOINTS2.find, data);
1270
+ };
1271
+ var createMasterDeviceModel = async (data) => {
1272
+ return apiPost(ENDPOINTS2.create, data);
1273
+ };
1274
+ var updateMasterDeviceModel = async (id, data) => {
1275
+ return apiPatch(ENDPOINTS2.update(id), data);
1276
+ };
1277
+ var deleteMasterDeviceModel = async (id) => {
1278
+ return apiDelete(ENDPOINTS2.delete(id));
1279
+ };
1280
+ var getMasterDeviceModelCache = async (device_manufacturer_id) => {
1281
+ return apiGet(ENDPOINTS2.cache(device_manufacturer_id));
1282
+ };
1283
+ var getMasterDeviceModelCacheCount = async (device_manufacturer_id) => {
1284
+ return apiGet(ENDPOINTS2.cache_count(device_manufacturer_id));
1285
+ };
1286
+ var getMasterDeviceModelCacheChild = async (device_manufacturer_id) => {
1287
+ return apiGet(ENDPOINTS2.cache_child(device_manufacturer_id));
1288
+ };
1289
+
1290
+ // src/services/master/device/master_device_type_service.ts
1291
+ var import_zod5 = require("zod");
1292
+ var import_zod_utils4 = require("zod/zod_utils");
1293
+ var import_zod_base_schema3 = require("zod/zod_base_schema");
1294
+ var URL3 = "master/device/type";
1295
+ var ENDPOINTS3 = {
1296
+ find: `${URL3}/search`,
1297
+ create: URL3,
1298
+ update: (id) => `${URL3}/${id}`,
1299
+ delete: (id) => `${URL3}/${id}`,
1300
+ cache: (device_model_id) => `${URL3}/cache?device_model_id=${device_model_id || "0"}`,
1301
+ cache_count: (device_model_id) => `${URL3}/cache_count?device_model_id=${device_model_id || "0"}`,
1302
+ cache_child: (device_model_id) => `${URL3}/cache_child?device_model_id=${device_model_id || "0"}`
1303
+ };
1304
+ var MasterDeviceTypeSchema = import_zod5.z.object({
1305
+ device_manufacturer_id: (0, import_zod_utils4.single_select_mandatory)("Device Manufacturer"),
1306
+ // ✅ Single-selection -> MasterDeviceManufacturer
1307
+ device_model_id: (0, import_zod_utils4.single_select_mandatory)("Device Model"),
1308
+ // ✅ Single-selection -> MasterDeviceModel
1309
+ device_type_name: (0, import_zod_utils4.stringMandatory)("Device Type Name", 3, 100),
1310
+ device_type_code: (0, import_zod_utils4.stringOptional)("Device Type Code", 0, 100),
1311
+ device_type_description: (0, import_zod_utils4.stringOptional)("Device Type Description", 0, 200),
1312
+ status: (0, import_zod_utils4.enumMandatory)("Status", Status, "Active" /* Active */)
1313
+ });
1314
+ var MasterDeviceTypeQuerySchema = import_zod_base_schema3.BaseQuerySchema.extend({
1315
+ device_manufacturer_ids: (0, import_zod_utils4.multi_select_optional)("Device Manufacturer"),
1316
+ // ✅ Multi-selection -> MasterDeviceManufacturer
1317
+ device_model_ids: (0, import_zod_utils4.multi_select_optional)("Device Model"),
1318
+ // ✅ Multi-selection -> MasterDeviceModel
1319
+ device_type_ids: (0, import_zod_utils4.multi_select_optional)("Device Type")
1320
+ // ✅ Multi-selection -> MasterDeviceType
1321
+ });
1322
+ var toMasterDeviceTypePayload = (deviceType) => {
1323
+ var _a, _b;
1324
+ return {
1325
+ device_manufacturer_id: deviceType.device_manufacturer_id,
1326
+ device_model_id: deviceType.device_model_id,
1327
+ device_type_name: deviceType.device_type_name,
1328
+ device_type_code: (_a = deviceType.device_type_code) != null ? _a : "",
1329
+ device_type_description: (_b = deviceType.device_type_description) != null ? _b : "",
1330
+ status: deviceType.status
1331
+ };
1332
+ };
1333
+ var newMasterDeviceTypePayload = () => ({
1334
+ device_manufacturer_id: "",
1335
+ device_model_id: "",
1336
+ device_type_name: "",
1337
+ device_type_code: "",
1338
+ device_type_description: "",
1339
+ status: "Active" /* Active */
1340
+ });
1341
+ var findMasterDeviceTypes = async (data) => {
1342
+ return apiPost(ENDPOINTS3.find, data);
1343
+ };
1344
+ var createMasterDeviceType = async (data) => {
1345
+ return apiPost(ENDPOINTS3.create, data);
1346
+ };
1347
+ var updateMasterDeviceType = async (id, data) => {
1348
+ return apiPatch(ENDPOINTS3.update(id), data);
1349
+ };
1350
+ var deleteMasterDeviceType = async (id) => {
1351
+ return apiDelete(ENDPOINTS3.delete(id));
1352
+ };
1353
+ var getMasterDeviceTypeCache = async (device_model_id) => {
1354
+ return apiGet(ENDPOINTS3.cache(device_model_id));
1355
+ };
1356
+ var getMasterDeviceTypeCacheCount = async (device_model_id) => {
1357
+ return apiGet(ENDPOINTS3.cache_count(device_model_id));
1358
+ };
1359
+ var getMasterDeviceTypeCacheChild = async (device_model_id) => {
1360
+ return apiGet(ENDPOINTS3.cache_child(device_model_id));
1361
+ };
1362
+ // Annotate the CommonJS export names for ESM import in node:
1363
+ 0 && (module.exports = {
1364
+ AdminRole,
1365
+ AlertSubType,
1366
+ AlertType,
1367
+ BaseQuerySchema,
1368
+ BillingStatus,
1369
+ BooleanType,
1370
+ DefaultBaseFindParams,
1371
+ DeviceStatus,
1372
+ DeviceType,
1373
+ DocumentStatus,
1374
+ DocumentType,
1375
+ DocumentValidityStatus,
1376
+ DoorSensorStatus,
1377
+ ExpenseCategory,
1378
+ FileType,
1379
+ FleetSize,
1380
+ GPSFuelApproveStatus,
1381
+ GPSSource,
1382
+ GPSType,
1383
+ GeofencePurposeType,
1384
+ GeofenceStatusType,
1385
+ GeofenceType,
1386
+ InspectionActionStatus,
1387
+ InspectionStatus,
1388
+ InspectionType,
1389
+ Is12AM,
1390
+ IssueSeverity,
1391
+ IssueSource,
1392
+ IssueStatus,
1393
+ JobCardStatus,
1394
+ LifeExpiry,
1395
+ LinkStatus,
1396
+ LinkType,
1397
+ LoadChild,
1398
+ LoadChildCount,
1399
+ LoadParents,
1400
+ LoginFrom,
1401
+ MasterDeviceManufacturerQuerySchema,
1402
+ MasterDeviceManufacturerSchema,
1403
+ MasterDeviceModelQuerySchema,
1404
+ MasterDeviceModelSchema,
1405
+ MasterDeviceTypeQuerySchema,
1406
+ MasterDeviceTypeSchema,
1407
+ MenuType,
1408
+ Module,
1409
+ MongoBaseQuerySchema,
1410
+ NightDriving,
1411
+ NotificationType,
1412
+ OdometerSource,
1413
+ OrderBy,
1414
+ OrderBySchema,
1415
+ OverSpeed,
1416
+ PAGING,
1417
+ PaymentStatus,
1418
+ Priority,
1419
+ PurchaseOrderStatus,
1420
+ PurchaseType,
1421
+ PurchaseVehicleType,
1422
+ RecurrenceInterval,
1423
+ ReminderSource,
1424
+ ReminderStatus,
1425
+ ReminderTriggerType,
1426
+ RequestType,
1427
+ RetreadingMethod,
1428
+ ScheduleStatus,
1429
+ ScheduleType,
1430
+ ServiceType,
1431
+ SimStatus,
1432
+ Status,
1433
+ StockType,
1434
+ SubModule,
1435
+ TicketStatus,
1436
+ TimeSlot,
1437
+ TrackHistoryLinkStatus,
1438
+ TyreStatus,
1439
+ VerifyStatus,
1440
+ YesNo,
1441
+ apiDelete,
1442
+ apiGet,
1443
+ apiPatch,
1444
+ apiPost,
1445
+ booleanMandatory,
1446
+ booleanOptional,
1447
+ createMasterDeviceManufacturer,
1448
+ createMasterDeviceModel,
1449
+ createMasterDeviceType,
1450
+ dateMandatory,
1451
+ dateOptional,
1452
+ dateTimeMandatory,
1453
+ dateTimeOptional,
1454
+ deleteMasterDeviceManufacturer,
1455
+ deleteMasterDeviceModel,
1456
+ deleteMasterDeviceType,
1457
+ doubleMandatory,
1458
+ doubleMandatoryAmount,
1459
+ doubleMandatoryLatLng,
1460
+ doubleOptional,
1461
+ doubleOptionalAmount,
1462
+ doubleOptionalLatLng,
1463
+ dynamicJsonSchema,
1464
+ enumArrayMandatory,
1465
+ enumArrayOptional,
1466
+ enumMandatory,
1467
+ enumOptional,
1468
+ findMasterDeviceManufacturers,
1469
+ findMasterDeviceModels,
1470
+ findMasterDeviceTypes,
1471
+ getAllEnums,
1472
+ getMasterDeviceManufacturerCache,
1473
+ getMasterDeviceManufacturerCacheChild,
1474
+ getMasterDeviceManufacturerCacheCount,
1475
+ getMasterDeviceModelCache,
1476
+ getMasterDeviceModelCacheChild,
1477
+ getMasterDeviceModelCacheCount,
1478
+ getMasterDeviceTypeCache,
1479
+ getMasterDeviceTypeCacheChild,
1480
+ getMasterDeviceTypeCacheCount,
1481
+ multi_select_mandatory,
1482
+ multi_select_optional,
1483
+ nestedArrayOfObjectMandatory,
1484
+ nestedArrayOfObjectsOptional,
1485
+ nestedObjectMandatory,
1486
+ nestedObjectOptional,
1487
+ newMasterDeviceManufacturerPayload,
1488
+ newMasterDeviceModelPayload,
1489
+ newMasterDeviceTypePayload,
1490
+ numberArrayMandatory,
1491
+ numberArrayOptional,
1492
+ numberMandatory,
1493
+ numberOptional,
1494
+ r_log,
1495
+ setupSdk,
1496
+ single_select_mandatory,
1497
+ single_select_optional,
1498
+ stringArrayMandatory,
1499
+ stringArrayOptional,
1500
+ stringMandatory,
1501
+ stringOptional,
1502
+ stringUUIDMandatory,
1503
+ toMasterDeviceManufacturerPayload,
1504
+ toMasterDeviceModelPayload,
1505
+ toMasterDeviceTypePayload,
1506
+ updateMasterDeviceManufacturer,
1507
+ updateMasterDeviceModel,
1508
+ updateMasterDeviceType,
1509
+ withDefaults
1510
+ });
1511
+ //# sourceMappingURL=index.cjs.map