vms-nest-prisma-api-document 5.0.4 → 5.0.5

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.
@@ -33,41 +33,41 @@ declare const MultipleVehicleReportSchema: z.ZodObject<{
33
33
  vehicle_summary: z.ZodDefault<z.ZodOptional<z.ZodNativeEnum<typeof YesNo>>>;
34
34
  driver_summary: z.ZodDefault<z.ZodOptional<z.ZodNativeEnum<typeof YesNo>>>;
35
35
  }, "strip", z.ZodTypeAny, {
36
+ db_index: string;
37
+ db_instance: string;
38
+ night_driving: NightDriving;
36
39
  search: string;
37
40
  paging: PAGING;
38
41
  page_count: number;
39
42
  page_index: number;
40
- login_from: LoginFrom;
41
43
  date_format_id: string;
42
44
  time_zone_id: string;
45
+ login_from: LoginFrom;
43
46
  organisation_id: string;
44
- db_instance: string;
45
- db_index: string;
46
47
  vehicle_ids: string[];
47
48
  from_date: string;
48
49
  to_date: string;
49
50
  time_slot: TimeSlot;
50
- night_driving: NightDriving;
51
51
  over_speed: OverSpeed;
52
52
  utilization_km: number;
53
53
  vehicle_summary: YesNo;
54
54
  driver_summary: YesNo;
55
55
  }, {
56
- login_from: LoginFrom;
56
+ db_index: string;
57
+ db_instance: string;
57
58
  date_format_id: string;
58
59
  time_zone_id: string;
60
+ login_from: LoginFrom;
59
61
  organisation_id: string;
60
- db_instance: string;
61
- db_index: string;
62
62
  from_date: string;
63
63
  to_date: string;
64
+ night_driving?: NightDriving | undefined;
64
65
  search?: string | undefined;
65
66
  paging?: PAGING | undefined;
66
67
  page_count?: unknown;
67
68
  page_index?: unknown;
68
69
  vehicle_ids?: string[] | undefined;
69
70
  time_slot?: TimeSlot | undefined;
70
- night_driving?: NightDriving | undefined;
71
71
  over_speed?: OverSpeed | undefined;
72
72
  utilization_km?: unknown;
73
73
  vehicle_summary?: YesNo | undefined;
@@ -96,40 +96,40 @@ declare const MultipleDriverReportSchema: z.ZodObject<{
96
96
  vehicle_summary: z.ZodDefault<z.ZodOptional<z.ZodNativeEnum<typeof YesNo>>>;
97
97
  driver_summary: z.ZodDefault<z.ZodOptional<z.ZodNativeEnum<typeof YesNo>>>;
98
98
  }, "strip", z.ZodTypeAny, {
99
+ db_index: string;
100
+ db_instance: string;
101
+ night_driving: NightDriving;
99
102
  search: string;
100
103
  paging: PAGING;
101
104
  page_count: number;
102
105
  page_index: number;
103
- login_from: LoginFrom;
104
106
  date_format_id: string;
105
107
  time_zone_id: string;
108
+ login_from: LoginFrom;
106
109
  organisation_id: string;
107
- db_instance: string;
108
- db_index: string;
109
110
  from_date: string;
110
111
  to_date: string;
111
112
  time_slot: TimeSlot;
112
- night_driving: NightDriving;
113
113
  over_speed: OverSpeed;
114
114
  utilization_km: number;
115
115
  vehicle_summary: YesNo;
116
116
  driver_summary: YesNo;
117
117
  driver_ids: string[];
118
118
  }, {
119
- login_from: LoginFrom;
119
+ db_index: string;
120
+ db_instance: string;
120
121
  date_format_id: string;
121
122
  time_zone_id: string;
123
+ login_from: LoginFrom;
122
124
  organisation_id: string;
123
- db_instance: string;
124
- db_index: string;
125
125
  from_date: string;
126
126
  to_date: string;
127
+ night_driving?: NightDriving | undefined;
127
128
  search?: string | undefined;
128
129
  paging?: PAGING | undefined;
129
130
  page_count?: unknown;
130
131
  page_index?: unknown;
131
132
  time_slot?: TimeSlot | undefined;
132
- night_driving?: NightDriving | undefined;
133
133
  over_speed?: OverSpeed | undefined;
134
134
  utilization_km?: unknown;
135
135
  vehicle_summary?: YesNo | undefined;
@@ -156,16 +156,16 @@ declare const SimpleReportSchema: z.ZodObject<{
156
156
  interval_seconds: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodNumber>>, number, unknown>;
157
157
  boolean_type: z.ZodType<BooleanType, z.ZodTypeDef, BooleanType>;
158
158
  }, "strip", z.ZodTypeAny, {
159
+ db_index: string;
160
+ db_instance: string;
159
161
  search: string;
160
162
  paging: PAGING;
161
163
  page_count: number;
162
164
  page_index: number;
163
- login_from: LoginFrom;
164
165
  date_format_id: string;
165
166
  time_zone_id: string;
167
+ login_from: LoginFrom;
166
168
  organisation_id: string;
167
- db_instance: string;
168
- db_index: string;
169
169
  vehicle_ids: string[];
170
170
  from_date: string;
171
171
  to_date: string;
@@ -173,12 +173,12 @@ declare const SimpleReportSchema: z.ZodObject<{
173
173
  interval_seconds: number;
174
174
  boolean_type: BooleanType;
175
175
  }, {
176
- login_from: LoginFrom;
176
+ db_index: string;
177
+ db_instance: string;
177
178
  date_format_id: string;
178
179
  time_zone_id: string;
180
+ login_from: LoginFrom;
179
181
  organisation_id: string;
180
- db_instance: string;
181
- db_index: string;
182
182
  from_date: string;
183
183
  to_date: string;
184
184
  gps_type: GPSType;
@@ -207,26 +207,26 @@ declare const MultipleVehicleLast24HoursReportSchema: z.ZodObject<{
207
207
  utilization_km: z.ZodEffects<z.ZodNumber, number, unknown>;
208
208
  is12am: z.ZodType<Is12AM, z.ZodTypeDef, Is12AM>;
209
209
  }, "strip", z.ZodTypeAny, {
210
+ db_index: string;
211
+ db_instance: string;
210
212
  search: string;
211
213
  paging: PAGING;
212
214
  page_count: number;
213
215
  page_index: number;
214
- login_from: LoginFrom;
215
216
  date_format_id: string;
216
217
  time_zone_id: string;
218
+ login_from: LoginFrom;
217
219
  organisation_id: string;
218
- db_instance: string;
219
- db_index: string;
220
220
  vehicle_ids: string[];
221
221
  utilization_km: number;
222
222
  is12am: Is12AM;
223
223
  }, {
224
- login_from: LoginFrom;
224
+ db_index: string;
225
+ db_instance: string;
225
226
  date_format_id: string;
226
227
  time_zone_id: string;
228
+ login_from: LoginFrom;
227
229
  organisation_id: string;
228
- db_instance: string;
229
- db_index: string;
230
230
  is12am: Is12AM;
231
231
  search?: string | undefined;
232
232
  paging?: PAGING | undefined;
@@ -253,28 +253,28 @@ declare const SingleVehicleReportSchema: z.ZodObject<{
253
253
  to_date_time: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
254
254
  interval_seconds: z.ZodEffects<z.ZodNumber, number, unknown>;
255
255
  }, "strip", z.ZodTypeAny, {
256
+ db_index: string;
257
+ db_instance: string;
258
+ vehicle_id: string;
256
259
  search: string;
257
260
  paging: PAGING;
258
261
  page_count: number;
259
262
  page_index: number;
260
- login_from: LoginFrom;
261
263
  date_format_id: string;
262
264
  time_zone_id: string;
265
+ login_from: LoginFrom;
263
266
  organisation_id: string;
264
- db_instance: string;
265
- db_index: string;
266
267
  interval_seconds: number;
267
- vehicle_id: string;
268
268
  from_date_time: string;
269
269
  to_date_time: string;
270
270
  }, {
271
- login_from: LoginFrom;
271
+ db_index: string;
272
+ db_instance: string;
273
+ vehicle_id: string;
272
274
  date_format_id: string;
273
275
  time_zone_id: string;
276
+ login_from: LoginFrom;
274
277
  organisation_id: string;
275
- db_instance: string;
276
- db_index: string;
277
- vehicle_id: string;
278
278
  from_date_time: string;
279
279
  to_date_time: string;
280
280
  search?: string | undefined;
@@ -298,25 +298,25 @@ declare const VehicleDashboardSummaryQuerySchema: z.ZodObject<{
298
298
  db_index: z.ZodEffects<z.ZodString, string, string>;
299
299
  vehicle_id: z.ZodEffects<z.ZodString, string, string>;
300
300
  }, "strip", z.ZodTypeAny, {
301
+ db_index: string;
302
+ db_instance: string;
303
+ vehicle_id: string;
301
304
  search: string;
302
305
  paging: PAGING;
303
306
  page_count: number;
304
307
  page_index: number;
305
- login_from: LoginFrom;
306
308
  date_format_id: string;
307
309
  time_zone_id: string;
310
+ login_from: LoginFrom;
308
311
  organisation_id: string;
309
- db_instance: string;
312
+ }, {
310
313
  db_index: string;
314
+ db_instance: string;
311
315
  vehicle_id: string;
312
- }, {
313
- login_from: LoginFrom;
314
316
  date_format_id: string;
315
317
  time_zone_id: string;
318
+ login_from: LoginFrom;
316
319
  organisation_id: string;
317
- db_instance: string;
318
- db_index: string;
319
- vehicle_id: string;
320
320
  search?: string | undefined;
321
321
  paging?: PAGING | undefined;
322
322
  page_count?: unknown;
@@ -0,0 +1,142 @@
1
+ import { Status, PAGING, LoadParents, LoadChild, LoadChildCount, OrderBy, YesNo } from '../../../core/Enums.js';
2
+ import { FBR, SBR } from '../../../core/BaseResponse.js';
3
+ import { z } from 'zod';
4
+ import { U as UserOrganisation, c as MasterMainCountry } from '../../../user_organisation_service-DJWj2iMa.js';
5
+ import '../../../zod_utils/zod_base_schema.js';
6
+ import '../main/master_main_sim_provider_service.js';
7
+
8
+ interface MasterFuelCompany extends Record<string, unknown> {
9
+ fuel_company_id: string;
10
+ company_name: string;
11
+ description?: string;
12
+ logo_url: String;
13
+ logo_key: String;
14
+ status: Status;
15
+ added_date_time: string;
16
+ modified_date_time: string;
17
+ organisation_id?: string;
18
+ UserOrganisation?: UserOrganisation;
19
+ country_id?: string;
20
+ MasterMainCountry?: MasterMainCountry;
21
+ }
22
+ declare const MasterFuelCompanySchema: z.ZodObject<{
23
+ organisation_id: z.ZodEffects<z.ZodString, string, string>;
24
+ country_id: z.ZodEffects<z.ZodString, string, string>;
25
+ company_name: z.ZodEffects<z.ZodString, string, string>;
26
+ description: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
27
+ logo_url: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
28
+ logo_key: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
29
+ status: z.ZodType<Status, z.ZodTypeDef, Status>;
30
+ }, "strip", z.ZodTypeAny, {
31
+ description: string;
32
+ status: Status;
33
+ organisation_id: string;
34
+ country_id: string;
35
+ company_name: string;
36
+ logo_url: string;
37
+ logo_key: string;
38
+ }, {
39
+ status: Status;
40
+ organisation_id: string;
41
+ country_id: string;
42
+ company_name: string;
43
+ description?: string | undefined;
44
+ logo_url?: string | undefined;
45
+ logo_key?: string | undefined;
46
+ }>;
47
+ type MasterFuelCompanyDTO = z.infer<typeof MasterFuelCompanySchema>;
48
+ declare const MasterFuelCompanyQuerySchema: z.ZodObject<{
49
+ search: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
50
+ status: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof Status>, "many">>>;
51
+ paging: z.ZodDefault<z.ZodOptional<z.ZodNativeEnum<typeof PAGING>>>;
52
+ page_count: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodNumber>>, number, unknown>;
53
+ page_index: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodNumber>>, number, unknown>;
54
+ load_parents: z.ZodDefault<z.ZodOptional<z.ZodNativeEnum<typeof LoadParents>>>;
55
+ load_parents_list: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
56
+ load_child: z.ZodDefault<z.ZodOptional<z.ZodNativeEnum<typeof LoadChild>>>;
57
+ load_child_list: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
58
+ load_child_count: z.ZodDefault<z.ZodOptional<z.ZodNativeEnum<typeof LoadChildCount>>>;
59
+ load_child_count_list: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
60
+ include_details: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
61
+ where_relations: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
62
+ order_by: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
63
+ name: z.ZodEffects<z.ZodString, string, string>;
64
+ field: z.ZodEffects<z.ZodString, string, string>;
65
+ direction: z.ZodType<OrderBy, z.ZodTypeDef, OrderBy>;
66
+ }, "strip", z.ZodTypeAny, {
67
+ name: string;
68
+ field: string;
69
+ direction: OrderBy;
70
+ }, {
71
+ name: string;
72
+ field: string;
73
+ direction: OrderBy;
74
+ }>, "many">>>;
75
+ include_master_data: z.ZodDefault<z.ZodOptional<z.ZodNativeEnum<typeof YesNo>>>;
76
+ date_format_id: z.ZodEffects<z.ZodString, string, string>;
77
+ time_zone_id: z.ZodEffects<z.ZodString, string, string>;
78
+ } & {
79
+ organisation_ids: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
80
+ country_ids: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
81
+ fuel_company_ids: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
82
+ }, "strip", z.ZodTypeAny, {
83
+ status: Status[];
84
+ search: string;
85
+ paging: PAGING;
86
+ page_count: number;
87
+ page_index: number;
88
+ load_parents: LoadParents;
89
+ load_parents_list: string[];
90
+ load_child: LoadChild;
91
+ load_child_list: string[];
92
+ load_child_count: LoadChildCount;
93
+ load_child_count_list: string[];
94
+ include_details: Record<string, any>;
95
+ where_relations: Record<string, any>;
96
+ order_by: {
97
+ name: string;
98
+ field: string;
99
+ direction: OrderBy;
100
+ }[];
101
+ include_master_data: YesNo;
102
+ date_format_id: string;
103
+ time_zone_id: string;
104
+ organisation_ids: string[];
105
+ country_ids: string[];
106
+ fuel_company_ids: string[];
107
+ }, {
108
+ date_format_id: string;
109
+ time_zone_id: string;
110
+ status?: Status[] | undefined;
111
+ search?: string | undefined;
112
+ paging?: PAGING | undefined;
113
+ page_count?: unknown;
114
+ page_index?: unknown;
115
+ load_parents?: LoadParents | undefined;
116
+ load_parents_list?: string[] | undefined;
117
+ load_child?: LoadChild | undefined;
118
+ load_child_list?: string[] | undefined;
119
+ load_child_count?: LoadChildCount | undefined;
120
+ load_child_count_list?: string[] | undefined;
121
+ include_details?: Record<string, any> | undefined;
122
+ where_relations?: Record<string, any> | undefined;
123
+ order_by?: {
124
+ name: string;
125
+ field: string;
126
+ direction: OrderBy;
127
+ }[] | undefined;
128
+ include_master_data?: YesNo | undefined;
129
+ organisation_ids?: string[] | undefined;
130
+ country_ids?: string[] | undefined;
131
+ fuel_company_ids?: string[] | undefined;
132
+ }>;
133
+ type MasterFuelCompanyQueryDTO = z.infer<typeof MasterFuelCompanyQuerySchema>;
134
+ declare const toMasterFuelCompanyPayload: (masterFuelCompany: MasterFuelCompany) => MasterFuelCompanyDTO;
135
+ declare const newMasterFuelCompanyPayload: () => MasterFuelCompanyDTO;
136
+ declare const findMasterFuelCompanys: (data: MasterFuelCompanyQueryDTO) => Promise<FBR<MasterFuelCompany[]>>;
137
+ declare const createMasterFuelCompany: (data: MasterFuelCompanyDTO) => Promise<SBR>;
138
+ declare const updateMasterFuelCompany: (id: string, data: MasterFuelCompanyDTO) => Promise<SBR>;
139
+ declare const deleteMasterFuelCompany: (id: string) => Promise<SBR>;
140
+ declare const getMasterFuelCompanyCache: (organisation_id: string) => Promise<FBR<MasterFuelCompany[]>>;
141
+
142
+ export { type MasterFuelCompany, type MasterFuelCompanyDTO, type MasterFuelCompanyQueryDTO, MasterFuelCompanyQuerySchema, MasterFuelCompanySchema, createMasterFuelCompany, deleteMasterFuelCompany, findMasterFuelCompanys, getMasterFuelCompanyCache, newMasterFuelCompanyPayload, toMasterFuelCompanyPayload, updateMasterFuelCompany };
@@ -0,0 +1,298 @@
1
+ // src/core/sdk-config.ts
2
+ var KEY = "__vms_axios_instance__";
3
+ var getAxiosInstance = () => {
4
+ const instance = globalThis[KEY];
5
+ if (!instance) {
6
+ throw new Error("\u274C Axios instance not configured. Call setAxiosInstance() first.");
7
+ }
8
+ return instance;
9
+ };
10
+
11
+ // src/core/apiCall.ts
12
+ var apiGet = async (url, params) => {
13
+ const response = await getAxiosInstance().get(url, { params });
14
+ return response.data;
15
+ };
16
+ var apiPost = async (url, data) => {
17
+ const response = await getAxiosInstance().post(url, data);
18
+ return response.data;
19
+ };
20
+ var apiPatch = async (url, data) => {
21
+ const response = await getAxiosInstance().patch(url, data);
22
+ return response.data;
23
+ };
24
+ var apiDelete = async (url) => {
25
+ const response = await getAxiosInstance().delete(url);
26
+ return response.data;
27
+ };
28
+
29
+ // src/services/master/expense/master_fuel_company_service.ts
30
+ import { z as z3 } from "zod";
31
+
32
+ // src/zod_utils/zod_utils.ts
33
+ import { z } from "zod";
34
+
35
+ // src/core/BaseResponse.ts
36
+ var r_log = (data = {}) => {
37
+ return data;
38
+ };
39
+
40
+ // src/zod_utils/zod_utils.ts
41
+ var handleNullOrUndefined = (value) => typeof value === "string" ? value : "";
42
+ var stringMandatory = (fieldName, min = 1, max = 100) => {
43
+ const schema = z.string().trim().min(min, `${fieldName} must be at least ${min} characters.`).max(max, `${fieldName} must be at most ${max} characters.`).nonempty(`${fieldName} is required.`).transform(handleNullOrUndefined);
44
+ return schema;
45
+ };
46
+ var stringOptional = (fieldName, min = 0, max = 255, defaultValue = "") => {
47
+ const schema = z.string().trim().min(min, `${fieldName} must be at least ${min} characters.`).max(max, `${fieldName} must be at most ${max} characters.`).transform(handleNullOrUndefined).default(defaultValue);
48
+ return schema;
49
+ };
50
+ var stringArrayOptional = (fieldName, min = 0, max = 100, defaultValue = [], unique = false) => {
51
+ const schema = z.array(z.string().trim(), {
52
+ invalid_type_error: `${fieldName} must be an array of strings.`
53
+ }).min(min, `${fieldName} must contain at least ${min} items.`).max(max, `${fieldName} must contain at most ${max} items.`);
54
+ if (unique) {
55
+ schema.refine(
56
+ (arr) => new Set(arr).size === arr.length,
57
+ `${fieldName} must contain unique values.`
58
+ );
59
+ }
60
+ return schema.optional().default(defaultValue);
61
+ };
62
+ var numberOptional = (fieldName, min = 0, max = 1e9, defaultValue = 0) => {
63
+ return z.preprocess(
64
+ (val) => typeof val === "string" && val.trim() !== "" ? Number(val) : val,
65
+ z.number({ invalid_type_error: `${fieldName} must be a number.` }).min(min, `${fieldName} must be at least ${min}.`).max(max, `${fieldName} must be at most ${max}.`).optional().default(defaultValue)
66
+ );
67
+ };
68
+ var enumMandatory = (fieldName, enumType, defaultValue) => {
69
+ return z.union([
70
+ z.nativeEnum(enumType, {
71
+ invalid_type_error: `${fieldName} should be one of the following values: ${Object.values(
72
+ enumType
73
+ ).join(", ")}.`
74
+ }),
75
+ z.string().refine((val) => Object.values(enumType).includes(val), {
76
+ message: `${fieldName} should be one of the following values: ${Object.values(
77
+ enumType
78
+ ).join(", ")}.`
79
+ })
80
+ ]).default(defaultValue).refine((val) => val !== "", {
81
+ message: `Please select ${fieldName}.`
82
+ });
83
+ };
84
+ var enumOptional = (fieldName, enumType, defaultValue) => {
85
+ return z.nativeEnum(enumType, {
86
+ invalid_type_error: `${fieldName} must be an array containing only the following values: ${Object.values(
87
+ enumType
88
+ ).join(", ")}.`
89
+ }).optional().default(() => defaultValue);
90
+ };
91
+ var getAllEnums = (enumType) => {
92
+ return Object.values(enumType);
93
+ };
94
+ var enumArrayOptional = (fieldName, enumType, defaultValue = getAllEnums(enumType), min = 0, max = 100, unique = false) => {
95
+ const schema = z.array(z.nativeEnum(enumType), {
96
+ invalid_type_error: `${fieldName} must be an array containing only the following values: ${Object.values(
97
+ enumType
98
+ ).join(", ")}.`
99
+ }).min(min, `${fieldName} must contain at least ${min} items.`).max(max, `${fieldName} must contain at most ${max} items.`);
100
+ if (unique) {
101
+ schema.refine(
102
+ (arr) => new Set(arr).size === arr.length,
103
+ `${fieldName} must contain unique values.`
104
+ );
105
+ }
106
+ return schema.optional().default(() => defaultValue);
107
+ };
108
+ var dynamicJsonSchema = (fieldName, defaultValue = {}) => z.record(z.any()).optional().default(() => defaultValue);
109
+ var single_select_mandatory = (fieldName) => {
110
+ const schema = z.string().trim().nonempty(`Please select ${fieldName}.`).transform(handleNullOrUndefined);
111
+ return schema;
112
+ };
113
+ var single_select_optional = (fieldName) => {
114
+ r_log(fieldName);
115
+ const schema = z.string().trim().transform(handleNullOrUndefined);
116
+ return schema;
117
+ };
118
+ var multi_select_optional = (fieldName, max = 1e3, defaultValue = []) => {
119
+ const schema = z.array(
120
+ z.string({
121
+ invalid_type_error: `${fieldName} must be an array of strings.`
122
+ })
123
+ ).max(
124
+ max,
125
+ `Please select at most ${max} ${fieldName}${max > 1 ? "s" : ""}.`
126
+ );
127
+ return schema.optional().default(defaultValue);
128
+ };
129
+
130
+ // src/zod_utils/zod_base_schema.ts
131
+ import { z as z2 } from "zod";
132
+
133
+ // src/core/Enums.ts
134
+ var PAGING = /* @__PURE__ */ ((PAGING2) => {
135
+ PAGING2["Yes"] = "Yes";
136
+ PAGING2["No"] = "No";
137
+ return PAGING2;
138
+ })(PAGING || {});
139
+ var LoadParents = /* @__PURE__ */ ((LoadParents2) => {
140
+ LoadParents2["Yes"] = "Yes";
141
+ LoadParents2["No"] = "No";
142
+ LoadParents2["Custom"] = "Custom";
143
+ return LoadParents2;
144
+ })(LoadParents || {});
145
+ var LoadChild = /* @__PURE__ */ ((LoadChild2) => {
146
+ LoadChild2["No"] = "No";
147
+ LoadChild2["Yes"] = "Yes";
148
+ LoadChild2["Count"] = "Count";
149
+ LoadChild2["Custom"] = "Custom";
150
+ LoadChild2["Direct"] = "Direct";
151
+ return LoadChild2;
152
+ })(LoadChild || {});
153
+ var LoadChildCount = /* @__PURE__ */ ((LoadChildCount2) => {
154
+ LoadChildCount2["No"] = "No";
155
+ LoadChildCount2["Yes"] = "Yes";
156
+ LoadChildCount2["Custom"] = "Custom";
157
+ return LoadChildCount2;
158
+ })(LoadChildCount || {});
159
+ var OrderBy = /* @__PURE__ */ ((OrderBy2) => {
160
+ OrderBy2["asc"] = "asc";
161
+ OrderBy2["desc"] = "desc";
162
+ return OrderBy2;
163
+ })(OrderBy || {});
164
+ var LoginFrom = /* @__PURE__ */ ((LoginFrom2) => {
165
+ LoginFrom2["Web"] = "Web";
166
+ LoginFrom2["Android"] = "Android";
167
+ LoginFrom2["IPhone"] = "IPhone";
168
+ return LoginFrom2;
169
+ })(LoginFrom || {});
170
+ var Status = /* @__PURE__ */ ((Status2) => {
171
+ Status2["Active"] = "Active";
172
+ Status2["Inactive"] = "Inactive";
173
+ return Status2;
174
+ })(Status || {});
175
+ var YesNo = /* @__PURE__ */ ((YesNo2) => {
176
+ YesNo2["Yes"] = "Yes";
177
+ YesNo2["No"] = "No";
178
+ return YesNo2;
179
+ })(YesNo || {});
180
+
181
+ // src/zod_utils/zod_base_schema.ts
182
+ var OrderBySchema = z2.array(
183
+ z2.object({
184
+ name: stringMandatory("Order Field Name", 0, 255),
185
+ field: stringMandatory("Order Field Name", 0, 255),
186
+ direction: enumMandatory("Order Direction", OrderBy, "asc" /* asc */)
187
+ })
188
+ );
189
+ var BaseQuerySchema = z2.object({
190
+ search: stringOptional("Search", 0, 255, ""),
191
+ status: enumArrayOptional("Status", Status, getAllEnums(Status), 0, 10, true),
192
+ paging: enumOptional("Paging", PAGING, "Yes" /* Yes */),
193
+ page_count: numberOptional("Page Count", 0, 1e3, 100),
194
+ page_index: numberOptional("Page Index", 0, 1e3, 0),
195
+ load_parents: enumOptional("Load Parents", LoadParents, "No" /* No */),
196
+ load_parents_list: stringArrayOptional("Load Parents List"),
197
+ load_child: enumOptional("Load Child", LoadChild, "No" /* No */),
198
+ load_child_list: stringArrayOptional("Load Child List"),
199
+ load_child_count: enumOptional(
200
+ "Load Child",
201
+ LoadChildCount,
202
+ "No" /* No */
203
+ ),
204
+ load_child_count_list: stringArrayOptional("Load Child List"),
205
+ include_details: dynamicJsonSchema("Include Details", {}),
206
+ where_relations: dynamicJsonSchema("Where Relations", {}),
207
+ order_by: OrderBySchema.optional().default([]),
208
+ include_master_data: enumOptional("Include Master Data", YesNo, "No" /* No */),
209
+ date_format_id: single_select_optional("MasterMainDateFormat"),
210
+ time_zone_id: single_select_optional("MasterMainTimeZone")
211
+ });
212
+ var MongoBaseQuerySchema = z2.object({
213
+ search: stringOptional("Search", 0, 255, ""),
214
+ paging: enumOptional("Paging", PAGING, "Yes" /* Yes */),
215
+ page_count: numberOptional("Page Count", 0, 1e3, 100),
216
+ page_index: numberOptional("Page Index", 0, 1e3, 0),
217
+ login_from: enumMandatory("Login From", LoginFrom, "Web" /* Web */),
218
+ date_format_id: single_select_optional("MasterMainDateFormat"),
219
+ // ✅ Single-selection -> MasterMainDateFormat
220
+ time_zone_id: single_select_optional("MasterMainTimeZone")
221
+ // ✅ Single-selection -> MasterMainTimeZone
222
+ });
223
+
224
+ // src/services/master/expense/master_fuel_company_service.ts
225
+ var URL = "master/expense/fuel_company";
226
+ var ENDPOINTS = {
227
+ find: `${URL}/search`,
228
+ create: URL,
229
+ update: (id) => `${URL}/${id}`,
230
+ delete: (id) => `${URL}/${id}`,
231
+ cache: (organisation_id) => `${URL}/cache/${organisation_id}`
232
+ };
233
+ var MasterFuelCompanySchema = z3.object({
234
+ organisation_id: single_select_mandatory("Organisation"),
235
+ // ✅ Single-selection -> UserOrganisation
236
+ country_id: single_select_mandatory("Master Main Country"),
237
+ // ✅ Single-selection -> MasterMainCountry
238
+ company_name: stringMandatory("Company Name", 3, 100),
239
+ description: stringOptional("Description", 0, 200),
240
+ logo_url: stringOptional("Logo URL", 0, 300),
241
+ logo_key: stringOptional("Logo Key", 0, 300),
242
+ status: enumMandatory("Status", Status, "Active" /* Active */)
243
+ });
244
+ var MasterFuelCompanyQuerySchema = BaseQuerySchema.extend({
245
+ organisation_ids: multi_select_optional("Organisation"),
246
+ // ✅ Multi-selection -> UserOrganisation
247
+ country_ids: multi_select_optional("Master Main Country"),
248
+ // ✅ Multi-selection -> MasterMainCountry
249
+ fuel_company_ids: multi_select_optional("Master Fuel Company")
250
+ // ✅ Multi-selection -> MasterFuelCompany
251
+ });
252
+ var toMasterFuelCompanyPayload = (masterFuelCompany) => ({
253
+ organisation_id: masterFuelCompany.organisation_id ?? "",
254
+ country_id: masterFuelCompany.country_id ?? "",
255
+ company_name: masterFuelCompany.company_name,
256
+ logo_url: "",
257
+ logo_key: "",
258
+ description: masterFuelCompany.description ?? "",
259
+ status: masterFuelCompany.status
260
+ });
261
+ var newMasterFuelCompanyPayload = () => ({
262
+ organisation_id: "",
263
+ country_id: "",
264
+ company_name: "",
265
+ description: "",
266
+ logo_url: "",
267
+ logo_key: "",
268
+ status: "Active" /* Active */
269
+ });
270
+ var findMasterFuelCompanys = async (data) => {
271
+ return apiPost(
272
+ ENDPOINTS.find,
273
+ data
274
+ );
275
+ };
276
+ var createMasterFuelCompany = async (data) => {
277
+ return apiPost(ENDPOINTS.create, data);
278
+ };
279
+ var updateMasterFuelCompany = async (id, data) => {
280
+ return apiPatch(ENDPOINTS.update(id), data);
281
+ };
282
+ var deleteMasterFuelCompany = async (id) => {
283
+ return apiDelete(ENDPOINTS.delete(id));
284
+ };
285
+ var getMasterFuelCompanyCache = async (organisation_id) => {
286
+ return apiGet(ENDPOINTS.cache(organisation_id));
287
+ };
288
+ export {
289
+ MasterFuelCompanyQuerySchema,
290
+ MasterFuelCompanySchema,
291
+ createMasterFuelCompany,
292
+ deleteMasterFuelCompany,
293
+ findMasterFuelCompanys,
294
+ getMasterFuelCompanyCache,
295
+ newMasterFuelCompanyPayload,
296
+ toMasterFuelCompanyPayload,
297
+ updateMasterFuelCompany
298
+ };