@meerkapp/wms-contracts 0.3.0-beta.14 → 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.cjs CHANGED
@@ -43,6 +43,7 @@ __export(index_exports, {
43
43
  CreateProductTypeSchema: () => CreateProductTypeSchema,
44
44
  CreateRoleSchema: () => CreateRoleSchema,
45
45
  CreateWarehouseSchema: () => CreateWarehouseSchema,
46
+ CurrencyCodeSchema: () => CurrencyCodeSchema,
46
47
  EmployeeRoleSchema: () => EmployeeRoleSchema,
47
48
  EmployeeSchema: () => EmployeeSchema,
48
49
  FolderSchema: () => FolderSchema,
@@ -50,7 +51,9 @@ __export(index_exports, {
50
51
  LoginSchema: () => LoginSchema,
51
52
  OrganizationSchema: () => OrganizationSchema,
52
53
  PaginationQuerySchema: () => PaginationQuerySchema,
54
+ PriceListAssignmentSchema: () => PriceListAssignmentSchema,
53
55
  PriceListSchema: () => PriceListSchema,
56
+ PriceListSummarySchema: () => PriceListSummarySchema,
54
57
  ProductBarcodeSchema: () => ProductBarcodeSchema,
55
58
  ProductBrandSchema: () => ProductBrandSchema,
56
59
  ProductCollectionSchema: () => ProductCollectionSchema,
@@ -64,11 +67,14 @@ __export(index_exports, {
64
67
  ProductItemWithRelationsSchema: () => ProductItemWithRelationsSchema,
65
68
  ProductMeasureSchema: () => ProductMeasureSchema,
66
69
  ProductPackageSchema: () => ProductPackageSchema,
70
+ ProductPriceInputSchema: () => ProductPriceInputSchema,
71
+ ProductPriceSchema: () => ProductPriceSchema,
67
72
  ProductShipmentSchema: () => ProductShipmentSchema,
68
73
  ProductTypeSchema: () => ProductTypeSchema,
69
74
  RolePermissionItemSchema: () => RolePermissionItemSchema,
70
75
  RoleSchema: () => RoleSchema,
71
76
  SYNC_TABLE_NAMES: () => SYNC_TABLE_NAMES,
77
+ SetPriceListAssignmentsSchema: () => SetPriceListAssignmentsSchema,
72
78
  SetupInitSchema: () => SetupInitSchema,
73
79
  SyncCursorSchema: () => SyncCursorSchema,
74
80
  SyncEntityIdSchema: () => SyncEntityIdSchema,
@@ -78,6 +84,7 @@ __export(index_exports, {
78
84
  UpdateOrganizationSchema: () => UpdateOrganizationSchema,
79
85
  UpdateOwnPasswordSchema: () => UpdateOwnPasswordSchema,
80
86
  UpdateOwnProfileSchema: () => UpdateOwnProfileSchema,
87
+ UpdatePriceListPricesSchema: () => UpdatePriceListPricesSchema,
81
88
  UpdatePriceListSchema: () => UpdatePriceListSchema,
82
89
  UpdateProductCollectionSchema: () => UpdateProductCollectionSchema,
83
90
  UpdateProductTypeSchema: () => UpdateProductTypeSchema,
@@ -86,7 +93,8 @@ __export(index_exports, {
86
93
  WarehouseSchema: () => WarehouseSchema,
87
94
  createSyncChangePayloadSchema: () => createSyncChangePayloadSchema,
88
95
  createSyncFetchResponseSchema: () => createSyncFetchResponseSchema,
89
- createSyncSocketPayloadSchema: () => createSyncSocketPayloadSchema
96
+ createSyncSocketPayloadSchema: () => createSyncSocketPayloadSchema,
97
+ getCurrencyMinorUnits: () => getCurrencyMinorUnits
90
98
  });
91
99
  module.exports = __toCommonJS(index_exports);
92
100
 
@@ -97,6 +105,40 @@ var PaginationQuerySchema = import_zod.z.object({
97
105
  limit: import_zod.z.coerce.number().int().min(1).max(100).default(20)
98
106
  });
99
107
 
108
+ // src/generated/schemas/enums/CurrencyCode.schema.ts
109
+ var z2 = __toESM(require("zod"), 1);
110
+ 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"]);
111
+
112
+ // src/common/currency/index.ts
113
+ var MINOR_UNIT_OVERRIDES = {
114
+ BHD: 3,
115
+ BIF: 0,
116
+ CLP: 0,
117
+ DJF: 0,
118
+ GNF: 0,
119
+ IQD: 3,
120
+ ISK: 0,
121
+ JOD: 3,
122
+ JPY: 0,
123
+ KMF: 0,
124
+ KRW: 0,
125
+ KWD: 3,
126
+ LYD: 3,
127
+ OMR: 3,
128
+ PYG: 0,
129
+ RWF: 0,
130
+ TND: 3,
131
+ UGX: 0,
132
+ VND: 0,
133
+ VUV: 0,
134
+ XAF: 0,
135
+ XOF: 0,
136
+ XPF: 0
137
+ };
138
+ function getCurrencyMinorUnits(currency) {
139
+ return MINOR_UNIT_OVERRIDES[currency] ?? 2;
140
+ }
141
+
100
142
  // src/modules/auth/index.ts
101
143
  var import_zod2 = require("zod");
102
144
  var ALL_PERMISSIONS = [
@@ -154,14 +196,14 @@ var SetupInitSchema = import_zod2.z.object({
154
196
  var import_zod3 = require("zod");
155
197
 
156
198
  // src/generated/schemas/variants/pure/Organization.pure.ts
157
- var z3 = __toESM(require("zod"), 1);
158
- var OrganizationModelSchema = z3.object({
159
- id: z3.number().int(),
160
- name: z3.string(),
161
- website: z3.string().nullable(),
162
- updatedAt: z3.date(),
163
- warehouses: z3.array(z3.unknown()),
164
- priceListAssignments: z3.array(z3.unknown())
199
+ var z4 = __toESM(require("zod"), 1);
200
+ var OrganizationModelSchema = z4.object({
201
+ id: z4.number().int(),
202
+ name: z4.string(),
203
+ website: z4.string().nullable(),
204
+ updatedAt: z4.date(),
205
+ warehouses: z4.array(z4.unknown()),
206
+ priceListAssignments: z4.array(z4.unknown())
165
207
  }).strict();
166
208
 
167
209
  // src/modules/organization/index.ts
@@ -176,21 +218,21 @@ var OrganizationSchema = OrganizationModelSchema.omit({ warehouses: true }).exte
176
218
  var import_zod4 = require("zod");
177
219
 
178
220
  // src/generated/schemas/variants/pure/Warehouse.pure.ts
179
- var z5 = __toESM(require("zod"), 1);
180
- var WarehouseModelSchema = z5.object({
181
- id: z5.number().int(),
182
- address: z5.string(),
183
- note: z5.string().nullable(),
184
- code: z5.string(),
185
- organizationId: z5.number().int(),
186
- localityId: z5.number().int(),
187
- updatedAt: z5.date(),
188
- organization: z5.unknown(),
189
- locality: z5.unknown(),
190
- employees: z5.array(z5.unknown()),
191
- shipments: z5.array(z5.unknown()),
192
- priceListAssignments: z5.array(z5.unknown()),
193
- stats: z5.array(z5.unknown())
221
+ var z6 = __toESM(require("zod"), 1);
222
+ var WarehouseModelSchema = z6.object({
223
+ id: z6.number().int(),
224
+ address: z6.string(),
225
+ note: z6.string().nullable(),
226
+ code: z6.string(),
227
+ organizationId: z6.number().int(),
228
+ localityId: z6.number().int(),
229
+ updatedAt: z6.date(),
230
+ organization: z6.unknown(),
231
+ locality: z6.unknown(),
232
+ employees: z6.array(z6.unknown()),
233
+ shipments: z6.array(z6.unknown()),
234
+ priceListAssignments: z6.array(z6.unknown()),
235
+ stats: z6.array(z6.unknown())
194
236
  }).strict();
195
237
 
196
238
  // src/modules/warehouse/index.ts
@@ -208,15 +250,15 @@ var WarehouseSchema = WarehouseModelSchema.omit({ organization: true, locality:
208
250
  var import_zod5 = require("zod");
209
251
 
210
252
  // src/generated/schemas/variants/pure/Locality.pure.ts
211
- var z7 = __toESM(require("zod"), 1);
212
- var LocalityModelSchema = z7.object({
213
- id: z7.number().int(),
214
- name: z7.string(),
215
- countryId: z7.number().int(),
216
- updatedAt: z7.date(),
217
- country: z7.unknown(),
218
- warehouses: z7.array(z7.unknown()),
219
- priceListAssignments: z7.array(z7.unknown())
253
+ var z8 = __toESM(require("zod"), 1);
254
+ var LocalityModelSchema = z8.object({
255
+ id: z8.number().int(),
256
+ name: z8.string(),
257
+ countryId: z8.number().int(),
258
+ updatedAt: z8.date(),
259
+ country: z8.unknown(),
260
+ warehouses: z8.array(z8.unknown()),
261
+ priceListAssignments: z8.array(z8.unknown())
220
262
  }).strict();
221
263
 
222
264
  // src/modules/locality/index.ts
@@ -230,14 +272,14 @@ var LocalitySchema = LocalityModelSchema.omit({ warehouses: true, country: true
230
272
  var import_zod6 = require("zod");
231
273
 
232
274
  // src/generated/schemas/variants/pure/Country.pure.ts
233
- var z9 = __toESM(require("zod"), 1);
234
- var CountryModelSchema = z9.object({
235
- id: z9.number().int(),
236
- code: z9.string(),
237
- updatedAt: z9.date(),
238
- localities: z9.array(z9.unknown()),
239
- products: z9.array(z9.unknown()),
240
- priceListAssignments: z9.array(z9.unknown())
275
+ var z10 = __toESM(require("zod"), 1);
276
+ var CountryModelSchema = z10.object({
277
+ id: z10.number().int(),
278
+ code: z10.string(),
279
+ updatedAt: z10.date(),
280
+ localities: z10.array(z10.unknown()),
281
+ products: z10.array(z10.unknown()),
282
+ priceListAssignments: z10.array(z10.unknown())
241
283
  }).strict();
242
284
 
243
285
  // src/modules/country/index.ts
@@ -247,32 +289,32 @@ var CountrySchema = CountryModelSchema.omit({ localities: true }).extend({ updat
247
289
  var import_zod7 = require("zod");
248
290
 
249
291
  // src/generated/schemas/variants/pure/Employee.pure.ts
250
- var z11 = __toESM(require("zod"), 1);
251
- var EmployeeModelSchema = z11.object({
252
- id: z11.string(),
253
- email: z11.string(),
254
- password: z11.string(),
255
- firstName: z11.string(),
256
- lastName: z11.string(),
257
- phone: z11.string().nullable(),
258
- avatarUrl: z11.string().nullable(),
259
- warehouseId: z11.number().int().nullable(),
260
- isActive: z11.boolean(),
261
- lastSeen: z11.date().nullable(),
262
- updatedAt: z11.date(),
263
- warehouse: z11.unknown().nullable(),
264
- roleAssignments: z11.array(z11.unknown())
292
+ var z12 = __toESM(require("zod"), 1);
293
+ var EmployeeModelSchema = z12.object({
294
+ id: z12.string(),
295
+ email: z12.string(),
296
+ password: z12.string(),
297
+ firstName: z12.string(),
298
+ lastName: z12.string(),
299
+ phone: z12.string().nullable(),
300
+ avatarUrl: z12.string().nullable(),
301
+ warehouseId: z12.number().int().nullable(),
302
+ isActive: z12.boolean(),
303
+ lastSeen: z12.date().nullable(),
304
+ updatedAt: z12.date(),
305
+ warehouse: z12.unknown().nullable(),
306
+ roleAssignments: z12.array(z12.unknown())
265
307
  }).strict();
266
308
 
267
309
  // src/generated/schemas/variants/pure/EmployeeRole.pure.ts
268
- var z12 = __toESM(require("zod"), 1);
269
- var EmployeeRoleModelSchema = z12.object({
270
- id: z12.number().int(),
271
- name: z12.string(),
272
- color: z12.string(),
273
- updatedAt: z12.date(),
274
- assignments: z12.array(z12.unknown()),
275
- permissions: z12.array(z12.unknown())
310
+ var z13 = __toESM(require("zod"), 1);
311
+ var EmployeeRoleModelSchema = z13.object({
312
+ id: z13.number().int(),
313
+ name: z13.string(),
314
+ color: z13.string(),
315
+ updatedAt: z13.date(),
316
+ assignments: z13.array(z13.unknown()),
317
+ permissions: z13.array(z13.unknown())
276
318
  }).strict();
277
319
 
278
320
  // src/modules/employee/index.ts
@@ -469,13 +511,13 @@ var ProductCollectionSchema = import_zod11.z.object({
469
511
  var import_zod12 = require("zod");
470
512
 
471
513
  // src/generated/schemas/variants/pure/ProductMeasure.pure.ts
472
- var z18 = __toESM(require("zod"), 1);
473
- var ProductMeasureModelSchema = z18.object({
474
- id: z18.number().int(),
475
- name: z18.string().nullable(),
476
- code: z18.string().nullable(),
477
- updatedAt: z18.date(),
478
- products: z18.array(z18.unknown())
514
+ var z19 = __toESM(require("zod"), 1);
515
+ var ProductMeasureModelSchema = z19.object({
516
+ id: z19.number().int(),
517
+ name: z19.string().nullable(),
518
+ code: z19.string().nullable(),
519
+ updatedAt: z19.date(),
520
+ products: z19.array(z19.unknown())
479
521
  }).strict();
480
522
 
481
523
  // src/modules/product-measure/index.ts
@@ -485,12 +527,12 @@ var ProductMeasureSchema = ProductMeasureModelSchema.omit({ products: true }).ex
485
527
  var import_zod13 = require("zod");
486
528
 
487
529
  // src/generated/schemas/variants/pure/ProductBrand.pure.ts
488
- var z20 = __toESM(require("zod"), 1);
489
- var ProductBrandModelSchema = z20.object({
490
- id: z20.number().int(),
491
- name: z20.string(),
492
- updatedAt: z20.date(),
493
- products: z20.array(z20.unknown())
530
+ var z21 = __toESM(require("zod"), 1);
531
+ var ProductBrandModelSchema = z21.object({
532
+ id: z21.number().int(),
533
+ name: z21.string(),
534
+ updatedAt: z21.date(),
535
+ products: z21.array(z21.unknown())
494
536
  }).strict();
495
537
 
496
538
  // src/modules/product-brand/index.ts
@@ -500,41 +542,37 @@ var ProductBrandSchema = ProductBrandModelSchema.omit({ products: true }).extend
500
542
  var import_zod15 = require("zod");
501
543
 
502
544
  // src/generated/schemas/variants/pure/ProductItem.pure.ts
503
- var z23 = __toESM(require("zod"), 1);
545
+ var z24 = __toESM(require("zod"), 1);
504
546
 
505
547
  // src/generated/schemas/enums/WriteoffStrategy.schema.ts
506
- var z22 = __toESM(require("zod"), 1);
507
- var WriteoffStrategySchema = z22.enum(["FIFO", "LIFO", "FEFO", "MANUAL"]);
548
+ var z23 = __toESM(require("zod"), 1);
549
+ var WriteoffStrategySchema = z23.enum(["FIFO", "LIFO", "FEFO", "MANUAL"]);
508
550
 
509
551
  // src/generated/schemas/variants/pure/ProductItem.pure.ts
510
- var ProductItemModelSchema = z23.object({
511
- id: z23.number().int(),
512
- sku: z23.string(),
513
- name: z23.string(),
514
- productCollectionId: z23.number().int().nullable(),
515
- productTypeId: z23.number().int(),
516
- productBrandId: z23.number().int().nullable(),
517
- productMeasureId: z23.number().int().nullable(),
518
- countryId: z23.number().int().nullable(),
519
- characteristics: z23.unknown(),
552
+ var ProductItemModelSchema = z24.object({
553
+ id: z24.number().int(),
554
+ sku: z24.string(),
555
+ name: z24.string(),
556
+ productCollectionId: z24.number().int().nullable(),
557
+ productTypeId: z24.number().int(),
558
+ productBrandId: z24.number().int().nullable(),
559
+ productMeasureId: z24.number().int().nullable(),
560
+ countryId: z24.number().int().nullable(),
561
+ characteristics: z24.unknown(),
520
562
  writeoffStrategy: WriteoffStrategySchema.nullable(),
521
- isPublic: z23.boolean(),
522
- updatedAt: z23.date(),
523
- productCollection: z23.unknown().nullable(),
524
- productType: z23.unknown(),
525
- productBrand: z23.unknown().nullable(),
526
- productMeasure: z23.unknown().nullable(),
527
- country: z23.unknown().nullable(),
528
- barcodes: z23.array(z23.unknown()),
529
- packages: z23.array(z23.unknown()),
530
- shipments: z23.array(z23.unknown()),
531
- stats: z23.array(z23.unknown())
563
+ isPublic: z24.boolean(),
564
+ updatedAt: z24.date(),
565
+ productCollection: z24.unknown().nullable(),
566
+ productType: z24.unknown(),
567
+ productBrand: z24.unknown().nullable(),
568
+ productMeasure: z24.unknown().nullable(),
569
+ country: z24.unknown().nullable(),
570
+ barcodes: z24.array(z24.unknown()),
571
+ packages: z24.array(z24.unknown()),
572
+ shipments: z24.array(z24.unknown()),
573
+ stats: z24.array(z24.unknown())
532
574
  }).strict();
533
575
 
534
- // src/generated/schemas/enums/CurrencyCode.schema.ts
535
- var z24 = __toESM(require("zod"), 1);
536
- 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"]);
537
-
538
576
  // src/modules/sync/index.ts
539
577
  var import_zod14 = require("zod");
540
578
  var SYNC_TABLE_NAMES = [
@@ -697,17 +735,21 @@ var ProductShipmentSchema = ProductShipmentModelSchema.omit({ warehouse: true, p
697
735
  // src/modules/price-list/index.ts
698
736
  var import_zod19 = require("zod");
699
737
 
700
- // src/generated/schemas/variants/pure/PriceList.pure.ts
738
+ // src/generated/schemas/enums/PriceListTargetType.schema.ts
701
739
  var z34 = __toESM(require("zod"), 1);
702
- var PriceListModelSchema = z34.object({
703
- id: z34.number().int(),
704
- name: z34.string(),
740
+ var PriceListTargetTypeSchema = z34.enum(["WAREHOUSE", "ORGANIZATION", "LOCALITY", "COUNTRY"]);
741
+
742
+ // src/generated/schemas/variants/pure/PriceList.pure.ts
743
+ var z35 = __toESM(require("zod"), 1);
744
+ var PriceListModelSchema = z35.object({
745
+ id: z35.number().int(),
746
+ name: z35.string(),
705
747
  currency: CurrencyCodeSchema,
706
- isDefault: z34.boolean(),
707
- createdAt: z34.date(),
708
- updatedAt: z34.date(),
709
- prices: z34.array(z34.unknown()),
710
- assignments: z34.array(z34.unknown())
748
+ isDefault: z35.boolean(),
749
+ createdAt: z35.date(),
750
+ updatedAt: z35.date(),
751
+ prices: z35.array(z35.unknown()),
752
+ assignments: z35.array(z35.unknown())
711
753
  }).strict();
712
754
 
713
755
  // src/modules/price-list/index.ts
@@ -719,7 +761,81 @@ var UpdatePriceListSchema = CreatePriceListSchema.partial();
719
761
  var PriceListSchema = PriceListModelSchema.omit({
720
762
  prices: true,
721
763
  assignments: true
722
- }).extend({ updatedAt: import_zod19.z.string() });
764
+ }).extend({
765
+ createdAt: import_zod19.z.string(),
766
+ updatedAt: import_zod19.z.string()
767
+ });
768
+ var PriceListSummarySchema = PriceListSchema.extend({
769
+ assignmentCount: import_zod19.z.number().int().nonnegative(),
770
+ priceCount: import_zod19.z.number().int().nonnegative()
771
+ });
772
+ var PriceListAssignmentSchema = import_zod19.z.object({
773
+ id: import_zod19.z.number().int().positive(),
774
+ priceListId: import_zod19.z.number().int().positive(),
775
+ targetType: PriceListTargetTypeSchema,
776
+ warehouseId: import_zod19.z.number().int().positive().nullable(),
777
+ organizationId: import_zod19.z.number().int().positive().nullable(),
778
+ localityId: import_zod19.z.number().int().positive().nullable(),
779
+ countryId: import_zod19.z.number().int().positive().nullable()
780
+ });
781
+ var IdArraySchema = import_zod19.z.array(import_zod19.z.number().int().positive());
782
+ var SetPriceListAssignmentsSchema = import_zod19.z.object({
783
+ warehouseIds: IdArraySchema,
784
+ organizationIds: IdArraySchema,
785
+ localityIds: IdArraySchema,
786
+ countryIds: IdArraySchema
787
+ }).superRefine((value, context) => {
788
+ for (const [field, ids] of Object.entries(value)) {
789
+ if (new Set(ids).size !== ids.length) {
790
+ context.addIssue({
791
+ code: import_zod19.z.ZodIssueCode.custom,
792
+ path: [field],
793
+ message: "Target ids must be unique"
794
+ });
795
+ }
796
+ }
797
+ });
798
+ var ProductPriceSchema = import_zod19.z.object({
799
+ id: import_zod19.z.number().int().positive(),
800
+ priceListId: import_zod19.z.number().int().positive(),
801
+ productPackageId: import_zod19.z.number().int().positive(),
802
+ priceAmount: import_zod19.z.string().regex(/^\d+$/),
803
+ createdAt: import_zod19.z.string(),
804
+ updatedAt: import_zod19.z.string()
805
+ });
806
+ var ProductPriceInputSchema = import_zod19.z.object({
807
+ productPackageId: import_zod19.z.number().int().positive(),
808
+ priceAmount: import_zod19.z.string().regex(/^\d+$/)
809
+ });
810
+ var UpdatePriceListPricesSchema = import_zod19.z.object({
811
+ upserted: import_zod19.z.array(ProductPriceInputSchema),
812
+ removedProductPackageIds: IdArraySchema
813
+ }).superRefine((value, context) => {
814
+ const upsertedIds = value.upserted.map((price) => price.productPackageId);
815
+ if (new Set(upsertedIds).size !== upsertedIds.length) {
816
+ context.addIssue({
817
+ code: import_zod19.z.ZodIssueCode.custom,
818
+ path: ["upserted"],
819
+ message: "Product package ids must be unique"
820
+ });
821
+ }
822
+ const removedIds = value.removedProductPackageIds;
823
+ if (new Set(removedIds).size !== removedIds.length) {
824
+ context.addIssue({
825
+ code: import_zod19.z.ZodIssueCode.custom,
826
+ path: ["removedProductPackageIds"],
827
+ message: "Product package ids must be unique"
828
+ });
829
+ }
830
+ const removedIdSet = new Set(removedIds);
831
+ if (upsertedIds.some((id) => removedIdSet.has(id))) {
832
+ context.addIssue({
833
+ code: import_zod19.z.ZodIssueCode.custom,
834
+ path: ["removedProductPackageIds"],
835
+ message: "A product package cannot be updated and removed in the same request"
836
+ });
837
+ }
838
+ });
723
839
  // Annotate the CommonJS export names for ESM import in node:
724
840
  0 && (module.exports = {
725
841
  ALL_PERMISSIONS,
@@ -735,6 +851,7 @@ var PriceListSchema = PriceListModelSchema.omit({
735
851
  CreateProductTypeSchema,
736
852
  CreateRoleSchema,
737
853
  CreateWarehouseSchema,
854
+ CurrencyCodeSchema,
738
855
  EmployeeRoleSchema,
739
856
  EmployeeSchema,
740
857
  FolderSchema,
@@ -742,7 +859,9 @@ var PriceListSchema = PriceListModelSchema.omit({
742
859
  LoginSchema,
743
860
  OrganizationSchema,
744
861
  PaginationQuerySchema,
862
+ PriceListAssignmentSchema,
745
863
  PriceListSchema,
864
+ PriceListSummarySchema,
746
865
  ProductBarcodeSchema,
747
866
  ProductBrandSchema,
748
867
  ProductCollectionSchema,
@@ -756,11 +875,14 @@ var PriceListSchema = PriceListModelSchema.omit({
756
875
  ProductItemWithRelationsSchema,
757
876
  ProductMeasureSchema,
758
877
  ProductPackageSchema,
878
+ ProductPriceInputSchema,
879
+ ProductPriceSchema,
759
880
  ProductShipmentSchema,
760
881
  ProductTypeSchema,
761
882
  RolePermissionItemSchema,
762
883
  RoleSchema,
763
884
  SYNC_TABLE_NAMES,
885
+ SetPriceListAssignmentsSchema,
764
886
  SetupInitSchema,
765
887
  SyncCursorSchema,
766
888
  SyncEntityIdSchema,
@@ -770,6 +892,7 @@ var PriceListSchema = PriceListModelSchema.omit({
770
892
  UpdateOrganizationSchema,
771
893
  UpdateOwnPasswordSchema,
772
894
  UpdateOwnProfileSchema,
895
+ UpdatePriceListPricesSchema,
773
896
  UpdatePriceListSchema,
774
897
  UpdateProductCollectionSchema,
775
898
  UpdateProductTypeSchema,
@@ -778,6 +901,7 @@ var PriceListSchema = PriceListModelSchema.omit({
778
901
  WarehouseSchema,
779
902
  createSyncChangePayloadSchema,
780
903
  createSyncFetchResponseSchema,
781
- createSyncSocketPayloadSchema
904
+ createSyncSocketPayloadSchema,
905
+ getCurrencyMinorUnits
782
906
  });
783
907
  //# sourceMappingURL=index.cjs.map