vms-nest-prisma-api-document 197.0.0 → 200.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/core/Enums.d.ts +31 -1
- package/dist/core/Enums.js +38 -0
- package/dist/services/account/analytics/user_login_analytics_service.d.ts +3 -3
- package/dist/services/account/analytics/user_page_analytics_service.d.ts +1 -1
- package/dist/services/account/bookmark_service.d.ts +1 -1
- package/dist/services/account/notification_preferences.service.d.ts +1 -1
- package/dist/services/account/report_preferences.service.d.ts +1 -1
- package/dist/services/account/ticket_service.d.ts +1 -1
- package/dist/services/fleet/bus_mangement/bus_stop.d.ts +1 -1
- package/dist/services/fleet/bus_mangement/calender.d.ts +1 -1
- package/dist/services/fleet/bus_mangement/master_route.d.ts +1 -1
- package/dist/services/fleet/bus_mangement/notice_board.d.ts +1 -1
- package/dist/services/fleet/bus_mangement/student.d.ts +1 -1
- package/dist/services/fleet/fuel_management/fleet_fuel_daily_summary_service.d.ts +1 -1
- package/dist/services/fleet/fuel_management/fleet_fuel_refill_service.d.ts +1 -1
- package/dist/services/fleet/fuel_management/fleet_fuel_removal_service.d.ts +1 -1
- package/dist/services/gps/features/geofence/gps_geofence_service.d.ts +1 -1
- package/dist/services/gps/features/geofence/gps_geofence_transaction_service.d.ts +1 -1
- package/dist/services/gps/features/geofence/gps_geofence_transaction_summary_service.d.ts +1 -1
- package/dist/services/gps/features/geofence/trip_geofence_to_geofence_service.d.ts +1 -1
- package/dist/services/gps/features/gps_live_track_share_link_service.d.ts +5 -5
- package/dist/services/gps/features/gps_track_history_share_link_service.d.ts +8 -8
- package/dist/services/main/devices/master_device_service.d.ts +1 -1
- package/dist/services/main/drivers/master_driver_service.d.ts +1 -1
- package/dist/services/main/sims/master_sim_service.d.ts +1 -1
- package/dist/services/main/users/auth_service.d.ts +1 -1
- package/dist/services/main/users/user_admin_service.d.ts +1 -1
- package/dist/services/main/users/user_organisation_service.d.ts +1 -1
- package/dist/services/main/users/user_service.d.ts +1 -1
- package/dist/services/main/vehicle/childs/vehicle_odometer_history.d.ts +1 -1
- package/dist/services/main/vehicle/master_vehicle_service.d.ts +1 -1
- package/dist/services/main/vehicle/master_vehicle_service.js +644 -378
- package/dist/services/master/bus/master_class_service.d.ts +1 -1
- package/dist/services/master/bus/master_program_service.d.ts +1 -1
- package/dist/services/master/bus/master_relationship_service.d.ts +1 -1
- package/dist/services/master/bus/master_section_service.d.ts +1 -1
- package/dist/services/master/bus/master_semester_service.d.ts +1 -1
- package/dist/services/master/bus/master_stream_service.d.ts +1 -1
- package/dist/services/master/bus/master_year_service.d.ts +1 -1
- package/dist/services/master/device/master_device_manufacturer_service.d.ts +1 -1
- package/dist/services/master/device/master_device_model_service.d.ts +1 -1
- package/dist/services/master/device/master_device_type_service.d.ts +1 -1
- package/dist/services/master/expense/master_expense_name_service.d.ts +1 -1
- package/dist/services/master/expense/master_expense_type_service.d.ts +1 -1
- package/dist/services/master/expense/master_fuel_company_service.d.ts +6 -6
- package/dist/services/master/expense/master_vendor_document_type_service.d.ts +3 -3
- package/dist/services/master/expense/master_vendor_type_service.d.ts +1 -1
- package/dist/services/master/fleet/master_fleet_incident_severity_service.d.ts +3 -3
- package/dist/services/master/fleet/master_fleet_incident_status_service.d.ts +1 -1
- package/dist/services/master/fleet/master_fleet_incident_type_service.d.ts +3 -3
- package/dist/services/master/fleet/master_fleet_insurance_claim_status_service.d.ts +1 -1
- package/dist/services/master/fleet/master_fleet_service_task_service.d.ts +1 -1
- package/dist/services/master/main/master_main_country_service.d.ts +1 -1
- package/dist/services/master/main/master_main_currency_service.d.ts +1 -1
- package/dist/services/master/main/master_main_date_format_service.d.ts +1 -1
- package/dist/services/master/main/master_main_industry_service.d.ts +1 -1
- package/dist/services/master/main/master_main_landmark_service.d.ts +1 -1
- package/dist/services/master/main/master_main_language_service.d.ts +1 -1
- package/dist/services/master/main/master_main_state_service.d.ts +1 -1
- package/dist/services/master/main/master_main_timezone_service.d.ts +1 -1
- package/dist/services/master/main/master_main_unit_distance_service.d.ts +1 -1
- package/dist/services/master/main/master_main_unit_mileage_service.d.ts +1 -1
- package/dist/services/master/main/master_main_unit_volume_service.d.ts +1 -1
- package/dist/services/master/organisation/organisation_branch_service.d.ts +1 -1
- package/dist/services/master/organisation/organisation_color_service.d.ts +1 -1
- package/dist/services/master/organisation/organisation_group_service.d.ts +1 -1
- package/dist/services/master/organisation/organisation_sub_company_service.d.ts +1 -1
- package/dist/services/master/organisation/organisation_tag_service.d.ts +1 -1
- package/dist/services/master/spare_part/master_spare_part_category_service.d.ts +1 -1
- package/dist/services/master/spare_part/master_spare_part_sub_category_service.d.ts +9 -9
- package/dist/services/master/spare_part/master_spare_part_unit_service.d.ts +1 -1
- package/dist/services/master/trip/master_trip_party_type_service.d.ts +1 -1
- package/dist/services/master/tyre/master_tyre_grade_service.d.ts +1 -1
- package/dist/services/master/tyre/master_tyre_make_service.d.ts +1 -1
- package/dist/services/master/tyre/master_tyre_model_service.d.ts +7 -7
- package/dist/services/master/user/master_user_role_service.d.ts +1 -1
- package/dist/services/master/user/master_user_status_service.d.ts +1 -1
- package/dist/services/master/vehicle/master_vehicle_associated_to_service.d.ts +1 -1
- package/dist/services/master/vehicle/master_vehicle_document_type_service.d.ts +1 -1
- package/dist/services/master/vehicle/master_vehicle_fuel_removal_reason_service.d.ts +1 -1
- package/dist/services/master/vehicle/master_vehicle_fuel_type_service.d.ts +1 -1
- package/dist/services/master/vehicle/master_vehicle_fuel_unit_service.d.ts +1 -1
- package/dist/services/master/vehicle/master_vehicle_make_service.d.ts +1 -1
- package/dist/services/master/vehicle/master_vehicle_model_service.d.ts +1 -1
- package/dist/services/master/vehicle/master_vehicle_ownership_type_service.d.ts +1 -1
- package/dist/services/master/vehicle/master_vehicle_status_type_service.d.ts +1 -1
- package/dist/services/master/vehicle/master_vehicle_sub_model_service.d.ts +1 -1
- package/dist/services/master/vehicle/master_vehicle_type_service.d.ts +1 -1
- package/dist/{user_organisation_service-ByNU_GlC.d.ts → user_organisation_service-CY8xuc2X.d.ts} +988 -482
- package/package.json +1 -1
|
@@ -79,20 +79,6 @@ var doubleOptional = (fieldName, min = 0, max = 1e6, decimalPlaces = 2, defaultV
|
|
|
79
79
|
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)
|
|
80
80
|
).optional();
|
|
81
81
|
};
|
|
82
|
-
var doubleOptionalLatLng = (fieldName, defaultValue = 0) => {
|
|
83
|
-
return z.preprocess(
|
|
84
|
-
(val) => {
|
|
85
|
-
if (typeof val === "string") {
|
|
86
|
-
val = parseFloat(val);
|
|
87
|
-
}
|
|
88
|
-
if (typeof val === "number") {
|
|
89
|
-
return parseFloat(val.toFixed(6));
|
|
90
|
-
}
|
|
91
|
-
return val;
|
|
92
|
-
},
|
|
93
|
-
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)
|
|
94
|
-
).optional();
|
|
95
|
-
};
|
|
96
82
|
var doubleOptionalAmount = (fieldName, defaultValue = 0) => {
|
|
97
83
|
return z.preprocess((val) => {
|
|
98
84
|
if (typeof val === "string") {
|
|
@@ -104,9 +90,6 @@ var doubleOptionalAmount = (fieldName, defaultValue = 0) => {
|
|
|
104
90
|
return val;
|
|
105
91
|
}, z.number({ invalid_type_error: `${fieldName} must be a number.` }).default(defaultValue)).optional();
|
|
106
92
|
};
|
|
107
|
-
var booleanOptional = (fieldName, defaultValue = false) => {
|
|
108
|
-
return z.boolean({ invalid_type_error: `${fieldName} must be true or false.` }).optional().default(defaultValue);
|
|
109
|
-
};
|
|
110
93
|
var enumMandatory = (fieldName, enumType, defaultValue) => {
|
|
111
94
|
return z.union([
|
|
112
95
|
z.nativeEnum(enumType, {
|
|
@@ -164,6 +147,18 @@ var dateOptional = (fieldName, minDate, maxDate, defaultValue = (/* @__PURE__ */
|
|
|
164
147
|
return schema;
|
|
165
148
|
};
|
|
166
149
|
var dynamicJsonSchema = (fieldName, defaultValue = {}) => z.record(z.any()).optional().default(() => defaultValue);
|
|
150
|
+
var nestedArrayOfObjectsOptional = (fieldName, schema, defaultValue = [], min = 0, max) => {
|
|
151
|
+
let arraySchema = z.array(schema, {
|
|
152
|
+
invalid_type_error: `${fieldName} must be an array of objects.`
|
|
153
|
+
}).min(min, `${fieldName} must contain at least ${min} items.`);
|
|
154
|
+
if (max !== void 0) {
|
|
155
|
+
arraySchema = arraySchema.max(
|
|
156
|
+
max,
|
|
157
|
+
`${fieldName} must contain at most ${max} items.`
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
return arraySchema.optional().default(() => defaultValue);
|
|
161
|
+
};
|
|
167
162
|
var single_select_mandatory = (fieldName) => {
|
|
168
163
|
const schema = z.string().trim().nonempty(`Please select ${fieldName}.`).transform(handleNullOrUndefined);
|
|
169
164
|
return schema;
|
|
@@ -256,18 +251,57 @@ var FileType = /* @__PURE__ */ ((FileType2) => {
|
|
|
256
251
|
FileType2["PDF"] = "PDF";
|
|
257
252
|
return FileType2;
|
|
258
253
|
})(FileType || {});
|
|
254
|
+
var DocumentValidityStatus = /* @__PURE__ */ ((DocumentValidityStatus2) => {
|
|
255
|
+
DocumentValidityStatus2["Valid"] = "Valid";
|
|
256
|
+
DocumentValidityStatus2["Expiring"] = "Expiring";
|
|
257
|
+
DocumentValidityStatus2["Expired"] = "Expired";
|
|
258
|
+
return DocumentValidityStatus2;
|
|
259
|
+
})(DocumentValidityStatus || {});
|
|
260
|
+
var DocumentStatus = /* @__PURE__ */ ((DocumentStatus2) => {
|
|
261
|
+
DocumentStatus2["Active"] = "Active";
|
|
262
|
+
DocumentStatus2["Inactive"] = "Inactive";
|
|
263
|
+
DocumentStatus2["Old"] = "Old";
|
|
264
|
+
return DocumentStatus2;
|
|
265
|
+
})(DocumentStatus || {});
|
|
259
266
|
var YesNo = /* @__PURE__ */ ((YesNo2) => {
|
|
260
267
|
YesNo2["Yes"] = "Yes";
|
|
261
268
|
YesNo2["No"] = "No";
|
|
262
269
|
return YesNo2;
|
|
263
270
|
})(YesNo || {});
|
|
264
|
-
var
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
return
|
|
270
|
-
})(
|
|
271
|
+
var SteeringType = /* @__PURE__ */ ((SteeringType2) => {
|
|
272
|
+
SteeringType2["Manual"] = "Manual";
|
|
273
|
+
SteeringType2["Power"] = "Power";
|
|
274
|
+
SteeringType2["Electric"] = "Electric";
|
|
275
|
+
SteeringType2["Hydraulic"] = "Hydraulic";
|
|
276
|
+
return SteeringType2;
|
|
277
|
+
})(SteeringType || {});
|
|
278
|
+
var WheelDriveType = /* @__PURE__ */ ((WheelDriveType2) => {
|
|
279
|
+
WheelDriveType2["FWD"] = "FWD";
|
|
280
|
+
WheelDriveType2["RWD"] = "RWD";
|
|
281
|
+
WheelDriveType2["AWD"] = "AWD";
|
|
282
|
+
WheelDriveType2["FourWD"] = "FourWD";
|
|
283
|
+
WheelDriveType2["TwoWD"] = "TwoWD";
|
|
284
|
+
WheelDriveType2["SixWD"] = "SixWD";
|
|
285
|
+
WheelDriveType2["EightWD"] = "EightWD";
|
|
286
|
+
WheelDriveType2["EAWD"] = "EAWD";
|
|
287
|
+
WheelDriveType2["SelectableFourWD"] = "SelectableFourWD";
|
|
288
|
+
return WheelDriveType2;
|
|
289
|
+
})(WheelDriveType || {});
|
|
290
|
+
var VehicleLifeStatus = /* @__PURE__ */ ((VehicleLifeStatus2) => {
|
|
291
|
+
VehicleLifeStatus2["Active"] = "Active";
|
|
292
|
+
VehicleLifeStatus2["Retired"] = "Retired";
|
|
293
|
+
VehicleLifeStatus2["Scrapped"] = "Scrapped";
|
|
294
|
+
VehicleLifeStatus2["Reassigned"] = "Reassigned";
|
|
295
|
+
VehicleLifeStatus2["Sold"] = "Sold";
|
|
296
|
+
VehicleLifeStatus2["Inactive"] = "Inactive";
|
|
297
|
+
return VehicleLifeStatus2;
|
|
298
|
+
})(VehicleLifeStatus || {});
|
|
299
|
+
var LoanInterestType = /* @__PURE__ */ ((LoanInterestType2) => {
|
|
300
|
+
LoanInterestType2["Simple"] = "Simple";
|
|
301
|
+
LoanInterestType2["Compound"] = "Compound";
|
|
302
|
+
LoanInterestType2["Reducing"] = "Reducing";
|
|
303
|
+
return LoanInterestType2;
|
|
304
|
+
})(LoanInterestType || {});
|
|
271
305
|
|
|
272
306
|
// src/zod_utils/zod_base_schema.ts
|
|
273
307
|
var OrderBySchema = z2.array(
|
|
@@ -330,40 +364,63 @@ var MongoBaseQuerySchema = z2.object({
|
|
|
330
364
|
// src/services/main/vehicle/master_vehicle_service.ts
|
|
331
365
|
var URL = "main/master_vehicle";
|
|
332
366
|
var ENDPOINTS = {
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
//
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
//
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
//
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
367
|
+
// AWS S3 PRESIGNED
|
|
368
|
+
vehicle_presigned_url: (file_name) => `${URL}/vehicle_presigned_url/${file_name}`,
|
|
369
|
+
device_presigned_url: (file_name) => `${URL}/device_presigned_url/${file_name}`,
|
|
370
|
+
vehicle_file_presigned_url: `${URL}/vehicle_file_presigned_url`,
|
|
371
|
+
// Vehicle CRED
|
|
372
|
+
find: `${URL}/search`,
|
|
373
|
+
find_live_dashboard: `${URL}/live_dashboard/search`,
|
|
374
|
+
find_gps_details: `${URL}/gps_details/search`,
|
|
375
|
+
create: `${URL}`,
|
|
376
|
+
update: `${URL}/:id`,
|
|
377
|
+
delete: `${URL}/:id`,
|
|
378
|
+
// API Updates
|
|
379
|
+
update_details_gps_sensor: `${URL}/gps_sensor_details/:id`,
|
|
380
|
+
update_details_trip: `${URL}/trip_details/:id`,
|
|
381
|
+
update_details_body: `${URL}/body_details/:id`,
|
|
382
|
+
update_details_life_cycle: `${URL}/life_cycle_details/:id`,
|
|
383
|
+
update_details_purchase: `${URL}/purchase_details/:id`,
|
|
384
|
+
// API Vehicle Driver Link
|
|
385
|
+
vehicle_driver_link: `${URL}/vehicle_driver_link`,
|
|
386
|
+
vehicle_driver_unlink: `${URL}/vehicle_driver_unlink`,
|
|
387
|
+
find_vehicle_driver_link_history_by_vehicle: `${URL}/vehicle_driver_link_history_by_vehicle/:id`,
|
|
388
|
+
find_vehicle_driver_link_history_by_driver: `${URL}/vehicle_driver_link_history_by_driver/:id`,
|
|
389
|
+
// API Vehicle Device Link
|
|
390
|
+
vehicle_device_link: `${URL}/vehicle_device_link`,
|
|
391
|
+
vehicle_device_unlink: `${URL}/vehicle_device_unlink`,
|
|
392
|
+
vehicle_device_link_history_by_vehicle: `${URL}/vehicle_device_link_history_by_vehicle/:id`,
|
|
393
|
+
vehicle_device_link_history_by_device: `${URL}/vehicle_device_link_history_by_device/:id`,
|
|
394
|
+
// Vehicle Document
|
|
395
|
+
create_document: `${URL}/document`,
|
|
396
|
+
find_document: `${URL}/find_document/search`,
|
|
397
|
+
update_document: `${URL}/vehicle_document/:id`,
|
|
398
|
+
remove_document: `${URL}/vehicle_document/:id`,
|
|
399
|
+
// File
|
|
400
|
+
create_file_vehicle: `${URL}/create_file_vehicle`,
|
|
401
|
+
remove_file_vehicle: `${URL}/remove_file_vehicle/:id`,
|
|
402
|
+
create_file_device: `${URL}/create_file_device`,
|
|
403
|
+
remove_file_device: `${URL}/remove_file_device/:id`,
|
|
404
|
+
create_file_vehicle_document: `${URL}/create_file_vehicle_document`,
|
|
405
|
+
remove_file_vehicle_document: `${URL}/remove_file_vehicle_document/:id`,
|
|
406
|
+
// Cache Endpoints By organisation_id
|
|
407
|
+
find_cache: `${URL}/cache/:organisation_id`,
|
|
408
|
+
find_cache_simple: `${URL}/cache_simple/:organisation_id`,
|
|
409
|
+
find_cache_parent: `${URL}/cache_parent/:organisation_id`,
|
|
410
|
+
find_cache_dropdown: `${URL}/cache_dropdown/:organisation_id`,
|
|
411
|
+
find_cache_dropdown_live_data: `${URL}/cache_dropdown_live_data/:organisation_id`,
|
|
412
|
+
// Cache Endpoints By user_id
|
|
413
|
+
find_cache_by_user: `${URL}/cache_by_user/:user_id`,
|
|
414
|
+
find_cache_simple_by_user: `${URL}/cache_simple_by_user/:user_id`,
|
|
415
|
+
find_cache_parent_by_user: `${URL}/cache_parent_by_user/:user_id`,
|
|
416
|
+
find_cache_dropdown_by_user: `${URL}/cache_dropdown_by_user/:user_id`
|
|
366
417
|
};
|
|
418
|
+
var MasterVehicleFileSchema = BaseFileSchema.extend({
|
|
419
|
+
organisation_id: single_select_optional("UserOrganisation"),
|
|
420
|
+
// ✅ Single-Selection -> UserOrganisation
|
|
421
|
+
vehicle_id: single_select_optional("MasterVehicle")
|
|
422
|
+
// ✅ Single-Selection -> MasterVehicle
|
|
423
|
+
});
|
|
367
424
|
var VehicleSchema = z3.object({
|
|
368
425
|
organisation_id: single_select_mandatory("UserOrganisation"),
|
|
369
426
|
// ✅ Single-Selection -> UserOrganisation
|
|
@@ -376,12 +433,6 @@ var VehicleSchema = z3.object({
|
|
|
376
433
|
is_fleet_active: enumMandatory("Is Fleet Active", YesNo, "Yes" /* Yes */),
|
|
377
434
|
is_gps_active: enumMandatory("Is GPS Active", YesNo, "No" /* No */),
|
|
378
435
|
is_trip_active: enumMandatory("Is Trip Active", YesNo, "No" /* No */),
|
|
379
|
-
vehicle_front_image_url: stringOptional("Vehicle Front Image URL", 0, 300),
|
|
380
|
-
vehicle_front_image_key: stringOptional("Vehicle Front Image Key", 0, 300),
|
|
381
|
-
vehicle_plate_image_url: stringOptional("Vehicle Plate Image URL", 0, 300),
|
|
382
|
-
vehicle_plate_image_key: stringOptional("Vehicle Plate Image Key", 0, 300),
|
|
383
|
-
vehicle_full_image_url: stringOptional("Vehicle Full Image URL", 0, 300),
|
|
384
|
-
vehicle_full_image_key: stringOptional("Vehicle Full Image Key", 0, 300),
|
|
385
436
|
status: enumMandatory("Status", Status, "Active" /* Active */),
|
|
386
437
|
organisation_sub_company_id: single_select_optional(
|
|
387
438
|
"Organisation Sub Company ID"
|
|
@@ -425,31 +476,64 @@ var VehicleSchema = z3.object({
|
|
|
425
476
|
// ✅ Single-Selection -> MasterVehicleFuelUnit
|
|
426
477
|
vehicle_total_fuel_quantity: numberOptional("Vehicle Total Fuel Quantity"),
|
|
427
478
|
vehicle_tank_1_fuel_quantity: numberOptional("Vehicle Tank 1 Fuel Quantity"),
|
|
428
|
-
vehicle_tank_2_fuel_quantity: numberOptional("Vehicle Tank 2 Fuel Quantity")
|
|
479
|
+
vehicle_tank_2_fuel_quantity: numberOptional("Vehicle Tank 2 Fuel Quantity"),
|
|
480
|
+
MasterVehicleFileSchema: nestedArrayOfObjectsOptional(
|
|
481
|
+
"MasterVehicleFileSchema",
|
|
482
|
+
MasterVehicleFileSchema,
|
|
483
|
+
[]
|
|
484
|
+
)
|
|
485
|
+
});
|
|
486
|
+
var VehicleBulkSchema = z3.object({
|
|
487
|
+
organisation_id: single_select_mandatory("UserOrganisation"),
|
|
488
|
+
// ✅ Single-Selection -> UserOrganisation
|
|
489
|
+
vehicle_number: stringMandatory("Vehicle Number", 2, 50),
|
|
490
|
+
vehicle_name: stringOptional("Vehicle Name", 0, 50),
|
|
491
|
+
is_fleet_active: enumMandatory("Is Fleet Active", YesNo, "Yes" /* Yes */),
|
|
492
|
+
is_gps_active: enumMandatory("Is GPS Active", YesNo, "No" /* No */),
|
|
493
|
+
is_trip_active: enumMandatory("Is Trip Active", YesNo, "No" /* No */),
|
|
494
|
+
status: enumMandatory("Status", Status, "Active" /* Active */),
|
|
495
|
+
vehicle_type_id: single_select_mandatory("MasterVehicleType"),
|
|
496
|
+
// ✅ Single-Selection -> MasterVehicleType
|
|
497
|
+
device_manufacturer_id: single_select_optional("MasterDeviceManufacturer"),
|
|
498
|
+
// ✅ Single-Selection -> MasterDeviceManufacturer
|
|
499
|
+
device_model_id: single_select_optional("MasterDeviceModel"),
|
|
500
|
+
// ✅ Single-Selection -> MasterDeviceModel
|
|
501
|
+
device_type_id: single_select_optional("MasterDeviceType"),
|
|
502
|
+
// ✅ Single-Selection -> MasterDeviceType
|
|
503
|
+
country_id: single_select_optional("MasterMainCountry"),
|
|
504
|
+
// ✅ Single-Selection -> MasterMainCountry
|
|
505
|
+
time_zone_id: single_select_optional("MasterMainTimeZone")
|
|
506
|
+
// ✅ Single-Selection -> MasterMainTimeZone
|
|
507
|
+
});
|
|
508
|
+
var MasterDeviceFileSchema = BaseFileSchema.extend({
|
|
509
|
+
organisation_id: single_select_optional("UserOrganisation"),
|
|
510
|
+
// ✅ Single-Selection -> UserOrganisation
|
|
511
|
+
device_id: single_select_optional("MasterVehicle")
|
|
512
|
+
// ✅ Single-Selection -> MasterVehicle
|
|
429
513
|
});
|
|
430
514
|
var VehicleDeviceLinkSchema = z3.object({
|
|
431
|
-
device_id: single_select_mandatory("
|
|
432
|
-
// Single
|
|
433
|
-
device_manufacturer_id: single_select_mandatory("
|
|
434
|
-
// Single
|
|
435
|
-
device_model_id: single_select_mandatory("
|
|
436
|
-
// Single
|
|
437
|
-
device_type_id: single_select_mandatory("
|
|
438
|
-
// Single
|
|
439
|
-
organisation_id: single_select_mandatory("
|
|
440
|
-
// Single
|
|
441
|
-
country_id: single_select_mandatory("
|
|
442
|
-
// Single
|
|
443
|
-
time_zone_id: single_select_mandatory("
|
|
444
|
-
// Single
|
|
445
|
-
vehicle_id: single_select_mandatory("
|
|
446
|
-
// Single
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
515
|
+
device_id: single_select_mandatory("MasterDevice"),
|
|
516
|
+
// ✅ Single-Selection -> MasterDevice
|
|
517
|
+
device_manufacturer_id: single_select_mandatory("MasterDeviceManufacturer"),
|
|
518
|
+
// ✅ Single-Selection -> MasterDeviceManufacturer
|
|
519
|
+
device_model_id: single_select_mandatory("MasterDeviceModel"),
|
|
520
|
+
// ✅ Single-Selection -> MasterDeviceModel
|
|
521
|
+
device_type_id: single_select_mandatory("MasterDeviceType"),
|
|
522
|
+
// ✅ Single-Selection -> MasterDeviceType
|
|
523
|
+
organisation_id: single_select_mandatory("UserOrganisation"),
|
|
524
|
+
// ✅ Single-Selection -> UserOrganisation
|
|
525
|
+
country_id: single_select_mandatory("MasterMainCountry"),
|
|
526
|
+
// ✅ Single-Selection -> MasterMainCountry
|
|
527
|
+
time_zone_id: single_select_mandatory("MasterMainTimeZone"),
|
|
528
|
+
// ✅ Single-Selection -> MasterMainTimeZone
|
|
529
|
+
vehicle_id: single_select_mandatory("MasterVehicle"),
|
|
530
|
+
// ✅ Single-Selection -> MasterVehicle
|
|
531
|
+
temperature: enumOptional("Temperature", YesNo, "No" /* No */),
|
|
532
|
+
duel_temperature: enumOptional("Dual Temperature", YesNo, "No" /* No */),
|
|
533
|
+
fuel: enumOptional("Fuel", YesNo, "No" /* No */),
|
|
534
|
+
fuel_bluetooth: enumOptional("Fuel Bluetooth", YesNo, "No" /* No */),
|
|
535
|
+
fuel_tank_size: numberOptional("Fuel Tank Size"),
|
|
536
|
+
over_speed_kmph: numberOptional("Over Speed KMPH"),
|
|
453
537
|
gps_lock_relay: enumOptional("GPS Lock Relay", YesNo, "No" /* No */),
|
|
454
538
|
gps_door_locker: enumOptional("GPS Door Locker", YesNo, "No" /* No */),
|
|
455
539
|
door_sensor: enumOptional("Door Sensor", YesNo, "No" /* No */),
|
|
@@ -457,45 +541,30 @@ var VehicleDeviceLinkSchema = z3.object({
|
|
|
457
541
|
dashcam_sensor: enumOptional("Dashcam Sensor", YesNo, "No" /* No */),
|
|
458
542
|
is_rear_cam: enumOptional("Is Rear Cam", YesNo, "No" /* No */),
|
|
459
543
|
is_front_cam: enumOptional("Is Front Cam", YesNo, "No" /* No */),
|
|
460
|
-
camera_extra_count: numberOptional("Camera Extra Count")
|
|
544
|
+
camera_extra_count: numberOptional("Camera Extra Count"),
|
|
545
|
+
MasterDeviceFileSchema: nestedArrayOfObjectsOptional(
|
|
546
|
+
"MasterDeviceFileSchema",
|
|
547
|
+
MasterDeviceFileSchema,
|
|
548
|
+
[]
|
|
549
|
+
)
|
|
461
550
|
});
|
|
462
551
|
var VehicleDeviceUnlinkSchema = z3.object({
|
|
463
|
-
|
|
464
|
-
// Single
|
|
465
|
-
|
|
466
|
-
// Single
|
|
552
|
+
organisation_id: single_select_mandatory("UserOrganisation"),
|
|
553
|
+
// ✅ Single-Selection -> UserOrganisation
|
|
554
|
+
vehicle_id: single_select_mandatory("MasterVehicle"),
|
|
555
|
+
// ✅ Single-Selection -> MasterVehicle
|
|
556
|
+
device_id: single_select_mandatory("MasterDevice")
|
|
557
|
+
// ✅ Single-Selection -> MasterDevice
|
|
467
558
|
});
|
|
468
559
|
var VehicleDriverLinkSchema = z3.object({
|
|
469
|
-
organisation_id: single_select_mandatory("
|
|
470
|
-
// Single
|
|
471
|
-
vehicle_id: single_select_mandatory("
|
|
472
|
-
// Single
|
|
473
|
-
driver_id: single_select_mandatory("
|
|
474
|
-
// Single
|
|
475
|
-
});
|
|
476
|
-
var SimpleFindQuerySchema = BaseQuerySchema.extend({
|
|
477
|
-
organisation_id: single_select_mandatory("Organisation ID")
|
|
478
|
-
// Single selection -> UserOrganisation
|
|
479
|
-
});
|
|
480
|
-
var VehicleDetailBodySchema = z3.object({
|
|
481
|
-
vehicle_body_details: stringOptional("Vehicle Body Details", 0, 300),
|
|
482
|
-
vehicle_height: doubleOptional("Vehicle Height", 0, 1e4, 2),
|
|
483
|
-
vehicle_width: doubleOptional("Vehicle Width", 0, 1e4, 2),
|
|
484
|
-
vehicle_length: doubleOptional("Vehicle Length", 0, 1e4, 2),
|
|
485
|
-
vehicle_passenger_capacity: numberOptional("Vehicle Passenger Capacity"),
|
|
486
|
-
vehicle_cargo_volume: doubleOptional("Vehicle Cargo Volume", 0, 1e4, 2),
|
|
487
|
-
vehicle_maximum_weight_capacity: doubleOptional(
|
|
488
|
-
"Vehicle Maximum Weight Capacity",
|
|
489
|
-
0,
|
|
490
|
-
1e4,
|
|
491
|
-
2
|
|
492
|
-
),
|
|
493
|
-
vehicle_total_fuel_quantity: numberOptional("Vehicle Total Fuel Quantity"),
|
|
494
|
-
vehicle_tank_1_fuel_quantity: numberOptional("Vehicle Tank 1 Fuel Quantity"),
|
|
495
|
-
vehicle_tank_2_fuel_quantity: numberOptional("Vehicle Tank 2 Fuel Quantity"),
|
|
496
|
-
status: enumMandatory("Status", Status, "Active" /* Active */)
|
|
560
|
+
organisation_id: single_select_mandatory("UserOrganisation"),
|
|
561
|
+
// ✅ Single-Selection -> UserOrganisation
|
|
562
|
+
vehicle_id: single_select_mandatory("MasterVehicle"),
|
|
563
|
+
// ✅ Single-Selection -> MasterVehicle
|
|
564
|
+
driver_id: single_select_mandatory("MasterDriver")
|
|
565
|
+
// ✅ Single-Selection -> MasterDriver
|
|
497
566
|
});
|
|
498
|
-
var
|
|
567
|
+
var VehicleDetailGPSSensorSchema = z3.object({
|
|
499
568
|
temperature: enumOptional("Temperature", YesNo, "No" /* No */),
|
|
500
569
|
duel_temperature: enumOptional("Dual Temperature", YesNo, "No" /* No */),
|
|
501
570
|
fuel: enumOptional("Fuel", YesNo, "No" /* No */),
|
|
@@ -509,125 +578,205 @@ var VehicleDetailGPSMainSchema = z3.object({
|
|
|
509
578
|
dashcam_sensor: enumOptional("Dashcam Sensor", YesNo, "No" /* No */),
|
|
510
579
|
is_rear_cam: enumOptional("Is Rear Cam", YesNo, "No" /* No */),
|
|
511
580
|
is_front_cam: enumOptional("Is Front Cam", YesNo, "No" /* No */),
|
|
512
|
-
camera_extra_count: numberOptional("Camera Extra Count")
|
|
513
|
-
status: enumMandatory("Status", Status, "Active" /* Active */)
|
|
581
|
+
camera_extra_count: numberOptional("Camera Extra Count")
|
|
514
582
|
});
|
|
515
|
-
var
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
al: numberOptional("Altitude"),
|
|
527
|
-
s: numberOptional("Speed"),
|
|
528
|
-
b: numberOptional("Bearing"),
|
|
529
|
-
c: numberOptional("Course"),
|
|
530
|
-
i: booleanOptional("I"),
|
|
531
|
-
m: booleanOptional("M"),
|
|
532
|
-
p: booleanOptional("P"),
|
|
533
|
-
v: booleanOptional("V"),
|
|
534
|
-
b_r: stringOptional("B_R", 0, 100),
|
|
535
|
-
// Fuel and Temperature
|
|
536
|
-
f1_r: stringOptional("Fuel Sensor 1 Reading", 0, 100),
|
|
537
|
-
f2_r: stringOptional("Fuel Sensor 2 Reading", 0, 100),
|
|
538
|
-
f1: doubleOptionalLatLng("Fuel Level 1", 2),
|
|
539
|
-
f2: doubleOptionalLatLng("Fuel Level 2", 2),
|
|
540
|
-
t1_r: stringOptional("Temperature Sensor 1 Reading", 0, 100),
|
|
541
|
-
t2_r: stringOptional("Temperature Sensor 2 Reading", 0, 100),
|
|
542
|
-
t1: doubleOptionalLatLng("Temperature 1", 2),
|
|
543
|
-
t2: doubleOptionalLatLng("Temperature 2", 2),
|
|
544
|
-
// Landmark Location
|
|
545
|
-
gl: stringOptional("GL", 0, 300),
|
|
546
|
-
lid: stringOptional("LID", 0, 300),
|
|
547
|
-
ll: stringOptional("LL", 0, 300),
|
|
548
|
-
ld: numberOptional("LD"),
|
|
549
|
-
// Sensor
|
|
550
|
-
s_r_l: booleanOptional("S_R_L"),
|
|
551
|
-
s_d_l: booleanOptional("S_D_L"),
|
|
552
|
-
s_d: booleanOptional("S_D"),
|
|
553
|
-
s_g: booleanOptional("S_G"),
|
|
554
|
-
g_s: enumOptional("GPS Source", GPSSource, "NoDevice" /* NoDevice */)
|
|
583
|
+
var VehicleDetailTripSchema = z3.object({
|
|
584
|
+
trip_name: stringOptional("Trip Name", 0, 100),
|
|
585
|
+
trip_no: stringOptional("Trip Name", 0, 100),
|
|
586
|
+
eway_bill_number: stringOptional("E-Way Bill Number", 0, 100),
|
|
587
|
+
route_name: stringOptional("Route Name", 0, 100),
|
|
588
|
+
trip_start_date: dateOptional("Trip Start Date"),
|
|
589
|
+
trip_end_date: dateOptional("Trip End Date"),
|
|
590
|
+
trip_notes_1: stringOptional("Trip Notes 1", 0, 200),
|
|
591
|
+
trip_notes_2: stringOptional("Trip Notes 2", 0, 200),
|
|
592
|
+
trip_notes_3: stringOptional("Trip Notes 3", 0, 200),
|
|
593
|
+
status: enumMandatory("Status", Status, "Active" /* Active */)
|
|
555
594
|
});
|
|
556
|
-
var
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
595
|
+
var VehicleDetailBodySchema = z3.object({
|
|
596
|
+
// 📦 Body & Dimension (Common)
|
|
597
|
+
vehicle_body_details: stringOptional("Vehicle Body Details", 0, 300),
|
|
598
|
+
vehicle_height: doubleOptional("Vehicle Height"),
|
|
599
|
+
vehicle_width: doubleOptional("Vehicle Width"),
|
|
600
|
+
vehicle_length: doubleOptional("Vehicle Length"),
|
|
601
|
+
wheel_base: doubleOptional("Wheel Base"),
|
|
602
|
+
number_of_doors: numberOptional("Number Of Doors"),
|
|
603
|
+
// Passenger Configuration (Cars/Buses)
|
|
604
|
+
vehicle_passenger_capacity: numberOptional("Vehicle Passenger Capacity"),
|
|
605
|
+
standing_passenger_capacity: numberOptional("Standing Passenger Capacity"),
|
|
606
|
+
seat_configuration: stringOptional("Seat Configuration", 0, 100),
|
|
607
|
+
has_air_conditioning: enumMandatory("Has Air Conditioning", YesNo, "No" /* No */),
|
|
608
|
+
has_heating_system: enumMandatory("Has Heating System", YesNo, "No" /* No */),
|
|
609
|
+
has_reclining_seats: enumMandatory("Has Reclining Seats", YesNo, "No" /* No */),
|
|
610
|
+
has_safety_belts: enumMandatory("Has Safety Belts", YesNo, "No" /* No */),
|
|
611
|
+
has_headrests: enumMandatory("Has Headrests", YesNo, "No" /* No */),
|
|
612
|
+
has_armrests: enumMandatory("Has Armrests", YesNo, "No" /* No */),
|
|
613
|
+
has_infotainment_system: enumMandatory(
|
|
614
|
+
"Has Infotainment System",
|
|
615
|
+
YesNo,
|
|
616
|
+
"No" /* No */
|
|
565
617
|
),
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
"
|
|
569
|
-
|
|
618
|
+
infotainment_type: stringOptional("Infotainment Type", 0, 100),
|
|
619
|
+
has_individual_lighting: enumMandatory(
|
|
620
|
+
"Has Individual Lighting",
|
|
621
|
+
YesNo,
|
|
622
|
+
"No" /* No */
|
|
570
623
|
),
|
|
571
|
-
|
|
572
|
-
"
|
|
573
|
-
|
|
624
|
+
has_overhead_luggage_storage: enumMandatory(
|
|
625
|
+
"Has Overhead Luggage Storage",
|
|
626
|
+
YesNo,
|
|
627
|
+
"No" /* No */
|
|
574
628
|
),
|
|
575
|
-
|
|
576
|
-
"
|
|
577
|
-
|
|
629
|
+
wheelchair_accessible: enumMandatory(
|
|
630
|
+
"Wheelchair Accessible",
|
|
631
|
+
YesNo,
|
|
632
|
+
"No" /* No */
|
|
578
633
|
),
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
634
|
+
// Cargo Configuration (Trucks/Vans)
|
|
635
|
+
vehicle_cargo_volume: doubleOptional("Vehicle Cargo Volume"),
|
|
636
|
+
vehicle_maximum_weight_capacity: doubleOptional(
|
|
637
|
+
"Vehicle Maximum Weight Capacity"
|
|
638
|
+
),
|
|
639
|
+
cargo_area_type: stringOptional("Cargo Area Type", 0, 100),
|
|
640
|
+
has_lift_gate: enumMandatory("Has Lift Gate", YesNo, "No" /* No */),
|
|
641
|
+
has_refrigeration_unit: enumMandatory(
|
|
642
|
+
"Has Refrigeration Unit",
|
|
643
|
+
YesNo,
|
|
644
|
+
"No" /* No */
|
|
645
|
+
),
|
|
646
|
+
refrigeration_temperature_range: stringOptional(
|
|
647
|
+
"Refrigeration Temperature Range",
|
|
648
|
+
0,
|
|
649
|
+
100
|
|
650
|
+
),
|
|
651
|
+
cargo_bed_length: doubleOptional("Cargo Bed Length"),
|
|
652
|
+
cargo_bed_width: doubleOptional("Cargo Bed Width"),
|
|
653
|
+
cargo_bed_height: doubleOptional("Cargo Bed Height"),
|
|
654
|
+
cargo_floor_material: stringOptional("Cargo Floor Material", 0, 100),
|
|
655
|
+
has_side_doors: enumMandatory("Has Side Doors", YesNo, "No" /* No */),
|
|
656
|
+
has_roof_hatch: enumMandatory("Has Roof Hatch", YesNo, "No" /* No */),
|
|
657
|
+
cargo_tie_down_hooks_count: numberOptional("Cargo Tie Down Hooks Count"),
|
|
658
|
+
is_custom_body_built: enumMandatory("Is Custom Body Built", YesNo, "No" /* No */),
|
|
659
|
+
number_of_axles: numberOptional("Number Of Axles"),
|
|
660
|
+
axle_configuration: stringOptional("Axle Configuration", 0, 50),
|
|
661
|
+
has_dual_rear_wheels: enumMandatory("Has Dual Rear Wheels", YesNo, "No" /* No */),
|
|
662
|
+
suspension_type: stringOptional("Suspension Type", 0, 100),
|
|
663
|
+
suspension_adjustability: enumMandatory(
|
|
664
|
+
"Suspension Adjustability",
|
|
665
|
+
YesNo,
|
|
666
|
+
"No" /* No */
|
|
667
|
+
),
|
|
668
|
+
ground_clearance_mm: doubleOptional("Ground Clearance MM"),
|
|
669
|
+
tire_size: stringOptional("Tire Size", 0, 50),
|
|
670
|
+
has_spare_tire: enumMandatory("Has Spare Tire", YesNo, "Yes" /* Yes */),
|
|
671
|
+
has_all_terrain_tires: enumMandatory(
|
|
672
|
+
"Has All Terrain Tires",
|
|
673
|
+
YesNo,
|
|
674
|
+
"No" /* No */
|
|
675
|
+
),
|
|
676
|
+
has_run_flat_tires: enumMandatory("Has Run Flat Tires", YesNo, "No" /* No */),
|
|
677
|
+
steering_type: enumMandatory(
|
|
678
|
+
"Steering Type",
|
|
679
|
+
SteeringType,
|
|
680
|
+
"Power" /* Power */
|
|
681
|
+
),
|
|
682
|
+
wheel_drive_type: enumMandatory(
|
|
683
|
+
"Wheel Drive Type",
|
|
684
|
+
WheelDriveType,
|
|
685
|
+
"FWD" /* FWD */
|
|
583
686
|
),
|
|
584
|
-
|
|
687
|
+
// 🛡️ Safety Features
|
|
688
|
+
has_abs: enumMandatory("Has ABS", YesNo, "No" /* No */),
|
|
689
|
+
has_airbags: enumMandatory("Has Airbags", YesNo, "No" /* No */),
|
|
690
|
+
has_speed_limiter: enumMandatory("Has Speed Limiter", YesNo, "No" /* No */),
|
|
691
|
+
has_gps_tracker: enumMandatory("Has GPS Tracker", YesNo, "No" /* No */),
|
|
692
|
+
has_parking_sensors: enumMandatory("Has Parking Sensors", YesNo, "No" /* No */),
|
|
693
|
+
has_rear_camera: enumMandatory("Has Rear Camera", YesNo, "No" /* No */),
|
|
694
|
+
has_lane_assist: enumMandatory("Has Lane Assist", YesNo, "No" /* No */),
|
|
695
|
+
has_automatic_emergency_brake: enumMandatory(
|
|
696
|
+
"Has Automatic Emergency Brake",
|
|
697
|
+
YesNo,
|
|
698
|
+
"No" /* No */
|
|
699
|
+
),
|
|
700
|
+
has_tire_pressure_monitoring: enumMandatory(
|
|
701
|
+
"Has Tire Pressure Monitoring",
|
|
702
|
+
YesNo,
|
|
703
|
+
"No" /* No */
|
|
704
|
+
),
|
|
705
|
+
has_blind_spot_monitoring: enumMandatory(
|
|
706
|
+
"Has Blind Spot Monitoring",
|
|
707
|
+
YesNo,
|
|
708
|
+
"No" /* No */
|
|
709
|
+
),
|
|
710
|
+
has_collision_warning_system: enumMandatory(
|
|
711
|
+
"Has Collision Warning System",
|
|
712
|
+
YesNo,
|
|
713
|
+
"No" /* No */
|
|
714
|
+
),
|
|
715
|
+
has_immobilizer: enumMandatory("Has Immobilizer", YesNo, "No" /* No */),
|
|
716
|
+
has_dashcam: enumMandatory("Has DashCam", YesNo, "No" /* No */),
|
|
717
|
+
has_emergency_exit: enumMandatory("Has Emergency Exit", YesNo, "No" /* No */),
|
|
718
|
+
status: enumMandatory("Status", Status, "Active" /* Active */)
|
|
585
719
|
});
|
|
586
720
|
var VehicleDetailLifeCycleSchema = z3.object({
|
|
721
|
+
// Lifecycle Start
|
|
587
722
|
service_start_date: dateOptional("Service Start Date"),
|
|
588
723
|
service_start_odometer_reading: numberOptional(
|
|
589
724
|
"Service Start Odometer Reading"
|
|
590
725
|
),
|
|
726
|
+
// Lifecycle End
|
|
591
727
|
service_end_date: dateOptional("Service End Date"),
|
|
592
728
|
service_end_odometer_reading: numberOptional("Service End Odometer Reading"),
|
|
729
|
+
// Estimated Life
|
|
593
730
|
life_estimate_max_month_year: dateOptional("Life Estimate Max Month/Year"),
|
|
594
731
|
life_estimate_max_odometer_reading: numberOptional(
|
|
595
732
|
"Life Estimate Max Odometer Reading"
|
|
596
733
|
),
|
|
597
|
-
|
|
598
|
-
|
|
734
|
+
// Lifecycle Status
|
|
735
|
+
life_expiry: enumMandatory("Life Expiry", LifeExpiry, "No" /* No */),
|
|
736
|
+
is_extended_life_approved: enumMandatory(
|
|
737
|
+
"Is Extended Life Approved",
|
|
738
|
+
YesNo,
|
|
739
|
+
"No" /* No */
|
|
740
|
+
),
|
|
741
|
+
life_status: enumMandatory(
|
|
742
|
+
"Life Status",
|
|
743
|
+
VehicleLifeStatus,
|
|
744
|
+
"Active" /* Active */
|
|
745
|
+
),
|
|
599
746
|
life_expiry_message: stringOptional("Life Expiry Message", 0, 300),
|
|
600
747
|
life_expiry_note: stringOptional("Life Expiry Note", 0, 2e3),
|
|
601
748
|
status: enumMandatory("Status", Status, "Active" /* Active */)
|
|
602
749
|
});
|
|
603
750
|
var VehicleDetailPurchaseSchema = z3.object({
|
|
604
|
-
// Purchase Info
|
|
751
|
+
// Basic Purchase Info
|
|
605
752
|
purchase_date: dateOptional("Purchase Date"),
|
|
606
753
|
purchase_notes: stringOptional("Purchase Notes", 0, 300),
|
|
607
|
-
purchase_vehicle_type:
|
|
754
|
+
purchase_vehicle_type: enumMandatory(
|
|
608
755
|
"Purchase Vehicle Type",
|
|
609
756
|
PurchaseVehicleType,
|
|
610
757
|
"New" /* New */
|
|
611
758
|
),
|
|
612
|
-
purchase_type:
|
|
759
|
+
purchase_type: enumMandatory(
|
|
613
760
|
"Purchase Type",
|
|
614
761
|
PurchaseType,
|
|
615
762
|
"NoFinance" /* NoFinance */
|
|
616
763
|
),
|
|
617
|
-
purchase_vendor_id: single_select_optional("Purchase Vendor ID"),
|
|
618
764
|
purchase_total_amount: doubleOptionalAmount("Purchase Total Amount", 2),
|
|
619
|
-
// Loan
|
|
620
|
-
loan_lender_id: single_select_optional("Loan Lender ID"),
|
|
765
|
+
// Loan Details
|
|
621
766
|
loan_amount: doubleOptionalAmount("Loan Amount", 2),
|
|
622
767
|
loan_down_payment: doubleOptionalAmount("Loan Down Payment", 2),
|
|
623
768
|
loan_interest_rate: doubleOptionalAmount("Loan Interest Rate", 2),
|
|
769
|
+
loan_interest_type: enumOptional(
|
|
770
|
+
"Loan Interest Type",
|
|
771
|
+
LoanInterestType,
|
|
772
|
+
"Simple" /* Simple */
|
|
773
|
+
),
|
|
624
774
|
loan_no_of_installments: numberOptional("Loan No of Installments"),
|
|
625
775
|
loan_first_payment_date: dateOptional("Loan First Payment Date"),
|
|
626
776
|
loan_last_payment_date: dateOptional("Loan Last Payment Date"),
|
|
627
777
|
loan_monthly_emi: doubleOptionalAmount("Loan Monthly EMI"),
|
|
628
778
|
loan_emi_date: numberOptional("Loan EMI Date"),
|
|
629
|
-
// Lease
|
|
630
|
-
lease_vendor_id: single_select_optional("Lease Vendor ID"),
|
|
779
|
+
// Lease Details
|
|
631
780
|
lease_start_date: dateOptional("Lease Start Date"),
|
|
632
781
|
lease_end_date: dateOptional("Lease End Date"),
|
|
633
782
|
lease_security_deposit_amount: doubleOptionalAmount(
|
|
@@ -642,72 +791,125 @@ var VehicleDetailPurchaseSchema = z3.object({
|
|
|
642
791
|
"Warranty Max Odometer Reading"
|
|
643
792
|
),
|
|
644
793
|
warranty_exchange_date: dateOptional("Warranty Exchange Date"),
|
|
794
|
+
purchase_vendor_id: single_select_optional("Purchase Vendor ID"),
|
|
795
|
+
loan_lender_id: single_select_optional("Loan Lender ID"),
|
|
796
|
+
lease_vendor_id: single_select_optional("Lease Vendor ID"),
|
|
645
797
|
// Metadata
|
|
646
798
|
status: enumMandatory("Status", Status, "Active" /* Active */)
|
|
647
799
|
});
|
|
648
|
-
var
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
trip_start_date: dateOptional("Trip Start Date"),
|
|
654
|
-
trip_end_date: dateOptional("Trip End Date"),
|
|
655
|
-
trip_notes_1: stringOptional("Trip Notes 1", 0, 200),
|
|
656
|
-
trip_notes_2: stringOptional("Trip Notes 2", 0, 200),
|
|
657
|
-
trip_notes_3: stringOptional("Trip Notes 3", 0, 200),
|
|
658
|
-
status: enumMandatory("Status", Status, "Active" /* Active */)
|
|
800
|
+
var MasterVehicleDocumentFileSchema = BaseFileSchema.extend({
|
|
801
|
+
organisation_id: single_select_optional("UserOrganisation"),
|
|
802
|
+
// ✅ Single-Selection -> UserOrganisation
|
|
803
|
+
vehicle_document_id: single_select_optional("VehicleDocument")
|
|
804
|
+
// ✅ Single-Selection -> VehicleDocument
|
|
659
805
|
});
|
|
660
|
-
var
|
|
661
|
-
|
|
662
|
-
//
|
|
663
|
-
|
|
664
|
-
//
|
|
665
|
-
|
|
666
|
-
//
|
|
667
|
-
|
|
668
|
-
|
|
806
|
+
var VehicleDocumentSchema = z3.object({
|
|
807
|
+
organisation_id: single_select_mandatory("UserOrganisation"),
|
|
808
|
+
// ✅ Single-Selection -> UserOrganisation
|
|
809
|
+
vehicle_id: single_select_mandatory("MasterVehicle"),
|
|
810
|
+
// ✅ Single-Selection -> MasterVehicle
|
|
811
|
+
document_type_id: single_select_mandatory("MasterVehicleDocumentType"),
|
|
812
|
+
// ✅ Single-Selection -> MasterVehicleDocumentType
|
|
813
|
+
vendor_id: single_select_optional("FleetVendor"),
|
|
814
|
+
// ✅ Single-Selection -> FleetVendor
|
|
815
|
+
vehicle_document_code: stringOptional("vehicle Document Code", 0, 50),
|
|
816
|
+
document_number: stringOptional("vehicle Document Code", 0, 100),
|
|
817
|
+
document_authorized_name: stringOptional("vehicle Document Code", 0, 100),
|
|
818
|
+
document_cost: doubleOptional("Document Cost"),
|
|
819
|
+
document_issue_date: dateOptional("Document Issue Date"),
|
|
820
|
+
document_valid_till_date: dateOptional("Document Valid Till Date"),
|
|
821
|
+
document_renewal_date: dateOptional("Document Renewal Date"),
|
|
822
|
+
document_validity_status: enumMandatory(
|
|
823
|
+
"DocumentValidityStatus",
|
|
824
|
+
DocumentValidityStatus,
|
|
825
|
+
"Valid" /* Valid */
|
|
669
826
|
),
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
// Multi-selection -> OrganisationTag
|
|
675
|
-
organisation_color_ids: multi_select_optional("Organisation Color IDs"),
|
|
676
|
-
// Multi-selection -> OrganisationColor
|
|
677
|
-
vehicle_make_ids: multi_select_optional("Vehicle Make IDs", 100, []),
|
|
678
|
-
// Multi-selection -> MasterVehicleMake
|
|
679
|
-
vehicle_model_ids: multi_select_optional("Vehicle Model IDs", 100, []),
|
|
680
|
-
// Multi-selection -> MasterVehicleModel
|
|
681
|
-
vehicle_sub_model_ids: multi_select_optional("Vehicle Sub Model IDs"),
|
|
682
|
-
// Multi-selection -> MasterVehicleSubModel
|
|
683
|
-
vehicle_type_ids: multi_select_optional("Vehicle Type IDs", 100, []),
|
|
684
|
-
// Multi-selection -> MasterVehicleType
|
|
685
|
-
vehicle_status_type_ids: multi_select_optional("Vehicle Status Type IDs"),
|
|
686
|
-
// Multi-selection -> MasterVehicleStatusType
|
|
687
|
-
vehicle_ownership_type_ids: multi_select_optional(
|
|
688
|
-
"Vehicle Ownership Type IDs"
|
|
827
|
+
document_status: enumMandatory(
|
|
828
|
+
"DocumentStatus",
|
|
829
|
+
DocumentStatus,
|
|
830
|
+
"Active" /* Active */
|
|
689
831
|
),
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
832
|
+
document_details_1: stringOptional("Document Details 1", 0, 200),
|
|
833
|
+
document_details_2: stringOptional("Document Details 2", 0, 200),
|
|
834
|
+
document_details_3: stringOptional("Document Details 3", 0, 200),
|
|
835
|
+
document_details_4: stringOptional("Document Details 4", 0, 200),
|
|
836
|
+
document_notes: stringOptional("Document Notes", 0, 2e3),
|
|
837
|
+
status: enumMandatory("Status", Status, "Active" /* Active */),
|
|
838
|
+
MasterVehicleDocumentFileSchema: nestedArrayOfObjectsOptional(
|
|
839
|
+
"MasterVehicleDocumentFileSchema",
|
|
840
|
+
MasterVehicleDocumentFileSchema,
|
|
841
|
+
[]
|
|
842
|
+
)
|
|
843
|
+
});
|
|
844
|
+
var VehicleDocumentQuerySchema = BaseQuerySchema.extend({
|
|
845
|
+
organisation_ids: multi_select_optional("UserOrganisation"),
|
|
846
|
+
// ✅ Multi-Selection -> UserOrganisation
|
|
847
|
+
vehicle_ids: multi_select_optional("MasterVehicle"),
|
|
848
|
+
// ✅ Multi-Selection -> MasterVehicle
|
|
849
|
+
document_type_ids: multi_select_optional("MasterVehicleDocumentType"),
|
|
850
|
+
// ✅ Multi-Selection -> MasterVehicleDocumentType
|
|
851
|
+
vendor_ids: multi_select_optional("FleetVendor"),
|
|
852
|
+
// ✅ Multi-Selection -> FleetVendor
|
|
853
|
+
vehicle_document_ids: multi_select_optional("VehicleDocument")
|
|
854
|
+
// ✅ Multi-Selection -> VehicleDocument
|
|
855
|
+
});
|
|
856
|
+
var VehicleQuerySchema = BaseQuerySchema.extend({
|
|
857
|
+
organisation_ids: multi_select_optional("UserOrganisation"),
|
|
858
|
+
// ✅ Multi-Selection -> UserOrganisation
|
|
859
|
+
is_driver_assigned: enumArrayOptional(
|
|
696
860
|
"Is Device Installed",
|
|
697
861
|
YesNo,
|
|
698
862
|
getAllEnums(YesNo)
|
|
699
863
|
),
|
|
700
|
-
|
|
864
|
+
driver_ids: multi_select_optional("MasterDriver"),
|
|
865
|
+
// ✅ Multi-Selection -> MasterDriver
|
|
866
|
+
is_device_installed: enumArrayOptional(
|
|
701
867
|
"Is Device Installed",
|
|
702
868
|
YesNo,
|
|
703
869
|
getAllEnums(YesNo)
|
|
704
|
-
)
|
|
870
|
+
),
|
|
871
|
+
device_ids: multi_select_optional("MasterDevice"),
|
|
872
|
+
// ✅ Multi-Selection -> MasterDevice
|
|
873
|
+
organisation_sub_company_ids: multi_select_optional("OrganisationSubCompany"),
|
|
874
|
+
// ✅ Multi-Selection -> OrganisationSubCompany
|
|
875
|
+
organisation_branch_ids: multi_select_optional("OrganisationBranch"),
|
|
876
|
+
// ✅ Multi-Selection -> OrganisationBranch
|
|
877
|
+
organisation_tag_ids: multi_select_optional("OrganisationTag"),
|
|
878
|
+
// ✅ Multi-Selection -> OrganisationTag
|
|
879
|
+
organisation_color_ids: multi_select_optional("OrganisationColor"),
|
|
880
|
+
// ✅ Multi-Selection -> OrganisationColor
|
|
881
|
+
vehicle_type_ids: multi_select_optional("MasterVehicleType"),
|
|
882
|
+
// ✅ Multi-Selection -> MasterVehicleType
|
|
883
|
+
vehicle_make_ids: multi_select_optional("MasterVehicleMake"),
|
|
884
|
+
// ✅ Multi-Selection -> MasterVehicleMake
|
|
885
|
+
vehicle_model_ids: multi_select_optional("MasterVehicleModel"),
|
|
886
|
+
// ✅ Multi-Selection -> MasterVehicleModel
|
|
887
|
+
vehicle_sub_model_ids: multi_select_optional("MasterVehicleSubModel"),
|
|
888
|
+
// ✅ Multi-Selection -> MasterVehicleSubModel
|
|
889
|
+
vehicle_status_type_ids: multi_select_optional("MasterVehicleStatusType"),
|
|
890
|
+
// ✅ Multi-Selection -> MasterVehicleStatusType
|
|
891
|
+
vehicle_ownership_type_ids: multi_select_optional(
|
|
892
|
+
"MasterVehicleOwnershipType"
|
|
893
|
+
),
|
|
894
|
+
// ✅ Multi-Selection -> MasterVehicleOwnershipType
|
|
895
|
+
vehicle_associated_to_ids: multi_select_optional("MasterVehicleAssociatedTo"),
|
|
896
|
+
// ✅ Multi-Selection -> MasterVehicleAssociatedTo
|
|
897
|
+
vehicle_fuel_type_ids: multi_select_optional("MasterVehicleFuelType"),
|
|
898
|
+
// ✅ Multi-Selection -> MasterVehicleFuelType
|
|
899
|
+
vehicle_fuel_unit_ids: multi_select_optional("MasterVehicleFuelUnit"),
|
|
900
|
+
// ✅ Multi-Selection -> MasterVehicleFuelUnit
|
|
901
|
+
vehicle_ids: multi_select_optional("MasterVehicle")
|
|
902
|
+
// ✅ Multi-Selection -> MasterVehicle
|
|
903
|
+
});
|
|
904
|
+
var SimpleFindQuerySchema = BaseQuerySchema.extend({
|
|
905
|
+
organisation_id: single_select_mandatory("UserOrganisation")
|
|
906
|
+
// ✅ Single-Selection -> UserOrganisation
|
|
705
907
|
});
|
|
706
908
|
var VehicleGPSQuerySchema = BaseQuerySchema.extend({
|
|
707
|
-
organisation_id: single_select_mandatory("
|
|
708
|
-
// Single
|
|
709
|
-
vehicle_id: single_select_mandatory("
|
|
710
|
-
// Single-selection ->
|
|
909
|
+
organisation_id: single_select_mandatory("UserOrganisation"),
|
|
910
|
+
// ✅ Single-Selection -> UserOrganisation
|
|
911
|
+
vehicle_id: single_select_mandatory("MasterVehicle")
|
|
912
|
+
// Single-selection -> MasterVehicle
|
|
711
913
|
});
|
|
712
914
|
var toVehiclePayload = (vehicle) => ({
|
|
713
915
|
organisation_id: vehicle.organisation_id,
|
|
@@ -717,16 +919,11 @@ var toVehiclePayload = (vehicle) => ({
|
|
|
717
919
|
engine_number: vehicle.engine_number || "",
|
|
718
920
|
chassis_number: vehicle.chassis_number || "",
|
|
719
921
|
vehicle_make_year: vehicle.vehicle_make_year || 0,
|
|
720
|
-
|
|
721
|
-
vehicle_front_image_key: vehicle.vehicle_front_image_key || "",
|
|
722
|
-
vehicle_plate_image_url: vehicle.vehicle_plate_image_url || "",
|
|
723
|
-
vehicle_plate_image_key: vehicle.vehicle_plate_image_key || "",
|
|
724
|
-
vehicle_full_image_url: vehicle.vehicle_full_image_url || "",
|
|
725
|
-
vehicle_full_image_key: vehicle.vehicle_full_image_key || "",
|
|
726
|
-
status: vehicle.status,
|
|
922
|
+
// Admin Account Details
|
|
727
923
|
is_fleet_active: vehicle.is_fleet_active,
|
|
728
924
|
is_gps_active: vehicle.is_gps_active,
|
|
729
925
|
is_trip_active: vehicle.is_trip_active,
|
|
926
|
+
status: vehicle.status,
|
|
730
927
|
organisation_sub_company_id: vehicle.organisation_sub_company_id || "",
|
|
731
928
|
organisation_branch_id: vehicle.organisation_branch_id || "",
|
|
732
929
|
organisation_tag_id: vehicle.organisation_tag_id || "",
|
|
@@ -745,7 +942,8 @@ var toVehiclePayload = (vehicle) => ({
|
|
|
745
942
|
secondary_vehicle_fuel_unit_id: vehicle.secondary_vehicle_fuel_unit_id || "",
|
|
746
943
|
vehicle_total_fuel_quantity: vehicle.vehicle_total_fuel_quantity || 0,
|
|
747
944
|
vehicle_tank_1_fuel_quantity: vehicle.vehicle_tank_1_fuel_quantity || 0,
|
|
748
|
-
vehicle_tank_2_fuel_quantity: vehicle.vehicle_tank_2_fuel_quantity || 0
|
|
945
|
+
vehicle_tank_2_fuel_quantity: vehicle.vehicle_tank_2_fuel_quantity || 0,
|
|
946
|
+
MasterVehicleFileSchema: []
|
|
749
947
|
});
|
|
750
948
|
var newVehiclePayload = () => ({
|
|
751
949
|
organisation_id: "",
|
|
@@ -755,12 +953,6 @@ var newVehiclePayload = () => ({
|
|
|
755
953
|
engine_number: "",
|
|
756
954
|
chassis_number: "",
|
|
757
955
|
vehicle_make_year: 0,
|
|
758
|
-
vehicle_front_image_url: "",
|
|
759
|
-
vehicle_front_image_key: "",
|
|
760
|
-
vehicle_plate_image_url: "",
|
|
761
|
-
vehicle_plate_image_key: "",
|
|
762
|
-
vehicle_full_image_url: "",
|
|
763
|
-
vehicle_full_image_key: "",
|
|
764
956
|
status: "Active" /* Active */,
|
|
765
957
|
is_fleet_active: "Yes" /* Yes */,
|
|
766
958
|
is_gps_active: "No" /* No */,
|
|
@@ -783,7 +975,8 @@ var newVehiclePayload = () => ({
|
|
|
783
975
|
secondary_vehicle_fuel_unit_id: "",
|
|
784
976
|
vehicle_total_fuel_quantity: 0,
|
|
785
977
|
vehicle_tank_1_fuel_quantity: 0,
|
|
786
|
-
vehicle_tank_2_fuel_quantity: 0
|
|
978
|
+
vehicle_tank_2_fuel_quantity: 0,
|
|
979
|
+
MasterVehicleFileSchema: []
|
|
787
980
|
});
|
|
788
981
|
var toVehicleDetailsGPSPayload = (vehicleGPS) => ({
|
|
789
982
|
temperature: vehicleGPS?.temperature ?? "No" /* No */,
|
|
@@ -800,7 +993,22 @@ var toVehicleDetailsGPSPayload = (vehicleGPS) => ({
|
|
|
800
993
|
is_rear_cam: vehicleGPS?.is_rear_cam ?? "No" /* No */,
|
|
801
994
|
is_front_cam: vehicleGPS?.is_front_cam ?? "No" /* No */,
|
|
802
995
|
camera_extra_count: vehicleGPS?.camera_extra_count ?? 0,
|
|
803
|
-
status: vehicleGPS ? vehicleGPS?.status : "Active" /* Active
|
|
996
|
+
status: vehicleGPS ? vehicleGPS?.status : "Active" /* Active */,
|
|
997
|
+
vehicle_details_gps_id: "",
|
|
998
|
+
added_date_time: "",
|
|
999
|
+
modified_date_time: ""
|
|
1000
|
+
});
|
|
1001
|
+
var toVehicleDetailsTripPayload = (trip) => ({
|
|
1002
|
+
trip_name: trip?.trip_name || "",
|
|
1003
|
+
trip_no: trip?.trip_no || "",
|
|
1004
|
+
eway_bill_number: trip?.eway_bill_number || "",
|
|
1005
|
+
route_name: trip?.route_name || "",
|
|
1006
|
+
trip_start_date: trip?.trip_start_date || "",
|
|
1007
|
+
trip_end_date: trip?.trip_end_date || "",
|
|
1008
|
+
trip_notes_1: trip?.trip_notes_1 || "",
|
|
1009
|
+
trip_notes_2: trip?.trip_notes_2 || "",
|
|
1010
|
+
trip_notes_3: trip?.trip_notes_3 || "",
|
|
1011
|
+
status: trip ? trip.status : "Active" /* Active */
|
|
804
1012
|
});
|
|
805
1013
|
var toVehicleDetailsBodyPayload = (vehicleBody) => ({
|
|
806
1014
|
vehicle_body_details: vehicleBody?.vehicle_body_details || "",
|
|
@@ -810,10 +1018,69 @@ var toVehicleDetailsBodyPayload = (vehicleBody) => ({
|
|
|
810
1018
|
vehicle_passenger_capacity: vehicleBody?.vehicle_passenger_capacity || 0,
|
|
811
1019
|
vehicle_cargo_volume: vehicleBody?.vehicle_cargo_volume || 0,
|
|
812
1020
|
vehicle_maximum_weight_capacity: vehicleBody?.vehicle_maximum_weight_capacity || 0,
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
1021
|
+
status: vehicleBody ? vehicleBody?.status : "Active" /* Active */,
|
|
1022
|
+
number_of_doors: 0,
|
|
1023
|
+
standing_passenger_capacity: 0,
|
|
1024
|
+
seat_configuration: "",
|
|
1025
|
+
has_air_conditioning: "Yes" /* Yes */,
|
|
1026
|
+
has_heating_system: "Yes" /* Yes */,
|
|
1027
|
+
has_reclining_seats: "Yes" /* Yes */,
|
|
1028
|
+
has_safety_belts: "Yes" /* Yes */,
|
|
1029
|
+
has_headrests: "Yes" /* Yes */,
|
|
1030
|
+
has_armrests: "Yes" /* Yes */,
|
|
1031
|
+
has_infotainment_system: "Yes" /* Yes */,
|
|
1032
|
+
infotainment_type: "",
|
|
1033
|
+
has_individual_lighting: "Yes" /* Yes */,
|
|
1034
|
+
has_overhead_luggage_storage: "Yes" /* Yes */,
|
|
1035
|
+
wheelchair_accessible: "Yes" /* Yes */,
|
|
1036
|
+
cargo_area_type: "",
|
|
1037
|
+
has_lift_gate: "Yes" /* Yes */,
|
|
1038
|
+
has_refrigeration_unit: "Yes" /* Yes */,
|
|
1039
|
+
refrigeration_temperature_range: "",
|
|
1040
|
+
cargo_floor_material: "",
|
|
1041
|
+
has_side_doors: "Yes" /* Yes */,
|
|
1042
|
+
has_roof_hatch: "Yes" /* Yes */,
|
|
1043
|
+
cargo_tie_down_hooks_count: 0,
|
|
1044
|
+
is_custom_body_built: "Yes" /* Yes */,
|
|
1045
|
+
number_of_axles: 0,
|
|
1046
|
+
axle_configuration: "",
|
|
1047
|
+
has_dual_rear_wheels: "Yes" /* Yes */,
|
|
1048
|
+
suspension_type: "",
|
|
1049
|
+
suspension_adjustability: "Yes" /* Yes */,
|
|
1050
|
+
tire_size: "",
|
|
1051
|
+
has_spare_tire: "Yes" /* Yes */,
|
|
1052
|
+
has_all_terrain_tires: "Yes" /* Yes */,
|
|
1053
|
+
has_run_flat_tires: "Yes" /* Yes */,
|
|
1054
|
+
steering_type: "Manual" /* Manual */,
|
|
1055
|
+
wheel_drive_type: "FWD" /* FWD */,
|
|
1056
|
+
has_abs: "Yes" /* Yes */,
|
|
1057
|
+
has_airbags: "Yes" /* Yes */,
|
|
1058
|
+
has_speed_limiter: "Yes" /* Yes */,
|
|
1059
|
+
has_gps_tracker: "Yes" /* Yes */,
|
|
1060
|
+
has_parking_sensors: "Yes" /* Yes */,
|
|
1061
|
+
has_rear_camera: "Yes" /* Yes */,
|
|
1062
|
+
has_lane_assist: "Yes" /* Yes */,
|
|
1063
|
+
has_automatic_emergency_brake: "Yes" /* Yes */,
|
|
1064
|
+
has_tire_pressure_monitoring: "Yes" /* Yes */,
|
|
1065
|
+
has_blind_spot_monitoring: "Yes" /* Yes */,
|
|
1066
|
+
has_collision_warning_system: "Yes" /* Yes */,
|
|
1067
|
+
has_immobilizer: "Yes" /* Yes */,
|
|
1068
|
+
has_dashcam: "Yes" /* Yes */,
|
|
1069
|
+
has_emergency_exit: "Yes" /* Yes */
|
|
1070
|
+
});
|
|
1071
|
+
var toVehicleDetailLifeCyclePayload = (vehicleLifeCycle) => ({
|
|
1072
|
+
service_start_date: vehicleLifeCycle?.service_start_date || "",
|
|
1073
|
+
service_start_odometer_reading: vehicleLifeCycle?.service_start_odometer_reading || 0,
|
|
1074
|
+
service_end_date: vehicleLifeCycle?.service_end_date || "",
|
|
1075
|
+
service_end_odometer_reading: vehicleLifeCycle?.service_end_odometer_reading || 0,
|
|
1076
|
+
life_estimate_max_month_year: vehicleLifeCycle?.life_estimate_max_month_year || "",
|
|
1077
|
+
life_estimate_max_odometer_reading: vehicleLifeCycle?.life_estimate_max_odometer_reading || 0,
|
|
1078
|
+
life_expiry: vehicleLifeCycle?.life_expiry || "No" /* No */,
|
|
1079
|
+
life_expiry_message: vehicleLifeCycle?.life_expiry_message || "",
|
|
1080
|
+
life_expiry_note: vehicleLifeCycle?.life_expiry_note || "",
|
|
1081
|
+
status: vehicleLifeCycle ? vehicleLifeCycle.status : "Active" /* Active */,
|
|
1082
|
+
is_extended_life_approved: "Yes" /* Yes */,
|
|
1083
|
+
life_status: "Active" /* Active */
|
|
817
1084
|
});
|
|
818
1085
|
var toVehicleDetailPurchasePayload = (vehiclePurchase) => ({
|
|
819
1086
|
purchase_date: vehiclePurchase?.purchase_date || "",
|
|
@@ -840,170 +1107,158 @@ var toVehicleDetailPurchasePayload = (vehiclePurchase) => ({
|
|
|
840
1107
|
warranty_expiration_date: vehiclePurchase?.warranty_expiration_date || "",
|
|
841
1108
|
warranty_max_odometer_reading: vehiclePurchase?.warranty_max_odometer_reading || 0,
|
|
842
1109
|
warranty_exchange_date: vehiclePurchase?.warranty_exchange_date || "",
|
|
843
|
-
status: vehiclePurchase ? vehiclePurchase.status : "Active" /* Active
|
|
844
|
-
|
|
845
|
-
var toVehicleDetailLifeCyclePayload = (vehicleLifeCycle) => ({
|
|
846
|
-
service_start_date: vehicleLifeCycle?.service_start_date || "",
|
|
847
|
-
service_start_odometer_reading: vehicleLifeCycle?.service_start_odometer_reading || 0,
|
|
848
|
-
service_end_date: vehicleLifeCycle?.service_end_date || "",
|
|
849
|
-
service_end_odometer_reading: vehicleLifeCycle?.service_end_odometer_reading || 0,
|
|
850
|
-
life_estimate_max_month_year: vehicleLifeCycle?.life_estimate_max_month_year || "",
|
|
851
|
-
life_estimate_max_odometer_reading: vehicleLifeCycle?.life_estimate_max_odometer_reading || 0,
|
|
852
|
-
life_expiry: vehicleLifeCycle?.life_expiry || "No" /* No */,
|
|
853
|
-
life_expiry_message: vehicleLifeCycle?.life_expiry_message || "",
|
|
854
|
-
life_expiry_note: vehicleLifeCycle?.life_expiry_note || "",
|
|
855
|
-
status: vehicleLifeCycle ? vehicleLifeCycle.status : "Active" /* Active */
|
|
1110
|
+
status: vehiclePurchase ? vehiclePurchase.status : "Active" /* Active */,
|
|
1111
|
+
loan_interest_type: "Simple" /* Simple */
|
|
856
1112
|
});
|
|
1113
|
+
var get_vehicle_presigned_url = async (fileName) => {
|
|
1114
|
+
return apiGet(ENDPOINTS.vehicle_presigned_url(fileName));
|
|
1115
|
+
};
|
|
1116
|
+
var get_device_presigned_url = async (fileName) => {
|
|
1117
|
+
return apiGet(ENDPOINTS.device_presigned_url(fileName));
|
|
1118
|
+
};
|
|
1119
|
+
var get_master_driver_presigned_url_file = async (data) => {
|
|
1120
|
+
return apiPost(ENDPOINTS.vehicle_file_presigned_url, data);
|
|
1121
|
+
};
|
|
857
1122
|
var findVehicles = async (payload) => {
|
|
858
|
-
return apiPost(
|
|
859
|
-
ENDPOINTS.FIND,
|
|
860
|
-
payload
|
|
861
|
-
);
|
|
1123
|
+
return apiPost(ENDPOINTS.find, payload);
|
|
862
1124
|
};
|
|
863
1125
|
var findVehiclesLiveDashboard = async (payload) => {
|
|
864
|
-
return apiPost(
|
|
865
|
-
ENDPOINTS.FIND_LIVE_DASHBOARD,
|
|
866
|
-
payload
|
|
867
|
-
);
|
|
1126
|
+
return apiPost(ENDPOINTS.find_live_dashboard, payload);
|
|
868
1127
|
};
|
|
869
1128
|
var findVehicleGPSDetails = async (payload) => {
|
|
870
|
-
return apiPost(
|
|
871
|
-
ENDPOINTS.FIND_GPS_DETAILS,
|
|
872
|
-
payload
|
|
873
|
-
);
|
|
1129
|
+
return apiPost(ENDPOINTS.find_gps_details, payload);
|
|
874
1130
|
};
|
|
875
1131
|
var createVehicle = async (payload) => {
|
|
876
|
-
return apiPost(ENDPOINTS.
|
|
1132
|
+
return apiPost(ENDPOINTS.create, payload);
|
|
877
1133
|
};
|
|
878
1134
|
var updateVehicle = async (id, payload) => {
|
|
879
|
-
return apiPatch(
|
|
880
|
-
ENDPOINTS.UPDATE.replace(":id", id),
|
|
881
|
-
payload
|
|
882
|
-
);
|
|
1135
|
+
return apiPatch(ENDPOINTS.update.replace(":id", id), payload);
|
|
883
1136
|
};
|
|
884
1137
|
var deleteVehicle = async (id) => {
|
|
885
|
-
return apiDelete(ENDPOINTS.
|
|
1138
|
+
return apiDelete(ENDPOINTS.delete.replace(":id", id));
|
|
1139
|
+
};
|
|
1140
|
+
var updateDetailsGpsSensor = async (id, payload) => {
|
|
1141
|
+
return apiPatch(ENDPOINTS.update_details_gps_sensor.replace(":id", id), payload);
|
|
1142
|
+
};
|
|
1143
|
+
var updateDetailsTrip = async (id, payload) => {
|
|
1144
|
+
return apiPatch(ENDPOINTS.update_details_trip.replace(":id", id), payload);
|
|
886
1145
|
};
|
|
887
1146
|
var updateVehicleBodyDetails = async (id, payload) => {
|
|
888
|
-
return apiPatch(
|
|
889
|
-
ENDPOINTS.BODY_DETAILS_UPDATE.replace(":id", id),
|
|
890
|
-
payload
|
|
891
|
-
);
|
|
1147
|
+
return apiPatch(ENDPOINTS.update_details_body.replace(":id", id), payload);
|
|
892
1148
|
};
|
|
893
1149
|
var updateVehicleLifeCycleDetails = async (id, payload) => {
|
|
894
|
-
return apiPatch(
|
|
895
|
-
ENDPOINTS.LIFE_CYCLE_DETAILS_UPDATE.replace(":id", id),
|
|
896
|
-
payload
|
|
897
|
-
);
|
|
1150
|
+
return apiPatch(ENDPOINTS.update_details_life_cycle.replace(":id", id), payload);
|
|
898
1151
|
};
|
|
899
1152
|
var updateVehiclePurchaseDetails = async (id, payload) => {
|
|
900
|
-
return apiPatch(
|
|
901
|
-
ENDPOINTS.PURCHASE_DETAILS_UPDATE.replace(":id", id),
|
|
902
|
-
payload
|
|
903
|
-
);
|
|
904
|
-
};
|
|
905
|
-
var updateVehicleGPSDetailsMain = async (id, payload) => {
|
|
906
|
-
return apiPatch(
|
|
907
|
-
ENDPOINTS.GPS_DETAILS_MAIN_UPDATE.replace(":id", id),
|
|
908
|
-
payload
|
|
909
|
-
);
|
|
910
|
-
};
|
|
911
|
-
var updateVehicleGPSDetailsData = async (id, payload) => {
|
|
912
|
-
return apiPatch(
|
|
913
|
-
ENDPOINTS.GPS_DETAILS_DATA_UPDATE.replace(":id", id),
|
|
914
|
-
payload
|
|
915
|
-
);
|
|
916
|
-
};
|
|
917
|
-
var updateVehicleGPSDetailsAnalytics = async (id, payload) => {
|
|
918
|
-
return apiPatch(
|
|
919
|
-
ENDPOINTS.GPS_DETAILS_ANALYTICS_UPDATE.replace(":id", id),
|
|
920
|
-
payload
|
|
921
|
-
);
|
|
922
|
-
};
|
|
923
|
-
var updateVehicleTripDetails = async (id, payload) => {
|
|
924
|
-
return apiPatch(
|
|
925
|
-
ENDPOINTS.TRIP_DETAILS_UPDATE.replace(":id", id),
|
|
926
|
-
payload
|
|
927
|
-
);
|
|
1153
|
+
return apiPatch(ENDPOINTS.update_details_purchase.replace(":id", id), payload);
|
|
928
1154
|
};
|
|
929
1155
|
var linkDriverToVehicle = async (payload) => {
|
|
930
|
-
return apiPost(ENDPOINTS.
|
|
1156
|
+
return apiPost(ENDPOINTS.vehicle_driver_link, payload);
|
|
931
1157
|
};
|
|
932
1158
|
var unlinkDriverFromVehicle = async (payload) => {
|
|
933
|
-
return apiPost(ENDPOINTS.
|
|
1159
|
+
return apiPost(ENDPOINTS.vehicle_driver_unlink, payload);
|
|
934
1160
|
};
|
|
935
1161
|
var getDriverLinkHistoryByVehicle = async (id, params) => {
|
|
936
|
-
return apiGet(
|
|
937
|
-
ENDPOINTS.DRIVER_LINK_HISTORY_BY_VEHICLE.replace(":id", id),
|
|
938
|
-
params
|
|
939
|
-
);
|
|
1162
|
+
return apiGet(ENDPOINTS.find_vehicle_driver_link_history_by_vehicle.replace(":id", id), params);
|
|
940
1163
|
};
|
|
941
1164
|
var getDriverLinkHistoryByDriver = async (id, params) => {
|
|
942
|
-
return apiGet(
|
|
943
|
-
ENDPOINTS.DRIVER_LINK_HISTORY_BY_DRIVER.replace(":id", id),
|
|
944
|
-
params
|
|
945
|
-
);
|
|
1165
|
+
return apiGet(ENDPOINTS.find_vehicle_driver_link_history_by_driver.replace(":id", id), params);
|
|
946
1166
|
};
|
|
947
1167
|
var linkDeviceToVehicle = async (payload) => {
|
|
948
|
-
return apiPost(ENDPOINTS.
|
|
1168
|
+
return apiPost(ENDPOINTS.vehicle_device_link, payload);
|
|
949
1169
|
};
|
|
950
1170
|
var unlinkDeviceFromVehicle = async (payload) => {
|
|
951
|
-
return apiPost(ENDPOINTS.
|
|
1171
|
+
return apiPost(ENDPOINTS.vehicle_device_unlink, payload);
|
|
952
1172
|
};
|
|
953
1173
|
var getDeviceLinkHistoryByVehicle = async (id, params) => {
|
|
954
|
-
return apiGet(
|
|
955
|
-
ENDPOINTS.DEVICE_LINK_HISTORY_BY_VEHICLE.replace(":id", id),
|
|
956
|
-
params
|
|
957
|
-
);
|
|
1174
|
+
return apiGet(ENDPOINTS.vehicle_device_link_history_by_vehicle.replace(":id", id), params);
|
|
958
1175
|
};
|
|
959
1176
|
var getDeviceLinkHistoryByDevice = async (id, params) => {
|
|
960
|
-
return apiGet(
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
);
|
|
1177
|
+
return apiGet(ENDPOINTS.vehicle_device_link_history_by_device.replace(":id", id), params);
|
|
1178
|
+
};
|
|
1179
|
+
var createDocument = async (payload) => {
|
|
1180
|
+
return apiPost(ENDPOINTS.create_document, payload);
|
|
1181
|
+
};
|
|
1182
|
+
var findDocument = async (payload) => {
|
|
1183
|
+
return apiPost(ENDPOINTS.find_document, payload);
|
|
1184
|
+
};
|
|
1185
|
+
var updateDocument = async (id, payload) => {
|
|
1186
|
+
return apiPatch(ENDPOINTS.update_document.replace(":id", id), payload);
|
|
1187
|
+
};
|
|
1188
|
+
var removeDocument = async (id) => {
|
|
1189
|
+
return apiDelete(ENDPOINTS.remove_document.replace(":id", id));
|
|
1190
|
+
};
|
|
1191
|
+
var createFileVehicle = async (payload) => {
|
|
1192
|
+
return apiPost(ENDPOINTS.create_file_vehicle, payload);
|
|
1193
|
+
};
|
|
1194
|
+
var removeFileVehicle = async (id) => {
|
|
1195
|
+
return apiDelete(ENDPOINTS.remove_file_vehicle.replace(":id", id));
|
|
1196
|
+
};
|
|
1197
|
+
var createFileDevice = async (payload) => {
|
|
1198
|
+
return apiPost(ENDPOINTS.create_file_device, payload);
|
|
1199
|
+
};
|
|
1200
|
+
var removeFileDevice = async (id) => {
|
|
1201
|
+
return apiDelete(ENDPOINTS.remove_file_device.replace(":id", id));
|
|
1202
|
+
};
|
|
1203
|
+
var createFileVehicleDocument = async (payload) => {
|
|
1204
|
+
return apiPost(ENDPOINTS.create_file_vehicle_document, payload);
|
|
1205
|
+
};
|
|
1206
|
+
var removeFileVehicleDocument = async (id) => {
|
|
1207
|
+
return apiDelete(ENDPOINTS.remove_file_vehicle_document.replace(":id", id));
|
|
964
1208
|
};
|
|
965
1209
|
var getVehicleCache = async (organisationId) => {
|
|
966
|
-
return apiGet(
|
|
967
|
-
ENDPOINTS.cache.replace(":organisation_id", organisationId)
|
|
968
|
-
);
|
|
1210
|
+
return apiGet(ENDPOINTS.find_cache.replace(":organisation_id", organisationId));
|
|
969
1211
|
};
|
|
970
1212
|
var getVehicleSimpleCache = async (organisationId) => {
|
|
971
|
-
return apiGet(
|
|
972
|
-
|
|
973
|
-
|
|
1213
|
+
return apiGet(ENDPOINTS.find_cache_simple.replace(":organisation_id", organisationId));
|
|
1214
|
+
};
|
|
1215
|
+
var getVehicleParentCache = async (organisationId) => {
|
|
1216
|
+
return apiGet(ENDPOINTS.find_cache_parent.replace(":organisation_id", organisationId));
|
|
974
1217
|
};
|
|
975
1218
|
var getVehicleSimpleDropdownCustom = async (organisationId) => {
|
|
976
|
-
return apiGet(
|
|
977
|
-
ENDPOINTS.cache_dropdown.replace(":organisation_id", organisationId)
|
|
978
|
-
);
|
|
1219
|
+
return apiGet(ENDPOINTS.find_cache_dropdown.replace(":organisation_id", organisationId));
|
|
979
1220
|
};
|
|
980
1221
|
var getVehicleSimpleDropdownCacheLiveData = async (organisationId) => {
|
|
981
|
-
return apiGet(
|
|
982
|
-
ENDPOINTS.cache_dropdown_live_data.replace(":organisation_id", organisationId)
|
|
983
|
-
);
|
|
1222
|
+
return apiGet(ENDPOINTS.find_cache_dropdown_live_data.replace(":organisation_id", organisationId));
|
|
984
1223
|
};
|
|
985
|
-
var
|
|
986
|
-
return apiGet(
|
|
987
|
-
|
|
988
|
-
|
|
1224
|
+
var getVehicleByUserCache = async (userId) => {
|
|
1225
|
+
return apiGet(ENDPOINTS.find_cache_by_user.replace(":user_id", userId));
|
|
1226
|
+
};
|
|
1227
|
+
var getVehicleSimpleByUserCache = async (userId) => {
|
|
1228
|
+
return apiGet(ENDPOINTS.find_cache_simple_by_user.replace(":user_id", userId));
|
|
1229
|
+
};
|
|
1230
|
+
var getVehicleParentByUserCache = async (userId) => {
|
|
1231
|
+
return apiGet(ENDPOINTS.find_cache_parent_by_user.replace(":user_id", userId));
|
|
1232
|
+
};
|
|
1233
|
+
var getVehicleSimpleDropdownByUserCustom = async (userId) => {
|
|
1234
|
+
return apiGet(ENDPOINTS.find_cache_dropdown_by_user.replace(":user_id", userId));
|
|
989
1235
|
};
|
|
990
1236
|
export {
|
|
1237
|
+
MasterDeviceFileSchema,
|
|
1238
|
+
MasterVehicleDocumentFileSchema,
|
|
1239
|
+
MasterVehicleFileSchema,
|
|
991
1240
|
SimpleFindQuerySchema,
|
|
1241
|
+
VehicleBulkSchema,
|
|
992
1242
|
VehicleDetailBodySchema,
|
|
993
|
-
|
|
994
|
-
VehicleDetailGPSDataSchema,
|
|
995
|
-
VehicleDetailGPSMainSchema,
|
|
1243
|
+
VehicleDetailGPSSensorSchema,
|
|
996
1244
|
VehicleDetailLifeCycleSchema,
|
|
997
1245
|
VehicleDetailPurchaseSchema,
|
|
998
1246
|
VehicleDetailTripSchema,
|
|
999
1247
|
VehicleDeviceLinkSchema,
|
|
1000
1248
|
VehicleDeviceUnlinkSchema,
|
|
1249
|
+
VehicleDocumentQuerySchema,
|
|
1250
|
+
VehicleDocumentSchema,
|
|
1001
1251
|
VehicleDriverLinkSchema,
|
|
1002
1252
|
VehicleGPSQuerySchema,
|
|
1003
1253
|
VehicleQuerySchema,
|
|
1004
1254
|
VehicleSchema,
|
|
1255
|
+
createDocument,
|
|
1256
|
+
createFileDevice,
|
|
1257
|
+
createFileVehicle,
|
|
1258
|
+
createFileVehicleDocument,
|
|
1005
1259
|
createVehicle,
|
|
1006
1260
|
deleteVehicle,
|
|
1261
|
+
findDocument,
|
|
1007
1262
|
findVehicleGPSDetails,
|
|
1008
1263
|
findVehicles,
|
|
1009
1264
|
findVehiclesLiveDashboard,
|
|
@@ -1011,27 +1266,38 @@ export {
|
|
|
1011
1266
|
getDeviceLinkHistoryByVehicle,
|
|
1012
1267
|
getDriverLinkHistoryByDriver,
|
|
1013
1268
|
getDriverLinkHistoryByVehicle,
|
|
1269
|
+
getVehicleByUserCache,
|
|
1014
1270
|
getVehicleCache,
|
|
1271
|
+
getVehicleParentByUserCache,
|
|
1015
1272
|
getVehicleParentCache,
|
|
1273
|
+
getVehicleSimpleByUserCache,
|
|
1016
1274
|
getVehicleSimpleCache,
|
|
1275
|
+
getVehicleSimpleDropdownByUserCustom,
|
|
1017
1276
|
getVehicleSimpleDropdownCacheLiveData,
|
|
1018
1277
|
getVehicleSimpleDropdownCustom,
|
|
1278
|
+
get_device_presigned_url,
|
|
1279
|
+
get_master_driver_presigned_url_file,
|
|
1280
|
+
get_vehicle_presigned_url,
|
|
1019
1281
|
linkDeviceToVehicle,
|
|
1020
1282
|
linkDriverToVehicle,
|
|
1021
1283
|
newVehiclePayload,
|
|
1284
|
+
removeDocument,
|
|
1285
|
+
removeFileDevice,
|
|
1286
|
+
removeFileVehicle,
|
|
1287
|
+
removeFileVehicleDocument,
|
|
1022
1288
|
toVehicleDetailLifeCyclePayload,
|
|
1023
1289
|
toVehicleDetailPurchasePayload,
|
|
1024
1290
|
toVehicleDetailsBodyPayload,
|
|
1025
1291
|
toVehicleDetailsGPSPayload,
|
|
1292
|
+
toVehicleDetailsTripPayload,
|
|
1026
1293
|
toVehiclePayload,
|
|
1027
1294
|
unlinkDeviceFromVehicle,
|
|
1028
1295
|
unlinkDriverFromVehicle,
|
|
1296
|
+
updateDetailsGpsSensor,
|
|
1297
|
+
updateDetailsTrip,
|
|
1298
|
+
updateDocument,
|
|
1029
1299
|
updateVehicle,
|
|
1030
1300
|
updateVehicleBodyDetails,
|
|
1031
|
-
updateVehicleGPSDetailsAnalytics,
|
|
1032
|
-
updateVehicleGPSDetailsData,
|
|
1033
|
-
updateVehicleGPSDetailsMain,
|
|
1034
1301
|
updateVehicleLifeCycleDetails,
|
|
1035
|
-
updateVehiclePurchaseDetails
|
|
1036
|
-
updateVehicleTripDetails
|
|
1302
|
+
updateVehiclePurchaseDetails
|
|
1037
1303
|
};
|