@artisan-commerce/builders 0.7.0-canary.8 → 0.7.0-canary.82

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.
Files changed (46) hide show
  1. package/dev/package.json +7 -0
  2. package/dist/bundle.cjs +2988 -0
  3. package/dist/bundle.cjs.map +1 -0
  4. package/dist/bundle.d.ts +3030 -0
  5. package/dist/bundle.mjs +2965 -0
  6. package/dist/bundle.mjs.map +1 -0
  7. package/dist/bundle.umd.js +2991 -0
  8. package/dist/bundle.umd.js.map +1 -0
  9. package/dist/noop.cjs +334 -0
  10. package/dist/noop.cjs.map +1 -0
  11. package/dist/noop.mjs +312 -0
  12. package/dist/noop.mjs.map +1 -0
  13. package/package.json +67 -57
  14. package/CHANGELOG.md +0 -380
  15. package/build/builders/account.builder.d.ts +0 -17
  16. package/build/builders/banner.builder.d.ts +0 -35
  17. package/build/builders/billingData.builder.d.ts +0 -18
  18. package/build/builders/catalogue.builder.d.ts +0 -18
  19. package/build/builders/category.builder.d.ts +0 -36
  20. package/build/builders/common.builder.d.ts +0 -289
  21. package/build/builders/country.builder.d.ts +0 -51
  22. package/build/builders/coupon.builder.d.ts +0 -50
  23. package/build/builders/fulfillment.builder.d.ts +0 -199
  24. package/build/builders/image.builder.d.ts +0 -34
  25. package/build/builders/notification.builder.d.ts +0 -19
  26. package/build/builders/order.builder.d.ts +0 -483
  27. package/build/builders/payment.builder.d.ts +0 -93
  28. package/build/builders/product.builder.d.ts +0 -170
  29. package/build/builders/settings.builder.d.ts +0 -37
  30. package/build/builders/shippingAddress.builder.d.ts +0 -108
  31. package/build/builders/shoppingCart.builder.d.ts +0 -76
  32. package/build/builders/store.builder.d.ts +0 -106
  33. package/build/builders/user.builder.d.ts +0 -33
  34. package/build/builders/vendor.builder.d.ts +0 -17
  35. package/build/config/constants.d.ts +0 -2
  36. package/build/data/products.data.d.ts +0 -4
  37. package/build/index.d.ts +0 -23
  38. package/build/lib/artisn.d.ts +0 -5
  39. package/build/main.bundle.js +0 -10
  40. package/build/report.json +0 -1
  41. package/build/types/artisn.types.d.ts +0 -1
  42. package/build/types/product.types.d.ts +0 -6
  43. package/build/utils/artisn.utils.d.ts +0 -2
  44. package/build/utils/common.utils.d.ts +0 -8
  45. package/build/vendors.bundle.js +0 -1
  46. package/build/vendors.d.ts +0 -1
@@ -0,0 +1,2988 @@
1
+ 'use strict';
2
+
3
+ var faker = require('@faker-js/faker');
4
+ var btoa = require('btoa');
5
+
6
+ const genItems = (builder, quantity) => {
7
+ const num = quantity != null ? quantity : faker.faker.datatype.number({ min: 1, max: 10 });
8
+ const items = [];
9
+ for (let i = 0; i < num; i++) {
10
+ items.push(builder());
11
+ }
12
+ return items;
13
+ };
14
+
15
+ const getCommonDocumentTypes = () => ["PASSPORT"];
16
+ const getARDocumentTypes = () => [
17
+ ...getCommonDocumentTypes(),
18
+ "DNI"
19
+ ];
20
+ const getBODocumentTypes = () => [
21
+ ...getCommonDocumentTypes()
22
+ ];
23
+ const getBRDocumentTypes = () => [
24
+ ...getCommonDocumentTypes()
25
+ ];
26
+ const getCLDocumentTypes = () => [
27
+ ...getCommonDocumentTypes(),
28
+ "RUT"
29
+ ];
30
+ const getCODocumentTypes = () => [
31
+ ...getCommonDocumentTypes(),
32
+ "NIT",
33
+ "CI_CO"
34
+ ];
35
+ const getECDocumentTypes = () => [
36
+ ...getCommonDocumentTypes(),
37
+ "CI",
38
+ "RUC"
39
+ ];
40
+ const getPYDocumentTypes = () => [
41
+ ...getCommonDocumentTypes()
42
+ ];
43
+ const getPEDocumentTypes = () => [
44
+ ...getCommonDocumentTypes(),
45
+ "DNI",
46
+ "RUC"
47
+ ];
48
+ const getUYDocumentTypes = () => [
49
+ ...getCommonDocumentTypes()
50
+ ];
51
+ const getVEDocumentTypes = () => [
52
+ ...getCommonDocumentTypes(),
53
+ "CE_VE",
54
+ "CI_VE",
55
+ "RIF"
56
+ ];
57
+ const getUSDocumentTypes = () => [
58
+ ...getCommonDocumentTypes()
59
+ ];
60
+ const getPassword = (...args) => `!0_Oo${faker.faker.internet.password(...args)}`;
61
+ const getUsername = (...params) => faker.faker.internet.userName(...params);
62
+ const genId = (...params) => faker.faker.datatype.uuid(...params);
63
+ const genNumericId = (...params) => +faker.faker.random.numeric(...params);
64
+ const genWord = (...params) => faker.faker.lorem.word(...params);
65
+ const genAddress = (...params) => faker.faker.address.streetAddress(...params);
66
+ const genName = (...params) => faker.faker.name.fullName(...params);
67
+ const genEmail = (...params) => faker.faker.internet.email(...params);
68
+ const genCompanyName = (...params) => faker.faker.company.name(...params);
69
+ const genParagraph = (...params) => faker.faker.lorem.paragraph(...params);
70
+ const genTitle = (...params) => faker.faker.lorem.slug(...params);
71
+ const genNumber = (...params) => faker.faker.datatype.number(...params);
72
+ const getBoolean = (...params) => faker.faker.datatype.boolean(...params);
73
+ const genCountryName = (...params) => faker.faker.address.country(...params);
74
+ const genRandomImage = (randomImageConfig) => {
75
+ const { query = "product" } = randomImageConfig != null ? randomImageConfig : {};
76
+ const { width = 300, height = 300 } = randomImageConfig != null ? randomImageConfig : {};
77
+ let url = `https://source.unsplash.com/${width}x${height}`;
78
+ if (query)
79
+ url += `/?${query}`;
80
+ return url;
81
+ };
82
+ const genWords = (words) => faker.faker.random.words(words);
83
+ const genURL = (...params) => faker.faker.internet.url(...params);
84
+ const genDate = () => faker.faker.date.recent(7).toISOString();
85
+ const genBase64 = () => btoa(genWord());
86
+ const genBiasBoolean = (bias) => {
87
+ if (bias > 1 || bias < 0) {
88
+ throw new Error(`Bias must be a number between 0 and 1. Value ${bias} is not valid`);
89
+ }
90
+ const random = faker.faker.datatype.number({ min: 0, max: 1, precision: 4 });
91
+ return random <= bias;
92
+ };
93
+ const genDocument = (digits) => {
94
+ let document = "";
95
+ for (let i = 0; i < digits; i++) {
96
+ document += genNumber(9);
97
+ }
98
+ return document;
99
+ };
100
+ const genDocumentType = (countryISOCode = "EC") => {
101
+ switch (countryISOCode) {
102
+ case "AR":
103
+ return chooseRandom(getARDocumentTypes());
104
+ case "BO":
105
+ return chooseRandom(getBODocumentTypes());
106
+ case "BR":
107
+ return chooseRandom(getBRDocumentTypes());
108
+ case "CL":
109
+ return chooseRandom(getCLDocumentTypes());
110
+ case "CO":
111
+ return chooseRandom(getCODocumentTypes());
112
+ case "EC":
113
+ return chooseRandom(getECDocumentTypes());
114
+ case "PY":
115
+ return chooseRandom(getPYDocumentTypes());
116
+ case "PE":
117
+ return chooseRandom(getPEDocumentTypes());
118
+ case "UY":
119
+ return chooseRandom(getUYDocumentTypes());
120
+ case "VE":
121
+ return chooseRandom(getVEDocumentTypes());
122
+ case "US":
123
+ return chooseRandom(getUSDocumentTypes());
124
+ default:
125
+ throw new Error(`Builder genDocumentType: The given country ISO code "${countryISOCode}" is not a supported ISO code`);
126
+ }
127
+ };
128
+ const genMobilPhone = (countryCode) => {
129
+ return `+${countryCode} ${genDocument(3)} ${genDocument(3)} ${genDocument(4)}`;
130
+ };
131
+ const genCountry = (id, name) => {
132
+ const country = {
133
+ id: id != null ? id : genId(),
134
+ name: name != null ? name : genCountryName()
135
+ };
136
+ return country;
137
+ };
138
+ const fillNumber = (num, max) => {
139
+ const maxNumLength = max ? String(max).length : num.length;
140
+ let newId = num;
141
+ for (let i = 0; i < maxNumLength - num.length; i++) {
142
+ newId = `0${newId}`;
143
+ }
144
+ return newId;
145
+ };
146
+ const chooseRandom = (array) => faker.faker.helpers.arrayElement(array);
147
+ const genSymbol = () => chooseRandom(["$", "S/", "$b", "Bs"]);
148
+ const genIP = (...params) => faker.faker.internet.ip(...params);
149
+
150
+ var common_builder = /*#__PURE__*/Object.freeze({
151
+ __proto__: null,
152
+ chooseRandom: chooseRandom,
153
+ fillNumber: fillNumber,
154
+ genAddress: genAddress,
155
+ genBase64: genBase64,
156
+ genBiasBoolean: genBiasBoolean,
157
+ genCompanyName: genCompanyName,
158
+ genCountry: genCountry,
159
+ genCountryName: genCountryName,
160
+ genDate: genDate,
161
+ genDocument: genDocument,
162
+ genDocumentType: genDocumentType,
163
+ genEmail: genEmail,
164
+ genIP: genIP,
165
+ genId: genId,
166
+ genItems: genItems,
167
+ genMobilPhone: genMobilPhone,
168
+ genName: genName,
169
+ genNumber: genNumber,
170
+ genNumericId: genNumericId,
171
+ genParagraph: genParagraph,
172
+ genRandomImage: genRandomImage,
173
+ genSymbol: genSymbol,
174
+ genTitle: genTitle,
175
+ genURL: genURL,
176
+ genWord: genWord,
177
+ genWords: genWords,
178
+ getARDocumentTypes: getARDocumentTypes,
179
+ getBODocumentTypes: getBODocumentTypes,
180
+ getBRDocumentTypes: getBRDocumentTypes,
181
+ getBoolean: getBoolean,
182
+ getCLDocumentTypes: getCLDocumentTypes,
183
+ getCODocumentTypes: getCODocumentTypes,
184
+ getCommonDocumentTypes: getCommonDocumentTypes,
185
+ getECDocumentTypes: getECDocumentTypes,
186
+ getPEDocumentTypes: getPEDocumentTypes,
187
+ getPYDocumentTypes: getPYDocumentTypes,
188
+ getPassword: getPassword,
189
+ getUSDocumentTypes: getUSDocumentTypes,
190
+ getUYDocumentTypes: getUYDocumentTypes,
191
+ getUsername: getUsername,
192
+ getVEDocumentTypes: getVEDocumentTypes
193
+ });
194
+
195
+ var __defProp$j = Object.defineProperty;
196
+ var __getOwnPropSymbols$j = Object.getOwnPropertySymbols;
197
+ var __hasOwnProp$j = Object.prototype.hasOwnProperty;
198
+ var __propIsEnum$j = Object.prototype.propertyIsEnumerable;
199
+ var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
200
+ var __spreadValues$j = (a, b) => {
201
+ for (var prop in b || (b = {}))
202
+ if (__hasOwnProp$j.call(b, prop))
203
+ __defNormalProp$j(a, prop, b[prop]);
204
+ if (__getOwnPropSymbols$j)
205
+ for (var prop of __getOwnPropSymbols$j(b)) {
206
+ if (__propIsEnum$j.call(b, prop))
207
+ __defNormalProp$j(a, prop, b[prop]);
208
+ }
209
+ return a;
210
+ };
211
+ const buildURLImage = genRandomImage;
212
+ const genURLImages = (quantity, overrides) => {
213
+ return genItems(() => buildURLImage(overrides), quantity);
214
+ };
215
+ const buildCDNImage = (overrides = {}, options) => {
216
+ const imageName = genWord();
217
+ return __spreadValues$j({
218
+ bucket: null,
219
+ cloudFrontUrl: genURL(),
220
+ key: `images/${imageName}.jpg`,
221
+ name: `${imageName}.jpg`,
222
+ url: buildURLImage(options)
223
+ }, overrides);
224
+ };
225
+ const genCDNImages = (quantity, options) => {
226
+ return genItems(() => buildCDNImage(void 0, options), quantity);
227
+ };
228
+
229
+ var image_builder = /*#__PURE__*/Object.freeze({
230
+ __proto__: null,
231
+ buildCDNImage: buildCDNImage,
232
+ buildURLImage: buildURLImage,
233
+ genCDNImages: genCDNImages,
234
+ genURLImages: genURLImages
235
+ });
236
+
237
+ var __defProp$i = Object.defineProperty;
238
+ var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
239
+ var __hasOwnProp$i = Object.prototype.hasOwnProperty;
240
+ var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
241
+ var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
242
+ var __spreadValues$i = (a, b) => {
243
+ for (var prop in b || (b = {}))
244
+ if (__hasOwnProp$i.call(b, prop))
245
+ __defNormalProp$i(a, prop, b[prop]);
246
+ if (__getOwnPropSymbols$i)
247
+ for (var prop of __getOwnPropSymbols$i(b)) {
248
+ if (__propIsEnum$i.call(b, prop))
249
+ __defNormalProp$i(a, prop, b[prop]);
250
+ }
251
+ return a;
252
+ };
253
+ const buildAccount = (overrides = {}) => {
254
+ return __spreadValues$i({
255
+ accountId: genId(),
256
+ name: genName(),
257
+ description: genBiasBoolean(0.5) ? genParagraph() : void 0,
258
+ images: genCDNImages(void 0, { query: "brand" })
259
+ }, overrides);
260
+ };
261
+ const genAccounts = (quantity) => {
262
+ return genItems(buildAccount, quantity);
263
+ };
264
+
265
+ var account_builder = /*#__PURE__*/Object.freeze({
266
+ __proto__: null,
267
+ buildAccount: buildAccount,
268
+ genAccounts: genAccounts
269
+ });
270
+
271
+ var __defProp$h = Object.defineProperty;
272
+ var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
273
+ var __hasOwnProp$h = Object.prototype.hasOwnProperty;
274
+ var __propIsEnum$h = Object.prototype.propertyIsEnumerable;
275
+ var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$h(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
276
+ var __spreadValues$h = (a, b) => {
277
+ for (var prop in b || (b = {}))
278
+ if (__hasOwnProp$h.call(b, prop))
279
+ __defNormalProp$h(a, prop, b[prop]);
280
+ if (__getOwnPropSymbols$h)
281
+ for (var prop of __getOwnPropSymbols$h(b)) {
282
+ if (__propIsEnum$h.call(b, prop))
283
+ __defNormalProp$h(a, prop, b[prop]);
284
+ }
285
+ return a;
286
+ };
287
+ const buildBanner = (overrides = {}) => {
288
+ const bannerScopes = ["APP", "GLOBAL", "WEB"];
289
+ const bannerTypes = [
290
+ "COUPON",
291
+ "INFO",
292
+ "PRODUCT",
293
+ "URL",
294
+ "CATEGORY",
295
+ "COUPON_QR",
296
+ "SECTION"
297
+ ];
298
+ return __spreadValues$h({
299
+ banner_title: genWords(2),
300
+ banner_description: genWords(8),
301
+ image_url: buildURLImage(),
302
+ banner_qr_code: "",
303
+ coupon: buildBannerCoupon(),
304
+ coupon_id: genId(),
305
+ banner_type: chooseRandom(bannerTypes),
306
+ image_file_name: `${genWord}.jpg`,
307
+ benefits: genBannerBenefits(),
308
+ vendor_id: genId(),
309
+ vendor_name: faker.faker.company.name(),
310
+ scope: chooseRandom(bannerScopes),
311
+ banner_category_id: genId(),
312
+ product_id: null,
313
+ product_name: null,
314
+ stores: [],
315
+ banner_url: buildURLImage(),
316
+ image_bucket: null,
317
+ image_cloud_front_url: genURL(),
318
+ image_key: `banners/${genWord}.jpg`,
319
+ category_id: genId(),
320
+ category_name: faker.faker.company.name(),
321
+ channel_id: genId(),
322
+ images: genBannerImages(),
323
+ section: null
324
+ }, overrides);
325
+ };
326
+ const buildBannerCoupon = (overrides = {}) => {
327
+ return __spreadValues$h({
328
+ name: genWord(),
329
+ only_store: genBiasBoolean(0.6),
330
+ coupon_type: chooseRandom(["COUPON", "MIX"])
331
+ }, overrides);
332
+ };
333
+ const buildBannerBenefits = (overrides = {}) => {
334
+ return __spreadValues$h({
335
+ id: genId(),
336
+ name: genWord()
337
+ }, overrides);
338
+ };
339
+ const genBannerBenefits = (quantity) => {
340
+ return genItems(buildBannerBenefits, quantity);
341
+ };
342
+ const genBanners = (quantity) => {
343
+ return genItems(buildBanner, quantity);
344
+ };
345
+ const buildBannerImage = (overrides = {}) => {
346
+ return __spreadValues$h({
347
+ file_name: `${genWord}.jpg`,
348
+ id: genId(),
349
+ image_file_name: `${genWord}.jpg`,
350
+ image_key: `banners/${genWord}.jpg`,
351
+ image_url: buildURLImage(),
352
+ position: genNumber(100),
353
+ url: genRandomImage()
354
+ }, overrides);
355
+ };
356
+ const genBannerImages = (quantity) => {
357
+ return genItems(buildBannerImage, quantity);
358
+ };
359
+
360
+ var banner_builder = /*#__PURE__*/Object.freeze({
361
+ __proto__: null,
362
+ buildBanner: buildBanner,
363
+ buildBannerBenefits: buildBannerBenefits,
364
+ buildBannerCoupon: buildBannerCoupon,
365
+ buildBannerImage: buildBannerImage,
366
+ genBannerBenefits: genBannerBenefits,
367
+ genBannerImages: genBannerImages,
368
+ genBanners: genBanners
369
+ });
370
+
371
+ var __defProp$g = Object.defineProperty;
372
+ var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
373
+ var __hasOwnProp$g = Object.prototype.hasOwnProperty;
374
+ var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
375
+ var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
376
+ var __spreadValues$g = (a, b) => {
377
+ for (var prop in b || (b = {}))
378
+ if (__hasOwnProp$g.call(b, prop))
379
+ __defNormalProp$g(a, prop, b[prop]);
380
+ if (__getOwnPropSymbols$g)
381
+ for (var prop of __getOwnPropSymbols$g(b)) {
382
+ if (__propIsEnum$g.call(b, prop))
383
+ __defNormalProp$g(a, prop, b[prop]);
384
+ }
385
+ return a;
386
+ };
387
+ const buildBillingData = (overrides = {}) => {
388
+ return __spreadValues$g({
389
+ id: genId(),
390
+ name: `${genName()} ${genName()}`,
391
+ nickname: genName(),
392
+ documentType: genDocumentType(),
393
+ document: genDocument(10),
394
+ address: genAddress(),
395
+ phone: genMobilPhone("593"),
396
+ email: genEmail(),
397
+ default: getBoolean(),
398
+ country: genCountry()
399
+ }, overrides);
400
+ };
401
+ const genBillingData = (quantity) => {
402
+ return genItems(buildBillingData, quantity);
403
+ };
404
+
405
+ var billingData_builder = /*#__PURE__*/Object.freeze({
406
+ __proto__: null,
407
+ buildBillingData: buildBillingData,
408
+ genBillingData: genBillingData
409
+ });
410
+
411
+ var __defProp$f = Object.defineProperty;
412
+ var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
413
+ var __hasOwnProp$f = Object.prototype.hasOwnProperty;
414
+ var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
415
+ var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$f(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
416
+ var __spreadValues$f = (a, b) => {
417
+ for (var prop in b || (b = {}))
418
+ if (__hasOwnProp$f.call(b, prop))
419
+ __defNormalProp$f(a, prop, b[prop]);
420
+ if (__getOwnPropSymbols$f)
421
+ for (var prop of __getOwnPropSymbols$f(b)) {
422
+ if (__propIsEnum$f.call(b, prop))
423
+ __defNormalProp$f(a, prop, b[prop]);
424
+ }
425
+ return a;
426
+ };
427
+ const catalogueOptions = ["A domicilio", "Pick-up"];
428
+ const buildCatalogue = (overrides = {}) => {
429
+ return __spreadValues$f({
430
+ catalogueId: genNumber(200).toString(),
431
+ name: faker.faker.company.bsAdjective(),
432
+ active: genBiasBoolean(0.5),
433
+ friendlyName: faker.faker.company.name()
434
+ }, overrides);
435
+ };
436
+ const genCatalogues = (quantity) => {
437
+ const num = quantity != null ? quantity : genNumber({ min: 1, max: 10 });
438
+ let options = [...catalogueOptions];
439
+ const catalogues = [];
440
+ for (let i = 0; i < num; i++) {
441
+ const overrides = {};
442
+ const option = chooseRandom(options);
443
+ if (option) {
444
+ overrides.name = option;
445
+ }
446
+ const catalogue = buildCatalogue(overrides);
447
+ catalogues.push(catalogue);
448
+ options = options.filter((catalogue2) => catalogue2 !== option);
449
+ }
450
+ return catalogues;
451
+ };
452
+
453
+ var catalogue_builder = /*#__PURE__*/Object.freeze({
454
+ __proto__: null,
455
+ buildCatalogue: buildCatalogue,
456
+ genCatalogues: genCatalogues
457
+ });
458
+
459
+ var __defProp$e = Object.defineProperty;
460
+ var __defProps$6 = Object.defineProperties;
461
+ var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
462
+ var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
463
+ var __hasOwnProp$e = Object.prototype.hasOwnProperty;
464
+ var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
465
+ var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
466
+ var __spreadValues$e = (a, b) => {
467
+ for (var prop in b || (b = {}))
468
+ if (__hasOwnProp$e.call(b, prop))
469
+ __defNormalProp$e(a, prop, b[prop]);
470
+ if (__getOwnPropSymbols$e)
471
+ for (var prop of __getOwnPropSymbols$e(b)) {
472
+ if (__propIsEnum$e.call(b, prop))
473
+ __defNormalProp$e(a, prop, b[prop]);
474
+ }
475
+ return a;
476
+ };
477
+ var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
478
+ const buildPriceCategoryTax = (overrides = {}) => {
479
+ return __spreadValues$e({
480
+ code: 0,
481
+ name: chooseRandom(["IVA"]),
482
+ percentage: 10,
483
+ vatRate: "",
484
+ vatRateCode: 0
485
+ }, overrides);
486
+ };
487
+ const genPriceCategoryTaxes = (quantity) => {
488
+ return genItems(buildPriceCategoryTax, quantity);
489
+ };
490
+ const getTaxTotals = (taxes, grossPrice) => {
491
+ return taxes.reduce((acc, tax) => {
492
+ return acc + tax.percentage / 100 * grossPrice;
493
+ }, 0);
494
+ };
495
+ const buildPriceCategory = (overrides = {}) => {
496
+ var _a;
497
+ const category = (_a = overrides.category) != null ? _a : "NORMAL";
498
+ const precision = category === "NORMAL" ? 2 : void 0;
499
+ const grossPrice = genNumber({ min: 2, max: 20, precision });
500
+ const withTaxes = genBiasBoolean(0.9);
501
+ const taxes = genPriceCategoryTaxes(withTaxes && precision ? 1 : 0);
502
+ const taxTotal = getTaxTotals(taxes, grossPrice);
503
+ const netPrice = grossPrice + taxTotal;
504
+ return __spreadValues$e({
505
+ category,
506
+ discount: 0,
507
+ discountGrossPrice: 0,
508
+ discountNetPrice: 0,
509
+ discounts: [],
510
+ grossPrice,
511
+ netPrice,
512
+ symbol: "$",
513
+ taxes,
514
+ salePercentage: 0,
515
+ priceBeforeSale: 0
516
+ }, overrides);
517
+ };
518
+ const buildBaseProduct = (overrides = {}) => {
519
+ return __spreadValues$e({
520
+ attributes: {
521
+ Cantidad: "1",
522
+ externalId: "001",
523
+ showInMenu: true
524
+ },
525
+ available: true,
526
+ addDirectlyToCart: genBiasBoolean(0.5),
527
+ coverUrl: "",
528
+ description: faker.faker.lorem.lines(2),
529
+ images: genCDNImages(genNumber({ min: 1, max: 5 })),
530
+ measure: "unit",
531
+ name: faker.faker.commerce.productName(),
532
+ outOfService: false,
533
+ outOfStock: false,
534
+ prices: {
535
+ NORMAL: buildPriceCategory({ category: "NORMAL" }),
536
+ POINTS: buildPriceCategory({ category: "POINTS" }),
537
+ SUGGESTED: buildPriceCategory({ category: "SUGGESTED" })
538
+ },
539
+ productId: genNumber(999).toString(),
540
+ sponsored: false,
541
+ standardTime: "",
542
+ status: "ACTIVE",
543
+ stock: 1e3,
544
+ suggestedPrice: "",
545
+ type: "PRODUCT"
546
+ }, overrides);
547
+ };
548
+ const genBaseProducts = (quantity) => {
549
+ return genItems(buildBaseProduct, quantity);
550
+ };
551
+ const MODIFIER_TYPES = ["RADIO", "CHECKBOX", "QUANTITY", "CUSTOMIZED"];
552
+ const buildProductAnswer = (overrides = {}, loop = 1) => {
553
+ const withQuestions = genBiasBoolean(0.1) && loop < 2;
554
+ const selectedRenderType = chooseRandom(MODIFIER_TYPES);
555
+ const renderType = genBiasBoolean(0.9) ? null : selectedRenderType;
556
+ const images = genCDNImages(void 0, { width: 60, height: 60 });
557
+ return __spreadValues$e({
558
+ attributes: {
559
+ Cantidad: "1",
560
+ externalId: "001",
561
+ showInMenu: true
562
+ },
563
+ images: genBiasBoolean(0.1) ? [] : images,
564
+ name: faker.faker.name.jobDescriptor(),
565
+ prices: {
566
+ NORMAL: buildPriceCategory({ category: "NORMAL" }),
567
+ POINTS: buildPriceCategory({ category: "POINTS" }),
568
+ SUGGESTED: buildPriceCategory({ category: "SUGGESTED" })
569
+ },
570
+ productId: genNumber(999).toString(),
571
+ type: chooseRandom(["PRODUCT", "MODIFIER"]),
572
+ renderType,
573
+ questions: withQuestions ? genProductQuestions(void 0, loop + 1) : []
574
+ }, overrides);
575
+ };
576
+ const genProductAnswers = (quantity, loop = 1) => {
577
+ if (loop > 2)
578
+ return [];
579
+ const num = quantity != null ? quantity : genNumber({ min: 1, max: 6 });
580
+ const productAnswers = [];
581
+ for (let i = 0; i < num; i++) {
582
+ const productAnswer = buildProductAnswer({}, loop);
583
+ productAnswers.push(productAnswer);
584
+ }
585
+ return productAnswers;
586
+ };
587
+ const buildProductQuestion = (overrides = {}, loop = 1) => {
588
+ const randomMin = genNumber({ min: 0, max: 5 });
589
+ const likelyMin = genNumber({ min: 0, max: 1 });
590
+ const min = genBiasBoolean(0.8) ? likelyMin : randomMin;
591
+ const randomMax = genNumber({ min, max: 5 });
592
+ const likelyMax = genNumber({ min, max: min > 1 ? min : 1 });
593
+ const max = genBiasBoolean(0.8) ? likelyMax : randomMax;
594
+ const selectedType = chooseRandom(MODIFIER_TYPES);
595
+ const type = genBiasBoolean(0.9) ? null : selectedType;
596
+ return __spreadValues$e({
597
+ answers: genProductAnswers(void 0, loop),
598
+ description: faker.faker.finance.transactionType(),
599
+ max,
600
+ min,
601
+ name: faker.faker.finance.accountName(),
602
+ questionId: genNumber(999).toString(),
603
+ type,
604
+ images: genCDNImages()
605
+ }, overrides);
606
+ };
607
+ const genProductQuestions = (quantity, loop = 1) => {
608
+ if (loop > 2)
609
+ return [];
610
+ const num = quantity != null ? quantity : genNumber({ min: 1, max: 5 });
611
+ const productQuestions = [];
612
+ for (let i = 0; i < num; i++) {
613
+ const productQuestion = buildProductQuestion({}, loop);
614
+ productQuestions.push(productQuestion);
615
+ }
616
+ return productQuestions;
617
+ };
618
+ const buildProductDetails = (overrides = {}) => {
619
+ const questions = genProductQuestions(void 0, 1);
620
+ const categories = [];
621
+ return __spreadValues$e(__spreadProps$6(__spreadValues$e({}, buildBaseProduct()), {
622
+ addDirectlyToCart: !questions.length,
623
+ isPriceVip: false,
624
+ manufacturer: [],
625
+ maxAmountForSale: 0,
626
+ schedule: [],
627
+ questions,
628
+ benefitId: null,
629
+ categories: genBiasBoolean(0.5) ? categories : null
630
+ }), overrides);
631
+ };
632
+ const genProductDetails = (quantity) => {
633
+ return genItems(buildProductDetails, quantity);
634
+ };
635
+ const buildCartProductAnswer = (questionId, overrides = {}) => {
636
+ return __spreadValues$e(__spreadProps$6(__spreadValues$e({}, buildProductAnswer()), {
637
+ amount: 1,
638
+ questionId,
639
+ priceCategory: "NORMAL",
640
+ comment: genBiasBoolean(0.2) ? faker.faker.commerce.productMaterial() : "",
641
+ questionsAndAnswers: []
642
+ }), overrides);
643
+ };
644
+ const genCartProductAnswers = (quantity) => {
645
+ const num = quantity != null ? quantity : genNumber({ min: 1, max: 5 });
646
+ const cartProductAnswers = [];
647
+ for (let i = 0; i < num; i++) {
648
+ const cartProductAnswer = buildCartProductAnswer(i.toString());
649
+ cartProductAnswers.push(cartProductAnswer);
650
+ }
651
+ return cartProductAnswers;
652
+ };
653
+ const buildCartProductQuestion = (overrides = {}) => {
654
+ return __spreadValues$e(__spreadProps$6(__spreadValues$e({}, buildProductQuestion()), {
655
+ answers: genCartProductAnswers()
656
+ }), overrides);
657
+ };
658
+ const genCartProductQuestions = (quantity) => {
659
+ return genItems(buildCartProductQuestion, quantity);
660
+ };
661
+ const buildCartProduct = (overrides = {}) => {
662
+ const comment = genBiasBoolean(0.2) ? faker.faker.commerce.productMaterial() : "";
663
+ const questions = genProductQuestions(void 0, 1);
664
+ return __spreadValues$e(__spreadProps$6(__spreadValues$e({}, buildProductDetails()), {
665
+ questions,
666
+ addDirectlyToCart: !questions.length,
667
+ amount: 1,
668
+ priceCategory: "NORMAL",
669
+ alerts: [],
670
+ comment,
671
+ questionsAndAnswers: genCartProductQuestions(),
672
+ hash: "",
673
+ createdAt: "",
674
+ updatedAt: ""
675
+ }), overrides);
676
+ };
677
+ const genCartProducts = (quantity) => {
678
+ return genItems(buildCartProduct, quantity);
679
+ };
680
+
681
+ var product_builder = /*#__PURE__*/Object.freeze({
682
+ __proto__: null,
683
+ MODIFIER_TYPES: MODIFIER_TYPES,
684
+ buildBaseProduct: buildBaseProduct,
685
+ buildCartProduct: buildCartProduct,
686
+ buildCartProductAnswer: buildCartProductAnswer,
687
+ buildCartProductQuestion: buildCartProductQuestion,
688
+ buildPriceCategory: buildPriceCategory,
689
+ buildPriceCategoryTax: buildPriceCategoryTax,
690
+ buildProductAnswer: buildProductAnswer,
691
+ buildProductDetails: buildProductDetails,
692
+ buildProductQuestion: buildProductQuestion,
693
+ genBaseProducts: genBaseProducts,
694
+ genCartProductAnswers: genCartProductAnswers,
695
+ genCartProductQuestions: genCartProductQuestions,
696
+ genCartProducts: genCartProducts,
697
+ genPriceCategoryTaxes: genPriceCategoryTaxes,
698
+ genProductAnswers: genProductAnswers,
699
+ genProductDetails: genProductDetails,
700
+ genProductQuestions: genProductQuestions
701
+ });
702
+
703
+ var __defProp$d = Object.defineProperty;
704
+ var __defProps$5 = Object.defineProperties;
705
+ var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
706
+ var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
707
+ var __hasOwnProp$d = Object.prototype.hasOwnProperty;
708
+ var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
709
+ var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
710
+ var __spreadValues$d = (a, b) => {
711
+ for (var prop in b || (b = {}))
712
+ if (__hasOwnProp$d.call(b, prop))
713
+ __defNormalProp$d(a, prop, b[prop]);
714
+ if (__getOwnPropSymbols$d)
715
+ for (var prop of __getOwnPropSymbols$d(b)) {
716
+ if (__propIsEnum$d.call(b, prop))
717
+ __defNormalProp$d(a, prop, b[prop]);
718
+ }
719
+ return a;
720
+ };
721
+ var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
722
+ const buildCategory = (overrides = {}) => {
723
+ return __spreadValues$d({
724
+ categoryId: genId(),
725
+ displayInMenu: genBiasBoolean(0.9),
726
+ images: genCDNImages(void 0, { width: 1200, height: 400 }),
727
+ name: genName(),
728
+ reload: true,
729
+ subcategories: genBiasBoolean(0.5),
730
+ featured: false
731
+ }, overrides);
732
+ };
733
+ const genCategories = (quantity) => {
734
+ return genItems(buildCategory, quantity);
735
+ };
736
+ const buildCategoryWithProducts = (overrides = {}) => {
737
+ const category = buildCategory();
738
+ return __spreadValues$d(__spreadProps$5(__spreadValues$d({}, category), {
739
+ products: genBaseProducts()
740
+ }), overrides);
741
+ };
742
+ const genCategoryWithProducts = (quantity) => {
743
+ return genItems(buildCategoryWithProducts, quantity);
744
+ };
745
+
746
+ var category_builder = /*#__PURE__*/Object.freeze({
747
+ __proto__: null,
748
+ buildCategory: buildCategory,
749
+ buildCategoryWithProducts: buildCategoryWithProducts,
750
+ genCategories: genCategories,
751
+ genCategoryWithProducts: genCategoryWithProducts
752
+ });
753
+
754
+ var __defProp$c = Object.defineProperty;
755
+ var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
756
+ var __hasOwnProp$c = Object.prototype.hasOwnProperty;
757
+ var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
758
+ var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
759
+ var __spreadValues$c = (a, b) => {
760
+ for (var prop in b || (b = {}))
761
+ if (__hasOwnProp$c.call(b, prop))
762
+ __defNormalProp$c(a, prop, b[prop]);
763
+ if (__getOwnPropSymbols$c)
764
+ for (var prop of __getOwnPropSymbols$c(b)) {
765
+ if (__propIsEnum$c.call(b, prop))
766
+ __defNormalProp$c(a, prop, b[prop]);
767
+ }
768
+ return a;
769
+ };
770
+ const countriesCodes = [
771
+ "AR",
772
+ "BO",
773
+ "BR",
774
+ "CL",
775
+ "CO",
776
+ "EC",
777
+ "PY",
778
+ "PE",
779
+ "UY",
780
+ "VE",
781
+ "US"
782
+ ];
783
+ const buildCountryCurrency = (overrides = {}) => {
784
+ return __spreadValues$c({
785
+ id: genId(),
786
+ name: chooseRandom(["USD", "EUR", "CHL"]),
787
+ sign: genSymbol(),
788
+ external_id: genId()
789
+ }, overrides);
790
+ };
791
+ const genCountryCurrencies = (quantity) => {
792
+ return genItems(buildCountryCurrency, quantity);
793
+ };
794
+ const buildCountry = (overrides = {}) => {
795
+ return __spreadValues$c({
796
+ id: genId(),
797
+ code: chooseRandom(countriesCodes),
798
+ currency: buildCountryCurrency(),
799
+ name: genName()
800
+ }, overrides);
801
+ };
802
+ const genCountries = (quantity) => {
803
+ return genItems(buildCountry, quantity);
804
+ };
805
+
806
+ var country_builder = /*#__PURE__*/Object.freeze({
807
+ __proto__: null,
808
+ buildCountry: buildCountry,
809
+ buildCountryCurrency: buildCountryCurrency,
810
+ countriesCodes: countriesCodes,
811
+ genCountries: genCountries,
812
+ genCountryCurrencies: genCountryCurrencies
813
+ });
814
+
815
+ var __defProp$b = Object.defineProperty;
816
+ var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
817
+ var __hasOwnProp$b = Object.prototype.hasOwnProperty;
818
+ var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
819
+ var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
820
+ var __spreadValues$b = (a, b) => {
821
+ for (var prop in b || (b = {}))
822
+ if (__hasOwnProp$b.call(b, prop))
823
+ __defNormalProp$b(a, prop, b[prop]);
824
+ if (__getOwnPropSymbols$b)
825
+ for (var prop of __getOwnPropSymbols$b(b)) {
826
+ if (__propIsEnum$b.call(b, prop))
827
+ __defNormalProp$b(a, prop, b[prop]);
828
+ }
829
+ return a;
830
+ };
831
+ const buildBenefit = (overrides = {}) => {
832
+ const benefitTypes = [
833
+ "ALTER_DELIVERY",
834
+ "DISCOUNT_FIXED",
835
+ "DISCOUNT_PERCENTAGE",
836
+ "PRODUCT"
837
+ ];
838
+ const type = chooseRandom(benefitTypes);
839
+ return __spreadValues$b({
840
+ accountId: genId(),
841
+ alerts: [],
842
+ hash: genId(),
843
+ award: type === "PRODUCT" ? genAwards(1) : buildAward(),
844
+ benefitId: genId(),
845
+ benefitWalletId: genId(),
846
+ code: null,
847
+ combined: genWord(),
848
+ createdAt: genDate(),
849
+ description: genWords(6),
850
+ discountPercentage: genNumber(100),
851
+ discountFixed: `${genNumber()}`,
852
+ expirationDate: genDate(),
853
+ externalId: null,
854
+ image: genCDNImages(void 0, { query: "discount" }),
855
+ limitAward: null,
856
+ limitBenefit: genNumber(4),
857
+ logicOperator: chooseRandom(["OR", "AND"]),
858
+ quantity: genNumber(7),
859
+ rules: [],
860
+ title: genWords(3),
861
+ type,
862
+ updatedAt: genDate(),
863
+ channelId: genId(),
864
+ vendorId: genNumber(30).toString()
865
+ }, overrides);
866
+ };
867
+ const genBenefits = (quantity) => {
868
+ return genItems(buildBenefit, quantity);
869
+ };
870
+ const buildAward = (overrides = {}) => {
871
+ return __spreadValues$b({
872
+ benefitId: genId(),
873
+ discountPercentage: genNumber(100),
874
+ discountValue: null,
875
+ id: genId(),
876
+ amount: genNumber(5),
877
+ productDescription: genWords(5),
878
+ productId: genId(),
879
+ vendorId: genNumber(99).toString()
880
+ }, overrides);
881
+ };
882
+ const genAwards = (quantity) => {
883
+ return genItems(buildAward, quantity);
884
+ };
885
+ const buildWallet = (overrides = {}) => {
886
+ return __spreadValues$b({
887
+ benefits: genBenefits()
888
+ }, overrides);
889
+ };
890
+ const genWallets = (quantity) => {
891
+ return genItems(buildWallet, quantity);
892
+ };
893
+ const buildStoreCoupon = (overrides = {}) => {
894
+ return __spreadValues$b({
895
+ featured: genBiasBoolean(0.5),
896
+ id: genId(),
897
+ name: genCompanyName(),
898
+ vendor_id: genNumber(9999).toString(),
899
+ coupons: genCoupons()
900
+ }, overrides);
901
+ };
902
+ const genStoreCoupons = (quantity) => {
903
+ return genItems(buildStoreCoupon, quantity);
904
+ };
905
+ const buildProductCoupon = (overrides = {}) => {
906
+ return __spreadValues$b({
907
+ amount: genNumber(1),
908
+ id: genId(),
909
+ benefitId: genId(),
910
+ discountPercentage: genNumber(100),
911
+ discountValue: genNumber(10),
912
+ productDescription: genWords(3),
913
+ productId: genId(),
914
+ swapProductId: null,
915
+ vendorId: genNumber(999).toString()
916
+ }, overrides);
917
+ };
918
+ const genProductCoupons = (quantity) => {
919
+ return genItems(buildProductCoupon, quantity);
920
+ };
921
+ const buildBenefitData = (overrides = {}) => {
922
+ return __spreadValues$b({
923
+ account_id: genId(),
924
+ amount: genNumber(1),
925
+ automatic_redeemed: genBiasBoolean(0.1).toString(),
926
+ code: genWord().toUpperCase(),
927
+ combined: genBiasBoolean(0.1).toString(),
928
+ days: null,
929
+ description: genWords(5),
930
+ discount_percentage: genNumber(9),
931
+ end_date: genDate(),
932
+ error_validation: genWords(3),
933
+ expiration_date: genDate(),
934
+ external_id: genNumber(1e4).toString(),
935
+ id: genId(),
936
+ image: null,
937
+ instruction: null,
938
+ limit_award: null,
939
+ limit_benefit: genNumber(99),
940
+ logic_operator: chooseRandom(["OR", "AND"]),
941
+ name: genWord(),
942
+ products: genProductCoupons(1),
943
+ quantity: genNumber(1),
944
+ rules: [],
945
+ spend: genNumber(100),
946
+ start_date: genDate(),
947
+ status: genWord(),
948
+ stock: genNumber(999),
949
+ success_message: genWords(3),
950
+ term_and_condition: genWords(3),
951
+ type: "MIX",
952
+ type_alias: genWord(),
953
+ unit: null,
954
+ vendor_id: genNumber(99).toString()
955
+ }, overrides);
956
+ };
957
+ const genBenefitData = (quantity) => {
958
+ return genItems(buildBenefitData, quantity);
959
+ };
960
+ const buildCoupon = (overrides = {}) => {
961
+ return __spreadValues$b({
962
+ benefits: genBenefitData(1),
963
+ category: buildCouponCategory(),
964
+ codes: genCodes(),
965
+ end_date: genDate(),
966
+ image: buildURLImage({ query: "coupon" }),
967
+ id: genId(),
968
+ name: genWord(),
969
+ only_store: genBiasBoolean(0.6),
970
+ spend: genNumber(100),
971
+ start_date: genDate(),
972
+ status: chooseRandom(["ACTIVE", "INACTIVE"]),
973
+ stock: genNumber(999),
974
+ term_and_condition: genWords(5),
975
+ text: genWords(4),
976
+ type: "COUPON",
977
+ vendor_id: genNumber(999).toString()
978
+ }, overrides);
979
+ };
980
+ const genCoupons = (quantity) => {
981
+ return genItems(buildCoupon, quantity);
982
+ };
983
+ const buildCouponCategory = (overrides = {}) => {
984
+ return __spreadValues$b({
985
+ featured: genBiasBoolean(0.5),
986
+ id: genId(),
987
+ name: genWord()
988
+ }, overrides);
989
+ };
990
+ const genCouponCategories = (quantity) => {
991
+ return genItems(buildCouponCategory, quantity);
992
+ };
993
+ const buildCode = (overrides = {}) => {
994
+ return __spreadValues$b({
995
+ code: genWord().toUpperCase(),
996
+ coupon_id: genId(),
997
+ id: genId(),
998
+ status: chooseRandom(["ACTIVE", "INACTIVE"]),
999
+ jwt: buildToken(),
1000
+ used: genBiasBoolean(0.5)
1001
+ }, overrides);
1002
+ };
1003
+ const genCodes = (quantity) => {
1004
+ return genItems(buildCode, quantity);
1005
+ };
1006
+ const buildToken = (overrides = {}) => {
1007
+ return __spreadValues$b({
1008
+ token: "www.google.com",
1009
+ dif: genNumber(17e8),
1010
+ iat: genNumber(17e8),
1011
+ exp: genNumber(3e4)
1012
+ }, overrides);
1013
+ };
1014
+ const genTokens = (quantity) => {
1015
+ return genItems(buildToken, quantity);
1016
+ };
1017
+ const buildStoreCouponDetail = (overrides = {}) => {
1018
+ return __spreadValues$b({
1019
+ benefits: genBenefitData(1),
1020
+ codes: genCodes(),
1021
+ end_date: genDate(),
1022
+ image: buildURLImage({ query: "coupon", height: 200, width: 544 }),
1023
+ id: genId(),
1024
+ name: genWord(),
1025
+ only_store: genBiasBoolean(0.6),
1026
+ spend: genNumber(100),
1027
+ start_date: genDate(),
1028
+ status: chooseRandom(["ACTIVE", "INACTIVE"]),
1029
+ stock: genNumber(999),
1030
+ term_and_condition: genWords(5),
1031
+ text: genWords(4),
1032
+ type: "COUPON",
1033
+ vendor_id: genNumber(999).toString()
1034
+ }, overrides);
1035
+ };
1036
+ const genStoreCouponDetails = (quantity) => {
1037
+ return genItems(buildStoreCouponDetail, quantity);
1038
+ };
1039
+
1040
+ var coupon_builder = /*#__PURE__*/Object.freeze({
1041
+ __proto__: null,
1042
+ buildAward: buildAward,
1043
+ buildBenefit: buildBenefit,
1044
+ buildBenefitData: buildBenefitData,
1045
+ buildCode: buildCode,
1046
+ buildCoupon: buildCoupon,
1047
+ buildCouponCategory: buildCouponCategory,
1048
+ buildProductCoupon: buildProductCoupon,
1049
+ buildStoreCoupon: buildStoreCoupon,
1050
+ buildStoreCouponDetail: buildStoreCouponDetail,
1051
+ buildToken: buildToken,
1052
+ buildWallet: buildWallet,
1053
+ genAwards: genAwards,
1054
+ genBenefitData: genBenefitData,
1055
+ genBenefits: genBenefits,
1056
+ genCodes: genCodes,
1057
+ genCouponCategories: genCouponCategories,
1058
+ genCoupons: genCoupons,
1059
+ genProductCoupons: genProductCoupons,
1060
+ genStoreCouponDetails: genStoreCouponDetails,
1061
+ genStoreCoupons: genStoreCoupons,
1062
+ genTokens: genTokens,
1063
+ genWallets: genWallets
1064
+ });
1065
+
1066
+ var __defProp$a = Object.defineProperty;
1067
+ var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
1068
+ var __hasOwnProp$a = Object.prototype.hasOwnProperty;
1069
+ var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
1070
+ var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1071
+ var __spreadValues$a = (a, b) => {
1072
+ for (var prop in b || (b = {}))
1073
+ if (__hasOwnProp$a.call(b, prop))
1074
+ __defNormalProp$a(a, prop, b[prop]);
1075
+ if (__getOwnPropSymbols$a)
1076
+ for (var prop of __getOwnPropSymbols$a(b)) {
1077
+ if (__propIsEnum$a.call(b, prop))
1078
+ __defNormalProp$a(a, prop, b[prop]);
1079
+ }
1080
+ return a;
1081
+ };
1082
+ const stepCategory = [
1083
+ "DONE",
1084
+ "IN_PROGRESS",
1085
+ "PAYMENT_IN_PROGRESS",
1086
+ "TO_DO"
1087
+ ];
1088
+ const stepCode = [
1089
+ "START",
1090
+ "IN_PROGRESS",
1091
+ "ORDERED",
1092
+ "RECEIVED",
1093
+ "TO_ASSIGN",
1094
+ "ASSIGNED",
1095
+ "ON_ROUTE",
1096
+ "DISPATCHED",
1097
+ "CANCELED",
1098
+ "ERROR"
1099
+ ];
1100
+ const buildIssue = (overrides = {}) => {
1101
+ return __spreadValues$a({
1102
+ conditions: [],
1103
+ children: [],
1104
+ related: [],
1105
+ step: buildStepWorkflow(),
1106
+ account_id: genId(),
1107
+ additional_info: buildIssueAdditionalInfo(),
1108
+ client_issue_id: genId(),
1109
+ transaction_id: genId(),
1110
+ history: genIssueHistory(),
1111
+ id: genId(),
1112
+ parent_issue_id: null,
1113
+ related_issue_id: null,
1114
+ step_id: genId(),
1115
+ vendor_id: genId(),
1116
+ workflow_id: genId()
1117
+ }, overrides);
1118
+ };
1119
+ const genIssues = (quantity) => {
1120
+ return genItems(buildIssue, quantity);
1121
+ };
1122
+ const buildIssueAdditionalInfo = (overrides = {}) => {
1123
+ return __spreadValues$a({
1124
+ stores: [
1125
+ genNumber(200),
1126
+ genNumber(200),
1127
+ genNumber(200),
1128
+ genNumber(200),
1129
+ genNumber(200)
1130
+ ],
1131
+ uid: genId()
1132
+ }, overrides);
1133
+ };
1134
+ const genIssueAdditionalInfo = (quantity) => {
1135
+ return genItems(buildIssueAdditionalInfo, quantity);
1136
+ };
1137
+ const buildIssueHistory = (overrides = {}) => {
1138
+ return __spreadValues$a({
1139
+ conditions: [],
1140
+ created_at: genDate(),
1141
+ finished_at: genDate(),
1142
+ additional_info: buildIssueAdditionalInfo(),
1143
+ id: genId(),
1144
+ step_id: genId(),
1145
+ step_name: genWords(2),
1146
+ transition_id: genId()
1147
+ }, overrides);
1148
+ };
1149
+ const genIssueHistory = (quantity) => {
1150
+ return genItems(buildIssueHistory, quantity);
1151
+ };
1152
+ const buildWorkflow = (overrides = {}) => {
1153
+ return __spreadValues$a({
1154
+ description: genWords(7),
1155
+ id: genId(),
1156
+ name: genCompanyName(),
1157
+ steps: genStepWorkflows(),
1158
+ webhooks: genWebhookWorkflows()
1159
+ }, overrides);
1160
+ };
1161
+ const genWorkflows = (quantity) => {
1162
+ return genItems(buildWorkflow, quantity);
1163
+ };
1164
+ const buildStepNotification = (overrides = {}) => {
1165
+ return __spreadValues$a({
1166
+ send_mail: genBiasBoolean(0.6),
1167
+ send_push: genBiasBoolean(0.4)
1168
+ }, overrides);
1169
+ };
1170
+ const genStepNotifications = (quantity) => {
1171
+ return genItems(buildStepNotification, quantity);
1172
+ };
1173
+ const buildStepWorkflow = (overrides = {}) => {
1174
+ return __spreadValues$a({
1175
+ additional_info: buildStepWorkflowAdditionalInfo(),
1176
+ category: chooseRandom(stepCategory),
1177
+ code: chooseRandom(stepCode),
1178
+ color: chooseRandom(["#FFFFFF", "#000000"]),
1179
+ id: genId(),
1180
+ description: genWords(10),
1181
+ description_frontend: genWords(5),
1182
+ name: genCompanyName(),
1183
+ subtitle_frontend: genWords(5),
1184
+ title_frontend: genWords(3),
1185
+ transitions: genTransitionWorkflows(),
1186
+ notification: buildStepNotification()
1187
+ }, overrides);
1188
+ };
1189
+ const genStepWorkflows = (quantity) => {
1190
+ return genItems(buildStepWorkflow, quantity);
1191
+ };
1192
+ const buildWebhookWorkflow = (overrides = {}) => {
1193
+ const methods = [
1194
+ "DELETE",
1195
+ "GET",
1196
+ "POST",
1197
+ "PATCH",
1198
+ "PUT"
1199
+ ];
1200
+ return __spreadValues$a({
1201
+ id: genId(),
1202
+ method: chooseRandom(methods),
1203
+ url: genURL()
1204
+ }, overrides);
1205
+ };
1206
+ const genWebhookWorkflows = (quantity) => {
1207
+ return genItems(buildWebhookWorkflow, quantity);
1208
+ };
1209
+ const buildStepWorkflowAdditionalInfo = (overrides = {}) => {
1210
+ return __spreadValues$a({
1211
+ client_frontend: genBiasBoolean(0.6),
1212
+ operators_frontend: genBiasBoolean(0.4),
1213
+ group: buildStepWorkflowGroup()
1214
+ }, overrides);
1215
+ };
1216
+ const genStepWorkflowAdditionalInfos = (quantity) => {
1217
+ return genItems(buildStepWorkflowAdditionalInfo, quantity);
1218
+ };
1219
+ const buildStepWorkflowGroup = (overrides = {}) => {
1220
+ const stepCode2 = [
1221
+ "START",
1222
+ "IN_PROGRESS",
1223
+ "ORDERED",
1224
+ "RECEIVED",
1225
+ "TO_ASSIGN",
1226
+ "ASSIGNED",
1227
+ "ON_ROUTE",
1228
+ "DISPATCHED",
1229
+ "CANCELED",
1230
+ "ERROR"
1231
+ ];
1232
+ return __spreadValues$a({
1233
+ code: chooseRandom(stepCode2),
1234
+ description: genWords(6),
1235
+ type: "default",
1236
+ weight: genNumber(1e4).toString()
1237
+ }, overrides);
1238
+ };
1239
+ const genStepWorkflowGroups = (quantity) => {
1240
+ return genItems(buildStepWorkflowGroup, quantity);
1241
+ };
1242
+ const buildTransitionWorkflow = (overrides = {}) => {
1243
+ return __spreadValues$a({
1244
+ channel_id: genId(),
1245
+ conditions: [],
1246
+ description: genWords(10),
1247
+ from_step_id: genId(),
1248
+ to_step_id: genId(),
1249
+ id: genId(),
1250
+ name: genName(),
1251
+ vendor_id: genId()
1252
+ }, overrides);
1253
+ };
1254
+ const genTransitionWorkflows = (quantity) => {
1255
+ return genItems(buildTransitionWorkflow, quantity);
1256
+ };
1257
+
1258
+ var fulfillment_builder = /*#__PURE__*/Object.freeze({
1259
+ __proto__: null,
1260
+ buildIssue: buildIssue,
1261
+ buildIssueAdditionalInfo: buildIssueAdditionalInfo,
1262
+ buildIssueHistory: buildIssueHistory,
1263
+ buildStepNotification: buildStepNotification,
1264
+ buildStepWorkflow: buildStepWorkflow,
1265
+ buildStepWorkflowAdditionalInfo: buildStepWorkflowAdditionalInfo,
1266
+ buildStepWorkflowGroup: buildStepWorkflowGroup,
1267
+ buildTransitionWorkflow: buildTransitionWorkflow,
1268
+ buildWebhookWorkflow: buildWebhookWorkflow,
1269
+ buildWorkflow: buildWorkflow,
1270
+ genIssueAdditionalInfo: genIssueAdditionalInfo,
1271
+ genIssueHistory: genIssueHistory,
1272
+ genIssues: genIssues,
1273
+ genStepNotifications: genStepNotifications,
1274
+ genStepWorkflowAdditionalInfos: genStepWorkflowAdditionalInfos,
1275
+ genStepWorkflowGroups: genStepWorkflowGroups,
1276
+ genStepWorkflows: genStepWorkflows,
1277
+ genTransitionWorkflows: genTransitionWorkflows,
1278
+ genWebhookWorkflows: genWebhookWorkflows,
1279
+ genWorkflows: genWorkflows,
1280
+ stepCategory: stepCategory,
1281
+ stepCode: stepCode
1282
+ });
1283
+
1284
+ var __defProp$9 = Object.defineProperty;
1285
+ var __defProps$4 = Object.defineProperties;
1286
+ var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
1287
+ var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
1288
+ var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
1289
+ var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
1290
+ var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1291
+ var __spreadValues$9 = (a, b) => {
1292
+ for (var prop in b || (b = {}))
1293
+ if (__hasOwnProp$9.call(b, prop))
1294
+ __defNormalProp$9(a, prop, b[prop]);
1295
+ if (__getOwnPropSymbols$9)
1296
+ for (var prop of __getOwnPropSymbols$9(b)) {
1297
+ if (__propIsEnum$9.call(b, prop))
1298
+ __defNormalProp$9(a, prop, b[prop]);
1299
+ }
1300
+ return a;
1301
+ };
1302
+ var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
1303
+ const buildMasivoCustomer = (overrides) => {
1304
+ return __spreadValues$9({
1305
+ name: genWord(),
1306
+ tier_id: "eac25bef-c6de-4906-8d99-014b5950132f",
1307
+ email: `${genWord()}@${genWord()}.com`,
1308
+ gender: chooseRandom(["MALE", "FEMALE", "NOT_SPECIFIED"]),
1309
+ id: `${genNumericId()}`,
1310
+ metadata: {
1311
+ coupon_code: genWord(10)
1312
+ },
1313
+ registration_date: "2024-11-15T00:00:00+00:00",
1314
+ status: "ACTIVE",
1315
+ dob: "2010-11-15T00:00:00+00:00",
1316
+ metrics: buildCustomerMetrics()
1317
+ }, overrides);
1318
+ };
1319
+ const buildCustomerMetrics = (overrides) => {
1320
+ return __spreadValues$9({
1321
+ last_month: buildMetrics(),
1322
+ last_quarter: buildMetrics(),
1323
+ last_year: buildMetrics(),
1324
+ last_semester: buildMetrics(),
1325
+ this_month: buildMetrics(),
1326
+ this_quarter: buildMetrics(),
1327
+ this_semester: buildMetrics(),
1328
+ this_year: buildMetrics(),
1329
+ lifetime: buildMetrics()
1330
+ }, overrides);
1331
+ };
1332
+ const buildMetrics = (overrides) => {
1333
+ return __spreadValues$9({
1334
+ from: genDate().toString(),
1335
+ to: genDate().toString(),
1336
+ last_visit: null,
1337
+ number_of_purchases: genNumber(),
1338
+ spend_total: genNumber(),
1339
+ tier_id: genId()
1340
+ }, overrides);
1341
+ };
1342
+ const buildMasivoWallet = (overrides) => {
1343
+ return __spreadValues$9({
1344
+ id: `${genNumericId()}`,
1345
+ owner_id: `${genNumericId()}`,
1346
+ totals: [buildWalletTotal(), buildWalletTotal()],
1347
+ lines: [buildWalletLine(), buildWalletLine()]
1348
+ }, overrides);
1349
+ };
1350
+ const buildMasivoInfo = (override, customerOverrides, walletOverrides) => {
1351
+ return __spreadValues$9({
1352
+ customer: buildMasivoCustomer(customerOverrides),
1353
+ wallet: buildMasivoWallet(walletOverrides)
1354
+ }, override);
1355
+ };
1356
+ const buildWalletMedia = (overrides) => {
1357
+ return __spreadValues$9({
1358
+ thumbnail_url: genURL(),
1359
+ cover_url: genURL()
1360
+ }, overrides);
1361
+ };
1362
+ const buildWalletAttribute = (overrides) => {
1363
+ return __spreadValues$9({
1364
+ conversion_factor: genNumber(1),
1365
+ action: chooseRandom(["ADD_PRODUCT", "REPLACE_PRODUCT"]),
1366
+ discount_type: chooseRandom(["fixed", "percentage"]),
1367
+ discount_value: genNumber(10),
1368
+ new_amount: genNumber(20),
1369
+ replace_amount: genNumber(20),
1370
+ replace_product_id: genId(),
1371
+ new_product_id: genId(),
1372
+ item_id: genId(),
1373
+ type: chooseRandom(["order", "shipping", "product"])
1374
+ }, overrides);
1375
+ };
1376
+ const buildMasivoConditionBase = (overrides) => {
1377
+ return __spreadValues$9({
1378
+ invalidMessage: genWord(4),
1379
+ primitive: chooseRandom(["int", "char", "bool"]),
1380
+ type: chooseRandom([
1381
+ "Current date",
1382
+ "Registration",
1383
+ "Birthday",
1384
+ "Customer number of purchases",
1385
+ "Customer has made a purchase",
1386
+ "Customer points balance",
1387
+ "Customer spend total",
1388
+ "Customer total spend",
1389
+ "Ordered at store",
1390
+ "Ordered in channel",
1391
+ "Payment method",
1392
+ "Order includes product",
1393
+ "Order value",
1394
+ "Order includes tag",
1395
+ "Product includes tag",
1396
+ "Shipping includes tag"
1397
+ ]),
1398
+ operator: chooseRandom([
1399
+ "greater than",
1400
+ "greater than or equal to",
1401
+ "less than",
1402
+ "less than or equal to",
1403
+ "equal to",
1404
+ "not equal to",
1405
+ "is",
1406
+ "is not",
1407
+ "falls within period",
1408
+ "occurred",
1409
+ "occurred in the last",
1410
+ "occurred more than"
1411
+ ])
1412
+ }, overrides);
1413
+ };
1414
+ const buildMasivoCondition = (overrides) => {
1415
+ return __spreadValues$9(__spreadProps$4(__spreadValues$9({}, buildMasivoConditionBase()), {
1416
+ value: genWord(4),
1417
+ reward_id: genId(),
1418
+ allDay: genBiasBoolean(0.2),
1419
+ startDate: genDate().toString(),
1420
+ endDate: genDate().toString(),
1421
+ repeat: chooseRandom([
1422
+ "NONE",
1423
+ "DAILY",
1424
+ "WEEKLY",
1425
+ "FORTNIGHTLY",
1426
+ "MONTHLY",
1427
+ "WEEK_OF_MONTH"
1428
+ ]),
1429
+ reporting_period: chooseRandom([
1430
+ "MONTHLY",
1431
+ "QUARTERLY",
1432
+ "YEARLY",
1433
+ "SEMESTERLY"
1434
+ ])
1435
+ }), overrides);
1436
+ };
1437
+ const buildWalletReward = (overrides) => {
1438
+ return __spreadValues$9({
1439
+ id: genId(),
1440
+ name: genWord(4),
1441
+ description: genWord(12),
1442
+ conditions: [],
1443
+ media: buildWalletMedia(),
1444
+ type: chooseRandom(["DISCOUNT", "POINTS", "GIFT_CARD", "PRODUCT"]),
1445
+ status: "ACTIVE",
1446
+ brand_id: null,
1447
+ attributes: buildWalletAttribute({
1448
+ conversion_factor: 0.025
1449
+ })
1450
+ }, overrides);
1451
+ };
1452
+ const buildWalletTotal = (overrides) => {
1453
+ return __spreadValues$9({
1454
+ reward_id: genId(),
1455
+ reward: buildWalletReward(),
1456
+ total: genNumber(200),
1457
+ expiration_date: genDate().toString()
1458
+ }, overrides);
1459
+ };
1460
+ const buildWalletLine = (overrides) => {
1461
+ return __spreadValues$9({
1462
+ brand_id: genId(),
1463
+ reward_id: genId(),
1464
+ campaign_id: genId(),
1465
+ expiration_date: genDate().toString(),
1466
+ issued_at: genDate().toString(),
1467
+ reservation_expires_at: genDate().toString(),
1468
+ amount: genNumber(200),
1469
+ reward: buildWalletReward()
1470
+ }, overrides);
1471
+ };
1472
+ const buildRedeemableBenefit = (overrides) => {
1473
+ return __spreadValues$9(__spreadValues$9({
1474
+ brand_id: genId(),
1475
+ campaign_id: genId(),
1476
+ issued_at: genDate().toString(),
1477
+ amount: genNumber(200),
1478
+ alerts: []
1479
+ }, buildWalletTotal()), overrides);
1480
+ };
1481
+ const buildLoyaltyAccumulation = (override) => {
1482
+ if (override)
1483
+ return override;
1484
+ const [line] = [buildWalletLine()];
1485
+ const [total] = [buildWalletTotal()];
1486
+ const { reward } = total;
1487
+ return __spreadProps$4(__spreadValues$9({}, line), { reward });
1488
+ };
1489
+ const buildMasivoTier = (overrides) => {
1490
+ return __spreadValues$9({
1491
+ id: genId(),
1492
+ name: `${genWord()} ${genWord()}`,
1493
+ status: "ACTIVE",
1494
+ level: genNumber(12),
1495
+ description: genParagraph(1),
1496
+ entry_conditions: [[buildMasivoCondition()]],
1497
+ exit_conditions: [[buildMasivoCondition()]],
1498
+ template_id: genId()
1499
+ }, overrides);
1500
+ };
1501
+ const buildExtendedLoyaltyInfo = (overrides) => {
1502
+ return __spreadValues$9(__spreadProps$4(__spreadValues$9({}, buildMasivoInfo()), {
1503
+ accumulations: [buildLoyaltyAccumulation()],
1504
+ redemptions: []
1505
+ }), overrides);
1506
+ };
1507
+ const buildCodesSummary = (overrides) => {
1508
+ return __spreadValues$9({
1509
+ codes: [genWord(1), genWord(1), genWord(1)],
1510
+ left: genNumber(70),
1511
+ used: genNumber(30),
1512
+ total: genNumber(100)
1513
+ }, overrides);
1514
+ };
1515
+ const buildCodeFormat = (overrides) => {
1516
+ return __spreadValues$9({
1517
+ case_sensitive: genBiasBoolean(0.3),
1518
+ exclude_characters: genWord(1),
1519
+ include_characters: genWord(1),
1520
+ template: genWord(10)
1521
+ }, overrides);
1522
+ };
1523
+ const buildCouponCampaignAttributes = (overrides) => {
1524
+ return __spreadValues$9({
1525
+ code_format: buildCodeFormat(),
1526
+ codes_summary: buildCodesSummary(),
1527
+ max_redemptions_per_code: genNumber(3),
1528
+ max_redemptions_per_code_per_customer: genNumber(5)
1529
+ }, overrides);
1530
+ };
1531
+ const buildLoyaltyCampaign = (overrides) => {
1532
+ return __spreadValues$9({
1533
+ id: genId(),
1534
+ name: `${genWord()} ${genWord()}`,
1535
+ description: genParagraph(1),
1536
+ brand_id: genId(),
1537
+ start_date: genDate().toString(),
1538
+ end_date: null,
1539
+ rules: [buildCampaignRule(), buildCampaignRule()],
1540
+ type: chooseRandom(["COUPONS", "BEHAVIOR"]),
1541
+ funded_by: null,
1542
+ labels: [chooseRandom(["Domicilio", "Restaurantes"])],
1543
+ budget: genNumber(1e3),
1544
+ divide_budget_in: chooseRandom(["daily", "weekly", "monthly", "total"]),
1545
+ content: {
1546
+ Title: {
1547
+ name: genWord(),
1548
+ type: "input",
1549
+ value: genWord()
1550
+ },
1551
+ BannerImage: {
1552
+ name: genWord(),
1553
+ type: "input",
1554
+ value: genURL()
1555
+ }
1556
+ },
1557
+ template_id: genId(),
1558
+ metadata: {},
1559
+ attributes: buildCouponCampaignAttributes(),
1560
+ status: chooseRandom(["RUNNING", "PAUSED", "SCHEDULED", "FINISHED"])
1561
+ }, overrides);
1562
+ };
1563
+ const buildMasivoEffect = (overrides) => {
1564
+ return __spreadValues$9({
1565
+ amount: genNumber(200),
1566
+ type: chooseRandom(["DISCOUNT", "POINTS", "GIFT_CARD", "PRODUCT"]),
1567
+ reward_id: genId(),
1568
+ reward: buildWalletReward(),
1569
+ tier_id: genId(),
1570
+ expiration_date: genDate().toString(),
1571
+ multiplier: chooseRandom(["Order value"])
1572
+ }, overrides);
1573
+ };
1574
+ const buildCampaignRule = (overrides) => {
1575
+ return __spreadValues$9({ conditions: [], effects: [] }, overrides);
1576
+ };
1577
+
1578
+ var masivo_builder = /*#__PURE__*/Object.freeze({
1579
+ __proto__: null,
1580
+ buildCampaignRule: buildCampaignRule,
1581
+ buildCodeFormat: buildCodeFormat,
1582
+ buildCodesSummary: buildCodesSummary,
1583
+ buildCouponCampaignAttributes: buildCouponCampaignAttributes,
1584
+ buildCustomerMetrics: buildCustomerMetrics,
1585
+ buildExtendedLoyaltyInfo: buildExtendedLoyaltyInfo,
1586
+ buildLoyaltyAccumulation: buildLoyaltyAccumulation,
1587
+ buildLoyaltyCampaign: buildLoyaltyCampaign,
1588
+ buildMasivoCondition: buildMasivoCondition,
1589
+ buildMasivoConditionBase: buildMasivoConditionBase,
1590
+ buildMasivoCustomer: buildMasivoCustomer,
1591
+ buildMasivoEffect: buildMasivoEffect,
1592
+ buildMasivoInfo: buildMasivoInfo,
1593
+ buildMasivoTier: buildMasivoTier,
1594
+ buildMasivoWallet: buildMasivoWallet,
1595
+ buildMetrics: buildMetrics,
1596
+ buildRedeemableBenefit: buildRedeemableBenefit,
1597
+ buildWalletAttribute: buildWalletAttribute,
1598
+ buildWalletLine: buildWalletLine,
1599
+ buildWalletMedia: buildWalletMedia,
1600
+ buildWalletReward: buildWalletReward,
1601
+ buildWalletTotal: buildWalletTotal
1602
+ });
1603
+
1604
+ var __defProp$8 = Object.defineProperty;
1605
+ var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
1606
+ var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
1607
+ var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
1608
+ var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1609
+ var __spreadValues$8 = (a, b) => {
1610
+ for (var prop in b || (b = {}))
1611
+ if (__hasOwnProp$8.call(b, prop))
1612
+ __defNormalProp$8(a, prop, b[prop]);
1613
+ if (__getOwnPropSymbols$8)
1614
+ for (var prop of __getOwnPropSymbols$8(b)) {
1615
+ if (__propIsEnum$8.call(b, prop))
1616
+ __defNormalProp$8(a, prop, b[prop]);
1617
+ }
1618
+ return a;
1619
+ };
1620
+ const buildUser = (overrides = {}) => {
1621
+ return __spreadValues$8({
1622
+ idInt: genNumericId(),
1623
+ uid: genId(),
1624
+ name: genName(),
1625
+ lastname: genName(),
1626
+ email: genEmail(),
1627
+ birthdate: faker.faker.date.past().toISOString().split("T")[0],
1628
+ country: genCountry(),
1629
+ document: genDocument(10),
1630
+ documentType: genDocumentType(),
1631
+ active: genBiasBoolean(0.8),
1632
+ externalId: genId(),
1633
+ gender: chooseRandom(["MALE", "FEMALE"]),
1634
+ vendorId: genId(),
1635
+ middleName: genName(),
1636
+ secondLastname: genName(),
1637
+ origin: chooseRandom(["ios", "android", "web"]),
1638
+ phone: buildPhone(),
1639
+ maritalStatus: chooseRandom(["MARRIED", "DIVORCED", "SINGLE"]),
1640
+ type: "NORMAL",
1641
+ latestConditionsAcceptanceDate: faker.faker.date.past().toISOString(),
1642
+ rewardsProgramStatus: chooseRandom(["REGISTERED", "UNREGISTERED"])
1643
+ }, overrides);
1644
+ };
1645
+ const genUsers = (quantity) => {
1646
+ return genItems(buildUser, quantity);
1647
+ };
1648
+ const buildPhone = (overrides = {}) => {
1649
+ return __spreadValues$8({
1650
+ countryCode: chooseRandom(["+593", "+1"]),
1651
+ countryIsoCode: chooseRandom(countriesCodes),
1652
+ number: genNumber(9999999999).toString()
1653
+ }, overrides);
1654
+ };
1655
+ const genPhones = (quantity) => {
1656
+ return genItems(buildPhone, quantity);
1657
+ };
1658
+
1659
+ var user_builder = /*#__PURE__*/Object.freeze({
1660
+ __proto__: null,
1661
+ buildPhone: buildPhone,
1662
+ buildUser: buildUser,
1663
+ genPhones: genPhones,
1664
+ genUsers: genUsers
1665
+ });
1666
+
1667
+ var __defProp$7 = Object.defineProperty;
1668
+ var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
1669
+ var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
1670
+ var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
1671
+ var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1672
+ var __spreadValues$7 = (a, b) => {
1673
+ for (var prop in b || (b = {}))
1674
+ if (__hasOwnProp$7.call(b, prop))
1675
+ __defNormalProp$7(a, prop, b[prop]);
1676
+ if (__getOwnPropSymbols$7)
1677
+ for (var prop of __getOwnPropSymbols$7(b)) {
1678
+ if (__propIsEnum$7.call(b, prop))
1679
+ __defNormalProp$7(a, prop, b[prop]);
1680
+ }
1681
+ return a;
1682
+ };
1683
+ const buildVendor = (overrides = {}) => {
1684
+ return __spreadValues$7({
1685
+ id: genNumber(999).toString(),
1686
+ images: genCDNImages(void 0, { query: "brand" }),
1687
+ maxPurchaseValue: 0,
1688
+ name: faker.faker.company.name(),
1689
+ description: genWords(10),
1690
+ sponsored: genBiasBoolean(0.5),
1691
+ active: genBiasBoolean(0.5)
1692
+ }, overrides);
1693
+ };
1694
+ const genVendors = (quantity) => {
1695
+ return genItems(buildVendor, quantity);
1696
+ };
1697
+
1698
+ var vendor_builder = /*#__PURE__*/Object.freeze({
1699
+ __proto__: null,
1700
+ buildVendor: buildVendor,
1701
+ genVendors: genVendors
1702
+ });
1703
+
1704
+ var __defProp$6 = Object.defineProperty;
1705
+ var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
1706
+ var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
1707
+ var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
1708
+ var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1709
+ var __spreadValues$6 = (a, b) => {
1710
+ for (var prop in b || (b = {}))
1711
+ if (__hasOwnProp$6.call(b, prop))
1712
+ __defNormalProp$6(a, prop, b[prop]);
1713
+ if (__getOwnPropSymbols$6)
1714
+ for (var prop of __getOwnPropSymbols$6(b)) {
1715
+ if (__propIsEnum$6.call(b, prop))
1716
+ __defNormalProp$6(a, prop, b[prop]);
1717
+ }
1718
+ return a;
1719
+ };
1720
+ const buildStore = (overrides = {}) => {
1721
+ return __spreadValues$6({
1722
+ storeId: genId(),
1723
+ storeName: faker.faker.name.jobTitle(),
1724
+ address: faker.faker.address.street(),
1725
+ vendor: buildVendor(),
1726
+ coverage: genBiasBoolean(0.99),
1727
+ coverUrl: genURL(),
1728
+ delivery: buildDelivery(),
1729
+ description: null,
1730
+ isOpen: genBiasBoolean(0.99),
1731
+ maxOrderAmount: genNumber(50),
1732
+ minOrderAmount: genNumber(10),
1733
+ orderSymbol: genSymbol(),
1734
+ phone: genMobilPhone("593"),
1735
+ sponsored: genBiasBoolean(0.1),
1736
+ latitude: genNumber({ min: 0, max: 80, precision: 6 }),
1737
+ longitude: genNumber({ min: 0, max: 80, precision: 6 }),
1738
+ schedules: genSchedules(8),
1739
+ timezone: "",
1740
+ services: genServices(10),
1741
+ cookTime: genNumber(60).toString(),
1742
+ city: buildGenericStoreLocation(),
1743
+ outOfService: genBiasBoolean(0.1),
1744
+ isDefault: genBiasBoolean(0.1),
1745
+ active: genBiasBoolean(0.9),
1746
+ minOrder: genNumber(15),
1747
+ minOrderSymbol: genSymbol(),
1748
+ country: buildGenericStoreLocation(),
1749
+ location: buildStoreLocation(),
1750
+ catalogues: genCatalogues(),
1751
+ images: genCDNImages(void 0, { query: "store" }),
1752
+ distance: genNumber(20),
1753
+ polygons: null
1754
+ }, overrides);
1755
+ };
1756
+ const buildDelivery = (overrides = {}) => {
1757
+ return __spreadValues$6({
1758
+ deliveryTimeUnit: chooseRandom(["min"]),
1759
+ deliveryTimeValue: genNumber(60).toString(),
1760
+ express: genBiasBoolean(0.1),
1761
+ freeDelivery: genBiasBoolean(0.1)
1762
+ }, overrides);
1763
+ };
1764
+ const buildSchedule = (overrides = {}) => {
1765
+ const days = [
1766
+ "MONDAY",
1767
+ "TUESDAY",
1768
+ "WEDNESDAY",
1769
+ "THURSDAY",
1770
+ "FRIDAY",
1771
+ "SATURDAY",
1772
+ "SUNDAY",
1773
+ "SPECIAL"
1774
+ ];
1775
+ return __spreadValues$6({
1776
+ day: chooseRandom(days),
1777
+ from: genNumber(36e3),
1778
+ to: genNumber(77400),
1779
+ catalogueId: genNumber(100).toString()
1780
+ }, overrides);
1781
+ };
1782
+ const buildService = (overrides = {}) => {
1783
+ return __spreadValues$6({
1784
+ name: genWord(),
1785
+ active: genBiasBoolean(0.5),
1786
+ url: genURL()
1787
+ }, overrides);
1788
+ };
1789
+ const genServices = (quantity) => {
1790
+ return genItems(buildService, quantity);
1791
+ };
1792
+ const genSchedules = (quantity) => {
1793
+ return genItems(buildSchedule, quantity);
1794
+ };
1795
+ const genStores = (quantity) => {
1796
+ return genItems(buildStore, quantity);
1797
+ };
1798
+ const buildGenericStoreLocation = (overrides = {}) => {
1799
+ return __spreadValues$6({
1800
+ id: genId(),
1801
+ name: genCompanyName(),
1802
+ active: genBiasBoolean(0.5)
1803
+ }, overrides);
1804
+ };
1805
+ const genGenericStoreLocation = (quantity) => {
1806
+ return genItems(buildGenericStoreLocation, quantity);
1807
+ };
1808
+ const buildStoreLocation = (overrides = {}) => {
1809
+ return __spreadValues$6({
1810
+ lat: genNumber(),
1811
+ lon: genNumber(),
1812
+ geohash: "6rbpjdx8km6m",
1813
+ fragment: genBiasBoolean(0.8)
1814
+ }, overrides);
1815
+ };
1816
+ const genStoreLocation = (quantity) => {
1817
+ return genItems(buildStoreLocation, quantity);
1818
+ };
1819
+
1820
+ var store_builder = /*#__PURE__*/Object.freeze({
1821
+ __proto__: null,
1822
+ buildDelivery: buildDelivery,
1823
+ buildGenericStoreLocation: buildGenericStoreLocation,
1824
+ buildSchedule: buildSchedule,
1825
+ buildService: buildService,
1826
+ buildStore: buildStore,
1827
+ buildStoreLocation: buildStoreLocation,
1828
+ genGenericStoreLocation: genGenericStoreLocation,
1829
+ genSchedules: genSchedules,
1830
+ genServices: genServices,
1831
+ genStoreLocation: genStoreLocation,
1832
+ genStores: genStores
1833
+ });
1834
+
1835
+ var __defProp$5 = Object.defineProperty;
1836
+ var __defProps$3 = Object.defineProperties;
1837
+ var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
1838
+ var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
1839
+ var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
1840
+ var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
1841
+ var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1842
+ var __spreadValues$5 = (a, b) => {
1843
+ for (var prop in b || (b = {}))
1844
+ if (__hasOwnProp$5.call(b, prop))
1845
+ __defNormalProp$5(a, prop, b[prop]);
1846
+ if (__getOwnPropSymbols$5)
1847
+ for (var prop of __getOwnPropSymbols$5(b)) {
1848
+ if (__propIsEnum$5.call(b, prop))
1849
+ __defNormalProp$5(a, prop, b[prop]);
1850
+ }
1851
+ return a;
1852
+ };
1853
+ var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
1854
+ const buildBillTotalNormalCategory = (overrides = {}) => {
1855
+ const subtotalBeforeTaxes = genNumber({ min: 1, max: 10, precision: 2 });
1856
+ const taxTotal = subtotalBeforeTaxes * 0.12;
1857
+ const total = subtotalBeforeTaxes + taxTotal;
1858
+ return __spreadValues$5({
1859
+ subtotalBeforeTaxes,
1860
+ taxTotal,
1861
+ total,
1862
+ discounts: genDiscounts(1),
1863
+ taxes: []
1864
+ }, overrides);
1865
+ };
1866
+ const buildBillTotal = (overrides = {}) => {
1867
+ return __spreadValues$5({
1868
+ NORMAL: buildBillTotalNormalCategory(),
1869
+ POINTS: buildBillTotalNormalCategory()
1870
+ }, overrides);
1871
+ };
1872
+ const buildCartStore = (overrides = {}) => {
1873
+ return __spreadValues$5(__spreadProps$3(__spreadValues$5({}, buildStore()), {
1874
+ alerts: [],
1875
+ products: {}
1876
+ }), overrides);
1877
+ };
1878
+ const genCartStores = (quantity) => {
1879
+ const num = quantity != null ? quantity : genNumber({ min: 1, max: 1 });
1880
+ const cartStores = {};
1881
+ for (let i = 0; i < num; i++) {
1882
+ const cartStore = buildCartStore();
1883
+ const storeIndex = cartStore.storeId;
1884
+ cartStores[storeIndex] = cartStore;
1885
+ }
1886
+ return cartStores;
1887
+ };
1888
+ const buildShoppingCart = (overrides = {}) => {
1889
+ return __spreadValues$5({
1890
+ name: "default",
1891
+ billTotal: buildBillTotal(),
1892
+ channelId: genId(),
1893
+ createdAt: new Date().toISOString(),
1894
+ latitude: genNumber({ min: -20, max: 20, precision: 8 }),
1895
+ longitude: genNumber({ min: -20, max: 20, precision: 8 }),
1896
+ id: genNumber(999).toString(),
1897
+ updatedAt: new Date().toISOString(),
1898
+ stores: genCartStores(),
1899
+ shippingCost: buildShippingCost()
1900
+ }, overrides);
1901
+ };
1902
+ const buildShippingCost = (overrides = {}) => {
1903
+ return __spreadValues$5({
1904
+ amount: genNumber(3),
1905
+ discountTotal: genNumber(100),
1906
+ discounts: [],
1907
+ grossPrice: genNumber(100),
1908
+ name: genWord(),
1909
+ netPrice: genNumber(100),
1910
+ productId: genId(),
1911
+ subtotalBeforeTaxes: genNumber(100),
1912
+ symbol: genSymbol(),
1913
+ taxTotal: genNumber(100),
1914
+ taxes: genShippingCostTaxes(),
1915
+ total: genNumber(100),
1916
+ discountNetPrice: genNumber(100)
1917
+ }, overrides);
1918
+ };
1919
+ const buildShippingCostTax = (overrides = {}) => {
1920
+ return __spreadValues$5({
1921
+ percentage: genNumber(100),
1922
+ name: genWord(),
1923
+ vatRateCode: genNumber(100),
1924
+ code: genNumber(100),
1925
+ vatRate: genWord(),
1926
+ taxBase: genNumber(100),
1927
+ value: genWord()
1928
+ }, overrides);
1929
+ };
1930
+ const genShippingCostTaxes = (quantity) => {
1931
+ return genItems(buildShippingCostTax, quantity);
1932
+ };
1933
+ const buildDiscount = (overrides = {}) => {
1934
+ const benefitTypes = [
1935
+ "ALTER_DELIVERY",
1936
+ "DISCOUNT_FIXED",
1937
+ "DISCOUNT_PERCENTAGE",
1938
+ "PRODUCT"
1939
+ ];
1940
+ const type = chooseRandom(benefitTypes);
1941
+ return __spreadValues$5({
1942
+ benefitId: genId(),
1943
+ benefitWalletId: genId(),
1944
+ discountBase: genNumber(100),
1945
+ hasTaxes: genBiasBoolean(0.5),
1946
+ isInitialized: genBiasBoolean(0.5),
1947
+ name: genWord(),
1948
+ percentage: genNumber(100),
1949
+ taxValue: genNumber(100),
1950
+ type,
1951
+ value: genNumber(100)
1952
+ }, overrides);
1953
+ };
1954
+ const genDiscounts = (quantity) => {
1955
+ return genItems(buildDiscount, quantity);
1956
+ };
1957
+
1958
+ var shoppingCart_builder = /*#__PURE__*/Object.freeze({
1959
+ __proto__: null,
1960
+ buildBillTotal: buildBillTotal,
1961
+ buildBillTotalNormalCategory: buildBillTotalNormalCategory,
1962
+ buildCartStore: buildCartStore,
1963
+ buildDiscount: buildDiscount,
1964
+ buildShippingCost: buildShippingCost,
1965
+ buildShippingCostTax: buildShippingCostTax,
1966
+ buildShoppingCart: buildShoppingCart,
1967
+ genCartStores: genCartStores,
1968
+ genDiscounts: genDiscounts,
1969
+ genShippingCostTaxes: genShippingCostTaxes
1970
+ });
1971
+
1972
+ var __defProp$4 = Object.defineProperty;
1973
+ var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
1974
+ var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
1975
+ var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
1976
+ var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1977
+ var __spreadValues$4 = (a, b) => {
1978
+ for (var prop in b || (b = {}))
1979
+ if (__hasOwnProp$4.call(b, prop))
1980
+ __defNormalProp$4(a, prop, b[prop]);
1981
+ if (__getOwnPropSymbols$4)
1982
+ for (var prop of __getOwnPropSymbols$4(b)) {
1983
+ if (__propIsEnum$4.call(b, prop))
1984
+ __defNormalProp$4(a, prop, b[prop]);
1985
+ }
1986
+ return a;
1987
+ };
1988
+ const genStreetName = (...params) => faker.faker.address.street(...params);
1989
+ const genStreetNumber = (...params) => faker.faker.address.zipCode(...params);
1990
+ const genLatitude = (...params) => faker.faker.address.latitude(...params);
1991
+ const genLongitude = (...params) => faker.faker.address.longitude(...params);
1992
+ const buildField = (overrides = {}) => {
1993
+ return __spreadValues$4({
1994
+ id: genWord(),
1995
+ value: genWord(),
1996
+ label: genWord(),
1997
+ rules: buildRule(),
1998
+ messages: buildMessage()
1999
+ }, overrides);
2000
+ };
2001
+ const genFields = (quantity) => {
2002
+ return genItems(buildField, quantity);
2003
+ };
2004
+ const buildRule = (overrides) => {
2005
+ return __spreadValues$4({
2006
+ max: genNumber(),
2007
+ min: genNumber()
2008
+ }, overrides);
2009
+ };
2010
+ const buildMessage = (overrides) => {
2011
+ return __spreadValues$4({
2012
+ max: genWord(),
2013
+ min: genWord()
2014
+ }, overrides);
2015
+ };
2016
+ const genRules = (quantity) => {
2017
+ return genItems(buildRule, quantity);
2018
+ };
2019
+ const genMessages = (quantity) => {
2020
+ return genItems(buildMessage, quantity);
2021
+ };
2022
+ const buildLivingPlace = (overrides = {}) => {
2023
+ return __spreadValues$4({
2024
+ id: genId(),
2025
+ fields: genFields(2),
2026
+ name: genWord(),
2027
+ active: 1,
2028
+ countryId: "1"
2029
+ }, overrides);
2030
+ };
2031
+ const genLivingPlaces = (quantity) => {
2032
+ return genItems(buildLivingPlace, quantity);
2033
+ };
2034
+ const buildShippingAddress = (overrides = {}) => {
2035
+ return __spreadValues$4({
2036
+ id: genId(),
2037
+ default: getBoolean(),
2038
+ mainStreet: genStreetName(),
2039
+ number: genStreetNumber(),
2040
+ secondaryStreet: genStreetName(),
2041
+ reference: genAddress(),
2042
+ lat: +genLatitude(),
2043
+ lng: +genLongitude(),
2044
+ country: genCountry(),
2045
+ livingPlace: buildLivingPlace(),
2046
+ updatedAt: genBiasBoolean(0.4) ? genDate() : void 0,
2047
+ createdAt: genDate(),
2048
+ numberContactAddress: genNumber().toString(),
2049
+ nickname: genName()
2050
+ }, overrides);
2051
+ };
2052
+ const genShippingAddress = (quantity) => {
2053
+ return genItems(buildShippingAddress, quantity);
2054
+ };
2055
+
2056
+ var shippingAddress_builder = /*#__PURE__*/Object.freeze({
2057
+ __proto__: null,
2058
+ buildField: buildField,
2059
+ buildLivingPlace: buildLivingPlace,
2060
+ buildMessage: buildMessage,
2061
+ buildRule: buildRule,
2062
+ buildShippingAddress: buildShippingAddress,
2063
+ genFields: genFields,
2064
+ genLatitude: genLatitude,
2065
+ genLivingPlaces: genLivingPlaces,
2066
+ genLongitude: genLongitude,
2067
+ genMessages: genMessages,
2068
+ genRules: genRules,
2069
+ genShippingAddress: genShippingAddress,
2070
+ genStreetName: genStreetName,
2071
+ genStreetNumber: genStreetNumber
2072
+ });
2073
+
2074
+ var __defProp$3 = Object.defineProperty;
2075
+ var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
2076
+ var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
2077
+ var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
2078
+ var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2079
+ var __spreadValues$3 = (a, b) => {
2080
+ for (var prop in b || (b = {}))
2081
+ if (__hasOwnProp$3.call(b, prop))
2082
+ __defNormalProp$3(a, prop, b[prop]);
2083
+ if (__getOwnPropSymbols$3)
2084
+ for (var prop of __getOwnPropSymbols$3(b)) {
2085
+ if (__propIsEnum$3.call(b, prop))
2086
+ __defNormalProp$3(a, prop, b[prop]);
2087
+ }
2088
+ return a;
2089
+ };
2090
+ const buildSettings = (overrides = {}) => {
2091
+ return __spreadValues$3({
2092
+ emailNotifications: genBiasBoolean(0.5),
2093
+ pushNotifications: genBiasBoolean(0.4)
2094
+ }, overrides);
2095
+ };
2096
+ const genSettings = (quantity) => {
2097
+ return genItems(buildSettings, quantity);
2098
+ };
2099
+ const buildUserSettings = (overrides = {}) => {
2100
+ return __spreadValues$3({
2101
+ uid: genId(),
2102
+ settings: buildSettings()
2103
+ }, overrides);
2104
+ };
2105
+ const genUserSettings = (quantity) => {
2106
+ return genItems(buildUserSettings, quantity);
2107
+ };
2108
+
2109
+ var settings_builder = /*#__PURE__*/Object.freeze({
2110
+ __proto__: null,
2111
+ buildSettings: buildSettings,
2112
+ buildUserSettings: buildUserSettings,
2113
+ genSettings: genSettings,
2114
+ genUserSettings: genUserSettings
2115
+ });
2116
+
2117
+ var __defProp$2 = Object.defineProperty;
2118
+ var __defProps$2 = Object.defineProperties;
2119
+ var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
2120
+ var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
2121
+ var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
2122
+ var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
2123
+ var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2124
+ var __spreadValues$2 = (a, b) => {
2125
+ for (var prop in b || (b = {}))
2126
+ if (__hasOwnProp$2.call(b, prop))
2127
+ __defNormalProp$2(a, prop, b[prop]);
2128
+ if (__getOwnPropSymbols$2)
2129
+ for (var prop of __getOwnPropSymbols$2(b)) {
2130
+ if (__propIsEnum$2.call(b, prop))
2131
+ __defNormalProp$2(a, prop, b[prop]);
2132
+ }
2133
+ return a;
2134
+ };
2135
+ var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
2136
+ const orderStatusOptions = [
2137
+ "APPROVED",
2138
+ "PENDING",
2139
+ "REJECTED"
2140
+ ];
2141
+ const paymentStatus = [
2142
+ "CANCELED",
2143
+ "PAID",
2144
+ "PENDING",
2145
+ "REFUNDED"
2146
+ ];
2147
+ const allocationOptions = [
2148
+ "PICKUP_TO_GO",
2149
+ "PICKUP_IN_PLACE",
2150
+ "DELIVERY"
2151
+ ];
2152
+ const genSeqId = () => {
2153
+ const randomNumber = genNumber({
2154
+ min: 111111,
2155
+ max: 999999
2156
+ });
2157
+ return `0000${randomNumber}-${randomNumber}`;
2158
+ };
2159
+ const genReference = () => {
2160
+ return `${genSeqId()}.00${genNumber(10)}`;
2161
+ };
2162
+ const buildBaseOrder = (overrides = {}) => {
2163
+ const allocation = chooseRandom(allocationOptions);
2164
+ const date = allocation !== "DELIVERY" ? genDate() : null;
2165
+ const category = chooseRandom(stepCategory);
2166
+ const code = chooseRandom(stepCode);
2167
+ const id = genId();
2168
+ const name = genWord();
2169
+ return __spreadValues$2({
2170
+ additionalMessage: genWords(3),
2171
+ allocation,
2172
+ channelId: genId(),
2173
+ id: genId(),
2174
+ orderDate: genDate(),
2175
+ orderTime: genDate(),
2176
+ pickupDate: date,
2177
+ pickupTime: date,
2178
+ seq_id: genSeqId(),
2179
+ shoppingCart: buildOrderShoppingCart(),
2180
+ step: buildOrderStep({ category, code, id, name }),
2181
+ stepCategory: category,
2182
+ stepCode: code,
2183
+ stepId: id,
2184
+ stepName: name,
2185
+ transactionId: genId(),
2186
+ vendorId: genId(),
2187
+ accountId: genId(),
2188
+ uid: genId(),
2189
+ hash: genId(),
2190
+ pickupCooktime: null,
2191
+ channelName: genCompanyName(),
2192
+ issueId: genId(),
2193
+ billingDataByUserId: genId(),
2194
+ comment: genWords(5),
2195
+ shippingAddressByUserId: genId(),
2196
+ user: buildOrderUser(),
2197
+ createdByOperator: buildOperatorInformation(),
2198
+ vendorName: genCompanyName()
2199
+ }, overrides);
2200
+ };
2201
+ const genBaseOrders = (quantity) => {
2202
+ return genItems(buildBaseOrder, quantity);
2203
+ };
2204
+ const buildOrderDetails = (overrides = {}) => {
2205
+ return __spreadValues$2(__spreadProps$2(__spreadValues$2({}, buildBaseOrder()), {
2206
+ billingData: buildBillingData(),
2207
+ shippingAddress: buildShippingAddress(),
2208
+ shippingCost: buildOrderDetailShippingCost()
2209
+ }), overrides);
2210
+ };
2211
+ const genOrderDetails = (quantity) => {
2212
+ return genItems(buildOrderDetails, quantity);
2213
+ };
2214
+ const buildOrderStep = (overrides = {}) => {
2215
+ return __spreadValues$2({
2216
+ description_frontend: genWords(6),
2217
+ subtitle_frontend: genWords(5),
2218
+ category: genWord(),
2219
+ code: genWord(),
2220
+ color: chooseRandom(["#FFFFFF", "#000000"]),
2221
+ description: genWords(6),
2222
+ id: genId(),
2223
+ name: genWord(),
2224
+ additional_info: buildOrderStepAdditionalInfo(),
2225
+ title_frontend: genWords(3)
2226
+ }, overrides);
2227
+ };
2228
+ const buildOrderStepAdditionalInfo = (overrides = {}) => {
2229
+ return __spreadValues$2({
2230
+ client_frontend: genBiasBoolean(0.5),
2231
+ client_frontend_error: genBiasBoolean(0.7),
2232
+ group: buildOrderStepAdditionalInfoGroup(),
2233
+ operators_frontend: genBiasBoolean(0.5)
2234
+ }, overrides);
2235
+ };
2236
+ const genOrderStepAdditionalInfos = (quantity) => {
2237
+ return genItems(buildOrderStepAdditionalInfo, quantity);
2238
+ };
2239
+ const buildOrderStepAdditionalInfoGroup = (overrides = {}) => {
2240
+ return __spreadValues$2({
2241
+ code: genWord(),
2242
+ description: genWords(5),
2243
+ type: genWord(),
2244
+ weight: genNumber(10).toString()
2245
+ }, overrides);
2246
+ };
2247
+ const genOrderSteps = (quantity) => {
2248
+ return genItems(buildOrderStep, quantity);
2249
+ };
2250
+ const buildOrderDetailShippingCost = (overrides = {}) => {
2251
+ return __spreadValues$2({
2252
+ net_price: genNumber(200)
2253
+ }, overrides);
2254
+ };
2255
+ const genOrderDetailShippingCosts = (quantity) => {
2256
+ return genItems(buildOrderDetailShippingCost, quantity);
2257
+ };
2258
+ const buildOrderRetry = (overrides = {}) => {
2259
+ return __spreadValues$2(__spreadProps$2(__spreadValues$2({
2260
+ id: genId(),
2261
+ amount: genNumber(100).toString(),
2262
+ created_at: genDate(),
2263
+ updated_at: genDate(),
2264
+ ip_address: genIP(),
2265
+ platform: genWord(),
2266
+ process_url: genURL(),
2267
+ request_id: genId(),
2268
+ reference: genReference(),
2269
+ payment_method_by_order: buildPaymentMethodByOrder(),
2270
+ step: buildOrderStep()
2271
+ }, buildStatus()), {
2272
+ status: genWord(),
2273
+ payment_method_by_order_id: genId(),
2274
+ user_agent: genWord(),
2275
+ payment_method: null
2276
+ }), overrides);
2277
+ };
2278
+ const buildStatus = (overrides = {}) => {
2279
+ return __spreadValues$2({
2280
+ status_category: genWord(),
2281
+ status_code: genWord(),
2282
+ status_id: genId(),
2283
+ status_name: genWord()
2284
+ }, overrides);
2285
+ };
2286
+ const genStatus = (quantity) => {
2287
+ return genItems(buildStatus, quantity);
2288
+ };
2289
+ const genOrderRetries = (quantity) => {
2290
+ return genItems(buildOrderRetry, quantity);
2291
+ };
2292
+ const buildOrderPaymentMethod = (overrides = {}) => {
2293
+ return __spreadValues$2({
2294
+ id: genId(),
2295
+ lastRetry: buildOrderRetry(),
2296
+ payment_method_id: genId(),
2297
+ status: chooseRandom(orderStatusOptions),
2298
+ step: buildOrderStep(),
2299
+ total: genNumber(200).toString(),
2300
+ payment_method_name: chooseRandom(["CC", "CASH", "DATAPHONE"])
2301
+ }, overrides);
2302
+ };
2303
+ const genOrderPaymentMethods = (quantity) => {
2304
+ return genItems(buildOrderPaymentMethod, quantity);
2305
+ };
2306
+ const buildOrderShoppingCart = (overrides = {}) => {
2307
+ return __spreadValues$2(__spreadProps$2(__spreadValues$2({}, buildShoppingCart()), {
2308
+ stores: genOrderStores(),
2309
+ paidPaymentMethods: genOrderPaymentMethods(),
2310
+ allRetries: genOrderRetries(),
2311
+ rejectedPaymentMethods: genOrderPaymentMethods(),
2312
+ comment: genWords(6),
2313
+ instructions: genWords(6),
2314
+ statusName: genWord(),
2315
+ paymentStatus: chooseRandom(paymentStatus),
2316
+ statusId: genId(),
2317
+ statusCode: chooseRandom(stepCode),
2318
+ issueId: genId(),
2319
+ invoiceNumber: genId(),
2320
+ billTotal: buildOrderBillTotal(),
2321
+ additional_info: void 0
2322
+ }), overrides);
2323
+ };
2324
+ const buildOrderStoreAdditionalInfo = (overrides = {}) => {
2325
+ return __spreadValues$2({
2326
+ address: faker.faker.address.street(),
2327
+ coverage: genBiasBoolean(0.99),
2328
+ latitude: genNumber({ min: 0, max: 80, precision: 6 }),
2329
+ longitude: genNumber({ min: 0, max: 80, precision: 6 }),
2330
+ schedules: genSchedules(8),
2331
+ phone: genMobilPhone("593"),
2332
+ sponsored: genBiasBoolean(0.1),
2333
+ timezone: "",
2334
+ channel_name: faker.faker.name.jobTitle(),
2335
+ order_symbol: genSymbol(),
2336
+ external_id: genId(),
2337
+ is_drinks_store: genBiasBoolean(0.3),
2338
+ max_order_amount: genNumber(100),
2339
+ min_order_amount: genNumber(5),
2340
+ show_drinks_store: genBiasBoolean(0.4),
2341
+ store_external_code: genId(),
2342
+ delivery: buildOrderStoreDelivery()
2343
+ }, overrides);
2344
+ };
2345
+ const genOrderStoreAdditionalInfos = (quantity) => {
2346
+ return genItems(buildOrderStoreAdditionalInfo, quantity);
2347
+ };
2348
+ const buildOrderStoreDelivery = (overrides = {}) => {
2349
+ return __spreadValues$2({
2350
+ delivery_time_unit: chooseRandom(["min"]),
2351
+ delivery_time_value: genNumber(60).toString(),
2352
+ express: genBiasBoolean(0.1),
2353
+ free_delivery: genBiasBoolean(0.1)
2354
+ }, overrides);
2355
+ };
2356
+ const genOrderStoreDeliveries = (quantity) => {
2357
+ return genItems(buildOrderStoreDelivery, quantity);
2358
+ };
2359
+ const buildOrderStore = (overrides = {}) => {
2360
+ return __spreadValues$2({
2361
+ id: genId(),
2362
+ orderId: genId(),
2363
+ digitalCommandSent: genWord(),
2364
+ statusId: genId(),
2365
+ statusName: genWord(),
2366
+ statusCode: chooseRandom(stepCode),
2367
+ billStoreTotal: buildOrderProductBillTotal(),
2368
+ products: genOrderProducts(),
2369
+ storeId: genId(),
2370
+ storeName: faker.faker.name.jobTitle(),
2371
+ additionalInfo: buildOrderStoreAdditionalInfo()
2372
+ }, overrides);
2373
+ };
2374
+ const genOrderStores = (quantity) => {
2375
+ return genItems(buildOrderStore, quantity);
2376
+ };
2377
+ const buildOrderProductAttributes = (overrides = {}) => {
2378
+ return __spreadValues$2({
2379
+ cantidad: "1",
2380
+ external_id: "001",
2381
+ show_in_menu: genBiasBoolean(0.5)
2382
+ }, overrides);
2383
+ };
2384
+ const genOrderProductAttributes = (quantity) => {
2385
+ return genItems(buildOrderProductAttributes, quantity);
2386
+ };
2387
+ const buildOrderProductAdditionalInfo = (overrides = {}) => {
2388
+ return __spreadValues$2({
2389
+ attributes: buildOrderProductAttributes(),
2390
+ available: genBiasBoolean(0.5),
2391
+ description: faker.faker.lorem.lines(2),
2392
+ is_price_vip: genBiasBoolean(0.5),
2393
+ max_amount_for_sale: genNumber(100),
2394
+ new_store: genId(),
2395
+ out_of_service: genBiasBoolean(0.5),
2396
+ out_of_stock: genBiasBoolean(0.5),
2397
+ sponsored: genBiasBoolean(0.1),
2398
+ status: "ACTIVE",
2399
+ stock: 1e3,
2400
+ suggested_price: genNumber(100).toString(),
2401
+ type: "PRODUCT",
2402
+ measure: "unit",
2403
+ bill_product: buildOrderBillProductAdditionalInfo(),
2404
+ bill_product_and_answers: buildOrderBillProductAdditionalInfo(),
2405
+ images: genOrderProductImages(),
2406
+ price_category: "NORMAL",
2407
+ prices: buildOrderBillProductAdditionalInfo()
2408
+ }, overrides);
2409
+ };
2410
+ const genOrderProductAdditionalInfos = (quantity) => {
2411
+ return genItems(buildOrderProductAdditionalInfo, quantity);
2412
+ };
2413
+ const buildOrderProductImage = (overrides = {}) => {
2414
+ const imageName = genWord();
2415
+ return __spreadValues$2({
2416
+ bucket: genWord(),
2417
+ cloud_front_url: genURL(),
2418
+ key: `images/${imageName}.jpg`,
2419
+ name: `${imageName}.jpg`,
2420
+ url: buildURLImage()
2421
+ }, overrides);
2422
+ };
2423
+ const genOrderProductImages = (quantity) => {
2424
+ return genItems(buildOrderProductImage, quantity);
2425
+ };
2426
+ const buildOrderBillProductAdditionalInfo = (overrides = {}) => {
2427
+ return __spreadValues$2({
2428
+ normal: buildOrderProductPriceCategory(),
2429
+ points: buildOrderProductPriceCategory()
2430
+ }, overrides);
2431
+ };
2432
+ const buildTaxCalculation = (overrides = {}) => {
2433
+ return __spreadValues$2({
2434
+ code: genNumber(10),
2435
+ name: chooseRandom(["IVA"]),
2436
+ percentage: genNumber(10),
2437
+ vat_rate: genNumber(10).toString(),
2438
+ tax_base: genNumber(10),
2439
+ value: genNumber(10),
2440
+ vat_rate_code: genNumber(10)
2441
+ }, overrides);
2442
+ };
2443
+ const genTaxCalculations = (quantity) => {
2444
+ return genItems(buildTaxCalculation, quantity);
2445
+ };
2446
+ const buildTaxCalculations = (overrides = {}) => {
2447
+ const key = `${genNumber(10)}_${genNumber(10)}`;
2448
+ return __spreadValues$2({
2449
+ [key]: buildTaxCalculation()
2450
+ }, overrides);
2451
+ };
2452
+ const buildOrderProductPriceCategory = (overrides = {}) => {
2453
+ return __spreadValues$2({
2454
+ amount: genNumber(50),
2455
+ taxes: genTaxCalculations(),
2456
+ category: "NORMAL",
2457
+ discount: genNumber(12),
2458
+ discount_gross_price: genNumber(50),
2459
+ discount_net_price: genNumber(50),
2460
+ discount_total: genNumber(40),
2461
+ discounts: [],
2462
+ gross_price: genNumber(50),
2463
+ net_price: genNumber(50),
2464
+ name: faker.faker.commerce.productName(),
2465
+ subtotal_before_taxes: genNumber(30),
2466
+ subtotal_before_taxes_before_discounts: genNumber(30),
2467
+ subtotal_without_taxes: genNumber(30),
2468
+ subtotal_zero: 0,
2469
+ product_id: genId(),
2470
+ symbol: genSymbol(),
2471
+ tax_calcs: buildTaxCalculations(),
2472
+ tax_total: genNumber(12),
2473
+ total: genNumber(50)
2474
+ }, overrides);
2475
+ };
2476
+ const genOrderProductPriceCategories = (quantity) => {
2477
+ return genItems(buildOrderProductPriceCategory, quantity);
2478
+ };
2479
+ const buildOrderProduct = (overrides = {}) => {
2480
+ return __spreadValues$2({
2481
+ id: genId(),
2482
+ additionalInfo: buildOrderProductAdditionalInfo(),
2483
+ productId: genId(),
2484
+ productName: genWords(5),
2485
+ comment: genWords(5),
2486
+ billProduct: buildOrderBillProduct(),
2487
+ billProductAndAnswers: buildOrderProductBillTotal(),
2488
+ questionsAndAnswers: genCartProductQuestions()
2489
+ }, overrides);
2490
+ };
2491
+ const genOrderProducts = (quantity) => {
2492
+ return genItems(buildOrderProduct, quantity);
2493
+ };
2494
+ const buildOrderBillProduct = (overrides = {}) => {
2495
+ return __spreadValues$2(__spreadProps$2(__spreadValues$2({}, buildOrderProductBillTotal()), {
2496
+ amount: genNumber(50)
2497
+ }), overrides);
2498
+ };
2499
+ const buildOrderProductBillTotal = (overrides = {}) => {
2500
+ return __spreadValues$2(__spreadProps$2(__spreadValues$2({}, buildBillTotalNormalCategory()), {
2501
+ discountTotal: genNumber(10)
2502
+ }), overrides);
2503
+ };
2504
+ const buildOrderBillTotal = (overrides = {}) => {
2505
+ return __spreadValues$2(__spreadProps$2(__spreadValues$2({}, buildBillTotalNormalCategory()), {
2506
+ discountTotal: genNumber(10),
2507
+ subtotalTaxedWithoutTaxes: genNumber(10),
2508
+ subtotalZero: genNumber(10),
2509
+ tip: genNumber(10)
2510
+ }), overrides);
2511
+ };
2512
+ const genOrderShoppingCarts = (quantity) => {
2513
+ return genItems(buildOrderShoppingCart, quantity);
2514
+ };
2515
+ const buildMetadataShipping = (overrides = {}) => {
2516
+ return __spreadValues$2({
2517
+ area: buildBaseField(),
2518
+ city: buildBaseField(),
2519
+ zone: buildZipCodeField(),
2520
+ store: buildBaseField(),
2521
+ country: buildBaseField()
2522
+ }, overrides);
2523
+ };
2524
+ const genMetadataShippings = (quantity) => {
2525
+ return genItems(buildMetadataShipping, quantity);
2526
+ };
2527
+ const buildBaseField = (overrides = {}) => {
2528
+ return __spreadValues$2({
2529
+ id: genId(),
2530
+ name: genName()
2531
+ }, overrides);
2532
+ };
2533
+ const genBaseFields = (quantity) => {
2534
+ return genItems(buildBaseField, quantity);
2535
+ };
2536
+ const buildZipCodeField = (overrides = {}) => {
2537
+ return __spreadValues$2(__spreadProps$2(__spreadValues$2({}, buildBaseField()), {
2538
+ zipCode: genWord()
2539
+ }), overrides);
2540
+ };
2541
+ const genZipCodeFields = (quantity) => {
2542
+ return genItems(buildZipCodeField, quantity);
2543
+ };
2544
+ const buildIntegrationMessage = (overrides = {}) => {
2545
+ return __spreadValues$2({
2546
+ kfcInjection: {
2547
+ [genNumber(999999).toString()]: buildInjectionDetail()
2548
+ }
2549
+ }, overrides);
2550
+ };
2551
+ const genIntegrationMessages = (quantity) => {
2552
+ return genItems(buildIntegrationMessage, quantity);
2553
+ };
2554
+ const buildInjectionDetail = (overrides = {}) => {
2555
+ return __spreadValues$2({
2556
+ causa: genWord(),
2557
+ codigo: genNumericId(),
2558
+ mensaje: genWord()
2559
+ }, overrides);
2560
+ };
2561
+ const genInjectionDetails = (quantity) => {
2562
+ return genItems(buildInjectionDetail, quantity);
2563
+ };
2564
+ const buildOrderUser = (overrides = {}) => {
2565
+ return __spreadValues$2(__spreadProps$2(__spreadValues$2({}, buildUser()), {
2566
+ settings: buildSettings(),
2567
+ additionalInfo: void 0
2568
+ }), overrides);
2569
+ };
2570
+ const genOrderUsers = (quantity) => {
2571
+ return genItems(buildOrderUser, quantity);
2572
+ };
2573
+ const buildOperatorInformation = (overrides = {}) => {
2574
+ return __spreadValues$2({
2575
+ id: genId(),
2576
+ name: genName(),
2577
+ email: genEmail(),
2578
+ skill: genWords(4),
2579
+ document: genDocument(10)
2580
+ }, overrides);
2581
+ };
2582
+ const genOperatorInformation = (quantity) => {
2583
+ return genItems(buildOperatorInformation, quantity);
2584
+ };
2585
+ const buildSuborder = (overrides = {}) => {
2586
+ return __spreadValues$2(__spreadProps$2(__spreadValues$2({}, buildStatus()), {
2587
+ additional_info: genWord(),
2588
+ created_at: genDate(),
2589
+ updated_at: genDate(),
2590
+ order_id: genId(),
2591
+ id: genId(),
2592
+ store_id: genId(),
2593
+ store_name: genCompanyName(),
2594
+ vendor: genCompanyName(),
2595
+ digital_command_sent: genBiasBoolean(0.5).toString()
2596
+ }), overrides);
2597
+ };
2598
+ const genSuborders = (quantity) => {
2599
+ return genItems(buildSuborder, quantity);
2600
+ };
2601
+ const buildPaymentMethodByOrder = (overrides = {}) => {
2602
+ return __spreadValues$2(__spreadProps$2(__spreadValues$2({}, buildStatus()), {
2603
+ amount: genNumber(200).toString(),
2604
+ created_at: genDate(),
2605
+ updated_at: genDate(),
2606
+ id: genId(),
2607
+ payment_method_id: genId(),
2608
+ status: genWord(),
2609
+ sri_payment_method_id: genId(),
2610
+ order: buildOrderRetryPaymentMethod(),
2611
+ order_id: genId()
2612
+ }), overrides);
2613
+ };
2614
+ const genPaymentMethodByOrders = (quantity) => {
2615
+ return genItems(buildPaymentMethodByOrder, quantity);
2616
+ };
2617
+ const buildOrderRetryPaymentMethod = (overrides = {}) => {
2618
+ return __spreadValues$2(__spreadProps$2(__spreadValues$2({
2619
+ account_id: genId(),
2620
+ vendor_id: genId(),
2621
+ allocation: chooseRandom(allocationOptions),
2622
+ billing_data_by_user_id: genId(),
2623
+ channel_id: genId(),
2624
+ created_at: genDate(),
2625
+ latitude: genLatitude(),
2626
+ longitude: genLongitude(),
2627
+ uid: genId(),
2628
+ insoft_order_process: genWord(),
2629
+ id: genId(),
2630
+ sent_fulfillment: genWord(),
2631
+ shopping_cart_id: genId()
2632
+ }, buildStatus()), {
2633
+ step: genNumber(10),
2634
+ suborders: genSuborders(),
2635
+ updated_at: genDate(),
2636
+ payment_status: chooseRandom(orderStatusOptions),
2637
+ seq_val: genReference()
2638
+ }), overrides);
2639
+ };
2640
+ const genOrderRetryPaymentMethods = (quantity) => {
2641
+ return genItems(buildOrderRetryPaymentMethod, quantity);
2642
+ };
2643
+
2644
+ var order_builder = /*#__PURE__*/Object.freeze({
2645
+ __proto__: null,
2646
+ allocationOptions: allocationOptions,
2647
+ buildBaseField: buildBaseField,
2648
+ buildBaseOrder: buildBaseOrder,
2649
+ buildInjectionDetail: buildInjectionDetail,
2650
+ buildIntegrationMessage: buildIntegrationMessage,
2651
+ buildMetadataShipping: buildMetadataShipping,
2652
+ buildOperatorInformation: buildOperatorInformation,
2653
+ buildOrderBillProduct: buildOrderBillProduct,
2654
+ buildOrderBillProductAdditionalInfo: buildOrderBillProductAdditionalInfo,
2655
+ buildOrderBillTotal: buildOrderBillTotal,
2656
+ buildOrderDetailShippingCost: buildOrderDetailShippingCost,
2657
+ buildOrderDetails: buildOrderDetails,
2658
+ buildOrderPaymentMethod: buildOrderPaymentMethod,
2659
+ buildOrderProduct: buildOrderProduct,
2660
+ buildOrderProductAdditionalInfo: buildOrderProductAdditionalInfo,
2661
+ buildOrderProductAttributes: buildOrderProductAttributes,
2662
+ buildOrderProductBillTotal: buildOrderProductBillTotal,
2663
+ buildOrderProductImage: buildOrderProductImage,
2664
+ buildOrderProductPriceCategory: buildOrderProductPriceCategory,
2665
+ buildOrderRetry: buildOrderRetry,
2666
+ buildOrderRetryPaymentMethod: buildOrderRetryPaymentMethod,
2667
+ buildOrderShoppingCart: buildOrderShoppingCart,
2668
+ buildOrderStep: buildOrderStep,
2669
+ buildOrderStepAdditionalInfo: buildOrderStepAdditionalInfo,
2670
+ buildOrderStepAdditionalInfoGroup: buildOrderStepAdditionalInfoGroup,
2671
+ buildOrderStore: buildOrderStore,
2672
+ buildOrderStoreAdditionalInfo: buildOrderStoreAdditionalInfo,
2673
+ buildOrderStoreDelivery: buildOrderStoreDelivery,
2674
+ buildOrderUser: buildOrderUser,
2675
+ buildPaymentMethodByOrder: buildPaymentMethodByOrder,
2676
+ buildStatus: buildStatus,
2677
+ buildSuborder: buildSuborder,
2678
+ buildTaxCalculation: buildTaxCalculation,
2679
+ buildTaxCalculations: buildTaxCalculations,
2680
+ buildZipCodeField: buildZipCodeField,
2681
+ genBaseFields: genBaseFields,
2682
+ genBaseOrders: genBaseOrders,
2683
+ genInjectionDetails: genInjectionDetails,
2684
+ genIntegrationMessages: genIntegrationMessages,
2685
+ genMetadataShippings: genMetadataShippings,
2686
+ genOperatorInformation: genOperatorInformation,
2687
+ genOrderDetailShippingCosts: genOrderDetailShippingCosts,
2688
+ genOrderDetails: genOrderDetails,
2689
+ genOrderPaymentMethods: genOrderPaymentMethods,
2690
+ genOrderProductAdditionalInfos: genOrderProductAdditionalInfos,
2691
+ genOrderProductAttributes: genOrderProductAttributes,
2692
+ genOrderProductImages: genOrderProductImages,
2693
+ genOrderProductPriceCategories: genOrderProductPriceCategories,
2694
+ genOrderProducts: genOrderProducts,
2695
+ genOrderRetries: genOrderRetries,
2696
+ genOrderRetryPaymentMethods: genOrderRetryPaymentMethods,
2697
+ genOrderShoppingCarts: genOrderShoppingCarts,
2698
+ genOrderStepAdditionalInfos: genOrderStepAdditionalInfos,
2699
+ genOrderSteps: genOrderSteps,
2700
+ genOrderStoreAdditionalInfos: genOrderStoreAdditionalInfos,
2701
+ genOrderStoreDeliveries: genOrderStoreDeliveries,
2702
+ genOrderStores: genOrderStores,
2703
+ genOrderUsers: genOrderUsers,
2704
+ genPaymentMethodByOrders: genPaymentMethodByOrders,
2705
+ genReference: genReference,
2706
+ genSeqId: genSeqId,
2707
+ genStatus: genStatus,
2708
+ genSuborders: genSuborders,
2709
+ genTaxCalculations: genTaxCalculations,
2710
+ genZipCodeFields: genZipCodeFields,
2711
+ orderStatusOptions: orderStatusOptions,
2712
+ paymentStatus: paymentStatus
2713
+ });
2714
+
2715
+ var __defProp$1 = Object.defineProperty;
2716
+ var __defProps$1 = Object.defineProperties;
2717
+ var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
2718
+ var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
2719
+ var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
2720
+ var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
2721
+ var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2722
+ var __spreadValues$1 = (a, b) => {
2723
+ for (var prop in b || (b = {}))
2724
+ if (__hasOwnProp$1.call(b, prop))
2725
+ __defNormalProp$1(a, prop, b[prop]);
2726
+ if (__getOwnPropSymbols$1)
2727
+ for (var prop of __getOwnPropSymbols$1(b)) {
2728
+ if (__propIsEnum$1.call(b, prop))
2729
+ __defNormalProp$1(a, prop, b[prop]);
2730
+ }
2731
+ return a;
2732
+ };
2733
+ var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
2734
+ const buildNotification = (overrides = {}) => {
2735
+ return __spreadValues$1({
2736
+ id: genId(),
2737
+ title: genWords(2),
2738
+ description: genWords(6),
2739
+ listTitle: genWords(2),
2740
+ listItems: genNotificationListItems(),
2741
+ creationDate: genDate(),
2742
+ priority: chooseRandom(["HIGH", "LOW"]),
2743
+ read: chooseRandom(["YES", "NO"]),
2744
+ extra_data: buildNotificationExtraData()
2745
+ }, overrides);
2746
+ };
2747
+ const genNotifications = (quantity) => {
2748
+ return genItems(buildNotification, quantity);
2749
+ };
2750
+ const buildNotificationUser = (overrides = {}) => {
2751
+ return __spreadValues$1({
2752
+ name: genName(),
2753
+ address: genAddress(),
2754
+ email: genEmail()
2755
+ }, overrides);
2756
+ };
2757
+ const genNotificationUsers = (quantity) => {
2758
+ return genItems(buildNotificationUser, quantity);
2759
+ };
2760
+ const buildNotificationStore = (overrides = {}) => {
2761
+ return __spreadValues$1(__spreadProps$1(__spreadValues$1({}, buildBaseField()), {
2762
+ address: genAddress()
2763
+ }), overrides);
2764
+ };
2765
+ const genNotificationStores = (quantity) => {
2766
+ return genItems(buildNotificationStore, quantity);
2767
+ };
2768
+ const buildNotificationStep = (overrides = {}) => {
2769
+ return __spreadValues$1({
2770
+ id: genId(),
2771
+ name: genWord(),
2772
+ code: chooseRandom(stepCode),
2773
+ category: chooseRandom(stepCategory)
2774
+ }, overrides);
2775
+ };
2776
+ const genNotificationSteps = (quantity) => {
2777
+ return genItems(buildNotificationStep, quantity);
2778
+ };
2779
+ const buildNotificationAdditionalInfo = (overrides = {}) => {
2780
+ return __spreadValues$1({
2781
+ parent_shopping_cart: getBoolean(),
2782
+ metadata_shipping: buildMetadataShipping(),
2783
+ aud: genCompanyName(),
2784
+ workflowId: genId()
2785
+ }, overrides);
2786
+ };
2787
+ const genNotificationAdditionalInfos = (quantity) => {
2788
+ return genItems(buildNotificationAdditionalInfo, quantity);
2789
+ };
2790
+ const buildNotificationExtraData = (overrides = {}) => {
2791
+ const vendorIncompat = buildBaseField();
2792
+ return __spreadValues$1({
2793
+ id: genId(),
2794
+ seqVal: genReference(),
2795
+ uid: genId(),
2796
+ user: buildNotificationUser(),
2797
+ accountId: genId(),
2798
+ vendor: __spreadProps$1(__spreadValues$1({}, vendorIncompat), { id: vendorIncompat.id.toString() }),
2799
+ city: buildBaseField(),
2800
+ store: buildNotificationStore(),
2801
+ channel_id: genId(),
2802
+ countryId: genId(),
2803
+ step: buildNotificationStep(),
2804
+ allocation: chooseRandom(allocationOptions),
2805
+ paymentMethod: "Points",
2806
+ total: genNumber(9999).toString(),
2807
+ additionalInfo: buildNotificationAdditionalInfo(),
2808
+ created_at: genDate()
2809
+ }, overrides);
2810
+ };
2811
+ const genNotificationExtraDatas = (quantity) => {
2812
+ return genItems(buildNotificationExtraData, quantity);
2813
+ };
2814
+ const buildNotificationListItem = (overrides = {}) => {
2815
+ return __spreadValues$1({
2816
+ title: genWords(2),
2817
+ description: genWords(6)
2818
+ }, overrides);
2819
+ };
2820
+ const genNotificationListItems = (quantity) => {
2821
+ return genItems(buildNotificationListItem, quantity);
2822
+ };
2823
+
2824
+ var notification_builder = /*#__PURE__*/Object.freeze({
2825
+ __proto__: null,
2826
+ buildNotification: buildNotification,
2827
+ buildNotificationAdditionalInfo: buildNotificationAdditionalInfo,
2828
+ buildNotificationExtraData: buildNotificationExtraData,
2829
+ buildNotificationListItem: buildNotificationListItem,
2830
+ buildNotificationStep: buildNotificationStep,
2831
+ buildNotificationStore: buildNotificationStore,
2832
+ buildNotificationUser: buildNotificationUser,
2833
+ genNotificationAdditionalInfos: genNotificationAdditionalInfos,
2834
+ genNotificationExtraDatas: genNotificationExtraDatas,
2835
+ genNotificationListItems: genNotificationListItems,
2836
+ genNotificationSteps: genNotificationSteps,
2837
+ genNotificationStores: genNotificationStores,
2838
+ genNotificationUsers: genNotificationUsers,
2839
+ genNotifications: genNotifications
2840
+ });
2841
+
2842
+ var __defProp = Object.defineProperty;
2843
+ var __defProps = Object.defineProperties;
2844
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
2845
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
2846
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
2847
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
2848
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2849
+ var __spreadValues = (a, b) => {
2850
+ for (var prop in b || (b = {}))
2851
+ if (__hasOwnProp.call(b, prop))
2852
+ __defNormalProp(a, prop, b[prop]);
2853
+ if (__getOwnPropSymbols)
2854
+ for (var prop of __getOwnPropSymbols(b)) {
2855
+ if (__propIsEnum.call(b, prop))
2856
+ __defNormalProp(a, prop, b[prop]);
2857
+ }
2858
+ return a;
2859
+ };
2860
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
2861
+ const buildBasePaymentMethod = (overrides = {}) => {
2862
+ return __spreadValues({
2863
+ created_at: genDate(),
2864
+ deleted_at: genDate(),
2865
+ updated_at: genDate(),
2866
+ id: genId()
2867
+ }, overrides);
2868
+ };
2869
+ const genBasePaymentMethods = (quantity) => {
2870
+ return genItems(buildBasePaymentMethod, quantity);
2871
+ };
2872
+ const buildPaymentMethod = (overrides = {}) => {
2873
+ const paymentNames = [
2874
+ "CASH",
2875
+ "CREDIT_CARD",
2876
+ "DATAPHONE"
2877
+ ];
2878
+ return __spreadValues(__spreadProps(__spreadValues({}, buildBasePaymentMethod()), {
2879
+ name: chooseRandom(paymentNames),
2880
+ image_url: genURL(),
2881
+ default: genBiasBoolean(0.6),
2882
+ external_id: genNumber(50).toString(),
2883
+ external_code: genNumber(50),
2884
+ parent_id: genNumber(50).toString(),
2885
+ methods: genPaymentProviders()
2886
+ }), overrides);
2887
+ };
2888
+ const genPaymentMethods = (quantity) => {
2889
+ return genItems(buildPaymentMethod, quantity);
2890
+ };
2891
+ const buildPaymentProvider = (overrides = {}) => {
2892
+ const providerNames = ["PayPhone", "Kushki", "Place to Pay", "Mercadopago"];
2893
+ return __spreadValues(__spreadProps(__spreadValues({}, buildBasePaymentMethod()), {
2894
+ name: chooseRandom(providerNames),
2895
+ image_url: genURL(),
2896
+ default: genBiasBoolean(0.6),
2897
+ external_id: genNumber(50).toString(),
2898
+ external_code: genNumber(50),
2899
+ parent_id: genNumber(50).toString(),
2900
+ methods: [],
2901
+ cc_brands: genCreditCardMappings()
2902
+ }), overrides);
2903
+ };
2904
+ const genPaymentProviders = (quantity) => {
2905
+ return genItems(buildPaymentProvider, quantity);
2906
+ };
2907
+ const buildCreditCardMapping = (overrides = {}) => {
2908
+ const cardsName = [
2909
+ "American Express",
2910
+ "Diners",
2911
+ "Discover",
2912
+ "Visa",
2913
+ "MasterCard"
2914
+ ];
2915
+ return __spreadValues(__spreadProps(__spreadValues({}, buildBasePaymentMethod()), {
2916
+ id: genId(),
2917
+ name: chooseRandom(cardsName),
2918
+ image_url: buildURLImage(),
2919
+ cc_brands_mapping: []
2920
+ }), overrides);
2921
+ };
2922
+ const genCreditCardMappings = (quantity) => {
2923
+ return genItems(buildCreditCardMapping, quantity);
2924
+ };
2925
+ const buildCardInscription = (overrides = {}) => {
2926
+ return __spreadValues({
2927
+ authCode: genNumericId().toString(),
2928
+ bin: genWord(),
2929
+ createdAt: new Date().toDateString(),
2930
+ id: genId(),
2931
+ uid: genId(),
2932
+ number: genNumericId().toString(),
2933
+ paymentToken: genNumericId().toString(),
2934
+ type: genWord()
2935
+ }, overrides);
2936
+ };
2937
+ const genCardInscriptions = (quantity) => {
2938
+ return genItems(buildCardInscription, quantity);
2939
+ };
2940
+
2941
+ var payment_builder = /*#__PURE__*/Object.freeze({
2942
+ __proto__: null,
2943
+ buildBasePaymentMethod: buildBasePaymentMethod,
2944
+ buildCardInscription: buildCardInscription,
2945
+ buildCreditCardMapping: buildCreditCardMapping,
2946
+ buildPaymentMethod: buildPaymentMethod,
2947
+ buildPaymentProvider: buildPaymentProvider,
2948
+ genBasePaymentMethods: genBasePaymentMethods,
2949
+ genCardInscriptions: genCardInscriptions,
2950
+ genCreditCardMappings: genCreditCardMappings,
2951
+ genPaymentMethods: genPaymentMethods,
2952
+ genPaymentProviders: genPaymentProviders
2953
+ });
2954
+
2955
+ const seed = (seed2) => {
2956
+ if (!faker.faker)
2957
+ throw new Error("Faker not found");
2958
+ return faker.faker.seed(seed2);
2959
+ };
2960
+
2961
+ var instance_utils = /*#__PURE__*/Object.freeze({
2962
+ __proto__: null,
2963
+ seed: seed
2964
+ });
2965
+
2966
+ exports.Builders = instance_utils;
2967
+ exports.accountBuilders = account_builder;
2968
+ exports.bannerBuilders = banner_builder;
2969
+ exports.billingDataBuilders = billingData_builder;
2970
+ exports.catalogueBuilders = catalogue_builder;
2971
+ exports.categoryBuilders = category_builder;
2972
+ exports.countryBuilders = country_builder;
2973
+ exports.couponBuilders = coupon_builder;
2974
+ exports.fulfillmentBuilders = fulfillment_builder;
2975
+ exports.imageBuilders = image_builder;
2976
+ exports.masivoBuilders = masivo_builder;
2977
+ exports.notificationBuilders = notification_builder;
2978
+ exports.orderBuilders = order_builder;
2979
+ exports.paymentBuilders = payment_builder;
2980
+ exports.productBuilders = product_builder;
2981
+ exports.settingsBuilders = settings_builder;
2982
+ exports.shippingAddressBuilders = shippingAddress_builder;
2983
+ exports.shoppingCartBuilders = shoppingCart_builder;
2984
+ exports.storeBuilders = store_builder;
2985
+ exports.userBuilders = user_builder;
2986
+ exports.utils = common_builder;
2987
+ exports.vendorBuilders = vendor_builder;
2988
+ //# sourceMappingURL=bundle.cjs.map