@artisan-commerce/builders 0.7.0-canary.72 → 0.7.0-canary.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.cjs +261 -117
- package/dist/bundle.cjs.map +1 -1
- package/dist/bundle.d.ts +58 -32
- package/dist/bundle.mjs +261 -117
- package/dist/bundle.mjs.map +1 -1
- package/dist/bundle.umd.js +261 -117
- package/dist/bundle.umd.js.map +1 -1
- package/package.json +3 -3
package/dist/bundle.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AdditionalInfo, Account, Banner, BannerCoupon, BannerBenefits, BannerImage, BillingData, Catalogue, Category, CategoryWithProducts, CommonDocumentType, ARDocumentType, BODocumentType, BRDocumentType, CLDocumentType, CODocumentType, ECDocumentType, PYDocumentType, PEDocumentType, UYDocumentType, VEDocumentType, USDocumentType, RandomImageConfig, CountryCode, DocumentType, CountrySummary, CountryCurrency, Country, Benefit, Award, Wallet, StoreCoupon, ProductCoupon, BenefitData, Coupon, CouponCategory, Code, Token, StoreCouponDetail, StepCategory, StepCode, Issue, IssueAdditionalInfo, IssueHistory, Workflow, StepNotification, StepWorkflow, WebhookWorkflow, StepWorkflowAdditionalInfo, StepWorkflowGroup, TransitionWorkflow, URLImage, CDNImage,
|
|
1
|
+
import { AdditionalInfo, Account, Banner, BannerCoupon, BannerBenefits, BannerImage, BillingData, Catalogue, Category, CategoryWithProducts, CommonDocumentType, ARDocumentType, BODocumentType, BRDocumentType, CLDocumentType, CODocumentType, ECDocumentType, PYDocumentType, PEDocumentType, UYDocumentType, VEDocumentType, USDocumentType, RandomImageConfig, CountryCode, DocumentType, CountrySummary, CountryCurrency, Country, Benefit, Award, Wallet, StoreCoupon, ProductCoupon, BenefitData, Coupon, CouponCategory, Code, Token, StoreCouponDetail, StepCategory, StepCode, Issue, IssueAdditionalInfo, IssueHistory, Workflow, StepNotification, StepWorkflow, WebhookWorkflow, StepWorkflowAdditionalInfo, StepWorkflowGroup, TransitionWorkflow, URLImage, CDNImage, MasivoCustomer, MasivoCustomerMetrics, MetricPeriod, MasivoWallet, MasivoInfo, WalletMedia, WalletAttribute, MasivoConditionBase, MasivoCondition, WalletReward, WalletTotal, WalletLine, RedeemableBenefit, LoyaltyAccumulation, MasivoTier, ExtendedLoyaltyInfo, CodesSummary, CodeFormat, CouponCampaignAttributes, MasivoCampaign, MasivoEffect, MasivoCampaignRule, Notification, NotificationUser, NotificationStore, NotificationStep, NotificationAdditionalInfo, NotificationExtraData, NotificationListItem, OrderStatus, PaymentStatus, Allocation, BaseOrder, OrderDetails, OrderStep, OrderStepAdditionalInfo, OrderStepAdditionalInfoGroup, OrderDetailShippingCost, OrderRetry, Status, OrderPaymentMethod, OrderShoppingCart, OrderStoreAdditionalInfo, OrderStoreDelivery, OrderStore, OrderProductAttributes, OrderProductAdditionalInfo, OrderProductImage, OrderBillProductAdditionalInfo, TaxCalculation, TaxCalculations, OrderProductPriceCategory, OrderProduct, OrderBillProduct, OrderProductBillTotal, OrderBillTotal, MetadataShipping, BaseField, ZipCodeField, IntegrationMessage, InjectionDetail, OrderUser, OperatorInformation, Suborder, PaymentMethodByOrder, OrderRetryPaymentMethod, BasePaymentMethod, PaymentMethod, PaymentProvider, CreditCardMapping, CardInscription, PriceCategoryTax, PriceCategory, BaseProduct, ProductAnswer, ProductQuestion, ProductDetails, CartProductAnswer, CartProductQuestion, CartProduct, Settings, UserSettings, Field, Rule, Message, LivingPlace, ShippingAddress, BillTotalCategory, BillTotal, CartStore, Objectify, ShoppingCart, ShippingCost, ShippingCostTax, Discount, Store, Delivery, Schedule, Service, GenericStoreLocation, StoreLocation, User, Phone, Vendor } from '@artisan-commerce/types';
|
|
2
2
|
import * as _faker_js_faker_utils_types from '@faker-js/faker/utils/types';
|
|
3
3
|
import * as _faker_js_faker_modules_random from '@faker-js/faker/modules/random';
|
|
4
4
|
|
|
@@ -1181,49 +1181,75 @@ declare namespace image_builder {
|
|
|
1181
1181
|
};
|
|
1182
1182
|
}
|
|
1183
1183
|
|
|
1184
|
-
declare const
|
|
1185
|
-
declare const
|
|
1186
|
-
declare const
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
declare const
|
|
1198
|
-
declare const
|
|
1199
|
-
declare const
|
|
1200
|
-
declare const
|
|
1201
|
-
declare const
|
|
1184
|
+
declare const buildMasivoCustomer: (overrides?: MasivoCustomer) => MasivoCustomer;
|
|
1185
|
+
declare const buildCustomerMetrics: (overrides?: MasivoCustomerMetrics) => MasivoCustomerMetrics;
|
|
1186
|
+
declare const buildMetrics: (overrides?: MetricPeriod) => MetricPeriod;
|
|
1187
|
+
declare const buildMasivoWallet: (overrides?: MasivoWallet) => MasivoWallet;
|
|
1188
|
+
declare const buildMasivoInfo: (override?: MasivoInfo, customerOverrides?: MasivoCustomer, walletOverrides?: MasivoWallet) => MasivoInfo;
|
|
1189
|
+
declare const buildWalletMedia: (overrides?: WalletMedia) => WalletMedia;
|
|
1190
|
+
declare const buildWalletAttribute: (overrides?: WalletAttribute) => WalletAttribute;
|
|
1191
|
+
declare const buildMasivoConditionBase: (overrides?: MasivoConditionBase) => MasivoConditionBase;
|
|
1192
|
+
declare const buildMasivoCondition: (overrides?: MasivoCondition) => MasivoCondition;
|
|
1193
|
+
declare const buildWalletReward: (overrides?: WalletReward) => WalletReward;
|
|
1194
|
+
declare const buildWalletTotal: (overrides?: WalletTotal) => WalletTotal;
|
|
1195
|
+
declare const buildWalletLine: (overrides?: WalletLine) => WalletLine;
|
|
1196
|
+
declare const buildRedeemableBenefit: (overrides?: RedeemableBenefit) => RedeemableBenefit;
|
|
1197
|
+
declare const buildLoyaltyAccumulation: (override?: LoyaltyAccumulation) => LoyaltyAccumulation;
|
|
1198
|
+
declare const buildMasivoTier: (overrides?: MasivoTier) => MasivoTier;
|
|
1199
|
+
declare const buildExtendedLoyaltyInfo: (overrides?: ExtendedLoyaltyInfo) => ExtendedLoyaltyInfo;
|
|
1200
|
+
declare const buildCodesSummary: (overrides?: CodesSummary) => CodesSummary;
|
|
1201
|
+
declare const buildCodeFormat: (overrides?: CodeFormat) => CodeFormat;
|
|
1202
|
+
declare const buildCouponCampaignAttributes: (overrides?: CouponCampaignAttributes) => CouponCampaignAttributes;
|
|
1202
1203
|
declare const buildLoyaltyCampaign: (overrides?: MasivoCampaign) => MasivoCampaign;
|
|
1203
|
-
declare const
|
|
1204
|
+
declare const buildMasivoEffect: (overrides?: MasivoEffect) => MasivoEffect;
|
|
1205
|
+
declare const buildCampaignRule: (overrides?: MasivoCampaignRule) => MasivoCampaignRule;
|
|
1204
1206
|
|
|
1205
1207
|
declare const masivo_builder_buildCampaignRule: typeof buildCampaignRule;
|
|
1208
|
+
declare const masivo_builder_buildCodeFormat: typeof buildCodeFormat;
|
|
1209
|
+
declare const masivo_builder_buildCodesSummary: typeof buildCodesSummary;
|
|
1210
|
+
declare const masivo_builder_buildCouponCampaignAttributes: typeof buildCouponCampaignAttributes;
|
|
1206
1211
|
declare const masivo_builder_buildCustomerMetrics: typeof buildCustomerMetrics;
|
|
1212
|
+
declare const masivo_builder_buildExtendedLoyaltyInfo: typeof buildExtendedLoyaltyInfo;
|
|
1213
|
+
declare const masivo_builder_buildLoyaltyAccumulation: typeof buildLoyaltyAccumulation;
|
|
1207
1214
|
declare const masivo_builder_buildLoyaltyCampaign: typeof buildLoyaltyCampaign;
|
|
1208
|
-
declare const
|
|
1209
|
-
declare const
|
|
1210
|
-
declare const
|
|
1211
|
-
declare const
|
|
1212
|
-
declare const
|
|
1213
|
-
declare const
|
|
1215
|
+
declare const masivo_builder_buildMasivoCondition: typeof buildMasivoCondition;
|
|
1216
|
+
declare const masivo_builder_buildMasivoConditionBase: typeof buildMasivoConditionBase;
|
|
1217
|
+
declare const masivo_builder_buildMasivoCustomer: typeof buildMasivoCustomer;
|
|
1218
|
+
declare const masivo_builder_buildMasivoEffect: typeof buildMasivoEffect;
|
|
1219
|
+
declare const masivo_builder_buildMasivoInfo: typeof buildMasivoInfo;
|
|
1220
|
+
declare const masivo_builder_buildMasivoTier: typeof buildMasivoTier;
|
|
1221
|
+
declare const masivo_builder_buildMasivoWallet: typeof buildMasivoWallet;
|
|
1214
1222
|
declare const masivo_builder_buildMetrics: typeof buildMetrics;
|
|
1223
|
+
declare const masivo_builder_buildRedeemableBenefit: typeof buildRedeemableBenefit;
|
|
1224
|
+
declare const masivo_builder_buildWalletAttribute: typeof buildWalletAttribute;
|
|
1225
|
+
declare const masivo_builder_buildWalletLine: typeof buildWalletLine;
|
|
1226
|
+
declare const masivo_builder_buildWalletMedia: typeof buildWalletMedia;
|
|
1227
|
+
declare const masivo_builder_buildWalletReward: typeof buildWalletReward;
|
|
1228
|
+
declare const masivo_builder_buildWalletTotal: typeof buildWalletTotal;
|
|
1215
1229
|
declare namespace masivo_builder {
|
|
1216
1230
|
export {
|
|
1217
1231
|
masivo_builder_buildCampaignRule as buildCampaignRule,
|
|
1232
|
+
masivo_builder_buildCodeFormat as buildCodeFormat,
|
|
1233
|
+
masivo_builder_buildCodesSummary as buildCodesSummary,
|
|
1234
|
+
masivo_builder_buildCouponCampaignAttributes as buildCouponCampaignAttributes,
|
|
1218
1235
|
masivo_builder_buildCustomerMetrics as buildCustomerMetrics,
|
|
1236
|
+
masivo_builder_buildExtendedLoyaltyInfo as buildExtendedLoyaltyInfo,
|
|
1237
|
+
masivo_builder_buildLoyaltyAccumulation as buildLoyaltyAccumulation,
|
|
1219
1238
|
masivo_builder_buildLoyaltyCampaign as buildLoyaltyCampaign,
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1239
|
+
masivo_builder_buildMasivoCondition as buildMasivoCondition,
|
|
1240
|
+
masivo_builder_buildMasivoConditionBase as buildMasivoConditionBase,
|
|
1241
|
+
masivo_builder_buildMasivoCustomer as buildMasivoCustomer,
|
|
1242
|
+
masivo_builder_buildMasivoEffect as buildMasivoEffect,
|
|
1243
|
+
masivo_builder_buildMasivoInfo as buildMasivoInfo,
|
|
1244
|
+
masivo_builder_buildMasivoTier as buildMasivoTier,
|
|
1245
|
+
masivo_builder_buildMasivoWallet as buildMasivoWallet,
|
|
1226
1246
|
masivo_builder_buildMetrics as buildMetrics,
|
|
1247
|
+
masivo_builder_buildRedeemableBenefit as buildRedeemableBenefit,
|
|
1248
|
+
masivo_builder_buildWalletAttribute as buildWalletAttribute,
|
|
1249
|
+
masivo_builder_buildWalletLine as buildWalletLine,
|
|
1250
|
+
masivo_builder_buildWalletMedia as buildWalletMedia,
|
|
1251
|
+
masivo_builder_buildWalletReward as buildWalletReward,
|
|
1252
|
+
masivo_builder_buildWalletTotal as buildWalletTotal,
|
|
1227
1253
|
};
|
|
1228
1254
|
}
|
|
1229
1255
|
|
package/dist/bundle.mjs
CHANGED
|
@@ -1298,109 +1298,245 @@ var __spreadValues$9 = (a, b) => {
|
|
|
1298
1298
|
return a;
|
|
1299
1299
|
};
|
|
1300
1300
|
var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
|
|
1301
|
-
const
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1301
|
+
const buildMasivoCustomer = (overrides) => {
|
|
1302
|
+
return __spreadValues$9({
|
|
1303
|
+
name: genWord(),
|
|
1304
|
+
tier_id: "eac25bef-c6de-4906-8d99-014b5950132f",
|
|
1305
|
+
email: `${genWord()}@${genWord()}.com`,
|
|
1306
|
+
gender: chooseRandom(["MALE", "FEMALE", "NOT_SPECIFIED"]),
|
|
1307
|
+
id: `${genNumericId()}`,
|
|
1308
|
+
metadata: {},
|
|
1309
|
+
registration_date: "2024-11-15T00:00:00+00:00",
|
|
1310
|
+
status: "ACTIVE",
|
|
1311
|
+
dob: "2010-11-15T00:00:00+00:00",
|
|
1312
|
+
metrics: buildCustomerMetrics()
|
|
1313
|
+
}, overrides);
|
|
1314
|
+
};
|
|
1315
|
+
const buildCustomerMetrics = (overrides) => {
|
|
1316
|
+
return __spreadValues$9({
|
|
1317
|
+
last_month: buildMetrics(),
|
|
1318
|
+
last_quarter: buildMetrics(),
|
|
1319
|
+
last_year: buildMetrics(),
|
|
1320
|
+
last_semester: buildMetrics(),
|
|
1321
|
+
this_month: buildMetrics(),
|
|
1322
|
+
this_quarter: buildMetrics(),
|
|
1323
|
+
this_semester: buildMetrics(),
|
|
1324
|
+
this_year: buildMetrics(),
|
|
1325
|
+
lifetime: buildMetrics()
|
|
1326
|
+
}, overrides);
|
|
1327
|
+
};
|
|
1328
|
+
const buildMetrics = (overrides) => {
|
|
1329
|
+
return __spreadValues$9({
|
|
1330
|
+
from: genDate().toString(),
|
|
1331
|
+
to: genDate().toString(),
|
|
1332
|
+
last_visit: null,
|
|
1333
|
+
number_of_purchases: genNumber(),
|
|
1334
|
+
spend_total: genNumber(),
|
|
1335
|
+
tier_id: genId()
|
|
1336
|
+
}, overrides);
|
|
1337
|
+
};
|
|
1338
|
+
const buildMasivoWallet = (overrides) => {
|
|
1339
|
+
return __spreadValues$9({
|
|
1340
|
+
id: `${genNumericId()}`,
|
|
1341
|
+
owner_id: `${genNumericId()}`,
|
|
1342
|
+
totals: [buildWalletTotal(), buildWalletTotal()],
|
|
1343
|
+
lines: [buildWalletLine(), buildWalletLine()]
|
|
1344
|
+
}, overrides);
|
|
1345
|
+
};
|
|
1346
|
+
const buildMasivoInfo = (override, customerOverrides, walletOverrides) => {
|
|
1347
|
+
return __spreadValues$9({
|
|
1348
|
+
customer: buildMasivoCustomer(customerOverrides),
|
|
1349
|
+
wallet: buildMasivoWallet(walletOverrides)
|
|
1350
|
+
}, override);
|
|
1351
|
+
};
|
|
1352
|
+
const buildWalletMedia = (overrides) => {
|
|
1353
|
+
return __spreadValues$9({
|
|
1354
|
+
thumbnail_url: genURL(),
|
|
1355
|
+
cover_url: genURL()
|
|
1356
|
+
}, overrides);
|
|
1357
|
+
};
|
|
1358
|
+
const buildWalletAttribute = (overrides) => {
|
|
1359
|
+
return __spreadValues$9({
|
|
1360
|
+
conversion_factor: genNumber(1),
|
|
1361
|
+
action: chooseRandom(["ADD_PRODUCT", "REPLACE_PRODUCT"]),
|
|
1362
|
+
discount_type: chooseRandom(["fixed", "percentage"]),
|
|
1363
|
+
discount_value: genNumber(10),
|
|
1364
|
+
new_amount: genNumber(20),
|
|
1365
|
+
replace_amount: genNumber(20),
|
|
1366
|
+
replace_product_id: genId(),
|
|
1367
|
+
new_product_id: genId(),
|
|
1368
|
+
item_id: genId(),
|
|
1369
|
+
type: chooseRandom(["order", "shipping", "product"])
|
|
1370
|
+
}, overrides);
|
|
1371
|
+
};
|
|
1372
|
+
const buildMasivoConditionBase = (overrides) => {
|
|
1373
|
+
return __spreadValues$9({
|
|
1374
|
+
invalidMessage: genWord(4),
|
|
1375
|
+
primitive: chooseRandom(["int", "char", "bool"]),
|
|
1376
|
+
type: chooseRandom([
|
|
1377
|
+
"Current date",
|
|
1378
|
+
"Registration",
|
|
1379
|
+
"Birthday",
|
|
1380
|
+
"Customer number of purchases",
|
|
1381
|
+
"Customer has made a purchase",
|
|
1382
|
+
"Customer points balance",
|
|
1383
|
+
"Customer spend total",
|
|
1384
|
+
"Customer total spend",
|
|
1385
|
+
"Ordered at store",
|
|
1386
|
+
"Ordered in channel",
|
|
1387
|
+
"Payment method",
|
|
1388
|
+
"Order includes product",
|
|
1389
|
+
"Order value",
|
|
1390
|
+
"Order includes tag",
|
|
1391
|
+
"Product includes tag",
|
|
1392
|
+
"Shipping includes tag"
|
|
1393
|
+
]),
|
|
1394
|
+
operator: chooseRandom([
|
|
1395
|
+
"greater than",
|
|
1396
|
+
"greater than or equal to",
|
|
1397
|
+
"less than",
|
|
1398
|
+
"less than or equal to",
|
|
1399
|
+
"equal to",
|
|
1400
|
+
"not equal to",
|
|
1401
|
+
"is",
|
|
1402
|
+
"is not",
|
|
1403
|
+
"falls within period",
|
|
1404
|
+
"occurred",
|
|
1405
|
+
"occurred in the last",
|
|
1406
|
+
"occurred more than"
|
|
1407
|
+
])
|
|
1408
|
+
}, overrides);
|
|
1409
|
+
};
|
|
1410
|
+
const buildMasivoCondition = (overrides) => {
|
|
1411
|
+
return __spreadValues$9(__spreadProps$4(__spreadValues$9({}, buildMasivoConditionBase()), {
|
|
1412
|
+
value: genWord(4),
|
|
1413
|
+
reward_id: genId(),
|
|
1414
|
+
allDay: genBiasBoolean(0.2),
|
|
1415
|
+
startDate: genDate().toString(),
|
|
1416
|
+
endDate: genDate().toString(),
|
|
1417
|
+
repeat: chooseRandom([
|
|
1418
|
+
"NONE",
|
|
1419
|
+
"DAILY",
|
|
1420
|
+
"WEEKLY",
|
|
1421
|
+
"FORTNIGHTLY",
|
|
1422
|
+
"MONTHLY",
|
|
1423
|
+
"WEEK_OF_MONTH"
|
|
1424
|
+
]),
|
|
1425
|
+
reporting_period: chooseRandom([
|
|
1426
|
+
"MONTHLY",
|
|
1427
|
+
"QUARTERLY",
|
|
1428
|
+
"YEARLY",
|
|
1429
|
+
"SEMESTERLY"
|
|
1430
|
+
])
|
|
1431
|
+
}), overrides);
|
|
1308
1432
|
};
|
|
1309
|
-
const
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
}
|
|
1332
|
-
const
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
conditions: [],
|
|
1354
|
-
media: {
|
|
1355
|
-
thumbnail_url: null,
|
|
1356
|
-
cover_url: null
|
|
1357
|
-
},
|
|
1358
|
-
type: "POINTS",
|
|
1359
|
-
status: "ACTIVE",
|
|
1360
|
-
brand_id: null,
|
|
1361
|
-
attributes: {
|
|
1362
|
-
conversion_factor: 0.025
|
|
1363
|
-
}
|
|
1364
|
-
},
|
|
1365
|
-
total: 200,
|
|
1366
|
-
expiration_date: "2025-11-16T04:59:59.999Z"
|
|
1367
|
-
}
|
|
1368
|
-
];
|
|
1369
|
-
const buildLoyaltyLines = () => [
|
|
1370
|
-
{
|
|
1371
|
-
reward_id: "71fd5647-d580-4d2d-b7dd-7800f639206b",
|
|
1372
|
-
campaign_id: "8cf83574-a9b0-4578-8cb8-bd8340acb7d2",
|
|
1373
|
-
brand_id: "0001",
|
|
1374
|
-
issued_at: "2024-11-15T17:03:27.1s43Z",
|
|
1375
|
-
expiration_date: "2025-11-16T04:59:59.999Z",
|
|
1376
|
-
amount: 200,
|
|
1377
|
-
reward: buildLoyaltyWalletTotals()[0].reward
|
|
1378
|
-
}
|
|
1379
|
-
];
|
|
1380
|
-
const buildLoyaltyWalletAccumulation = (override) => {
|
|
1433
|
+
const buildWalletReward = (overrides) => {
|
|
1434
|
+
return __spreadValues$9({
|
|
1435
|
+
id: genId(),
|
|
1436
|
+
name: genWord(4),
|
|
1437
|
+
description: genWord(12),
|
|
1438
|
+
conditions: [],
|
|
1439
|
+
media: buildWalletMedia(),
|
|
1440
|
+
type: chooseRandom(["DISCOUNT", "POINTS", "GIFT_CARD", "PRODUCT"]),
|
|
1441
|
+
status: "ACTIVE",
|
|
1442
|
+
brand_id: null,
|
|
1443
|
+
attributes: buildWalletAttribute({
|
|
1444
|
+
conversion_factor: 0.025
|
|
1445
|
+
})
|
|
1446
|
+
}, overrides);
|
|
1447
|
+
};
|
|
1448
|
+
const buildWalletTotal = (overrides) => {
|
|
1449
|
+
return __spreadValues$9({
|
|
1450
|
+
reward_id: genId(),
|
|
1451
|
+
reward: buildWalletReward(),
|
|
1452
|
+
total: genNumber(200),
|
|
1453
|
+
expiration_date: genDate().toString()
|
|
1454
|
+
}, overrides);
|
|
1455
|
+
};
|
|
1456
|
+
const buildWalletLine = (overrides) => {
|
|
1457
|
+
return __spreadValues$9({
|
|
1458
|
+
brand_id: genId(),
|
|
1459
|
+
reward_id: genId(),
|
|
1460
|
+
campaign_id: genId(),
|
|
1461
|
+
expiration_date: genDate().toString(),
|
|
1462
|
+
issued_at: genDate().toString(),
|
|
1463
|
+
reservation_expires_at: genDate().toString(),
|
|
1464
|
+
amount: genNumber(200),
|
|
1465
|
+
reward: buildWalletReward()
|
|
1466
|
+
}, overrides);
|
|
1467
|
+
};
|
|
1468
|
+
const buildRedeemableBenefit = (overrides) => {
|
|
1469
|
+
return __spreadValues$9(__spreadValues$9({
|
|
1470
|
+
brand_id: genId(),
|
|
1471
|
+
campaign_id: genId(),
|
|
1472
|
+
issued_at: genDate().toString(),
|
|
1473
|
+
amount: genNumber(200)
|
|
1474
|
+
}, buildWalletTotal()), overrides);
|
|
1475
|
+
};
|
|
1476
|
+
const buildLoyaltyAccumulation = (override) => {
|
|
1381
1477
|
if (override)
|
|
1382
1478
|
return override;
|
|
1383
|
-
const [line] =
|
|
1384
|
-
const [total] =
|
|
1479
|
+
const [line] = [buildWalletLine()];
|
|
1480
|
+
const [total] = [buildWalletTotal()];
|
|
1385
1481
|
const { reward } = total;
|
|
1386
1482
|
return __spreadProps$4(__spreadValues$9({}, line), { reward });
|
|
1387
1483
|
};
|
|
1484
|
+
const buildMasivoTier = (overrides) => {
|
|
1485
|
+
return __spreadValues$9({
|
|
1486
|
+
id: genId(),
|
|
1487
|
+
name: `${genWord()} ${genWord()}`,
|
|
1488
|
+
status: "ACTIVE",
|
|
1489
|
+
level: genNumber(12),
|
|
1490
|
+
description: genParagraph(1),
|
|
1491
|
+
entry_conditions: [[buildMasivoCondition()]],
|
|
1492
|
+
exit_conditions: [[buildMasivoCondition()]],
|
|
1493
|
+
template_id: genId()
|
|
1494
|
+
}, overrides);
|
|
1495
|
+
};
|
|
1496
|
+
const buildExtendedLoyaltyInfo = (overrides) => {
|
|
1497
|
+
return __spreadValues$9(__spreadProps$4(__spreadValues$9({}, buildMasivoInfo()), {
|
|
1498
|
+
accumulations: [buildLoyaltyAccumulation()],
|
|
1499
|
+
redemptions: []
|
|
1500
|
+
}), overrides);
|
|
1501
|
+
};
|
|
1502
|
+
const buildCodesSummary = (overrides) => {
|
|
1503
|
+
return __spreadValues$9({
|
|
1504
|
+
codes: [genWord(1), genWord(1), genWord(1)],
|
|
1505
|
+
left: genNumber(70),
|
|
1506
|
+
used: genNumber(30),
|
|
1507
|
+
total: genNumber(100)
|
|
1508
|
+
}, overrides);
|
|
1509
|
+
};
|
|
1510
|
+
const buildCodeFormat = (overrides) => {
|
|
1511
|
+
return __spreadValues$9({
|
|
1512
|
+
case_sensitive: genBiasBoolean(0.3),
|
|
1513
|
+
exclude_characters: genWord(1),
|
|
1514
|
+
include_characters: genWord(1),
|
|
1515
|
+
template: genWord(10)
|
|
1516
|
+
}, overrides);
|
|
1517
|
+
};
|
|
1518
|
+
const buildCouponCampaignAttributes = (overrides) => {
|
|
1519
|
+
return __spreadValues$9({
|
|
1520
|
+
code_format: buildCodeFormat(),
|
|
1521
|
+
codes_summary: buildCodesSummary(),
|
|
1522
|
+
max_redemptions_per_code: genNumber(3),
|
|
1523
|
+
max_redemptions_per_code_per_customer: genNumber(5)
|
|
1524
|
+
}, overrides);
|
|
1525
|
+
};
|
|
1388
1526
|
const buildLoyaltyCampaign = (overrides) => {
|
|
1389
|
-
|
|
1390
|
-
return overrides;
|
|
1391
|
-
return {
|
|
1527
|
+
return __spreadValues$9({
|
|
1392
1528
|
id: genId(),
|
|
1393
1529
|
name: `${genWord()} ${genWord()}`,
|
|
1394
1530
|
description: genParagraph(1),
|
|
1395
|
-
brand_id:
|
|
1531
|
+
brand_id: genId(),
|
|
1396
1532
|
start_date: genDate().toString(),
|
|
1397
1533
|
end_date: null,
|
|
1398
|
-
rules:
|
|
1399
|
-
type: "COUPONS",
|
|
1534
|
+
rules: [buildCampaignRule(), buildCampaignRule()],
|
|
1535
|
+
type: chooseRandom(["COUPONS", "BEHAVIOR"]),
|
|
1400
1536
|
funded_by: null,
|
|
1401
1537
|
labels: [chooseRandom(["Domicilio", "Restaurantes"])],
|
|
1402
|
-
budget: 1e3,
|
|
1403
|
-
divide_budget_in: "total",
|
|
1538
|
+
budget: genNumber(1e3),
|
|
1539
|
+
divide_budget_in: chooseRandom(["daily", "weekly", "monthly", "total"]),
|
|
1404
1540
|
content: {
|
|
1405
1541
|
Title: {
|
|
1406
1542
|
name: genWord(),
|
|
@@ -1415,41 +1551,49 @@ const buildLoyaltyCampaign = (overrides) => {
|
|
|
1415
1551
|
},
|
|
1416
1552
|
template_id: genId(),
|
|
1417
1553
|
metadata: {},
|
|
1418
|
-
attributes:
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
};
|
|
1554
|
+
attributes: buildCouponCampaignAttributes(),
|
|
1555
|
+
status: chooseRandom(["RUNNING", "PAUSED", "SCHEDULED", "FINISHED"])
|
|
1556
|
+
}, overrides);
|
|
1557
|
+
};
|
|
1558
|
+
const buildMasivoEffect = (overrides) => {
|
|
1559
|
+
return __spreadValues$9({
|
|
1560
|
+
amount: genNumber(200),
|
|
1561
|
+
type: chooseRandom(["DISCOUNT", "POINTS", "GIFT_CARD", "PRODUCT"]),
|
|
1562
|
+
reward_id: genId(),
|
|
1563
|
+
reward: buildWalletReward(),
|
|
1564
|
+
tier_id: genId(),
|
|
1565
|
+
expiration_date: genDate().toString(),
|
|
1566
|
+
multiplier: chooseRandom(["Order value"])
|
|
1567
|
+
}, overrides);
|
|
1568
|
+
};
|
|
1569
|
+
const buildCampaignRule = (overrides) => {
|
|
1570
|
+
return __spreadValues$9({ conditions: [], effects: [] }, overrides);
|
|
1435
1571
|
};
|
|
1436
|
-
const buildCampaignRule = () => ({
|
|
1437
|
-
conditions: [],
|
|
1438
|
-
effects: []
|
|
1439
|
-
});
|
|
1440
1572
|
|
|
1441
1573
|
var masivo_builder = /*#__PURE__*/Object.freeze({
|
|
1442
1574
|
__proto__: null,
|
|
1443
1575
|
buildCampaignRule: buildCampaignRule,
|
|
1576
|
+
buildCodeFormat: buildCodeFormat,
|
|
1577
|
+
buildCodesSummary: buildCodesSummary,
|
|
1578
|
+
buildCouponCampaignAttributes: buildCouponCampaignAttributes,
|
|
1444
1579
|
buildCustomerMetrics: buildCustomerMetrics,
|
|
1580
|
+
buildExtendedLoyaltyInfo: buildExtendedLoyaltyInfo,
|
|
1581
|
+
buildLoyaltyAccumulation: buildLoyaltyAccumulation,
|
|
1445
1582
|
buildLoyaltyCampaign: buildLoyaltyCampaign,
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1583
|
+
buildMasivoCondition: buildMasivoCondition,
|
|
1584
|
+
buildMasivoConditionBase: buildMasivoConditionBase,
|
|
1585
|
+
buildMasivoCustomer: buildMasivoCustomer,
|
|
1586
|
+
buildMasivoEffect: buildMasivoEffect,
|
|
1587
|
+
buildMasivoInfo: buildMasivoInfo,
|
|
1588
|
+
buildMasivoTier: buildMasivoTier,
|
|
1589
|
+
buildMasivoWallet: buildMasivoWallet,
|
|
1590
|
+
buildMetrics: buildMetrics,
|
|
1591
|
+
buildRedeemableBenefit: buildRedeemableBenefit,
|
|
1592
|
+
buildWalletAttribute: buildWalletAttribute,
|
|
1593
|
+
buildWalletLine: buildWalletLine,
|
|
1594
|
+
buildWalletMedia: buildWalletMedia,
|
|
1595
|
+
buildWalletReward: buildWalletReward,
|
|
1596
|
+
buildWalletTotal: buildWalletTotal
|
|
1453
1597
|
});
|
|
1454
1598
|
|
|
1455
1599
|
var __defProp$8 = Object.defineProperty;
|