@meerkapp/wms-contracts 0.3.0-beta.13 → 0.3.0-beta.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -5,8 +5,42 @@ var PaginationQuerySchema = z.object({
5
5
  limit: z.coerce.number().int().min(1).max(100).default(20)
6
6
  });
7
7
 
8
+ // src/generated/schemas/enums/CurrencyCode.schema.ts
9
+ import * as z2 from "zod";
10
+ var CurrencyCodeSchema = z2.enum(["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRU", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLE", "SOS", "SRD", "SSP", "STN", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "UYU", "UZS", "VES", "VND", "VUV", "WST", "XAF", "XCD", "XOF", "XPF", "YER", "ZAR", "ZMW", "ZWL"]);
11
+
12
+ // src/common/currency/index.ts
13
+ var MINOR_UNIT_OVERRIDES = {
14
+ BHD: 3,
15
+ BIF: 0,
16
+ CLP: 0,
17
+ DJF: 0,
18
+ GNF: 0,
19
+ IQD: 3,
20
+ ISK: 0,
21
+ JOD: 3,
22
+ JPY: 0,
23
+ KMF: 0,
24
+ KRW: 0,
25
+ KWD: 3,
26
+ LYD: 3,
27
+ OMR: 3,
28
+ PYG: 0,
29
+ RWF: 0,
30
+ TND: 3,
31
+ UGX: 0,
32
+ VND: 0,
33
+ VUV: 0,
34
+ XAF: 0,
35
+ XOF: 0,
36
+ XPF: 0
37
+ };
38
+ function getCurrencyMinorUnits(currency) {
39
+ return MINOR_UNIT_OVERRIDES[currency] ?? 2;
40
+ }
41
+
8
42
  // src/modules/auth/index.ts
9
- import { z as z2 } from "zod";
43
+ import { z as z3 } from "zod";
10
44
  var ALL_PERMISSIONS = [
11
45
  "organization:create",
12
46
  "organization:update",
@@ -47,254 +81,255 @@ var ALL_PERMISSIONS = [
47
81
  "price_list:create",
48
82
  "price_list:update"
49
83
  ];
50
- var LoginSchema = z2.object({
51
- email: z2.string().email(),
52
- password: z2.string().min(1)
84
+ var LoginSchema = z3.object({
85
+ email: z3.string().email(),
86
+ password: z3.string().min(1)
53
87
  });
54
- var SetupInitSchema = z2.object({
55
- email: z2.string().email(),
56
- password: z2.string().min(8),
57
- firstName: z2.string().min(1),
58
- lastName: z2.string().min(1)
88
+ var SetupInitSchema = z3.object({
89
+ email: z3.string().email(),
90
+ password: z3.string().min(8),
91
+ firstName: z3.string().min(1),
92
+ lastName: z3.string().min(1)
59
93
  });
60
94
 
61
95
  // src/modules/organization/index.ts
62
- import { z as z4 } from "zod";
96
+ import { z as z5 } from "zod";
63
97
 
64
98
  // src/generated/schemas/variants/pure/Organization.pure.ts
65
- import * as z3 from "zod";
66
- var OrganizationModelSchema = z3.object({
67
- id: z3.number().int(),
68
- name: z3.string(),
69
- website: z3.string().nullable(),
70
- updatedAt: z3.date(),
71
- warehouses: z3.array(z3.unknown()),
72
- priceListAssignments: z3.array(z3.unknown())
99
+ import * as z4 from "zod";
100
+ var OrganizationModelSchema = z4.object({
101
+ id: z4.number().int(),
102
+ name: z4.string(),
103
+ website: z4.string().nullable(),
104
+ updatedAt: z4.date(),
105
+ warehouses: z4.array(z4.unknown()),
106
+ priceListAssignments: z4.array(z4.unknown())
73
107
  }).strict();
74
108
 
75
109
  // src/modules/organization/index.ts
76
- var CreateOrganizationSchema = z4.object({
77
- name: z4.string().min(1),
78
- website: z4.string().url().optional().nullable()
110
+ var CreateOrganizationSchema = z5.object({
111
+ name: z5.string().min(1),
112
+ website: z5.string().url().optional().nullable()
79
113
  });
80
114
  var UpdateOrganizationSchema = CreateOrganizationSchema.partial();
81
- var OrganizationSchema = OrganizationModelSchema.omit({ warehouses: true }).extend({ updatedAt: z4.string() });
115
+ var OrganizationSchema = OrganizationModelSchema.omit({ warehouses: true }).extend({ updatedAt: z5.string() });
82
116
 
83
117
  // src/modules/warehouse/index.ts
84
- import { z as z6 } from "zod";
118
+ import { z as z7 } from "zod";
85
119
 
86
120
  // src/generated/schemas/variants/pure/Warehouse.pure.ts
87
- import * as z5 from "zod";
88
- var WarehouseModelSchema = z5.object({
89
- id: z5.number().int(),
90
- address: z5.string(),
91
- note: z5.string().nullable(),
92
- code: z5.string(),
93
- organizationId: z5.number().int(),
94
- localityId: z5.number().int(),
95
- updatedAt: z5.date(),
96
- organization: z5.unknown(),
97
- locality: z5.unknown(),
98
- employees: z5.array(z5.unknown()),
99
- shipments: z5.array(z5.unknown()),
100
- priceListAssignments: z5.array(z5.unknown())
121
+ import * as z6 from "zod";
122
+ var WarehouseModelSchema = z6.object({
123
+ id: z6.number().int(),
124
+ address: z6.string(),
125
+ note: z6.string().nullable(),
126
+ code: z6.string(),
127
+ organizationId: z6.number().int(),
128
+ localityId: z6.number().int(),
129
+ updatedAt: z6.date(),
130
+ organization: z6.unknown(),
131
+ locality: z6.unknown(),
132
+ employees: z6.array(z6.unknown()),
133
+ shipments: z6.array(z6.unknown()),
134
+ priceListAssignments: z6.array(z6.unknown()),
135
+ stats: z6.array(z6.unknown())
101
136
  }).strict();
102
137
 
103
138
  // src/modules/warehouse/index.ts
104
- var CreateWarehouseSchema = z6.object({
105
- address: z6.string().min(1),
106
- note: z6.string().optional().nullable(),
107
- code: z6.string().min(1),
108
- organizationId: z6.number().int().positive(),
109
- localityId: z6.number().int().positive()
139
+ var CreateWarehouseSchema = z7.object({
140
+ address: z7.string().min(1),
141
+ note: z7.string().optional().nullable(),
142
+ code: z7.string().min(1),
143
+ organizationId: z7.number().int().positive(),
144
+ localityId: z7.number().int().positive()
110
145
  });
111
146
  var UpdateWarehouseSchema = CreateWarehouseSchema.partial();
112
- var WarehouseSchema = WarehouseModelSchema.omit({ organization: true, locality: true }).extend({ updatedAt: z6.string() });
147
+ var WarehouseSchema = WarehouseModelSchema.omit({ organization: true, locality: true }).extend({ updatedAt: z7.string() });
113
148
 
114
149
  // src/modules/locality/index.ts
115
- import { z as z8 } from "zod";
150
+ import { z as z9 } from "zod";
116
151
 
117
152
  // src/generated/schemas/variants/pure/Locality.pure.ts
118
- import * as z7 from "zod";
119
- var LocalityModelSchema = z7.object({
120
- id: z7.number().int(),
121
- name: z7.string(),
122
- countryId: z7.number().int(),
123
- updatedAt: z7.date(),
124
- country: z7.unknown(),
125
- warehouses: z7.array(z7.unknown()),
126
- priceListAssignments: z7.array(z7.unknown())
153
+ import * as z8 from "zod";
154
+ var LocalityModelSchema = z8.object({
155
+ id: z8.number().int(),
156
+ name: z8.string(),
157
+ countryId: z8.number().int(),
158
+ updatedAt: z8.date(),
159
+ country: z8.unknown(),
160
+ warehouses: z8.array(z8.unknown()),
161
+ priceListAssignments: z8.array(z8.unknown())
127
162
  }).strict();
128
163
 
129
164
  // src/modules/locality/index.ts
130
- var CreateLocalitySchema = z8.object({
131
- name: z8.string().min(1),
132
- countryId: z8.number().int().positive()
165
+ var CreateLocalitySchema = z9.object({
166
+ name: z9.string().min(1),
167
+ countryId: z9.number().int().positive()
133
168
  });
134
- var LocalitySchema = LocalityModelSchema.omit({ warehouses: true, country: true }).extend({ updatedAt: z8.string() });
169
+ var LocalitySchema = LocalityModelSchema.omit({ warehouses: true, country: true }).extend({ updatedAt: z9.string() });
135
170
 
136
171
  // src/modules/country/index.ts
137
- import { z as z10 } from "zod";
172
+ import { z as z11 } from "zod";
138
173
 
139
174
  // src/generated/schemas/variants/pure/Country.pure.ts
140
- import * as z9 from "zod";
141
- var CountryModelSchema = z9.object({
142
- id: z9.number().int(),
143
- code: z9.string(),
144
- updatedAt: z9.date(),
145
- localities: z9.array(z9.unknown()),
146
- products: z9.array(z9.unknown()),
147
- priceListAssignments: z9.array(z9.unknown())
175
+ import * as z10 from "zod";
176
+ var CountryModelSchema = z10.object({
177
+ id: z10.number().int(),
178
+ code: z10.string(),
179
+ updatedAt: z10.date(),
180
+ localities: z10.array(z10.unknown()),
181
+ products: z10.array(z10.unknown()),
182
+ priceListAssignments: z10.array(z10.unknown())
148
183
  }).strict();
149
184
 
150
185
  // src/modules/country/index.ts
151
- var CountrySchema = CountryModelSchema.omit({ localities: true }).extend({ updatedAt: z10.string() });
186
+ var CountrySchema = CountryModelSchema.omit({ localities: true }).extend({ updatedAt: z11.string() });
152
187
 
153
188
  // src/modules/employee/index.ts
154
- import { z as z13 } from "zod";
189
+ import { z as z14 } from "zod";
155
190
 
156
191
  // src/generated/schemas/variants/pure/Employee.pure.ts
157
- import * as z11 from "zod";
158
- var EmployeeModelSchema = z11.object({
159
- id: z11.string(),
160
- email: z11.string(),
161
- password: z11.string(),
162
- firstName: z11.string(),
163
- lastName: z11.string(),
164
- phone: z11.string().nullable(),
165
- avatarUrl: z11.string().nullable(),
166
- warehouseId: z11.number().int().nullable(),
167
- isActive: z11.boolean(),
168
- lastSeen: z11.date().nullable(),
169
- updatedAt: z11.date(),
170
- warehouse: z11.unknown().nullable(),
171
- roleAssignments: z11.array(z11.unknown())
192
+ import * as z12 from "zod";
193
+ var EmployeeModelSchema = z12.object({
194
+ id: z12.string(),
195
+ email: z12.string(),
196
+ password: z12.string(),
197
+ firstName: z12.string(),
198
+ lastName: z12.string(),
199
+ phone: z12.string().nullable(),
200
+ avatarUrl: z12.string().nullable(),
201
+ warehouseId: z12.number().int().nullable(),
202
+ isActive: z12.boolean(),
203
+ lastSeen: z12.date().nullable(),
204
+ updatedAt: z12.date(),
205
+ warehouse: z12.unknown().nullable(),
206
+ roleAssignments: z12.array(z12.unknown())
172
207
  }).strict();
173
208
 
174
209
  // src/generated/schemas/variants/pure/EmployeeRole.pure.ts
175
- import * as z12 from "zod";
176
- var EmployeeRoleModelSchema = z12.object({
177
- id: z12.number().int(),
178
- name: z12.string(),
179
- color: z12.string(),
180
- updatedAt: z12.date(),
181
- assignments: z12.array(z12.unknown()),
182
- permissions: z12.array(z12.unknown())
210
+ import * as z13 from "zod";
211
+ var EmployeeRoleModelSchema = z13.object({
212
+ id: z13.number().int(),
213
+ name: z13.string(),
214
+ color: z13.string(),
215
+ updatedAt: z13.date(),
216
+ assignments: z13.array(z13.unknown()),
217
+ permissions: z13.array(z13.unknown())
183
218
  }).strict();
184
219
 
185
220
  // src/modules/employee/index.ts
186
- var EmployeeRoleSchema = EmployeeRoleModelSchema.omit({ assignments: true, permissions: true }).extend({ id: z13.number(), updatedAt: z13.string() });
221
+ var EmployeeRoleSchema = EmployeeRoleModelSchema.omit({ assignments: true, permissions: true }).extend({ id: z14.number(), updatedAt: z14.string() });
187
222
  var EmployeeSchema = EmployeeModelSchema.omit({ password: true, warehouse: true, roleAssignments: true }).extend({
188
- avatarUrl: z13.string().nullable(),
189
- phone: z13.string().nullable(),
190
- lastSeen: z13.string().nullable(),
191
- updatedAt: z13.string(),
192
- roleAssignments: z13.array(
193
- z13.object({
223
+ avatarUrl: z14.string().nullable(),
224
+ phone: z14.string().nullable(),
225
+ lastSeen: z14.string().nullable(),
226
+ updatedAt: z14.string(),
227
+ roleAssignments: z14.array(
228
+ z14.object({
194
229
  employeeRole: EmployeeRoleSchema
195
230
  })
196
231
  )
197
232
  });
198
- var CreateEmployeeSchema = z13.object({
199
- email: z13.string().email(),
200
- password: z13.string().min(8),
201
- firstName: z13.string().min(1),
202
- lastName: z13.string().min(1),
203
- phone: z13.string().min(7).max(20).optional(),
204
- warehouseId: z13.number().int().optional(),
205
- roleIds: z13.array(z13.number().int()).optional()
206
- });
207
- var UpdateEmployeeSchema = z13.object({
208
- firstName: z13.string().min(1).optional(),
209
- lastName: z13.string().min(1).optional(),
210
- phone: z13.string().min(7).max(20).nullable().optional(),
211
- warehouseId: z13.number().int().nullable().optional(),
212
- roleIds: z13.array(z13.number().int()).optional(),
213
- email: z13.string().email().optional(),
214
- newPassword: z13.string().min(8).optional(),
215
- isActive: z13.boolean().optional()
216
- });
217
- var UpdateOwnProfileSchema = z13.object({
218
- firstName: z13.string().min(1).optional(),
219
- lastName: z13.string().min(1).optional(),
220
- phone: z13.string().min(7).max(20).nullable().optional(),
221
- email: z13.string().email().optional()
222
- });
223
- var UpdateOwnPasswordSchema = z13.object({
224
- currentPassword: z13.string().min(1),
225
- newPassword: z13.string().min(8)
233
+ var CreateEmployeeSchema = z14.object({
234
+ email: z14.string().email(),
235
+ password: z14.string().min(8),
236
+ firstName: z14.string().min(1),
237
+ lastName: z14.string().min(1),
238
+ phone: z14.string().min(7).max(20).optional(),
239
+ warehouseId: z14.number().int().optional(),
240
+ roleIds: z14.array(z14.number().int()).optional()
241
+ });
242
+ var UpdateEmployeeSchema = z14.object({
243
+ firstName: z14.string().min(1).optional(),
244
+ lastName: z14.string().min(1).optional(),
245
+ phone: z14.string().min(7).max(20).nullable().optional(),
246
+ warehouseId: z14.number().int().nullable().optional(),
247
+ roleIds: z14.array(z14.number().int()).optional(),
248
+ email: z14.string().email().optional(),
249
+ newPassword: z14.string().min(8).optional(),
250
+ isActive: z14.boolean().optional()
251
+ });
252
+ var UpdateOwnProfileSchema = z14.object({
253
+ firstName: z14.string().min(1).optional(),
254
+ lastName: z14.string().min(1).optional(),
255
+ phone: z14.string().min(7).max(20).nullable().optional(),
256
+ email: z14.string().email().optional()
257
+ });
258
+ var UpdateOwnPasswordSchema = z14.object({
259
+ currentPassword: z14.string().min(1),
260
+ newPassword: z14.string().min(8)
226
261
  });
227
262
 
228
263
  // src/modules/role/index.ts
229
- import { z as z14 } from "zod";
230
- var RolePermissionItemSchema = z14.object({
231
- employeePermission: z14.object({
232
- id: z14.number(),
233
- name: z14.string()
264
+ import { z as z15 } from "zod";
265
+ var RolePermissionItemSchema = z15.object({
266
+ employeePermission: z15.object({
267
+ id: z15.number(),
268
+ name: z15.string()
234
269
  })
235
270
  });
236
271
  var RoleSchema = EmployeeRoleModelSchema.omit({ assignments: true, permissions: true }).extend({
237
- id: z14.number(),
238
- updatedAt: z14.string(),
239
- permissions: z14.array(RolePermissionItemSchema)
272
+ id: z15.number(),
273
+ updatedAt: z15.string(),
274
+ permissions: z15.array(RolePermissionItemSchema)
240
275
  });
241
- var CreateRoleSchema = z14.object({
242
- name: z14.string().min(1),
243
- color: z14.string(),
244
- permissionIds: z14.array(z14.number().int()).optional()
276
+ var CreateRoleSchema = z15.object({
277
+ name: z15.string().min(1),
278
+ color: z15.string(),
279
+ permissionIds: z15.array(z15.number().int()).optional()
245
280
  });
246
- var UpdateRoleSchema = z14.object({
247
- name: z14.string().min(1).optional(),
248
- color: z14.string().optional(),
249
- permissionIds: z14.array(z14.number().int()).optional()
281
+ var UpdateRoleSchema = z15.object({
282
+ name: z15.string().min(1).optional(),
283
+ color: z15.string().optional(),
284
+ permissionIds: z15.array(z15.number().int()).optional()
250
285
  });
251
286
 
252
287
  // src/modules/product-type/index.ts
253
- import { z as z15 } from "zod";
254
- var NumberCharacteristicSchema = z15.object({
255
- key: z15.string().min(1),
256
- label: z15.string().min(1),
257
- type: z15.literal("number"),
258
- required: z15.boolean().default(false),
259
- validation: z15.object({
260
- min: z15.number().optional(),
261
- max: z15.number().optional()
288
+ import { z as z16 } from "zod";
289
+ var NumberCharacteristicSchema = z16.object({
290
+ key: z16.string().min(1),
291
+ label: z16.string().min(1),
292
+ type: z16.literal("number"),
293
+ required: z16.boolean().default(false),
294
+ validation: z16.object({
295
+ min: z16.number().optional(),
296
+ max: z16.number().optional()
262
297
  }).optional(),
263
- ui: z15.object({
264
- suffix: z15.string().optional()
298
+ ui: z16.object({
299
+ suffix: z16.string().optional()
265
300
  }).optional()
266
301
  });
267
- var SelectOptionSchema = z15.object({
268
- label: z15.string().min(1),
269
- value: z15.string().min(1)
270
- });
271
- var SelectCharacteristicSchema = z15.object({
272
- key: z15.string().min(1),
273
- label: z15.string().min(1),
274
- type: z15.literal("select"),
275
- required: z15.boolean().default(false),
276
- options: z15.array(SelectOptionSchema).min(1)
277
- });
278
- var ToggleCharacteristicSchema = z15.object({
279
- key: z15.string().min(1),
280
- label: z15.string().min(1),
281
- type: z15.literal("toggle"),
282
- required: z15.boolean().default(false),
283
- true_label: z15.string().min(1),
284
- false_label: z15.string().min(1)
285
- });
286
- var CheckboxCharacteristicSchema = z15.object({
287
- key: z15.string().min(1),
288
- label: z15.string().min(1),
289
- type: z15.literal("checkbox")
290
- });
291
- var CharacteristicSchema = z15.discriminatedUnion("type", [
302
+ var SelectOptionSchema = z16.object({
303
+ label: z16.string().min(1),
304
+ value: z16.string().min(1)
305
+ });
306
+ var SelectCharacteristicSchema = z16.object({
307
+ key: z16.string().min(1),
308
+ label: z16.string().min(1),
309
+ type: z16.literal("select"),
310
+ required: z16.boolean().default(false),
311
+ options: z16.array(SelectOptionSchema).min(1)
312
+ });
313
+ var ToggleCharacteristicSchema = z16.object({
314
+ key: z16.string().min(1),
315
+ label: z16.string().min(1),
316
+ type: z16.literal("toggle"),
317
+ required: z16.boolean().default(false),
318
+ true_label: z16.string().min(1),
319
+ false_label: z16.string().min(1)
320
+ });
321
+ var CheckboxCharacteristicSchema = z16.object({
322
+ key: z16.string().min(1),
323
+ label: z16.string().min(1),
324
+ type: z16.literal("checkbox")
325
+ });
326
+ var CharacteristicSchema = z16.discriminatedUnion("type", [
292
327
  NumberCharacteristicSchema,
293
328
  SelectCharacteristicSchema,
294
329
  ToggleCharacteristicSchema,
295
330
  CheckboxCharacteristicSchema
296
331
  ]);
297
- var CharacteristicsSchemeSchema = z15.array(CharacteristicSchema);
332
+ var CharacteristicsSchemeSchema = z16.array(CharacteristicSchema);
298
333
  var SKU_TEMPLATE_REGEX = /^(\{(brand|counter)(?::\d+)?\}|\{[a-z_]+(?::\d+)?\}|[^{}]+)+$/;
299
334
  var RESERVED_SKU_KEYS = /* @__PURE__ */ new Set(["brand", "counter"]);
300
335
  var SKU_COMPATIBLE_TYPES = /* @__PURE__ */ new Set(["number", "select", "toggle"]);
@@ -306,11 +341,11 @@ function validateSkuTemplate(data) {
306
341
  const templateKeys = [...data.skuTemplate.matchAll(/\{([a-z_]+)(?::\d+)?\}/g)].map(([, key]) => key).filter((key) => !RESERVED_SKU_KEYS.has(key));
307
342
  return templateKeys.every((key) => skuCompatibleKeys.has(key));
308
343
  }
309
- var ProductTypeBaseSchema = z15.object({
310
- name: z15.string().min(1),
311
- defaultWriteoffStrategy: z15.enum(["FIFO", "LIFO", "FEFO", "MANUAL"]).default("FIFO"),
312
- skuMode: z15.enum(["GLOBAL", "CUSTOM"]).default("GLOBAL"),
313
- skuTemplate: z15.string().regex(SKU_TEMPLATE_REGEX, "Invalid SKU template format").optional().nullable(),
344
+ var ProductTypeBaseSchema = z16.object({
345
+ name: z16.string().min(1),
346
+ defaultWriteoffStrategy: z16.enum(["FIFO", "LIFO", "FEFO", "MANUAL"]).default("FIFO"),
347
+ skuMode: z16.enum(["GLOBAL", "CUSTOM"]).default("GLOBAL"),
348
+ skuTemplate: z16.string().regex(SKU_TEMPLATE_REGEX, "Invalid SKU template format").optional().nullable(),
314
349
  characteristicsScheme: CharacteristicsSchemeSchema.optional().nullable()
315
350
  });
316
351
  var CreateProductTypeSchema = ProductTypeBaseSchema.refine(
@@ -327,119 +362,169 @@ var UpdateProductTypeSchema = ProductTypeBaseSchema.partial().refine(
327
362
  message: "All keys in skuTemplate must be required characteristics of type number, select or toggle",
328
363
  path: ["skuTemplate"]
329
364
  });
330
- var ProductTypeSchema = z15.object({
331
- id: z15.number(),
332
- name: z15.string(),
333
- defaultWriteoffStrategy: z15.enum(["FIFO", "LIFO", "FEFO", "MANUAL"]),
334
- skuMode: z15.enum(["GLOBAL", "CUSTOM"]),
335
- skuTemplate: z15.string().nullable(),
336
- skuCounter: z15.number(),
337
- characteristicsScheme: CharacteristicsSchemeSchema.nullable(),
338
- updatedAt: z15.string()
339
- });
340
-
341
- // src/modules/folder/index.ts
342
- import { z as z16 } from "zod";
343
- var CreateFolderSchema = z16.object({
344
- name: z16.string().min(1),
345
- parentId: z16.number().int().positive().optional().nullable()
346
- });
347
- var UpdateFolderSchema = CreateFolderSchema.partial();
348
- var FolderSchema = z16.object({
365
+ var ProductTypeSchema = z16.object({
349
366
  id: z16.number(),
350
367
  name: z16.string(),
351
- parentId: z16.number().nullable(),
352
- pinnedAt: z16.string().nullable(),
353
- pinOrder: z16.number().nullable(),
368
+ defaultWriteoffStrategy: z16.enum(["FIFO", "LIFO", "FEFO", "MANUAL"]),
369
+ skuMode: z16.enum(["GLOBAL", "CUSTOM"]),
370
+ skuTemplate: z16.string().nullable(),
371
+ skuCounter: z16.number(),
372
+ characteristicsScheme: CharacteristicsSchemeSchema.nullable(),
354
373
  updatedAt: z16.string()
355
374
  });
356
375
 
357
- // src/modules/product-collection/index.ts
376
+ // src/modules/folder/index.ts
358
377
  import { z as z17 } from "zod";
359
- var CreateProductCollectionSchema = z17.object({
378
+ var CreateFolderSchema = z17.object({
360
379
  name: z17.string().min(1),
361
- folderId: z17.number().int().positive().optional().nullable(),
362
- defaultProductTypeId: z17.number().int().positive().optional().nullable()
380
+ parentId: z17.number().int().positive().optional().nullable()
363
381
  });
364
- var UpdateProductCollectionSchema = CreateProductCollectionSchema.partial();
365
- var ProductCollectionSchema = z17.object({
382
+ var UpdateFolderSchema = CreateFolderSchema.partial();
383
+ var FolderSchema = z17.object({
366
384
  id: z17.number(),
367
385
  name: z17.string(),
368
- folderId: z17.number().nullable(),
369
- defaultProductTypeId: z17.number().nullable(),
386
+ parentId: z17.number().nullable(),
370
387
  pinnedAt: z17.string().nullable(),
371
388
  pinOrder: z17.number().nullable(),
372
389
  updatedAt: z17.string()
373
390
  });
374
391
 
392
+ // src/modules/product-collection/index.ts
393
+ import { z as z18 } from "zod";
394
+ var CreateProductCollectionSchema = z18.object({
395
+ name: z18.string().min(1),
396
+ folderId: z18.number().int().positive().optional().nullable(),
397
+ defaultProductTypeId: z18.number().int().positive().optional().nullable()
398
+ });
399
+ var UpdateProductCollectionSchema = CreateProductCollectionSchema.partial();
400
+ var ProductCollectionSchema = z18.object({
401
+ id: z18.number(),
402
+ name: z18.string(),
403
+ folderId: z18.number().nullable(),
404
+ defaultProductTypeId: z18.number().nullable(),
405
+ pinnedAt: z18.string().nullable(),
406
+ pinOrder: z18.number().nullable(),
407
+ updatedAt: z18.string()
408
+ });
409
+
375
410
  // src/modules/product-measure/index.ts
376
- import { z as z19 } from "zod";
411
+ import { z as z20 } from "zod";
377
412
 
378
413
  // src/generated/schemas/variants/pure/ProductMeasure.pure.ts
379
- import * as z18 from "zod";
380
- var ProductMeasureModelSchema = z18.object({
381
- id: z18.number().int(),
382
- name: z18.string().nullable(),
383
- code: z18.string().nullable(),
384
- updatedAt: z18.date(),
385
- products: z18.array(z18.unknown())
414
+ import * as z19 from "zod";
415
+ var ProductMeasureModelSchema = z19.object({
416
+ id: z19.number().int(),
417
+ name: z19.string().nullable(),
418
+ code: z19.string().nullable(),
419
+ updatedAt: z19.date(),
420
+ products: z19.array(z19.unknown())
386
421
  }).strict();
387
422
 
388
423
  // src/modules/product-measure/index.ts
389
- var ProductMeasureSchema = ProductMeasureModelSchema.omit({ products: true }).extend({ updatedAt: z19.string() });
424
+ var ProductMeasureSchema = ProductMeasureModelSchema.omit({ products: true }).extend({ updatedAt: z20.string() });
390
425
 
391
426
  // src/modules/product-brand/index.ts
392
- import { z as z21 } from "zod";
427
+ import { z as z22 } from "zod";
393
428
 
394
429
  // src/generated/schemas/variants/pure/ProductBrand.pure.ts
395
- import * as z20 from "zod";
396
- var ProductBrandModelSchema = z20.object({
397
- id: z20.number().int(),
398
- name: z20.string(),
399
- updatedAt: z20.date(),
400
- products: z20.array(z20.unknown())
430
+ import * as z21 from "zod";
431
+ var ProductBrandModelSchema = z21.object({
432
+ id: z21.number().int(),
433
+ name: z21.string(),
434
+ updatedAt: z21.date(),
435
+ products: z21.array(z21.unknown())
401
436
  }).strict();
402
437
 
403
438
  // src/modules/product-brand/index.ts
404
- var ProductBrandSchema = ProductBrandModelSchema.omit({ products: true }).extend({ updatedAt: z21.string() });
439
+ var ProductBrandSchema = ProductBrandModelSchema.omit({ products: true }).extend({ updatedAt: z22.string() });
405
440
 
406
441
  // src/modules/product-item/index.ts
407
- import { z as z25 } from "zod";
442
+ import { z as z26 } from "zod";
408
443
 
409
444
  // src/generated/schemas/variants/pure/ProductItem.pure.ts
410
- import * as z23 from "zod";
445
+ import * as z24 from "zod";
411
446
 
412
447
  // src/generated/schemas/enums/WriteoffStrategy.schema.ts
413
- import * as z22 from "zod";
414
- var WriteoffStrategySchema = z22.enum(["FIFO", "LIFO", "FEFO", "MANUAL"]);
448
+ import * as z23 from "zod";
449
+ var WriteoffStrategySchema = z23.enum(["FIFO", "LIFO", "FEFO", "MANUAL"]);
415
450
 
416
451
  // src/generated/schemas/variants/pure/ProductItem.pure.ts
417
- var ProductItemModelSchema = z23.object({
418
- id: z23.number().int(),
419
- sku: z23.string(),
420
- name: z23.string(),
421
- productCollectionId: z23.number().int().nullable(),
422
- productTypeId: z23.number().int(),
423
- productBrandId: z23.number().int().nullable(),
424
- productMeasureId: z23.number().int().nullable(),
425
- countryId: z23.number().int().nullable(),
426
- characteristics: z23.unknown(),
452
+ var ProductItemModelSchema = z24.object({
453
+ id: z24.number().int(),
454
+ sku: z24.string(),
455
+ name: z24.string(),
456
+ productCollectionId: z24.number().int().nullable(),
457
+ productTypeId: z24.number().int(),
458
+ productBrandId: z24.number().int().nullable(),
459
+ productMeasureId: z24.number().int().nullable(),
460
+ countryId: z24.number().int().nullable(),
461
+ characteristics: z24.unknown(),
427
462
  writeoffStrategy: WriteoffStrategySchema.nullable(),
428
- isPublic: z23.boolean(),
429
- updatedAt: z23.date(),
430
- productCollection: z23.unknown().nullable(),
431
- productType: z23.unknown(),
432
- productBrand: z23.unknown().nullable(),
433
- productMeasure: z23.unknown().nullable(),
434
- country: z23.unknown().nullable(),
435
- barcodes: z23.array(z23.unknown()),
436
- packages: z23.array(z23.unknown()),
437
- shipments: z23.array(z23.unknown())
463
+ isPublic: z24.boolean(),
464
+ updatedAt: z24.date(),
465
+ productCollection: z24.unknown().nullable(),
466
+ productType: z24.unknown(),
467
+ productBrand: z24.unknown().nullable(),
468
+ productMeasure: z24.unknown().nullable(),
469
+ country: z24.unknown().nullable(),
470
+ barcodes: z24.array(z24.unknown()),
471
+ packages: z24.array(z24.unknown()),
472
+ shipments: z24.array(z24.unknown()),
473
+ stats: z24.array(z24.unknown())
438
474
  }).strict();
439
475
 
440
- // src/generated/schemas/enums/CurrencyCode.schema.ts
441
- import * as z24 from "zod";
442
- var CurrencyCodeSchema = z24.enum(["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRU", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLE", "SOS", "SRD", "SSP", "STN", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "UYU", "UZS", "VES", "VND", "VUV", "WST", "XAF", "XCD", "XOF", "XPF", "YER", "ZAR", "ZMW", "ZWL"]);
476
+ // src/modules/sync/index.ts
477
+ import { z as z25 } from "zod";
478
+ var SYNC_TABLE_NAMES = [
479
+ "country",
480
+ "locality",
481
+ "organization",
482
+ "warehouse",
483
+ "folder",
484
+ "product_collection",
485
+ "product_type",
486
+ "product_brand",
487
+ "product_measure",
488
+ "product_package",
489
+ "product_shipment",
490
+ "product_item",
491
+ "product_barcode",
492
+ "product_item_stats"
493
+ ];
494
+ var SyncTableNameSchema = z25.enum(SYNC_TABLE_NAMES);
495
+ var SyncCursorSchema = z25.union([z25.string(), z25.number(), z25.null()]);
496
+ var SyncEntityIdSchema = z25.union([z25.string(), z25.number()]);
497
+ function createSyncFetchResponseSchema(itemSchema) {
498
+ return z25.object({
499
+ items: z25.array(itemSchema),
500
+ cursor: SyncCursorSchema,
501
+ hasMore: z25.boolean()
502
+ });
503
+ }
504
+ function createSyncChangePayloadSchema(itemSchema) {
505
+ const ids = z25.array(SyncEntityIdSchema);
506
+ return z25.object({
507
+ added: z25.array(itemSchema).optional(),
508
+ modified: z25.array(itemSchema).optional(),
509
+ removed: ids.optional(),
510
+ upserted: z25.array(itemSchema).optional(),
511
+ deletedIds: ids.optional(),
512
+ deleted: ids.optional(),
513
+ cursor: SyncCursorSchema.optional()
514
+ });
515
+ }
516
+ function createSyncSocketPayloadSchema(itemSchema) {
517
+ const ids = z25.array(SyncEntityIdSchema);
518
+ return z25.object({
519
+ added: z25.array(itemSchema),
520
+ modified: z25.array(itemSchema),
521
+ removed: ids,
522
+ upserted: z25.array(itemSchema),
523
+ deletedIds: ids,
524
+ deleted: ids,
525
+ cursor: SyncCursorSchema
526
+ });
527
+ }
443
528
 
444
529
  // src/modules/product-item/index.ts
445
530
  var ProductItemSchema = ProductItemModelSchema.omit({
@@ -451,118 +536,206 @@ var ProductItemSchema = ProductItemModelSchema.omit({
451
536
  barcodes: true,
452
537
  packages: true,
453
538
  shipments: true
454
- }).extend({ updatedAt: z25.string() });
539
+ }).extend({ updatedAt: z26.string() });
455
540
  var ProductItemWithRelationsSchema = ProductItemSchema.extend({
456
541
  productBrand: ProductBrandSchema.nullable(),
457
542
  productMeasure: ProductMeasureSchema.nullable()
458
543
  });
459
- var ProductItemStatsQuerySchema = z25.object({
460
- productCollectionId: z25.coerce.number().int().positive(),
461
- warehouseId: z25.coerce.number().int().positive()
462
- });
463
- var ProductItemStatsSchema = z25.object({
464
- id: z25.number().int(),
465
- productItemId: z25.number().int(),
466
- warehouseId: z25.number().int(),
467
- quantity: z25.string(),
468
- retailPrice: z25.string().nullable(),
469
- currency: CurrencyCodeSchema.nullable()
470
- });
544
+ var ProductItemStatsQuerySchema = z26.object({
545
+ productCollectionId: z26.coerce.number().int().positive(),
546
+ warehouseId: z26.coerce.number().int().positive()
547
+ });
548
+ var ProductItemStatsFetchQuerySchema = z26.object({
549
+ warehouseId: z26.coerce.number().int().positive(),
550
+ productCollectionId: z26.coerce.number().int().positive().optional(),
551
+ cursor: z26.string().min(1).optional(),
552
+ limit: z26.coerce.number().int().positive().optional()
553
+ });
554
+ var ProductItemStatsSchema = z26.object({
555
+ id: z26.number().int(),
556
+ productItemId: z26.number().int(),
557
+ warehouseId: z26.number().int(),
558
+ quantity: z26.string(),
559
+ retailPrice: z26.string().nullable(),
560
+ currency: CurrencyCodeSchema.nullable(),
561
+ updatedAt: z26.string()
562
+ });
563
+ var ProductItemStatsFetchResponseSchema = createSyncFetchResponseSchema(ProductItemStatsSchema);
564
+ var ProductItemStatsChangePayloadSchema = createSyncChangePayloadSchema(ProductItemStatsSchema);
565
+ var ProductItemStatsSocketPayloadSchema = createSyncSocketPayloadSchema(ProductItemStatsSchema);
471
566
 
472
567
  // src/modules/product-barcode/index.ts
473
- import { z as z28 } from "zod";
568
+ import { z as z29 } from "zod";
474
569
 
475
570
  // src/generated/schemas/variants/pure/ProductBarcode.pure.ts
476
- import * as z27 from "zod";
571
+ import * as z28 from "zod";
477
572
 
478
573
  // src/generated/schemas/enums/BarcodeType.schema.ts
479
- import * as z26 from "zod";
480
- var BarcodeTypeSchema = z26.enum(["FACTORY", "CUSTOM"]);
574
+ import * as z27 from "zod";
575
+ var BarcodeTypeSchema = z27.enum(["FACTORY", "CUSTOM"]);
481
576
 
482
577
  // src/generated/schemas/variants/pure/ProductBarcode.pure.ts
483
- var ProductBarcodeModelSchema = z27.object({
484
- id: z27.number().int(),
485
- code: z27.string(),
578
+ var ProductBarcodeModelSchema = z28.object({
579
+ id: z28.number().int(),
580
+ code: z28.string(),
486
581
  type: BarcodeTypeSchema,
487
- productItemId: z27.number().int(),
488
- updatedAt: z27.date(),
489
- productItem: z27.unknown()
582
+ productItemId: z28.number().int(),
583
+ updatedAt: z28.date(),
584
+ productItem: z28.unknown()
490
585
  }).strict();
491
586
 
492
587
  // src/modules/product-barcode/index.ts
493
- var ProductBarcodeSchema = ProductBarcodeModelSchema.omit({ productItem: true }).extend({ updatedAt: z28.string() });
588
+ var ProductBarcodeSchema = ProductBarcodeModelSchema.omit({ productItem: true }).extend({ updatedAt: z29.string() });
494
589
 
495
590
  // src/modules/product-package/index.ts
496
- import { z as z30 } from "zod";
591
+ import { z as z31 } from "zod";
497
592
 
498
593
  // src/generated/schemas/variants/pure/ProductPackage.pure.ts
499
- import * as z29 from "zod";
500
- var ProductPackageModelSchema = z29.object({
501
- id: z29.number().int(),
502
- name: z29.string().nullable(),
503
- isBase: z29.boolean(),
504
- productItemId: z29.number().int(),
505
- conversionFactor: z29.number(),
506
- updatedAt: z29.date(),
507
- productItem: z29.unknown(),
508
- prices: z29.array(z29.unknown())
594
+ import * as z30 from "zod";
595
+ var ProductPackageModelSchema = z30.object({
596
+ id: z30.number().int(),
597
+ name: z30.string().nullable(),
598
+ isBase: z30.boolean(),
599
+ productItemId: z30.number().int(),
600
+ conversionFactor: z30.number(),
601
+ updatedAt: z30.date(),
602
+ productItem: z30.unknown(),
603
+ prices: z30.array(z30.unknown())
509
604
  }).strict();
510
605
 
511
606
  // src/modules/product-package/index.ts
512
- var ProductPackageSchema = ProductPackageModelSchema.omit({ productItem: true }).extend({ updatedAt: z30.string() });
607
+ var ProductPackageSchema = ProductPackageModelSchema.omit({ productItem: true }).extend({ updatedAt: z31.string() });
513
608
 
514
609
  // src/modules/product-shipment/index.ts
515
- import { z as z32 } from "zod";
610
+ import { z as z33 } from "zod";
516
611
 
517
612
  // src/generated/schemas/variants/pure/ProductShipment.pure.ts
518
- import * as z31 from "zod";
519
- var ProductShipmentModelSchema = z31.object({
520
- id: z31.number().int(),
521
- warehouseId: z31.number().int(),
522
- productItemId: z31.number().int(),
523
- arrivalDate: z31.date(),
524
- expiryDate: z31.date().nullable(),
525
- quantity: z31.number(),
526
- priceAmount: z31.bigint(),
613
+ import * as z32 from "zod";
614
+ var ProductShipmentModelSchema = z32.object({
615
+ id: z32.number().int(),
616
+ warehouseId: z32.number().int(),
617
+ productItemId: z32.number().int(),
618
+ arrivalDate: z32.date(),
619
+ expiryDate: z32.date().nullable(),
620
+ quantity: z32.number(),
621
+ priceAmount: z32.bigint(),
527
622
  currency: CurrencyCodeSchema,
528
- updatedAt: z31.date(),
529
- warehouse: z31.unknown(),
530
- productItem: z31.unknown()
623
+ updatedAt: z32.date(),
624
+ warehouse: z32.unknown(),
625
+ productItem: z32.unknown()
531
626
  }).strict();
532
627
 
533
628
  // src/modules/product-shipment/index.ts
534
629
  var ProductShipmentSchema = ProductShipmentModelSchema.omit({ warehouse: true, productItem: true }).extend({
535
- arrivalDate: z32.string(),
536
- expiryDate: z32.string().nullable(),
537
- updatedAt: z32.string()
630
+ arrivalDate: z33.string(),
631
+ expiryDate: z33.string().nullable(),
632
+ updatedAt: z33.string()
538
633
  });
539
634
 
540
635
  // src/modules/price-list/index.ts
541
- import { z as z34 } from "zod";
636
+ import { z as z36 } from "zod";
637
+
638
+ // src/generated/schemas/enums/PriceListTargetType.schema.ts
639
+ import * as z34 from "zod";
640
+ var PriceListTargetTypeSchema = z34.enum(["WAREHOUSE", "ORGANIZATION", "LOCALITY", "COUNTRY"]);
542
641
 
543
642
  // src/generated/schemas/variants/pure/PriceList.pure.ts
544
- import * as z33 from "zod";
545
- var PriceListModelSchema = z33.object({
546
- id: z33.number().int(),
547
- name: z33.string(),
643
+ import * as z35 from "zod";
644
+ var PriceListModelSchema = z35.object({
645
+ id: z35.number().int(),
646
+ name: z35.string(),
548
647
  currency: CurrencyCodeSchema,
549
- isDefault: z33.boolean(),
550
- createdAt: z33.date(),
551
- updatedAt: z33.date(),
552
- prices: z33.array(z33.unknown()),
553
- assignments: z33.array(z33.unknown())
648
+ isDefault: z35.boolean(),
649
+ createdAt: z35.date(),
650
+ updatedAt: z35.date(),
651
+ prices: z35.array(z35.unknown()),
652
+ assignments: z35.array(z35.unknown())
554
653
  }).strict();
555
654
 
556
655
  // src/modules/price-list/index.ts
557
- var CreatePriceListSchema = z34.object({
558
- name: z34.string().min(1),
656
+ var CreatePriceListSchema = z36.object({
657
+ name: z36.string().min(1),
559
658
  currency: CurrencyCodeSchema
560
659
  });
561
660
  var UpdatePriceListSchema = CreatePriceListSchema.partial();
562
661
  var PriceListSchema = PriceListModelSchema.omit({
563
662
  prices: true,
564
663
  assignments: true
565
- }).extend({ updatedAt: z34.string() });
664
+ }).extend({
665
+ createdAt: z36.string(),
666
+ updatedAt: z36.string()
667
+ });
668
+ var PriceListSummarySchema = PriceListSchema.extend({
669
+ assignmentCount: z36.number().int().nonnegative(),
670
+ priceCount: z36.number().int().nonnegative()
671
+ });
672
+ var PriceListAssignmentSchema = z36.object({
673
+ id: z36.number().int().positive(),
674
+ priceListId: z36.number().int().positive(),
675
+ targetType: PriceListTargetTypeSchema,
676
+ warehouseId: z36.number().int().positive().nullable(),
677
+ organizationId: z36.number().int().positive().nullable(),
678
+ localityId: z36.number().int().positive().nullable(),
679
+ countryId: z36.number().int().positive().nullable()
680
+ });
681
+ var IdArraySchema = z36.array(z36.number().int().positive());
682
+ var SetPriceListAssignmentsSchema = z36.object({
683
+ warehouseIds: IdArraySchema,
684
+ organizationIds: IdArraySchema,
685
+ localityIds: IdArraySchema,
686
+ countryIds: IdArraySchema
687
+ }).superRefine((value, context) => {
688
+ for (const [field, ids] of Object.entries(value)) {
689
+ if (new Set(ids).size !== ids.length) {
690
+ context.addIssue({
691
+ code: z36.ZodIssueCode.custom,
692
+ path: [field],
693
+ message: "Target ids must be unique"
694
+ });
695
+ }
696
+ }
697
+ });
698
+ var ProductPriceSchema = z36.object({
699
+ id: z36.number().int().positive(),
700
+ priceListId: z36.number().int().positive(),
701
+ productPackageId: z36.number().int().positive(),
702
+ priceAmount: z36.string().regex(/^\d+$/),
703
+ createdAt: z36.string(),
704
+ updatedAt: z36.string()
705
+ });
706
+ var ProductPriceInputSchema = z36.object({
707
+ productPackageId: z36.number().int().positive(),
708
+ priceAmount: z36.string().regex(/^\d+$/)
709
+ });
710
+ var UpdatePriceListPricesSchema = z36.object({
711
+ upserted: z36.array(ProductPriceInputSchema),
712
+ removedProductPackageIds: IdArraySchema
713
+ }).superRefine((value, context) => {
714
+ const upsertedIds = value.upserted.map((price) => price.productPackageId);
715
+ if (new Set(upsertedIds).size !== upsertedIds.length) {
716
+ context.addIssue({
717
+ code: z36.ZodIssueCode.custom,
718
+ path: ["upserted"],
719
+ message: "Product package ids must be unique"
720
+ });
721
+ }
722
+ const removedIds = value.removedProductPackageIds;
723
+ if (new Set(removedIds).size !== removedIds.length) {
724
+ context.addIssue({
725
+ code: z36.ZodIssueCode.custom,
726
+ path: ["removedProductPackageIds"],
727
+ message: "Product package ids must be unique"
728
+ });
729
+ }
730
+ const removedIdSet = new Set(removedIds);
731
+ if (upsertedIds.some((id) => removedIdSet.has(id))) {
732
+ context.addIssue({
733
+ code: z36.ZodIssueCode.custom,
734
+ path: ["removedProductPackageIds"],
735
+ message: "A product package cannot be updated and removed in the same request"
736
+ });
737
+ }
738
+ });
566
739
  export {
567
740
  ALL_PERMISSIONS,
568
741
  CharacteristicSchema,
@@ -577,6 +750,7 @@ export {
577
750
  CreateProductTypeSchema,
578
751
  CreateRoleSchema,
579
752
  CreateWarehouseSchema,
753
+ CurrencyCodeSchema,
580
754
  EmployeeRoleSchema,
581
755
  EmployeeSchema,
582
756
  FolderSchema,
@@ -584,31 +758,49 @@ export {
584
758
  LoginSchema,
585
759
  OrganizationSchema,
586
760
  PaginationQuerySchema,
761
+ PriceListAssignmentSchema,
587
762
  PriceListSchema,
763
+ PriceListSummarySchema,
588
764
  ProductBarcodeSchema,
589
765
  ProductBrandSchema,
590
766
  ProductCollectionSchema,
591
767
  ProductItemSchema,
768
+ ProductItemStatsChangePayloadSchema,
769
+ ProductItemStatsFetchQuerySchema,
770
+ ProductItemStatsFetchResponseSchema,
592
771
  ProductItemStatsQuerySchema,
593
772
  ProductItemStatsSchema,
773
+ ProductItemStatsSocketPayloadSchema,
594
774
  ProductItemWithRelationsSchema,
595
775
  ProductMeasureSchema,
596
776
  ProductPackageSchema,
777
+ ProductPriceInputSchema,
778
+ ProductPriceSchema,
597
779
  ProductShipmentSchema,
598
780
  ProductTypeSchema,
599
781
  RolePermissionItemSchema,
600
782
  RoleSchema,
783
+ SYNC_TABLE_NAMES,
784
+ SetPriceListAssignmentsSchema,
601
785
  SetupInitSchema,
786
+ SyncCursorSchema,
787
+ SyncEntityIdSchema,
788
+ SyncTableNameSchema,
602
789
  UpdateEmployeeSchema,
603
790
  UpdateFolderSchema,
604
791
  UpdateOrganizationSchema,
605
792
  UpdateOwnPasswordSchema,
606
793
  UpdateOwnProfileSchema,
794
+ UpdatePriceListPricesSchema,
607
795
  UpdatePriceListSchema,
608
796
  UpdateProductCollectionSchema,
609
797
  UpdateProductTypeSchema,
610
798
  UpdateRoleSchema,
611
799
  UpdateWarehouseSchema,
612
- WarehouseSchema
800
+ WarehouseSchema,
801
+ createSyncChangePayloadSchema,
802
+ createSyncFetchResponseSchema,
803
+ createSyncSocketPayloadSchema,
804
+ getCurrencyMinorUnits
613
805
  };
614
806
  //# sourceMappingURL=index.js.map