vms-nest-prisma-api-document 196.0.0 → 199.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/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 +7 -7
- package/dist/services/fleet/fuel_management/fleet_fuel_removal_service.d.ts +3 -3
- 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 +10 -1
- package/dist/services/main/users/auth_service.js +6 -3
- 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 +640 -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 +6 -6
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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_eway_bill_provider_service.d.ts +2 -2
- package/dist/services/master/main/master_main_fasttag_bank_service.d.ts +2 -2
- 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 +1 -1
- 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 +3 -3
- package/dist/services/master/tyre/master_tyre_make_service.d.ts +1 -1
- package/dist/services/master/tyre/master_tyre_model_service.d.ts +3 -3
- 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-Bbr1S3XY.d.ts → user_organisation_service-D0C-0xuK.d.ts} +985 -485
- 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,26 @@ 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
|
-
vehicle_id: single_select_mandatory("
|
|
464
|
-
// Single
|
|
465
|
-
device_id: single_select_mandatory("
|
|
466
|
-
// Single
|
|
552
|
+
vehicle_id: single_select_mandatory("MasterVehicle"),
|
|
553
|
+
// ✅ Single-Selection -> MasterVehicle
|
|
554
|
+
device_id: single_select_mandatory("MasterDevice")
|
|
555
|
+
// ✅ Single-Selection -> MasterDevice
|
|
467
556
|
});
|
|
468
557
|
var VehicleDriverLinkSchema = z3.object({
|
|
469
|
-
|
|
470
|
-
// Single
|
|
471
|
-
|
|
472
|
-
// Single
|
|
473
|
-
driver_id: single_select_mandatory("Driver ID")
|
|
474
|
-
// Single selection -> MasterDriver
|
|
475
|
-
});
|
|
476
|
-
var SimpleFindQuerySchema = BaseQuerySchema.extend({
|
|
477
|
-
organisation_id: single_select_mandatory("Organisation ID")
|
|
478
|
-
// Single selection -> UserOrganisation
|
|
558
|
+
vehicle_id: single_select_mandatory("MasterVehicle"),
|
|
559
|
+
// ✅ Single-Selection -> MasterVehicle
|
|
560
|
+
driver_id: single_select_mandatory("MasterDriver")
|
|
561
|
+
// ✅ Single-Selection -> MasterDriver
|
|
479
562
|
});
|
|
480
|
-
var
|
|
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 */)
|
|
497
|
-
});
|
|
498
|
-
var VehicleDetailGPSMainSchema = z3.object({
|
|
563
|
+
var VehicleDetailGPSSensorSchema = z3.object({
|
|
499
564
|
temperature: enumOptional("Temperature", YesNo, "No" /* No */),
|
|
500
565
|
duel_temperature: enumOptional("Dual Temperature", YesNo, "No" /* No */),
|
|
501
566
|
fuel: enumOptional("Fuel", YesNo, "No" /* No */),
|
|
@@ -509,125 +574,205 @@ var VehicleDetailGPSMainSchema = z3.object({
|
|
|
509
574
|
dashcam_sensor: enumOptional("Dashcam Sensor", YesNo, "No" /* No */),
|
|
510
575
|
is_rear_cam: enumOptional("Is Rear Cam", YesNo, "No" /* No */),
|
|
511
576
|
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 */)
|
|
577
|
+
camera_extra_count: numberOptional("Camera Extra Count")
|
|
514
578
|
});
|
|
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 */)
|
|
579
|
+
var VehicleDetailTripSchema = z3.object({
|
|
580
|
+
trip_name: stringOptional("Trip Name", 0, 100),
|
|
581
|
+
trip_no: stringOptional("Trip Name", 0, 100),
|
|
582
|
+
eway_bill_number: stringOptional("E-Way Bill Number", 0, 100),
|
|
583
|
+
route_name: stringOptional("Route Name", 0, 100),
|
|
584
|
+
trip_start_date: dateOptional("Trip Start Date"),
|
|
585
|
+
trip_end_date: dateOptional("Trip End Date"),
|
|
586
|
+
trip_notes_1: stringOptional("Trip Notes 1", 0, 200),
|
|
587
|
+
trip_notes_2: stringOptional("Trip Notes 2", 0, 200),
|
|
588
|
+
trip_notes_3: stringOptional("Trip Notes 3", 0, 200),
|
|
589
|
+
status: enumMandatory("Status", Status, "Active" /* Active */)
|
|
555
590
|
});
|
|
556
|
-
var
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
591
|
+
var VehicleDetailBodySchema = z3.object({
|
|
592
|
+
// 📦 Body & Dimension (Common)
|
|
593
|
+
vehicle_body_details: stringOptional("Vehicle Body Details", 0, 300),
|
|
594
|
+
vehicle_height: doubleOptional("Vehicle Height"),
|
|
595
|
+
vehicle_width: doubleOptional("Vehicle Width"),
|
|
596
|
+
vehicle_length: doubleOptional("Vehicle Length"),
|
|
597
|
+
wheel_base: doubleOptional("Wheel Base"),
|
|
598
|
+
number_of_doors: numberOptional("Number Of Doors"),
|
|
599
|
+
// Passenger Configuration (Cars/Buses)
|
|
600
|
+
vehicle_passenger_capacity: numberOptional("Vehicle Passenger Capacity"),
|
|
601
|
+
standing_passenger_capacity: numberOptional("Standing Passenger Capacity"),
|
|
602
|
+
seat_configuration: stringOptional("Seat Configuration", 0, 100),
|
|
603
|
+
has_air_conditioning: enumMandatory("Has Air Conditioning", YesNo, "No" /* No */),
|
|
604
|
+
has_heating_system: enumMandatory("Has Heating System", YesNo, "No" /* No */),
|
|
605
|
+
has_reclining_seats: enumMandatory("Has Reclining Seats", YesNo, "No" /* No */),
|
|
606
|
+
has_safety_belts: enumMandatory("Has Safety Belts", YesNo, "No" /* No */),
|
|
607
|
+
has_headrests: enumMandatory("Has Headrests", YesNo, "No" /* No */),
|
|
608
|
+
has_armrests: enumMandatory("Has Armrests", YesNo, "No" /* No */),
|
|
609
|
+
has_infotainment_system: enumMandatory(
|
|
610
|
+
"Has Infotainment System",
|
|
611
|
+
YesNo,
|
|
612
|
+
"No" /* No */
|
|
613
|
+
),
|
|
614
|
+
infotainment_type: stringOptional("Infotainment Type", 0, 100),
|
|
615
|
+
has_individual_lighting: enumMandatory(
|
|
616
|
+
"Has Individual Lighting",
|
|
617
|
+
YesNo,
|
|
618
|
+
"No" /* No */
|
|
619
|
+
),
|
|
620
|
+
has_overhead_luggage_storage: enumMandatory(
|
|
621
|
+
"Has Overhead Luggage Storage",
|
|
622
|
+
YesNo,
|
|
623
|
+
"No" /* No */
|
|
624
|
+
),
|
|
625
|
+
wheelchair_accessible: enumMandatory(
|
|
626
|
+
"Wheelchair Accessible",
|
|
627
|
+
YesNo,
|
|
628
|
+
"No" /* No */
|
|
629
|
+
),
|
|
630
|
+
// Cargo Configuration (Trucks/Vans)
|
|
631
|
+
vehicle_cargo_volume: doubleOptional("Vehicle Cargo Volume"),
|
|
632
|
+
vehicle_maximum_weight_capacity: doubleOptional(
|
|
633
|
+
"Vehicle Maximum Weight Capacity"
|
|
634
|
+
),
|
|
635
|
+
cargo_area_type: stringOptional("Cargo Area Type", 0, 100),
|
|
636
|
+
has_lift_gate: enumMandatory("Has Lift Gate", YesNo, "No" /* No */),
|
|
637
|
+
has_refrigeration_unit: enumMandatory(
|
|
638
|
+
"Has Refrigeration Unit",
|
|
639
|
+
YesNo,
|
|
640
|
+
"No" /* No */
|
|
641
|
+
),
|
|
642
|
+
refrigeration_temperature_range: stringOptional(
|
|
643
|
+
"Refrigeration Temperature Range",
|
|
644
|
+
0,
|
|
645
|
+
100
|
|
646
|
+
),
|
|
647
|
+
cargo_bed_length: doubleOptional("Cargo Bed Length"),
|
|
648
|
+
cargo_bed_width: doubleOptional("Cargo Bed Width"),
|
|
649
|
+
cargo_bed_height: doubleOptional("Cargo Bed Height"),
|
|
650
|
+
cargo_floor_material: stringOptional("Cargo Floor Material", 0, 100),
|
|
651
|
+
has_side_doors: enumMandatory("Has Side Doors", YesNo, "No" /* No */),
|
|
652
|
+
has_roof_hatch: enumMandatory("Has Roof Hatch", YesNo, "No" /* No */),
|
|
653
|
+
cargo_tie_down_hooks_count: numberOptional("Cargo Tie Down Hooks Count"),
|
|
654
|
+
is_custom_body_built: enumMandatory("Is Custom Body Built", YesNo, "No" /* No */),
|
|
655
|
+
number_of_axles: numberOptional("Number Of Axles"),
|
|
656
|
+
axle_configuration: stringOptional("Axle Configuration", 0, 50),
|
|
657
|
+
has_dual_rear_wheels: enumMandatory("Has Dual Rear Wheels", YesNo, "No" /* No */),
|
|
658
|
+
suspension_type: stringOptional("Suspension Type", 0, 100),
|
|
659
|
+
suspension_adjustability: enumMandatory(
|
|
660
|
+
"Suspension Adjustability",
|
|
661
|
+
YesNo,
|
|
662
|
+
"No" /* No */
|
|
663
|
+
),
|
|
664
|
+
ground_clearance_mm: doubleOptional("Ground Clearance MM"),
|
|
665
|
+
tire_size: stringOptional("Tire Size", 0, 50),
|
|
666
|
+
has_spare_tire: enumMandatory("Has Spare Tire", YesNo, "Yes" /* Yes */),
|
|
667
|
+
has_all_terrain_tires: enumMandatory(
|
|
668
|
+
"Has All Terrain Tires",
|
|
669
|
+
YesNo,
|
|
670
|
+
"No" /* No */
|
|
565
671
|
),
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
"
|
|
569
|
-
|
|
672
|
+
has_run_flat_tires: enumMandatory("Has Run Flat Tires", YesNo, "No" /* No */),
|
|
673
|
+
steering_type: enumMandatory(
|
|
674
|
+
"Steering Type",
|
|
675
|
+
SteeringType,
|
|
676
|
+
"Power" /* Power */
|
|
570
677
|
),
|
|
571
|
-
|
|
572
|
-
"
|
|
573
|
-
|
|
678
|
+
wheel_drive_type: enumMandatory(
|
|
679
|
+
"Wheel Drive Type",
|
|
680
|
+
WheelDriveType,
|
|
681
|
+
"FWD" /* FWD */
|
|
574
682
|
),
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
683
|
+
// 🛡️ Safety Features
|
|
684
|
+
has_abs: enumMandatory("Has ABS", YesNo, "No" /* No */),
|
|
685
|
+
has_airbags: enumMandatory("Has Airbags", YesNo, "No" /* No */),
|
|
686
|
+
has_speed_limiter: enumMandatory("Has Speed Limiter", YesNo, "No" /* No */),
|
|
687
|
+
has_gps_tracker: enumMandatory("Has GPS Tracker", YesNo, "No" /* No */),
|
|
688
|
+
has_parking_sensors: enumMandatory("Has Parking Sensors", YesNo, "No" /* No */),
|
|
689
|
+
has_rear_camera: enumMandatory("Has Rear Camera", YesNo, "No" /* No */),
|
|
690
|
+
has_lane_assist: enumMandatory("Has Lane Assist", YesNo, "No" /* No */),
|
|
691
|
+
has_automatic_emergency_brake: enumMandatory(
|
|
692
|
+
"Has Automatic Emergency Brake",
|
|
693
|
+
YesNo,
|
|
694
|
+
"No" /* No */
|
|
695
|
+
),
|
|
696
|
+
has_tire_pressure_monitoring: enumMandatory(
|
|
697
|
+
"Has Tire Pressure Monitoring",
|
|
698
|
+
YesNo,
|
|
699
|
+
"No" /* No */
|
|
700
|
+
),
|
|
701
|
+
has_blind_spot_monitoring: enumMandatory(
|
|
702
|
+
"Has Blind Spot Monitoring",
|
|
703
|
+
YesNo,
|
|
704
|
+
"No" /* No */
|
|
578
705
|
),
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
706
|
+
has_collision_warning_system: enumMandatory(
|
|
707
|
+
"Has Collision Warning System",
|
|
708
|
+
YesNo,
|
|
709
|
+
"No" /* No */
|
|
583
710
|
),
|
|
584
|
-
|
|
711
|
+
has_immobilizer: enumMandatory("Has Immobilizer", YesNo, "No" /* No */),
|
|
712
|
+
has_dashcam: enumMandatory("Has DashCam", YesNo, "No" /* No */),
|
|
713
|
+
has_emergency_exit: enumMandatory("Has Emergency Exit", YesNo, "No" /* No */),
|
|
714
|
+
status: enumMandatory("Status", Status, "Active" /* Active */)
|
|
585
715
|
});
|
|
586
716
|
var VehicleDetailLifeCycleSchema = z3.object({
|
|
717
|
+
// Lifecycle Start
|
|
587
718
|
service_start_date: dateOptional("Service Start Date"),
|
|
588
719
|
service_start_odometer_reading: numberOptional(
|
|
589
720
|
"Service Start Odometer Reading"
|
|
590
721
|
),
|
|
722
|
+
// Lifecycle End
|
|
591
723
|
service_end_date: dateOptional("Service End Date"),
|
|
592
724
|
service_end_odometer_reading: numberOptional("Service End Odometer Reading"),
|
|
725
|
+
// Estimated Life
|
|
593
726
|
life_estimate_max_month_year: dateOptional("Life Estimate Max Month/Year"),
|
|
594
727
|
life_estimate_max_odometer_reading: numberOptional(
|
|
595
728
|
"Life Estimate Max Odometer Reading"
|
|
596
729
|
),
|
|
597
|
-
|
|
598
|
-
|
|
730
|
+
// Lifecycle Status
|
|
731
|
+
life_expiry: enumMandatory("Life Expiry", LifeExpiry, "No" /* No */),
|
|
732
|
+
is_extended_life_approved: enumMandatory(
|
|
733
|
+
"Is Extended Life Approved",
|
|
734
|
+
YesNo,
|
|
735
|
+
"No" /* No */
|
|
736
|
+
),
|
|
737
|
+
life_status: enumMandatory(
|
|
738
|
+
"Life Status",
|
|
739
|
+
VehicleLifeStatus,
|
|
740
|
+
"Active" /* Active */
|
|
741
|
+
),
|
|
599
742
|
life_expiry_message: stringOptional("Life Expiry Message", 0, 300),
|
|
600
743
|
life_expiry_note: stringOptional("Life Expiry Note", 0, 2e3),
|
|
601
744
|
status: enumMandatory("Status", Status, "Active" /* Active */)
|
|
602
745
|
});
|
|
603
746
|
var VehicleDetailPurchaseSchema = z3.object({
|
|
604
|
-
// Purchase Info
|
|
747
|
+
// Basic Purchase Info
|
|
605
748
|
purchase_date: dateOptional("Purchase Date"),
|
|
606
749
|
purchase_notes: stringOptional("Purchase Notes", 0, 300),
|
|
607
|
-
purchase_vehicle_type:
|
|
750
|
+
purchase_vehicle_type: enumMandatory(
|
|
608
751
|
"Purchase Vehicle Type",
|
|
609
752
|
PurchaseVehicleType,
|
|
610
753
|
"New" /* New */
|
|
611
754
|
),
|
|
612
|
-
purchase_type:
|
|
755
|
+
purchase_type: enumMandatory(
|
|
613
756
|
"Purchase Type",
|
|
614
757
|
PurchaseType,
|
|
615
758
|
"NoFinance" /* NoFinance */
|
|
616
759
|
),
|
|
617
|
-
purchase_vendor_id: single_select_optional("Purchase Vendor ID"),
|
|
618
760
|
purchase_total_amount: doubleOptionalAmount("Purchase Total Amount", 2),
|
|
619
|
-
// Loan
|
|
620
|
-
loan_lender_id: single_select_optional("Loan Lender ID"),
|
|
761
|
+
// Loan Details
|
|
621
762
|
loan_amount: doubleOptionalAmount("Loan Amount", 2),
|
|
622
763
|
loan_down_payment: doubleOptionalAmount("Loan Down Payment", 2),
|
|
623
764
|
loan_interest_rate: doubleOptionalAmount("Loan Interest Rate", 2),
|
|
765
|
+
loan_interest_type: enumOptional(
|
|
766
|
+
"Loan Interest Type",
|
|
767
|
+
LoanInterestType,
|
|
768
|
+
"Simple" /* Simple */
|
|
769
|
+
),
|
|
624
770
|
loan_no_of_installments: numberOptional("Loan No of Installments"),
|
|
625
771
|
loan_first_payment_date: dateOptional("Loan First Payment Date"),
|
|
626
772
|
loan_last_payment_date: dateOptional("Loan Last Payment Date"),
|
|
627
773
|
loan_monthly_emi: doubleOptionalAmount("Loan Monthly EMI"),
|
|
628
774
|
loan_emi_date: numberOptional("Loan EMI Date"),
|
|
629
|
-
// Lease
|
|
630
|
-
lease_vendor_id: single_select_optional("Lease Vendor ID"),
|
|
775
|
+
// Lease Details
|
|
631
776
|
lease_start_date: dateOptional("Lease Start Date"),
|
|
632
777
|
lease_end_date: dateOptional("Lease End Date"),
|
|
633
778
|
lease_security_deposit_amount: doubleOptionalAmount(
|
|
@@ -642,72 +787,125 @@ var VehicleDetailPurchaseSchema = z3.object({
|
|
|
642
787
|
"Warranty Max Odometer Reading"
|
|
643
788
|
),
|
|
644
789
|
warranty_exchange_date: dateOptional("Warranty Exchange Date"),
|
|
790
|
+
purchase_vendor_id: single_select_optional("Purchase Vendor ID"),
|
|
791
|
+
loan_lender_id: single_select_optional("Loan Lender ID"),
|
|
792
|
+
lease_vendor_id: single_select_optional("Lease Vendor ID"),
|
|
645
793
|
// Metadata
|
|
646
794
|
status: enumMandatory("Status", Status, "Active" /* Active */)
|
|
647
795
|
});
|
|
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 */)
|
|
796
|
+
var MasterVehicleDocumentFileSchema = BaseFileSchema.extend({
|
|
797
|
+
organisation_id: single_select_optional("UserOrganisation"),
|
|
798
|
+
// ✅ Single-Selection -> UserOrganisation
|
|
799
|
+
vehicle_document_id: single_select_optional("VehicleDocument")
|
|
800
|
+
// ✅ Single-Selection -> VehicleDocument
|
|
659
801
|
});
|
|
660
|
-
var
|
|
661
|
-
|
|
662
|
-
//
|
|
663
|
-
|
|
664
|
-
//
|
|
665
|
-
|
|
666
|
-
//
|
|
667
|
-
|
|
668
|
-
|
|
802
|
+
var VehicleDocumentSchema = z3.object({
|
|
803
|
+
organisation_id: single_select_mandatory("UserOrganisation"),
|
|
804
|
+
// ✅ Single-Selection -> UserOrganisation
|
|
805
|
+
vehicle_id: single_select_mandatory("MasterVehicle"),
|
|
806
|
+
// ✅ Single-Selection -> MasterVehicle
|
|
807
|
+
document_type_id: single_select_mandatory("MasterVehicleDocumentType"),
|
|
808
|
+
// ✅ Single-Selection -> MasterVehicleDocumentType
|
|
809
|
+
vendor_id: single_select_optional("FleetVendor"),
|
|
810
|
+
// ✅ Single-Selection -> FleetVendor
|
|
811
|
+
vehicle_document_code: stringOptional("vehicle Document Code", 0, 50),
|
|
812
|
+
document_number: stringOptional("vehicle Document Code", 0, 100),
|
|
813
|
+
document_authorized_name: stringOptional("vehicle Document Code", 0, 100),
|
|
814
|
+
document_cost: doubleOptional("Document Cost"),
|
|
815
|
+
document_issue_date: dateOptional("Document Issue Date"),
|
|
816
|
+
document_valid_till_date: dateOptional("Document Valid Till Date"),
|
|
817
|
+
document_renewal_date: dateOptional("Document Renewal Date"),
|
|
818
|
+
document_validity_status: enumMandatory(
|
|
819
|
+
"DocumentValidityStatus",
|
|
820
|
+
DocumentValidityStatus,
|
|
821
|
+
"Valid" /* Valid */
|
|
669
822
|
),
|
|
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"
|
|
823
|
+
document_status: enumMandatory(
|
|
824
|
+
"DocumentStatus",
|
|
825
|
+
DocumentStatus,
|
|
826
|
+
"Active" /* Active */
|
|
689
827
|
),
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
828
|
+
document_details_1: stringOptional("Document Details 1", 0, 200),
|
|
829
|
+
document_details_2: stringOptional("Document Details 2", 0, 200),
|
|
830
|
+
document_details_3: stringOptional("Document Details 3", 0, 200),
|
|
831
|
+
document_details_4: stringOptional("Document Details 4", 0, 200),
|
|
832
|
+
document_notes: stringOptional("Document Notes", 0, 2e3),
|
|
833
|
+
status: enumMandatory("Status", Status, "Active" /* Active */),
|
|
834
|
+
MasterVehicleDocumentFileSchema: nestedArrayOfObjectsOptional(
|
|
835
|
+
"MasterVehicleDocumentFileSchema",
|
|
836
|
+
MasterVehicleDocumentFileSchema,
|
|
837
|
+
[]
|
|
838
|
+
)
|
|
839
|
+
});
|
|
840
|
+
var VehicleDocumentQuerySchema = BaseQuerySchema.extend({
|
|
841
|
+
organisation_ids: multi_select_optional("UserOrganisation"),
|
|
842
|
+
// ✅ Multi-Selection -> UserOrganisation
|
|
843
|
+
vehicle_ids: multi_select_optional("MasterVehicle"),
|
|
844
|
+
// ✅ Multi-Selection -> MasterVehicle
|
|
845
|
+
document_type_ids: multi_select_optional("MasterVehicleDocumentType"),
|
|
846
|
+
// ✅ Multi-Selection -> MasterVehicleDocumentType
|
|
847
|
+
vendor_ids: multi_select_optional("FleetVendor"),
|
|
848
|
+
// ✅ Multi-Selection -> FleetVendor
|
|
849
|
+
vehicle_document_ids: multi_select_optional("VehicleDocument")
|
|
850
|
+
// ✅ Multi-Selection -> VehicleDocument
|
|
851
|
+
});
|
|
852
|
+
var VehicleQuerySchema = BaseQuerySchema.extend({
|
|
853
|
+
organisation_ids: multi_select_optional("UserOrganisation"),
|
|
854
|
+
// ✅ Multi-Selection -> UserOrganisation
|
|
855
|
+
is_driver_assigned: enumArrayOptional(
|
|
696
856
|
"Is Device Installed",
|
|
697
857
|
YesNo,
|
|
698
858
|
getAllEnums(YesNo)
|
|
699
859
|
),
|
|
700
|
-
|
|
860
|
+
driver_ids: multi_select_optional("MasterDriver"),
|
|
861
|
+
// ✅ Multi-Selection -> MasterDriver
|
|
862
|
+
is_device_installed: enumArrayOptional(
|
|
701
863
|
"Is Device Installed",
|
|
702
864
|
YesNo,
|
|
703
865
|
getAllEnums(YesNo)
|
|
704
|
-
)
|
|
866
|
+
),
|
|
867
|
+
device_ids: multi_select_optional("MasterDevice"),
|
|
868
|
+
// ✅ Multi-Selection -> MasterDevice
|
|
869
|
+
organisation_sub_company_ids: multi_select_optional("OrganisationSubCompany"),
|
|
870
|
+
// ✅ Multi-Selection -> OrganisationSubCompany
|
|
871
|
+
organisation_branch_ids: multi_select_optional("OrganisationBranch"),
|
|
872
|
+
// ✅ Multi-Selection -> OrganisationBranch
|
|
873
|
+
organisation_tag_ids: multi_select_optional("OrganisationTag"),
|
|
874
|
+
// ✅ Multi-Selection -> OrganisationTag
|
|
875
|
+
organisation_color_ids: multi_select_optional("OrganisationColor"),
|
|
876
|
+
// ✅ Multi-Selection -> OrganisationColor
|
|
877
|
+
vehicle_type_ids: multi_select_optional("MasterVehicleType"),
|
|
878
|
+
// ✅ Multi-Selection -> MasterVehicleType
|
|
879
|
+
vehicle_make_ids: multi_select_optional("MasterVehicleMake"),
|
|
880
|
+
// ✅ Multi-Selection -> MasterVehicleMake
|
|
881
|
+
vehicle_model_ids: multi_select_optional("MasterVehicleModel"),
|
|
882
|
+
// ✅ Multi-Selection -> MasterVehicleModel
|
|
883
|
+
vehicle_sub_model_ids: multi_select_optional("MasterVehicleSubModel"),
|
|
884
|
+
// ✅ Multi-Selection -> MasterVehicleSubModel
|
|
885
|
+
vehicle_status_type_ids: multi_select_optional("MasterVehicleStatusType"),
|
|
886
|
+
// ✅ Multi-Selection -> MasterVehicleStatusType
|
|
887
|
+
vehicle_ownership_type_ids: multi_select_optional(
|
|
888
|
+
"MasterVehicleOwnershipType"
|
|
889
|
+
),
|
|
890
|
+
// ✅ Multi-Selection -> MasterVehicleOwnershipType
|
|
891
|
+
vehicle_associated_to_ids: multi_select_optional("MasterVehicleAssociatedTo"),
|
|
892
|
+
// ✅ Multi-Selection -> MasterVehicleAssociatedTo
|
|
893
|
+
vehicle_fuel_type_ids: multi_select_optional("MasterVehicleFuelType"),
|
|
894
|
+
// ✅ Multi-Selection -> MasterVehicleFuelType
|
|
895
|
+
vehicle_fuel_unit_ids: multi_select_optional("MasterVehicleFuelUnit"),
|
|
896
|
+
// ✅ Multi-Selection -> MasterVehicleFuelUnit
|
|
897
|
+
vehicle_ids: multi_select_optional("MasterVehicle")
|
|
898
|
+
// ✅ Multi-Selection -> MasterVehicle
|
|
899
|
+
});
|
|
900
|
+
var SimpleFindQuerySchema = BaseQuerySchema.extend({
|
|
901
|
+
organisation_id: single_select_mandatory("UserOrganisation")
|
|
902
|
+
// ✅ Single-Selection -> UserOrganisation
|
|
705
903
|
});
|
|
706
904
|
var VehicleGPSQuerySchema = BaseQuerySchema.extend({
|
|
707
|
-
organisation_id: single_select_mandatory("
|
|
708
|
-
// Single
|
|
709
|
-
vehicle_id: single_select_mandatory("
|
|
710
|
-
// Single-selection ->
|
|
905
|
+
organisation_id: single_select_mandatory("UserOrganisation"),
|
|
906
|
+
// ✅ Single-Selection -> UserOrganisation
|
|
907
|
+
vehicle_id: single_select_mandatory("MasterVehicle")
|
|
908
|
+
// Single-selection -> MasterVehicle
|
|
711
909
|
});
|
|
712
910
|
var toVehiclePayload = (vehicle) => ({
|
|
713
911
|
organisation_id: vehicle.organisation_id,
|
|
@@ -717,16 +915,11 @@ var toVehiclePayload = (vehicle) => ({
|
|
|
717
915
|
engine_number: vehicle.engine_number || "",
|
|
718
916
|
chassis_number: vehicle.chassis_number || "",
|
|
719
917
|
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,
|
|
918
|
+
// Admin Account Details
|
|
727
919
|
is_fleet_active: vehicle.is_fleet_active,
|
|
728
920
|
is_gps_active: vehicle.is_gps_active,
|
|
729
921
|
is_trip_active: vehicle.is_trip_active,
|
|
922
|
+
status: vehicle.status,
|
|
730
923
|
organisation_sub_company_id: vehicle.organisation_sub_company_id || "",
|
|
731
924
|
organisation_branch_id: vehicle.organisation_branch_id || "",
|
|
732
925
|
organisation_tag_id: vehicle.organisation_tag_id || "",
|
|
@@ -745,7 +938,8 @@ var toVehiclePayload = (vehicle) => ({
|
|
|
745
938
|
secondary_vehicle_fuel_unit_id: vehicle.secondary_vehicle_fuel_unit_id || "",
|
|
746
939
|
vehicle_total_fuel_quantity: vehicle.vehicle_total_fuel_quantity || 0,
|
|
747
940
|
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
|
|
941
|
+
vehicle_tank_2_fuel_quantity: vehicle.vehicle_tank_2_fuel_quantity || 0,
|
|
942
|
+
MasterVehicleFileSchema: []
|
|
749
943
|
});
|
|
750
944
|
var newVehiclePayload = () => ({
|
|
751
945
|
organisation_id: "",
|
|
@@ -755,12 +949,6 @@ var newVehiclePayload = () => ({
|
|
|
755
949
|
engine_number: "",
|
|
756
950
|
chassis_number: "",
|
|
757
951
|
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
952
|
status: "Active" /* Active */,
|
|
765
953
|
is_fleet_active: "Yes" /* Yes */,
|
|
766
954
|
is_gps_active: "No" /* No */,
|
|
@@ -783,7 +971,8 @@ var newVehiclePayload = () => ({
|
|
|
783
971
|
secondary_vehicle_fuel_unit_id: "",
|
|
784
972
|
vehicle_total_fuel_quantity: 0,
|
|
785
973
|
vehicle_tank_1_fuel_quantity: 0,
|
|
786
|
-
vehicle_tank_2_fuel_quantity: 0
|
|
974
|
+
vehicle_tank_2_fuel_quantity: 0,
|
|
975
|
+
MasterVehicleFileSchema: []
|
|
787
976
|
});
|
|
788
977
|
var toVehicleDetailsGPSPayload = (vehicleGPS) => ({
|
|
789
978
|
temperature: vehicleGPS?.temperature ?? "No" /* No */,
|
|
@@ -800,7 +989,22 @@ var toVehicleDetailsGPSPayload = (vehicleGPS) => ({
|
|
|
800
989
|
is_rear_cam: vehicleGPS?.is_rear_cam ?? "No" /* No */,
|
|
801
990
|
is_front_cam: vehicleGPS?.is_front_cam ?? "No" /* No */,
|
|
802
991
|
camera_extra_count: vehicleGPS?.camera_extra_count ?? 0,
|
|
803
|
-
status: vehicleGPS ? vehicleGPS?.status : "Active" /* Active
|
|
992
|
+
status: vehicleGPS ? vehicleGPS?.status : "Active" /* Active */,
|
|
993
|
+
vehicle_details_gps_id: "",
|
|
994
|
+
added_date_time: "",
|
|
995
|
+
modified_date_time: ""
|
|
996
|
+
});
|
|
997
|
+
var toVehicleDetailsTripPayload = (trip) => ({
|
|
998
|
+
trip_name: trip?.trip_name || "",
|
|
999
|
+
trip_no: trip?.trip_no || "",
|
|
1000
|
+
eway_bill_number: trip?.eway_bill_number || "",
|
|
1001
|
+
route_name: trip?.route_name || "",
|
|
1002
|
+
trip_start_date: trip?.trip_start_date || "",
|
|
1003
|
+
trip_end_date: trip?.trip_end_date || "",
|
|
1004
|
+
trip_notes_1: trip?.trip_notes_1 || "",
|
|
1005
|
+
trip_notes_2: trip?.trip_notes_2 || "",
|
|
1006
|
+
trip_notes_3: trip?.trip_notes_3 || "",
|
|
1007
|
+
status: trip ? trip.status : "Active" /* Active */
|
|
804
1008
|
});
|
|
805
1009
|
var toVehicleDetailsBodyPayload = (vehicleBody) => ({
|
|
806
1010
|
vehicle_body_details: vehicleBody?.vehicle_body_details || "",
|
|
@@ -810,10 +1014,69 @@ var toVehicleDetailsBodyPayload = (vehicleBody) => ({
|
|
|
810
1014
|
vehicle_passenger_capacity: vehicleBody?.vehicle_passenger_capacity || 0,
|
|
811
1015
|
vehicle_cargo_volume: vehicleBody?.vehicle_cargo_volume || 0,
|
|
812
1016
|
vehicle_maximum_weight_capacity: vehicleBody?.vehicle_maximum_weight_capacity || 0,
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
1017
|
+
status: vehicleBody ? vehicleBody?.status : "Active" /* Active */,
|
|
1018
|
+
number_of_doors: 0,
|
|
1019
|
+
standing_passenger_capacity: 0,
|
|
1020
|
+
seat_configuration: "",
|
|
1021
|
+
has_air_conditioning: "Yes" /* Yes */,
|
|
1022
|
+
has_heating_system: "Yes" /* Yes */,
|
|
1023
|
+
has_reclining_seats: "Yes" /* Yes */,
|
|
1024
|
+
has_safety_belts: "Yes" /* Yes */,
|
|
1025
|
+
has_headrests: "Yes" /* Yes */,
|
|
1026
|
+
has_armrests: "Yes" /* Yes */,
|
|
1027
|
+
has_infotainment_system: "Yes" /* Yes */,
|
|
1028
|
+
infotainment_type: "",
|
|
1029
|
+
has_individual_lighting: "Yes" /* Yes */,
|
|
1030
|
+
has_overhead_luggage_storage: "Yes" /* Yes */,
|
|
1031
|
+
wheelchair_accessible: "Yes" /* Yes */,
|
|
1032
|
+
cargo_area_type: "",
|
|
1033
|
+
has_lift_gate: "Yes" /* Yes */,
|
|
1034
|
+
has_refrigeration_unit: "Yes" /* Yes */,
|
|
1035
|
+
refrigeration_temperature_range: "",
|
|
1036
|
+
cargo_floor_material: "",
|
|
1037
|
+
has_side_doors: "Yes" /* Yes */,
|
|
1038
|
+
has_roof_hatch: "Yes" /* Yes */,
|
|
1039
|
+
cargo_tie_down_hooks_count: 0,
|
|
1040
|
+
is_custom_body_built: "Yes" /* Yes */,
|
|
1041
|
+
number_of_axles: 0,
|
|
1042
|
+
axle_configuration: "",
|
|
1043
|
+
has_dual_rear_wheels: "Yes" /* Yes */,
|
|
1044
|
+
suspension_type: "",
|
|
1045
|
+
suspension_adjustability: "Yes" /* Yes */,
|
|
1046
|
+
tire_size: "",
|
|
1047
|
+
has_spare_tire: "Yes" /* Yes */,
|
|
1048
|
+
has_all_terrain_tires: "Yes" /* Yes */,
|
|
1049
|
+
has_run_flat_tires: "Yes" /* Yes */,
|
|
1050
|
+
steering_type: "Manual" /* Manual */,
|
|
1051
|
+
wheel_drive_type: "FWD" /* FWD */,
|
|
1052
|
+
has_abs: "Yes" /* Yes */,
|
|
1053
|
+
has_airbags: "Yes" /* Yes */,
|
|
1054
|
+
has_speed_limiter: "Yes" /* Yes */,
|
|
1055
|
+
has_gps_tracker: "Yes" /* Yes */,
|
|
1056
|
+
has_parking_sensors: "Yes" /* Yes */,
|
|
1057
|
+
has_rear_camera: "Yes" /* Yes */,
|
|
1058
|
+
has_lane_assist: "Yes" /* Yes */,
|
|
1059
|
+
has_automatic_emergency_brake: "Yes" /* Yes */,
|
|
1060
|
+
has_tire_pressure_monitoring: "Yes" /* Yes */,
|
|
1061
|
+
has_blind_spot_monitoring: "Yes" /* Yes */,
|
|
1062
|
+
has_collision_warning_system: "Yes" /* Yes */,
|
|
1063
|
+
has_immobilizer: "Yes" /* Yes */,
|
|
1064
|
+
has_dashcam: "Yes" /* Yes */,
|
|
1065
|
+
has_emergency_exit: "Yes" /* Yes */
|
|
1066
|
+
});
|
|
1067
|
+
var toVehicleDetailLifeCyclePayload = (vehicleLifeCycle) => ({
|
|
1068
|
+
service_start_date: vehicleLifeCycle?.service_start_date || "",
|
|
1069
|
+
service_start_odometer_reading: vehicleLifeCycle?.service_start_odometer_reading || 0,
|
|
1070
|
+
service_end_date: vehicleLifeCycle?.service_end_date || "",
|
|
1071
|
+
service_end_odometer_reading: vehicleLifeCycle?.service_end_odometer_reading || 0,
|
|
1072
|
+
life_estimate_max_month_year: vehicleLifeCycle?.life_estimate_max_month_year || "",
|
|
1073
|
+
life_estimate_max_odometer_reading: vehicleLifeCycle?.life_estimate_max_odometer_reading || 0,
|
|
1074
|
+
life_expiry: vehicleLifeCycle?.life_expiry || "No" /* No */,
|
|
1075
|
+
life_expiry_message: vehicleLifeCycle?.life_expiry_message || "",
|
|
1076
|
+
life_expiry_note: vehicleLifeCycle?.life_expiry_note || "",
|
|
1077
|
+
status: vehicleLifeCycle ? vehicleLifeCycle.status : "Active" /* Active */,
|
|
1078
|
+
is_extended_life_approved: "Yes" /* Yes */,
|
|
1079
|
+
life_status: "Active" /* Active */
|
|
817
1080
|
});
|
|
818
1081
|
var toVehicleDetailPurchasePayload = (vehiclePurchase) => ({
|
|
819
1082
|
purchase_date: vehiclePurchase?.purchase_date || "",
|
|
@@ -840,170 +1103,158 @@ var toVehicleDetailPurchasePayload = (vehiclePurchase) => ({
|
|
|
840
1103
|
warranty_expiration_date: vehiclePurchase?.warranty_expiration_date || "",
|
|
841
1104
|
warranty_max_odometer_reading: vehiclePurchase?.warranty_max_odometer_reading || 0,
|
|
842
1105
|
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 */
|
|
1106
|
+
status: vehiclePurchase ? vehiclePurchase.status : "Active" /* Active */,
|
|
1107
|
+
loan_interest_type: "Simple" /* Simple */
|
|
856
1108
|
});
|
|
1109
|
+
var get_vehicle_presigned_url = async (fileName) => {
|
|
1110
|
+
return apiGet(ENDPOINTS.vehicle_presigned_url(fileName));
|
|
1111
|
+
};
|
|
1112
|
+
var get_device_presigned_url = async (fileName) => {
|
|
1113
|
+
return apiGet(ENDPOINTS.device_presigned_url(fileName));
|
|
1114
|
+
};
|
|
1115
|
+
var get_master_driver_presigned_url_file = async (data) => {
|
|
1116
|
+
return apiPost(ENDPOINTS.vehicle_file_presigned_url, data);
|
|
1117
|
+
};
|
|
857
1118
|
var findVehicles = async (payload) => {
|
|
858
|
-
return apiPost(
|
|
859
|
-
ENDPOINTS.FIND,
|
|
860
|
-
payload
|
|
861
|
-
);
|
|
1119
|
+
return apiPost(ENDPOINTS.find, payload);
|
|
862
1120
|
};
|
|
863
1121
|
var findVehiclesLiveDashboard = async (payload) => {
|
|
864
|
-
return apiPost(
|
|
865
|
-
ENDPOINTS.FIND_LIVE_DASHBOARD,
|
|
866
|
-
payload
|
|
867
|
-
);
|
|
1122
|
+
return apiPost(ENDPOINTS.find_live_dashboard, payload);
|
|
868
1123
|
};
|
|
869
1124
|
var findVehicleGPSDetails = async (payload) => {
|
|
870
|
-
return apiPost(
|
|
871
|
-
ENDPOINTS.FIND_GPS_DETAILS,
|
|
872
|
-
payload
|
|
873
|
-
);
|
|
1125
|
+
return apiPost(ENDPOINTS.find_gps_details, payload);
|
|
874
1126
|
};
|
|
875
1127
|
var createVehicle = async (payload) => {
|
|
876
|
-
return apiPost(ENDPOINTS.
|
|
1128
|
+
return apiPost(ENDPOINTS.create, payload);
|
|
877
1129
|
};
|
|
878
1130
|
var updateVehicle = async (id, payload) => {
|
|
879
|
-
return apiPatch(
|
|
880
|
-
ENDPOINTS.UPDATE.replace(":id", id),
|
|
881
|
-
payload
|
|
882
|
-
);
|
|
1131
|
+
return apiPatch(ENDPOINTS.update.replace(":id", id), payload);
|
|
883
1132
|
};
|
|
884
1133
|
var deleteVehicle = async (id) => {
|
|
885
|
-
return apiDelete(ENDPOINTS.
|
|
1134
|
+
return apiDelete(ENDPOINTS.delete.replace(":id", id));
|
|
1135
|
+
};
|
|
1136
|
+
var updateDetailsGpsSensor = async (id, payload) => {
|
|
1137
|
+
return apiPatch(ENDPOINTS.update_details_gps_sensor.replace(":id", id), payload);
|
|
1138
|
+
};
|
|
1139
|
+
var updateDetailsTrip = async (id, payload) => {
|
|
1140
|
+
return apiPatch(ENDPOINTS.update_details_trip.replace(":id", id), payload);
|
|
886
1141
|
};
|
|
887
1142
|
var updateVehicleBodyDetails = async (id, payload) => {
|
|
888
|
-
return apiPatch(
|
|
889
|
-
ENDPOINTS.BODY_DETAILS_UPDATE.replace(":id", id),
|
|
890
|
-
payload
|
|
891
|
-
);
|
|
1143
|
+
return apiPatch(ENDPOINTS.update_details_body.replace(":id", id), payload);
|
|
892
1144
|
};
|
|
893
1145
|
var updateVehicleLifeCycleDetails = async (id, payload) => {
|
|
894
|
-
return apiPatch(
|
|
895
|
-
ENDPOINTS.LIFE_CYCLE_DETAILS_UPDATE.replace(":id", id),
|
|
896
|
-
payload
|
|
897
|
-
);
|
|
1146
|
+
return apiPatch(ENDPOINTS.update_details_life_cycle.replace(":id", id), payload);
|
|
898
1147
|
};
|
|
899
1148
|
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
|
-
);
|
|
1149
|
+
return apiPatch(ENDPOINTS.update_details_purchase.replace(":id", id), payload);
|
|
928
1150
|
};
|
|
929
1151
|
var linkDriverToVehicle = async (payload) => {
|
|
930
|
-
return apiPost(ENDPOINTS.
|
|
1152
|
+
return apiPost(ENDPOINTS.vehicle_driver_link, payload);
|
|
931
1153
|
};
|
|
932
1154
|
var unlinkDriverFromVehicle = async (payload) => {
|
|
933
|
-
return apiPost(ENDPOINTS.
|
|
1155
|
+
return apiPost(ENDPOINTS.vehicle_driver_unlink, payload);
|
|
934
1156
|
};
|
|
935
1157
|
var getDriverLinkHistoryByVehicle = async (id, params) => {
|
|
936
|
-
return apiGet(
|
|
937
|
-
ENDPOINTS.DRIVER_LINK_HISTORY_BY_VEHICLE.replace(":id", id),
|
|
938
|
-
params
|
|
939
|
-
);
|
|
1158
|
+
return apiGet(ENDPOINTS.find_vehicle_driver_link_history_by_vehicle.replace(":id", id), params);
|
|
940
1159
|
};
|
|
941
1160
|
var getDriverLinkHistoryByDriver = async (id, params) => {
|
|
942
|
-
return apiGet(
|
|
943
|
-
ENDPOINTS.DRIVER_LINK_HISTORY_BY_DRIVER.replace(":id", id),
|
|
944
|
-
params
|
|
945
|
-
);
|
|
1161
|
+
return apiGet(ENDPOINTS.find_vehicle_driver_link_history_by_driver.replace(":id", id), params);
|
|
946
1162
|
};
|
|
947
1163
|
var linkDeviceToVehicle = async (payload) => {
|
|
948
|
-
return apiPost(ENDPOINTS.
|
|
1164
|
+
return apiPost(ENDPOINTS.vehicle_device_link, payload);
|
|
949
1165
|
};
|
|
950
1166
|
var unlinkDeviceFromVehicle = async (payload) => {
|
|
951
|
-
return apiPost(ENDPOINTS.
|
|
1167
|
+
return apiPost(ENDPOINTS.vehicle_device_unlink, payload);
|
|
952
1168
|
};
|
|
953
1169
|
var getDeviceLinkHistoryByVehicle = async (id, params) => {
|
|
954
|
-
return apiGet(
|
|
955
|
-
ENDPOINTS.DEVICE_LINK_HISTORY_BY_VEHICLE.replace(":id", id),
|
|
956
|
-
params
|
|
957
|
-
);
|
|
1170
|
+
return apiGet(ENDPOINTS.vehicle_device_link_history_by_vehicle.replace(":id", id), params);
|
|
958
1171
|
};
|
|
959
1172
|
var getDeviceLinkHistoryByDevice = async (id, params) => {
|
|
960
|
-
return apiGet(
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
);
|
|
1173
|
+
return apiGet(ENDPOINTS.vehicle_device_link_history_by_device.replace(":id", id), params);
|
|
1174
|
+
};
|
|
1175
|
+
var createDocument = async (payload) => {
|
|
1176
|
+
return apiPost(ENDPOINTS.create_document, payload);
|
|
1177
|
+
};
|
|
1178
|
+
var findDocument = async (payload) => {
|
|
1179
|
+
return apiPost(ENDPOINTS.find_document, payload);
|
|
1180
|
+
};
|
|
1181
|
+
var updateDocument = async (id, payload) => {
|
|
1182
|
+
return apiPatch(ENDPOINTS.update_document.replace(":id", id), payload);
|
|
1183
|
+
};
|
|
1184
|
+
var removeDocument = async (id) => {
|
|
1185
|
+
return apiDelete(ENDPOINTS.remove_document.replace(":id", id));
|
|
1186
|
+
};
|
|
1187
|
+
var createFileVehicle = async (payload) => {
|
|
1188
|
+
return apiPost(ENDPOINTS.create_file_vehicle, payload);
|
|
1189
|
+
};
|
|
1190
|
+
var removeFileVehicle = async (id) => {
|
|
1191
|
+
return apiDelete(ENDPOINTS.remove_file_vehicle.replace(":id", id));
|
|
1192
|
+
};
|
|
1193
|
+
var createFileDevice = async (payload) => {
|
|
1194
|
+
return apiPost(ENDPOINTS.create_file_device, payload);
|
|
1195
|
+
};
|
|
1196
|
+
var removeFileDevice = async (id) => {
|
|
1197
|
+
return apiDelete(ENDPOINTS.remove_file_device.replace(":id", id));
|
|
1198
|
+
};
|
|
1199
|
+
var createFileVehicleDocument = async (payload) => {
|
|
1200
|
+
return apiPost(ENDPOINTS.create_file_vehicle_document, payload);
|
|
1201
|
+
};
|
|
1202
|
+
var removeFileVehicleDocument = async (id) => {
|
|
1203
|
+
return apiDelete(ENDPOINTS.remove_file_vehicle_document.replace(":id", id));
|
|
964
1204
|
};
|
|
965
1205
|
var getVehicleCache = async (organisationId) => {
|
|
966
|
-
return apiGet(
|
|
967
|
-
ENDPOINTS.cache.replace(":organisation_id", organisationId)
|
|
968
|
-
);
|
|
1206
|
+
return apiGet(ENDPOINTS.find_cache.replace(":organisation_id", organisationId));
|
|
969
1207
|
};
|
|
970
1208
|
var getVehicleSimpleCache = async (organisationId) => {
|
|
971
|
-
return apiGet(
|
|
972
|
-
|
|
973
|
-
|
|
1209
|
+
return apiGet(ENDPOINTS.find_cache_simple.replace(":organisation_id", organisationId));
|
|
1210
|
+
};
|
|
1211
|
+
var getVehicleParentCache = async (organisationId) => {
|
|
1212
|
+
return apiGet(ENDPOINTS.find_cache_parent.replace(":organisation_id", organisationId));
|
|
974
1213
|
};
|
|
975
1214
|
var getVehicleSimpleDropdownCustom = async (organisationId) => {
|
|
976
|
-
return apiGet(
|
|
977
|
-
ENDPOINTS.cache_dropdown.replace(":organisation_id", organisationId)
|
|
978
|
-
);
|
|
1215
|
+
return apiGet(ENDPOINTS.find_cache_dropdown.replace(":organisation_id", organisationId));
|
|
979
1216
|
};
|
|
980
1217
|
var getVehicleSimpleDropdownCacheLiveData = async (organisationId) => {
|
|
981
|
-
return apiGet(
|
|
982
|
-
ENDPOINTS.cache_dropdown_live_data.replace(":organisation_id", organisationId)
|
|
983
|
-
);
|
|
1218
|
+
return apiGet(ENDPOINTS.find_cache_dropdown_live_data.replace(":organisation_id", organisationId));
|
|
984
1219
|
};
|
|
985
|
-
var
|
|
986
|
-
return apiGet(
|
|
987
|
-
|
|
988
|
-
|
|
1220
|
+
var getVehicleByUserCache = async (userId) => {
|
|
1221
|
+
return apiGet(ENDPOINTS.find_cache_by_user.replace(":user_id", userId));
|
|
1222
|
+
};
|
|
1223
|
+
var getVehicleSimpleByUserCache = async (userId) => {
|
|
1224
|
+
return apiGet(ENDPOINTS.find_cache_simple_by_user.replace(":user_id", userId));
|
|
1225
|
+
};
|
|
1226
|
+
var getVehicleParentByUserCache = async (userId) => {
|
|
1227
|
+
return apiGet(ENDPOINTS.find_cache_parent_by_user.replace(":user_id", userId));
|
|
1228
|
+
};
|
|
1229
|
+
var getVehicleSimpleDropdownByUserCustom = async (userId) => {
|
|
1230
|
+
return apiGet(ENDPOINTS.find_cache_dropdown_by_user.replace(":user_id", userId));
|
|
989
1231
|
};
|
|
990
1232
|
export {
|
|
1233
|
+
MasterDeviceFileSchema,
|
|
1234
|
+
MasterVehicleDocumentFileSchema,
|
|
1235
|
+
MasterVehicleFileSchema,
|
|
991
1236
|
SimpleFindQuerySchema,
|
|
1237
|
+
VehicleBulkSchema,
|
|
992
1238
|
VehicleDetailBodySchema,
|
|
993
|
-
|
|
994
|
-
VehicleDetailGPSDataSchema,
|
|
995
|
-
VehicleDetailGPSMainSchema,
|
|
1239
|
+
VehicleDetailGPSSensorSchema,
|
|
996
1240
|
VehicleDetailLifeCycleSchema,
|
|
997
1241
|
VehicleDetailPurchaseSchema,
|
|
998
1242
|
VehicleDetailTripSchema,
|
|
999
1243
|
VehicleDeviceLinkSchema,
|
|
1000
1244
|
VehicleDeviceUnlinkSchema,
|
|
1245
|
+
VehicleDocumentQuerySchema,
|
|
1246
|
+
VehicleDocumentSchema,
|
|
1001
1247
|
VehicleDriverLinkSchema,
|
|
1002
1248
|
VehicleGPSQuerySchema,
|
|
1003
1249
|
VehicleQuerySchema,
|
|
1004
1250
|
VehicleSchema,
|
|
1251
|
+
createDocument,
|
|
1252
|
+
createFileDevice,
|
|
1253
|
+
createFileVehicle,
|
|
1254
|
+
createFileVehicleDocument,
|
|
1005
1255
|
createVehicle,
|
|
1006
1256
|
deleteVehicle,
|
|
1257
|
+
findDocument,
|
|
1007
1258
|
findVehicleGPSDetails,
|
|
1008
1259
|
findVehicles,
|
|
1009
1260
|
findVehiclesLiveDashboard,
|
|
@@ -1011,27 +1262,38 @@ export {
|
|
|
1011
1262
|
getDeviceLinkHistoryByVehicle,
|
|
1012
1263
|
getDriverLinkHistoryByDriver,
|
|
1013
1264
|
getDriverLinkHistoryByVehicle,
|
|
1265
|
+
getVehicleByUserCache,
|
|
1014
1266
|
getVehicleCache,
|
|
1267
|
+
getVehicleParentByUserCache,
|
|
1015
1268
|
getVehicleParentCache,
|
|
1269
|
+
getVehicleSimpleByUserCache,
|
|
1016
1270
|
getVehicleSimpleCache,
|
|
1271
|
+
getVehicleSimpleDropdownByUserCustom,
|
|
1017
1272
|
getVehicleSimpleDropdownCacheLiveData,
|
|
1018
1273
|
getVehicleSimpleDropdownCustom,
|
|
1274
|
+
get_device_presigned_url,
|
|
1275
|
+
get_master_driver_presigned_url_file,
|
|
1276
|
+
get_vehicle_presigned_url,
|
|
1019
1277
|
linkDeviceToVehicle,
|
|
1020
1278
|
linkDriverToVehicle,
|
|
1021
1279
|
newVehiclePayload,
|
|
1280
|
+
removeDocument,
|
|
1281
|
+
removeFileDevice,
|
|
1282
|
+
removeFileVehicle,
|
|
1283
|
+
removeFileVehicleDocument,
|
|
1022
1284
|
toVehicleDetailLifeCyclePayload,
|
|
1023
1285
|
toVehicleDetailPurchasePayload,
|
|
1024
1286
|
toVehicleDetailsBodyPayload,
|
|
1025
1287
|
toVehicleDetailsGPSPayload,
|
|
1288
|
+
toVehicleDetailsTripPayload,
|
|
1026
1289
|
toVehiclePayload,
|
|
1027
1290
|
unlinkDeviceFromVehicle,
|
|
1028
1291
|
unlinkDriverFromVehicle,
|
|
1292
|
+
updateDetailsGpsSensor,
|
|
1293
|
+
updateDetailsTrip,
|
|
1294
|
+
updateDocument,
|
|
1029
1295
|
updateVehicle,
|
|
1030
1296
|
updateVehicleBodyDetails,
|
|
1031
|
-
updateVehicleGPSDetailsAnalytics,
|
|
1032
|
-
updateVehicleGPSDetailsData,
|
|
1033
|
-
updateVehicleGPSDetailsMain,
|
|
1034
1297
|
updateVehicleLifeCycleDetails,
|
|
1035
|
-
updateVehiclePurchaseDetails
|
|
1036
|
-
updateVehicleTripDetails
|
|
1298
|
+
updateVehiclePurchaseDetails
|
|
1037
1299
|
};
|