@feedmepos/mf-connect 0.1.114-prod → 0.1.115-dev
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/README.md +66 -1
- package/dist/{App-DMYXrCc7.js → App-43mZfFAr.js} +700 -654
- package/dist/AuditLogs-BPpdm96t.js +2016 -0
- package/dist/{Bin-CHZolo56.js → Bin-CA7v180Y.js} +8 -8
- package/dist/Broadcast-qmdifF2Y.js +306 -0
- package/dist/{CampaignAnalytic-DgZvsUoF.js → CampaignAnalytic-xnrDxqaH.js} +7 -7
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-C42uL_JO.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-zjk-QdtX.js} +9 -9
- package/dist/{Card-wRFTJwJ9.js → Card-D8icsk7L.js} +25 -24
- package/dist/{Collections-9G-_9Etz.js → Collections--THcD-E_.js} +197 -185
- package/dist/{Credit-Bl7IDMCU.js → Credit-JrbtVMBp.js} +21 -20
- package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-BVLJeofG.js → DateRangeChip.vue_vue_type_script_setup_true_lang-DrwKtnE5.js} +1 -1
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DgdAlHU7.js +4442 -0
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-Q1f6EQW3.js → EffectSheet.vue_vue_type_style_index_0_lang-hVgqWdD0.js} +32 -32
- package/dist/{Experience-Cs2iViLv.js → Experience-CFeRqBoj.js} +32 -31
- package/dist/{FileSaver.min-B3Levdbu.js → FileSaver.min-CCXIBm58.js} +1 -1
- package/dist/{Game-oXURgzan.js → Game-CPxq6Ex3.js} +19 -18
- package/dist/{GiftCardSetup-C2Wu-dRl.js → GiftCardSetup-D0esVZDp.js} +75 -75
- package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-Da2e89Um.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-CJ1-vL-K.js} +7 -7
- package/dist/{Goals-B_xEM7gf.js → Goals-DaKI6uXt.js} +4 -4
- package/dist/Grab-BWzdN_cd.js +301 -0
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-BRJR1heE.js → ImageInput.vue_vue_type_script_setup_true_lang-BOnL0GxM.js} +1 -1
- package/dist/{Index-kuT6W6R_.js → Index-2kENoaZm.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-7JqHfSk-.js → LocationPicker.vue_vue_type_script_setup_true_lang-BtWnJKU_.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CI_4S7tW.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CX_Sspu5.js} +1 -1
- package/dist/{LoyaltyDashboard-CqxHdZcm.js → LoyaltyDashboard-CB93Fz8u.js} +15 -15
- package/dist/MainLayout-DwnjGXh6.js +4 -0
- package/dist/{MainLayout-CAERFIms.js → MainLayout.vue_vue_type_script_setup_true_lang-Du8fw5v_.js} +5 -4
- package/dist/Marketing-DCco__2F.js +273 -0
- package/dist/MarketingMaterialEdit-BbgFtrYP.js +1037 -0
- package/dist/{Member-B8VZEn9t.js → Member-B--nYyr0.js} +7 -7
- package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-B31lVLKh.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-BBlzO7Db.js} +43 -50
- package/dist/{MemberImportHistory-D9tgHnTS.js → MemberImportHistory-D52Y4RTC.js} +7 -7
- package/dist/{MemberList-Hw_xQY1i.js → MemberList-13Owa1fj.js} +103 -105
- package/dist/{MemberTransactions-DiBO4plw.js → MemberTransactions-CpXEWNbq.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CbFt5X89.js → MessageInput.vue_vue_type_script_setup_true_lang-DlELjFM0.js} +4228 -4176
- package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-BE_-Ed4z.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-C_y0rM8c.js} +1 -1
- package/dist/{Mission-DpYei3aF.js → Mission-Ci-UzXSu.js} +22 -21
- package/dist/{Overview-CARquJCS.js → Overview-CKxSfAGF.js} +145 -144
- package/dist/{Overview-BFQMmyT6.js → Overview-CXen9Ram.js} +23 -22
- package/dist/{Point-Dd2ykwNv.js → Point-CR3YOaag.js} +22 -21
- package/dist/{Promotion-DXl-W7np.js → Promotion-tw3J4ul-.js} +137 -131
- package/dist/{Queue-Cd3N-4iB.js → Queue-BZGA5ZXt.js} +47 -46
- package/dist/{Record-C3HdDsh5.js → Record-BTevVXnT.js} +9 -9
- package/dist/{Review-Bif3Ub9Z.js → Review-BU7c8ZF0.js} +2 -2
- package/dist/ReviewFacebookCallback-BnMF6Arh.js +225 -0
- package/dist/{ReviewGoogleCallback-i-RNLlLm.js → ReviewGoogleCallback-xpdPHSdg.js} +5 -5
- package/dist/{Reward-DHxzrR_7.js → Reward-jlA_7cxz.js} +29 -29
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-DcrFlcSo.js → RewardGroup.vue_vue_type_script_setup_true_lang-D3z_n42G.js} +16 -15
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-CsHxqH9h.js +1923 -0
- package/dist/{Segment-Cjpxordk.js → Segment-C1Bwm--Q.js} +290 -291
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-6u21xBu6.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-B6apgWTM.js} +31 -30
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-BOXVzfer.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-B7m2F9UV.js} +4 -4
- package/dist/Setting-CDM4RhLW.js +574 -0
- package/dist/{SettingAdvertisements-aog5fz32.js → SettingAdvertisements-4XEAJzlL.js} +12 -12
- package/dist/Settings-D-0tvZRr.js +286 -0
- package/dist/{Store-Bq3kw1l2.js → Store-C56dXtc4.js} +31 -30
- package/dist/{StoreRewards-ZGXKEM09.js → StoreRewards-DQ1Q6WS6.js} +15 -15
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-LLD91Rz6.js +1319 -0
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-Bvy4NJMd.js +7007 -0
- package/dist/{Tier-CfgpEHY7.js → Tier-D4CPZqw7.js} +2576 -687
- package/dist/{Title-B2itYWeD.js → Title-DCbwhUic.js} +94 -92
- package/dist/{Transaction-hJ5ygIcf.js → Transaction-C5LrasXr.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-8BgGlpTh.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Cl9b4mrK.js} +26 -26
- package/dist/{Voucher-TG47pGR3.js → Voucher-rrVbNZKR.js} +19 -19
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-CjuXCTxg.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BIq227nz.js} +16 -16
- package/dist/WhatsappAccount-oJDo5zTr.js +159 -0
- package/dist/WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-aCQCYFYq.js +39 -0
- package/dist/WhatsappBot-Cl64wG_F.js +876 -0
- package/dist/WhatsappBotLogs-D3uT4EiB.js +372 -0
- package/dist/WhatsappBotSettings-Cs1lLxh-.js +705 -0
- package/dist/WhatsappLayout-C639d2HP.js +21 -0
- package/dist/WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-DpPxWp2x.js +253 -0
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BRs-gbP0.js → ZodTextField.vue_vue_type_script_setup_true_lang-C39_95SZ.js} +2 -2
- package/dist/{app-tPHYkJcQ.js → app-CgimGODl.js} +10610 -8223
- package/dist/app.js +4 -3
- package/dist/{base.export-BHDVnGj2.js → base.export-D2P6HFvo.js} +2 -2
- package/dist/browser-BSAOEeIM.js +1478 -0
- package/dist/{business-HLyWfrXY.js → business-Bu5TqSA0.js} +1 -1
- package/dist/campaign-BFIXSgdJ.js +400 -0
- package/dist/{campaign-5zFgUNLw.js → campaign-zJxttSIk.js} +31 -25
- package/dist/{campaign.enum-BOkDnP2g.js → campaign.enum-Dx-Zo68Q.js} +3 -2
- package/dist/{campaign.fn-BIAoVtJj.js → campaign.fn-gvjlcEfe.js} +78 -78
- package/dist/{collectible.enum-BbZSAfys.js → collectible.enum-Liy2wH3s.js} +1 -1
- package/dist/{collection.fn-DPSgBHnz.js → collection.fn-DOm0HsSh.js} +2 -2
- package/dist/{currency-BVrMqU6-.js → currency-BpbQvbm8.js} +1 -1
- package/dist/duplicateCampaign-CvsvjRE9.js +51 -0
- package/dist/{effect-BBifVx76.js → effect-D-GtNB3n.js} +1 -1
- package/dist/{email-addresses-9C7xHTNv.js → email-addresses-BKMoAtMi.js} +2 -2
- package/dist/feature-flag-BJ_eyKsq.js +868 -0
- package/dist/feature-flag-Bo-k5sIG.js +50 -0
- package/dist/google-BQK68wbe.js +5 -0
- package/dist/{helper-C08jyQNK.js → helper-CkfjBgMM.js} +1 -1
- package/dist/{index-Dhyqf1s8.js → index-B6kU3PkV.js} +2700 -2613
- package/dist/{index-BgwZGunW.js → index-BAtUrtqM.js} +19 -6
- package/dist/index-BKsxIwbi.js +14571 -0
- package/dist/{index-DZ-q5O-V.js → index-BdEXUNoG.js} +4 -4
- package/dist/{index-hIUtD2eY.js → index-Bhl5IRXy.js} +11 -10
- package/dist/{index-kCbkOivd.js → index-BpTIulTX.js} +1 -1
- package/dist/index-C-iwb2Ln.js +109 -0
- package/dist/{index-Ciw2TZxV.js → index-CCEXSPxk.js} +8 -7
- package/dist/{index-CUle4c2B.js → index-CIej31pF.js} +4 -3
- package/dist/{index-ihw-WFCa.js → index-CQ8XFbBk.js} +2 -2
- package/dist/index-C_H8jFYf.js +2743 -0
- package/dist/{index-CEe1kJ0T.js → index-CfQuYqXn.js} +1 -1
- package/dist/{index-C_WoO58V.js → index-CuREApMc.js} +8 -7
- package/dist/{index-NJSI4wX4.js → index-D0JK99Ko.js} +693 -231
- package/dist/{index-DnRMNmUA.js → index-DKxN1mMS.js} +396 -232
- package/dist/index-DQ8JJhxs.js +74 -0
- package/dist/{index-D24Q28cH.js → index-DUAZOMVJ.js} +1 -1
- package/dist/{index-Yo0tP8KJ.js → index-DqGs6RJG.js} +683 -581
- package/dist/{index-B_334Y_i.js → index-DwU3fsLW.js} +29 -15
- package/dist/{index-hSRM1smQ.js → index-LygS9WsG.js} +8028 -10767
- package/dist/{index-96ZiAKj_.js → index-feCrYhi6.js} +1 -1
- package/dist/{index-Dk-jg0wN.js → index-zTvr2GR4.js} +2 -2
- package/dist/{index.esm2017-hN99SQTb.js → index.esm2017-DZi9IQPS.js} +209 -209
- package/dist/{loading-CVuY4vQ4.js → loading-Brid2wnu.js} +1 -1
- package/dist/{lodash-GFl9_FMH.js → lodash-C1epw3Kv.js} +1 -1
- package/dist/{member-import-CshTzabx.js → member-import-DAIxTIiu.js} +6 -5
- package/dist/{membership-S0KES3Ex.js → membership-BZmljFhF.js} +3 -3
- package/dist/{money-JxdX8ru4.js → money-cLcyGcSZ.js} +1 -1
- package/dist/{number-BRLwa-mB.js → number-C2jPLJr2.js} +1 -1
- package/dist/objectid-C-wocWKI.js +145 -0
- package/dist/{onboarding-BSKYeyP7.js → onboarding-oRfy_g05.js} +25 -25
- package/dist/{onboardingSetup-BqT52VRm.js → onboardingSetup-BLD6m8HY.js} +2 -2
- package/dist/{plugins-BR_wmMFJ.js → plugins-CUsr9vB0.js} +3 -3
- package/dist/{MarketingMaterialEdit-BvIthCHG.js → remy-icon-BhUGu2NI.js} +2 -1031
- package/dist/{reward-CpCGg_W2.js → reward-UOT03odb.js} +1 -1
- package/dist/{rule-Dbg9e8MO.js → rule-BgJnPjkI.js} +572 -492
- package/dist/style.css +1 -1
- package/dist/template-BZyFhr73.js +188 -0
- package/dist/{timezone-CDVa-xPr.js → timezone-BXA4wq7Y.js} +1 -1
- package/dist/{transaction.fn-DrTBoF9T.js → transaction.fn-CQ4fpRt3.js} +2 -2
- package/dist/{trigger-wqGwQfB2.js → trigger-DXJCGT0q.js} +8 -8
- package/dist/useMarketingMaterialActions-B-Wib5ga.js +125 -0
- package/dist/{usePagination-fODgpZZ8.js → usePagination-Pp4okWr8.js} +1 -1
- package/dist/{user-DaLUK1dk.js → user-B3gXcAIy.js} +1 -1
- package/dist/vue-i18n-DWGiC_vs.js +2365 -0
- package/dist/{xlsx-Bl4_Dtrq.js → xlsx-CCaDUTgW.js} +651 -651
- package/dist/{zod-CAzWyVqj.js → zod-CPwjOxvW.js} +1 -1
- package/package.json +12 -3
- package/dist/Broadcast-ByWvxVhW.js +0 -271
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DGpQfV5T.js +0 -2431
- package/dist/Marketing-KgcwGErU.js +0 -236
- package/dist/ReviewFacebookCallback-mJF54-9l.js +0 -238
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-39f3I4BB.js +0 -1883
- package/dist/Setting-Dl9MelHz.js +0 -2036
- package/dist/Settings-DvCCClIP.js +0 -179
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-DscLAF0p.js +0 -1264
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-l_v4FHO0.js +0 -142
- package/dist/campaign-awCRccgX.js +0 -228
- package/dist/google-C3S8u0mT.js +0 -4
- package/dist/index-CoNJdOx7.js +0 -51
- package/dist/objectid-CEHN25HN.js +0 -145
- package/dist/rule-builder-BEIjxsE0.js +0 -102
- package/dist/template-CS-lExgI.js +0 -236
- package/dist/useMarketingMaterialActions-DC0gIyIZ.js +0 -96
- package/dist/vue-i18n-Dx-KXojZ.js +0 -2365
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { z as e
|
|
2
|
-
import { F as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { z as e } from "./index-C_H8jFYf.js";
|
|
2
|
+
import { F as t, b as _, m as g, d as X } from "./index-LygS9WsG.js";
|
|
3
|
+
import { F as M } from "./campaign.enum-Dx-Zo68Q.js";
|
|
4
|
+
import { f as T, F as L, g as c, i as ee, j as O, k as u, m as x, e as te } from "./index-B6kU3PkV.js";
|
|
5
|
+
import { o as P, m as S, n as ne, p as oe, q as ie } from "./index-DqGs6RJG.js";
|
|
6
|
+
import { c as p, f as ae } from "./index-BKsxIwbi.js";
|
|
6
7
|
e.object({
|
|
7
8
|
location: t,
|
|
8
9
|
memberId: t,
|
|
9
|
-
nettTotal:
|
|
10
|
+
nettTotal: _,
|
|
10
11
|
remark: e.string().optional()
|
|
11
12
|
});
|
|
12
|
-
const
|
|
13
|
+
const le = e.enum(["COUNTER", "POS"]);
|
|
13
14
|
e.object({
|
|
14
15
|
id: e.string(),
|
|
15
16
|
userId: e.string(),
|
|
@@ -20,9 +21,9 @@ e.object({
|
|
|
20
21
|
level: e.number().nullish(),
|
|
21
22
|
mostPurchasedItems: e.array(e.string()).nullish()
|
|
22
23
|
});
|
|
23
|
-
const
|
|
24
|
+
const se = {
|
|
24
25
|
collectionName: "Bills"
|
|
25
|
-
},
|
|
26
|
+
}, j = e.object({
|
|
26
27
|
_id: e.string(),
|
|
27
28
|
items: e.record(e.string(), e.number()).nullish(),
|
|
28
29
|
// business: z.string(),
|
|
@@ -31,25 +32,27 @@ const X = {
|
|
|
31
32
|
user: e.string().nullish(),
|
|
32
33
|
memberid: e.string().nullish(),
|
|
33
34
|
// roundToNearest: z.number().nullish(),
|
|
34
|
-
nettTotal:
|
|
35
|
-
adjustedTotal:
|
|
35
|
+
nettTotal: _,
|
|
36
|
+
adjustedTotal: _.optional(),
|
|
36
37
|
// activeItems: z.array(z.string()),
|
|
37
38
|
remark: e.string().nullish(),
|
|
38
39
|
createdAt: e.coerce.date(),
|
|
39
40
|
completedAt: e.coerce.date(),
|
|
41
|
+
refunded: e.boolean().nullish(),
|
|
42
|
+
refundRecord: e.array(e.string()).nullish(),
|
|
40
43
|
location: e.string(),
|
|
41
|
-
channel:
|
|
42
|
-
}).transform((
|
|
43
|
-
...
|
|
44
|
-
createdTime:
|
|
45
|
-
completedTime:
|
|
44
|
+
channel: le.optional()
|
|
45
|
+
}).transform((i) => ({
|
|
46
|
+
...i,
|
|
47
|
+
createdTime: i.createdAt,
|
|
48
|
+
completedTime: i.completedAt,
|
|
46
49
|
get amount() {
|
|
47
|
-
return
|
|
50
|
+
return i.nettTotal.amount / 10 ** i.nettTotal.precision;
|
|
48
51
|
},
|
|
49
52
|
get adjustmentAmount() {
|
|
50
|
-
return
|
|
53
|
+
return i.adjustedTotal ? i.adjustedTotal.amount / 10 ** i.adjustedTotal.precision : void 0;
|
|
51
54
|
}
|
|
52
|
-
})).describe(
|
|
55
|
+
})).describe(g.describe(se)), re = e.object({
|
|
53
56
|
_id: e.string(),
|
|
54
57
|
rating: e.coerce.number(),
|
|
55
58
|
user: e.string().optional(),
|
|
@@ -60,6 +63,7 @@ const X = {
|
|
|
60
63
|
"SIMPLE_CLAIM",
|
|
61
64
|
"LINK_CLAIM",
|
|
62
65
|
"BILL_COMPLETED",
|
|
66
|
+
"BILL_REFUNDED",
|
|
63
67
|
"SCHEDULE",
|
|
64
68
|
"BIRTHDAY",
|
|
65
69
|
"FEEDBACK",
|
|
@@ -74,7 +78,7 @@ const X = {
|
|
|
74
78
|
"REFERRAL_ADDED",
|
|
75
79
|
"MEMBER_IMPORTED",
|
|
76
80
|
"SEGMENTATION_IMPORTED"
|
|
77
|
-
]),
|
|
81
|
+
]), Ze = o.extract([
|
|
78
82
|
"BILL_COMPLETED",
|
|
79
83
|
"FEEDBACK",
|
|
80
84
|
"GAME_COMPLETED",
|
|
@@ -87,64 +91,64 @@ const X = {
|
|
|
87
91
|
]);
|
|
88
92
|
e.enum(["START_OF", "BEFORE"]);
|
|
89
93
|
e.enum(["WEEK", "MONTH"]);
|
|
90
|
-
const
|
|
94
|
+
const de = e.enum([
|
|
91
95
|
"WAITING",
|
|
92
96
|
"ACTIVE",
|
|
93
97
|
"COMPLETED",
|
|
94
98
|
"FAILED"
|
|
95
|
-
]),
|
|
99
|
+
]), a = e.object({
|
|
96
100
|
// type: F_EVENT_TYPE,
|
|
97
|
-
rule:
|
|
98
|
-
}),
|
|
101
|
+
rule: T.optional()
|
|
102
|
+
}), ce = a.extend({
|
|
99
103
|
type: e.literal(o.enum.BILL_COMPLETED)
|
|
100
|
-
}),
|
|
104
|
+
}), me = a.extend({
|
|
101
105
|
type: e.literal(o.enum.FEEDBACK)
|
|
102
|
-
}),
|
|
106
|
+
}), ue = a.extend({
|
|
103
107
|
type: e.literal(o.enum.SIMPLE_CLAIM)
|
|
104
108
|
});
|
|
105
|
-
|
|
109
|
+
a.extend({
|
|
106
110
|
type: e.literal(o.enum.ENTER_SEGMENT),
|
|
107
111
|
segment: e.string()
|
|
108
112
|
});
|
|
109
|
-
const
|
|
113
|
+
const pe = a.extend({
|
|
110
114
|
type: e.literal(o.enum.MEMBER_REWARD)
|
|
111
|
-
}),
|
|
115
|
+
}), Ee = a.extend({
|
|
112
116
|
type: e.literal(o.enum.SCHEDULE)
|
|
113
117
|
// option: FdoCronRule,
|
|
114
|
-
}),
|
|
118
|
+
}), ge = a.extend({
|
|
115
119
|
type: e.literal(o.enum.MEMBERSHIP_JOINED)
|
|
116
|
-
}),
|
|
120
|
+
}), be = a.extend({
|
|
117
121
|
type: e.literal(o.enum.TIER_UPGRADED)
|
|
118
|
-
}),
|
|
122
|
+
}), ye = a.extend({
|
|
119
123
|
type: e.literal(o.enum.MAKING_ORDER)
|
|
120
|
-
}),
|
|
124
|
+
}), Ce = a.extend({
|
|
121
125
|
type: e.literal(o.enum.ISSUE_REWARD)
|
|
122
|
-
}),
|
|
126
|
+
}), Re = a.extend({
|
|
123
127
|
type: e.literal(o.enum.GAME_COMPLETED)
|
|
124
128
|
});
|
|
125
|
-
|
|
129
|
+
a.extend({
|
|
126
130
|
type: e.literal(o.enum.REFERRAL_ADDED)
|
|
127
131
|
});
|
|
128
|
-
|
|
132
|
+
a.extend({
|
|
129
133
|
type: e.literal(o.enum.MEMBER_IMPORTED)
|
|
130
134
|
});
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
ne,
|
|
134
|
-
le,
|
|
135
|
-
oe,
|
|
136
|
-
se,
|
|
137
|
-
re,
|
|
138
|
-
de,
|
|
135
|
+
const Ie = e.discriminatedUnion("type", [
|
|
136
|
+
ue,
|
|
139
137
|
ce,
|
|
140
|
-
|
|
141
|
-
me
|
|
138
|
+
Ee,
|
|
139
|
+
me,
|
|
140
|
+
ge,
|
|
141
|
+
be,
|
|
142
|
+
ye,
|
|
143
|
+
Ce,
|
|
144
|
+
pe,
|
|
145
|
+
Re
|
|
142
146
|
]);
|
|
143
147
|
e.object({
|
|
144
148
|
_id: t,
|
|
145
149
|
type: o,
|
|
146
150
|
ref: e.string(),
|
|
147
|
-
status:
|
|
151
|
+
status: de.optional(),
|
|
148
152
|
context: e.record(e.string(), e.any()).optional(),
|
|
149
153
|
failedReason: e.any().optional()
|
|
150
154
|
}).describe(JSON.stringify({ collectionName: "EventLogs" }));
|
|
@@ -155,18 +159,24 @@ const l = e.object({
|
|
|
155
159
|
campaignIds: e.array(t).optional(),
|
|
156
160
|
slackWebhookUrl: e.string().optional(),
|
|
157
161
|
emittedAt: e.coerce.date().default(/* @__PURE__ */ new Date())
|
|
158
|
-
}),
|
|
162
|
+
}), _e = l.extend({
|
|
159
163
|
type: e.literal(o.enum.BILL_COMPLETED),
|
|
160
164
|
context: e.object({
|
|
161
|
-
bill:
|
|
165
|
+
bill: j,
|
|
162
166
|
rawBill: e.any()
|
|
163
167
|
})
|
|
164
|
-
}),
|
|
168
|
+
}), he = l.extend({
|
|
169
|
+
type: e.literal(o.enum.BILL_REFUNDED),
|
|
170
|
+
context: e.object({
|
|
171
|
+
bill: j,
|
|
172
|
+
rawBill: e.any()
|
|
173
|
+
})
|
|
174
|
+
}), fe = l.extend({
|
|
165
175
|
type: e.literal(o.enum.SCHEDULE),
|
|
166
176
|
context: e.object({
|
|
167
177
|
triggeredAt: e.coerce.date()
|
|
168
178
|
})
|
|
169
|
-
}),
|
|
179
|
+
}), Fe = l.extend({
|
|
170
180
|
type: e.literal(o.enum.PAGINATE_SCHEDULE),
|
|
171
181
|
context: e.object({
|
|
172
182
|
triggeredAt: e.coerce.date(),
|
|
@@ -174,83 +184,85 @@ const l = e.object({
|
|
|
174
184
|
skip: e.coerce.number(),
|
|
175
185
|
limit: e.coerce.number()
|
|
176
186
|
})
|
|
177
|
-
}),
|
|
187
|
+
}), De = l.extend({
|
|
178
188
|
type: e.literal(o.enum.FEEDBACK),
|
|
179
189
|
context: e.object({
|
|
180
|
-
feedback:
|
|
190
|
+
feedback: re
|
|
181
191
|
})
|
|
182
|
-
}),
|
|
192
|
+
}), Ae = l.extend({
|
|
183
193
|
type: e.literal(o.enum.MEMBERSHIP_JOINED),
|
|
184
194
|
context: e.object({
|
|
185
|
-
user:
|
|
195
|
+
user: P
|
|
186
196
|
})
|
|
187
|
-
}),
|
|
197
|
+
}), Me = l.extend({
|
|
188
198
|
type: e.literal(o.enum.TIER_UPGRADED),
|
|
189
199
|
context: e.object({
|
|
190
|
-
transaction:
|
|
200
|
+
transaction: S
|
|
191
201
|
})
|
|
192
|
-
}),
|
|
202
|
+
}), Te = l.extend({
|
|
193
203
|
type: e.literal(o.enum.ISSUE_REWARD),
|
|
194
204
|
context: e.object({
|
|
195
|
-
transaction:
|
|
196
|
-
collection:
|
|
205
|
+
transaction: S,
|
|
206
|
+
collection: ne
|
|
197
207
|
})
|
|
198
|
-
}),
|
|
208
|
+
}), Le = l.extend({
|
|
199
209
|
type: e.literal(o.enum.REFERRAL_ADDED),
|
|
200
210
|
context: e.object({
|
|
201
|
-
user:
|
|
211
|
+
user: P
|
|
202
212
|
})
|
|
203
|
-
}),
|
|
213
|
+
}), N = e.object({
|
|
204
214
|
ref: t,
|
|
205
215
|
originalName: e.string(),
|
|
206
216
|
mimeType: e.string(),
|
|
207
217
|
size: e.number(),
|
|
208
218
|
fbFilePath: e.string(),
|
|
209
219
|
isFbFileDeleted: e.boolean().nullish()
|
|
210
|
-
}),
|
|
220
|
+
}), Oe = e.object({
|
|
211
221
|
resetCollectionExpiryBalance: e.boolean().nullish()
|
|
212
|
-
}),
|
|
222
|
+
}), xe = l.extend({
|
|
213
223
|
type: e.literal(o.enum.MEMBER_IMPORTED),
|
|
214
224
|
context: e.object({
|
|
215
225
|
business: e.string(),
|
|
216
|
-
file:
|
|
217
|
-
config:
|
|
226
|
+
file: N,
|
|
227
|
+
config: Oe.optional()
|
|
218
228
|
})
|
|
219
|
-
}),
|
|
229
|
+
}), Pe = l.extend({
|
|
220
230
|
type: e.literal(o.enum.SEGMENTATION_IMPORTED),
|
|
221
231
|
context: e.object({
|
|
222
232
|
business: e.string(),
|
|
223
233
|
segment: e.string(),
|
|
224
|
-
file:
|
|
234
|
+
file: N
|
|
225
235
|
})
|
|
226
236
|
});
|
|
227
237
|
e.discriminatedUnion("type", [
|
|
228
|
-
Ee,
|
|
229
|
-
pe,
|
|
230
|
-
be,
|
|
231
|
-
ye,
|
|
232
|
-
Ce,
|
|
233
|
-
Re,
|
|
234
|
-
ge,
|
|
235
238
|
_e,
|
|
236
239
|
he,
|
|
237
|
-
|
|
240
|
+
fe,
|
|
241
|
+
De,
|
|
242
|
+
Ae,
|
|
243
|
+
Me,
|
|
244
|
+
Te,
|
|
245
|
+
Fe,
|
|
246
|
+
Le,
|
|
247
|
+
xe,
|
|
248
|
+
Pe
|
|
238
249
|
]);
|
|
239
|
-
const
|
|
250
|
+
const Se = {
|
|
240
251
|
collectionName: "Locations",
|
|
241
252
|
transform: {
|
|
242
253
|
_id: "oid",
|
|
243
254
|
business: "oid"
|
|
244
255
|
}
|
|
245
|
-
},
|
|
256
|
+
}, B = e.object({
|
|
246
257
|
_id: t,
|
|
247
258
|
business: t,
|
|
248
259
|
name: e.string(),
|
|
249
260
|
code: e.string().nullish(),
|
|
250
261
|
otp: e.string().nullish(),
|
|
251
262
|
otpExpiredAt: e.coerce.date().nullish(),
|
|
252
|
-
apiToken: e.string().nullish()
|
|
253
|
-
|
|
263
|
+
apiToken: e.string().nullish(),
|
|
264
|
+
customAttribute: e.record(e.any()).nullish()
|
|
265
|
+
}).describe(g.describe(Se));
|
|
254
266
|
e.object({
|
|
255
267
|
_id: t,
|
|
256
268
|
name: e.string(),
|
|
@@ -258,7 +270,7 @@ e.object({
|
|
|
258
270
|
os: e.string(),
|
|
259
271
|
apiToken: e.string().nullish()
|
|
260
272
|
}).describe(
|
|
261
|
-
|
|
273
|
+
g.describe({
|
|
262
274
|
collectionName: "LocationDevices",
|
|
263
275
|
transform: {
|
|
264
276
|
_id: "oid",
|
|
@@ -270,76 +282,177 @@ e.object({
|
|
|
270
282
|
_id: e.string(),
|
|
271
283
|
name: e.string()
|
|
272
284
|
});
|
|
273
|
-
const
|
|
274
|
-
type: e.literal(
|
|
285
|
+
const h = e.enum(["NO_REWARD", "VOUCHER", "LOYALTY"]), f = e.number().min(0, "Weight need to be at least 0"), F = e.number().int("Must be integer").min(0, "Threshold need to be at least 0"), G = e.object({
|
|
286
|
+
type: e.literal(h.enum.NO_REWARD),
|
|
275
287
|
collectible: e.null(),
|
|
276
|
-
weight:
|
|
277
|
-
}),
|
|
278
|
-
type: e.literal(
|
|
288
|
+
weight: f
|
|
289
|
+
}), U = e.object({
|
|
290
|
+
type: e.literal(h.enum.VOUCHER),
|
|
279
291
|
collectible: t,
|
|
280
|
-
collectibleConfig: e.lazy(() =>
|
|
281
|
-
earningOption: e.lazy(() =>
|
|
282
|
-
}),
|
|
283
|
-
type: e.literal(
|
|
292
|
+
collectibleConfig: e.lazy(() => L._def.right.options[0]),
|
|
293
|
+
earningOption: e.lazy(() => c)
|
|
294
|
+
}), y = e.object({
|
|
295
|
+
type: e.literal(h.enum.LOYALTY),
|
|
284
296
|
collectible: t,
|
|
285
|
-
earningOption: e.lazy(() =>
|
|
286
|
-
validityOption: e.lazy(() =>
|
|
287
|
-
}),
|
|
288
|
-
weight:
|
|
289
|
-
}),
|
|
297
|
+
earningOption: e.lazy(() => c),
|
|
298
|
+
validityOption: e.lazy(() => ee)
|
|
299
|
+
}), w = U.extend({
|
|
300
|
+
weight: f
|
|
301
|
+
}), v = y.extend({
|
|
290
302
|
weight: e.number().min(0, "Weight need to be at least 0")
|
|
291
|
-
}),
|
|
292
|
-
validityOption:
|
|
293
|
-
weight:
|
|
294
|
-
}),
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
]),
|
|
299
|
-
|
|
303
|
+
}), Qe = y.extend({
|
|
304
|
+
validityOption: O,
|
|
305
|
+
weight: f
|
|
306
|
+
}), je = e.discriminatedUnion("type", [
|
|
307
|
+
w,
|
|
308
|
+
v,
|
|
309
|
+
G
|
|
310
|
+
]), D = e.discriminatedUnion("type", [
|
|
311
|
+
w.extend({
|
|
300
312
|
collectible: t.nullish(),
|
|
301
313
|
business: t.nullish()
|
|
302
314
|
}),
|
|
303
|
-
|
|
315
|
+
v.extend({
|
|
304
316
|
collectible: t.nullish(),
|
|
305
317
|
business: t.nullish()
|
|
306
318
|
}),
|
|
307
|
-
|
|
308
|
-
]),
|
|
309
|
-
threshold:
|
|
310
|
-
}),
|
|
311
|
-
threshold:
|
|
312
|
-
}),
|
|
313
|
-
validityOption:
|
|
314
|
-
threshold:
|
|
315
|
-
}),
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
]),
|
|
319
|
-
|
|
319
|
+
G
|
|
320
|
+
]), z = U.extend({
|
|
321
|
+
threshold: F
|
|
322
|
+
}), H = y.extend({
|
|
323
|
+
threshold: F
|
|
324
|
+
}), $e = y.extend({
|
|
325
|
+
validityOption: O,
|
|
326
|
+
threshold: F
|
|
327
|
+
}), k = e.discriminatedUnion("type", [
|
|
328
|
+
z,
|
|
329
|
+
H
|
|
330
|
+
]), Ne = e.discriminatedUnion("type", [
|
|
331
|
+
z.extend({
|
|
320
332
|
collectible: t.nullish(),
|
|
321
333
|
business: t.nullish()
|
|
322
334
|
}),
|
|
323
|
-
|
|
335
|
+
H.extend({
|
|
324
336
|
collectible: t.nullish(),
|
|
325
|
-
collectibleConfig:
|
|
337
|
+
collectibleConfig: L.nullish(),
|
|
326
338
|
business: t.nullish()
|
|
327
339
|
})
|
|
328
|
-
]),
|
|
329
|
-
type:
|
|
340
|
+
]), Be = e.enum(["PROGRESSIVE", "STAMP"]), Ge = e.object({
|
|
341
|
+
type: Be,
|
|
330
342
|
end: e.number().int().min(0, "Threshold need to be at least 1"),
|
|
331
|
-
rewards: e.array(e.lazy(() =>
|
|
332
|
-
}).superRefine((
|
|
333
|
-
|
|
343
|
+
rewards: e.array(e.lazy(() => k)).nullish()
|
|
344
|
+
}).superRefine((i, d) => {
|
|
345
|
+
i.type == "STAMP" && i.end > 40 && (d.addIssue({
|
|
334
346
|
code: "custom",
|
|
335
347
|
path: [],
|
|
336
348
|
message: "Stamp mission can have at most 40 threshold"
|
|
337
|
-
}),
|
|
349
|
+
}), d.addIssue({
|
|
338
350
|
code: "custom",
|
|
339
351
|
path: ["end"],
|
|
340
352
|
message: "Stamp mission can have at most 40 threshold"
|
|
341
353
|
}));
|
|
342
|
-
}),
|
|
354
|
+
}), C = e.object({
|
|
355
|
+
totalCount: e.number().optional(),
|
|
356
|
+
totalCountPerUser: e.number().optional()
|
|
357
|
+
}), m = e.object({
|
|
358
|
+
periods: e.array(
|
|
359
|
+
e.object({
|
|
360
|
+
startTime: e.string(),
|
|
361
|
+
endTime: e.string()
|
|
362
|
+
})
|
|
363
|
+
)
|
|
364
|
+
}), R = e.object({
|
|
365
|
+
startTime: e.string(),
|
|
366
|
+
// ISO 8601 date string
|
|
367
|
+
endTime: e.string(),
|
|
368
|
+
// ISO 8601 date string
|
|
369
|
+
eaterType: e.enum(["all", "new", "existing"]),
|
|
370
|
+
minBasketAmount: e.number().optional(),
|
|
371
|
+
bundleQuantity: e.number().optional(),
|
|
372
|
+
workingHour: e.object({
|
|
373
|
+
mon: m.optional(),
|
|
374
|
+
tue: m.optional(),
|
|
375
|
+
wed: m.optional(),
|
|
376
|
+
thu: m.optional(),
|
|
377
|
+
fri: m.optional(),
|
|
378
|
+
sat: m.optional(),
|
|
379
|
+
sun: m.optional()
|
|
380
|
+
}).optional()
|
|
381
|
+
}), Ue = e.object({
|
|
382
|
+
type: e.enum(["items", "category", "order"]),
|
|
383
|
+
objectIDs: e.array(e.string()).optional()
|
|
384
|
+
}), I = e.object({
|
|
385
|
+
type: e.enum([
|
|
386
|
+
"net",
|
|
387
|
+
// dollar off
|
|
388
|
+
"percentage",
|
|
389
|
+
// percentage off
|
|
390
|
+
"bundleSameFixPrice",
|
|
391
|
+
// bundle fix price (same item)
|
|
392
|
+
"bundleDiffFixPrice",
|
|
393
|
+
// bundle fix price (different items)
|
|
394
|
+
"bundleSameNet",
|
|
395
|
+
// bundle dollar off (same item)
|
|
396
|
+
"bundleDiffNet",
|
|
397
|
+
// bundle dollar off (different items)
|
|
398
|
+
"bundleSamePercentage",
|
|
399
|
+
// bundle percentage off (same item)
|
|
400
|
+
"bundleDiffPercentage",
|
|
401
|
+
// bundle percentage off (different items)
|
|
402
|
+
"delivery",
|
|
403
|
+
// delivery fee off
|
|
404
|
+
"freeItem"
|
|
405
|
+
// free item
|
|
406
|
+
]),
|
|
407
|
+
value: e.number(),
|
|
408
|
+
cap: e.number().optional(),
|
|
409
|
+
// for percentage off campaigns
|
|
410
|
+
scope: Ue
|
|
411
|
+
});
|
|
412
|
+
e.object({
|
|
413
|
+
merchantID: e.string().optional(),
|
|
414
|
+
name: e.string().max(256),
|
|
415
|
+
quotas: C.optional(),
|
|
416
|
+
conditions: R,
|
|
417
|
+
discount: I,
|
|
418
|
+
customTag: e.string().max(22).optional()
|
|
419
|
+
});
|
|
420
|
+
e.object({
|
|
421
|
+
id: e.string()
|
|
422
|
+
});
|
|
423
|
+
e.object({
|
|
424
|
+
merchantID: e.string().optional(),
|
|
425
|
+
name: e.string().max(256).optional(),
|
|
426
|
+
quotas: C.optional(),
|
|
427
|
+
conditions: R.optional(),
|
|
428
|
+
discount: I.optional(),
|
|
429
|
+
customTag: e.string().max(22).optional()
|
|
430
|
+
});
|
|
431
|
+
const A = e.object({
|
|
432
|
+
id: e.string(),
|
|
433
|
+
merchantID: e.string(),
|
|
434
|
+
name: e.string(),
|
|
435
|
+
quotas: C.optional(),
|
|
436
|
+
conditions: R,
|
|
437
|
+
discount: I,
|
|
438
|
+
customTag: e.string().optional(),
|
|
439
|
+
status: e.enum(["ongoing", "upcoming", "expired", "cancelled"]).optional(),
|
|
440
|
+
createdAt: e.string().optional(),
|
|
441
|
+
updatedAt: e.string().optional()
|
|
442
|
+
});
|
|
443
|
+
e.object({
|
|
444
|
+
ongoing: e.array(A),
|
|
445
|
+
upcoming: e.array(A)
|
|
446
|
+
});
|
|
447
|
+
e.object({
|
|
448
|
+
merchantID: e.string()
|
|
449
|
+
});
|
|
450
|
+
e.object({
|
|
451
|
+
target: e.string(),
|
|
452
|
+
reason: e.string(),
|
|
453
|
+
message: e.string()
|
|
454
|
+
});
|
|
455
|
+
const we = {
|
|
343
456
|
collectionName: "Groups",
|
|
344
457
|
transform: {
|
|
345
458
|
_id: "oid",
|
|
@@ -357,33 +470,36 @@ const C = e.enum(["NO_REWARD", "VOUCHER", "LOYALTY"]), R = e.number().min(0, "We
|
|
|
357
470
|
foreignField: "group"
|
|
358
471
|
}
|
|
359
472
|
}
|
|
360
|
-
},
|
|
473
|
+
}, Xe = e.object({
|
|
361
474
|
_id: t,
|
|
362
475
|
name: e.string().min(1).max(300),
|
|
363
476
|
business: t,
|
|
364
477
|
pf_campaigns: e.array(e.any()).optional()
|
|
365
|
-
}).describe(
|
|
478
|
+
}).describe(g.describe(we)), ve = e.object({
|
|
366
479
|
from: e.string().email().nullish(),
|
|
367
480
|
name: e.string().min(1).max(50).nullish()
|
|
368
|
-
}),
|
|
481
|
+
}), ze = e.object({
|
|
369
482
|
_id: e.string(),
|
|
370
483
|
url: e.string(),
|
|
371
484
|
targetLocation: e.array(t).nullish(),
|
|
372
485
|
// null/empty = all locations
|
|
373
486
|
order: e.number().optional()
|
|
374
|
-
}),
|
|
375
|
-
type: e.literal(
|
|
487
|
+
}), W = e.object({
|
|
488
|
+
type: e.literal(M.enum.MEMBERSHIP),
|
|
376
489
|
business: t,
|
|
377
490
|
name: e.string().min(1).max(50),
|
|
378
491
|
image: e.string().nullish(),
|
|
379
492
|
url: e.string().nullish(),
|
|
380
|
-
tiers: e.array(e.lazy(() =>
|
|
493
|
+
tiers: e.array(e.lazy(() => oe)),
|
|
381
494
|
titles: e.array(t),
|
|
382
495
|
tierCycleEnable: e.boolean().optional(),
|
|
383
|
-
tierCycle: e.lazy(() =>
|
|
384
|
-
|
|
385
|
-
|
|
496
|
+
tierCycle: e.lazy(() => T).nullish(),
|
|
497
|
+
tierRules: e.array(e.lazy(() => ie)).nullish(),
|
|
498
|
+
migrated: e.boolean().optional(),
|
|
499
|
+
welcomeMessage: p.optional(),
|
|
500
|
+
advertisements: e.union([e.array(e.string()), e.array(ze)]).optional(),
|
|
386
501
|
cardEnable: e.boolean().optional(),
|
|
502
|
+
autoRevertReward: e.boolean().optional(),
|
|
387
503
|
design: e.array(
|
|
388
504
|
e.object({
|
|
389
505
|
_id: t,
|
|
@@ -392,18 +508,15 @@ const C = e.enum(["NO_REWARD", "VOUCHER", "LOYALTY"]), R = e.number().min(0, "We
|
|
|
392
508
|
).optional(),
|
|
393
509
|
targetLocation: e.array(t).nullish(),
|
|
394
510
|
brand: e.string().nullish(),
|
|
395
|
-
email:
|
|
511
|
+
email: ve.nullish(),
|
|
396
512
|
freeCreditAsDiscount: e.boolean().optional(),
|
|
397
|
-
pf_title: e.array(e.lazy(() =>
|
|
398
|
-
pf_targetLocation: e.array(e.lazy(() =>
|
|
399
|
-
allowedPhoneCountries: e.union([
|
|
400
|
-
e.array(e.string().regex(/^\+\d{1,4}$/)),
|
|
401
|
-
e.null()
|
|
402
|
-
]).optional(),
|
|
513
|
+
pf_title: e.array(e.lazy(() => u)).optional(),
|
|
514
|
+
pf_targetLocation: e.array(e.lazy(() => B)).optional(),
|
|
515
|
+
allowedPhoneCountries: e.union([e.array(e.string().regex(/^\+\d{1,4}$/)), e.null()]).optional(),
|
|
403
516
|
// new structure
|
|
404
517
|
group: e.string().nullish(),
|
|
405
518
|
templateId: t.nullish()
|
|
406
|
-
}), n =
|
|
519
|
+
}), n = M.exclude(["MEMBERSHIP"]), s = e.object({
|
|
407
520
|
_id: t.nullish(),
|
|
408
521
|
type: n,
|
|
409
522
|
// common information
|
|
@@ -411,8 +524,8 @@ const C = e.enum(["NO_REWARD", "VOUCHER", "LOYALTY"]), R = e.number().min(0, "We
|
|
|
411
524
|
name: e.string().min(1).max(50),
|
|
412
525
|
image: e.string().nullish(),
|
|
413
526
|
description: e.string().max(500).nullish(),
|
|
414
|
-
timeframeOptions:
|
|
415
|
-
|
|
527
|
+
timeframeOptions: x.superRefine((i, d) => {
|
|
528
|
+
i.start && i.end && i.end < i.start && d.addIssue({
|
|
416
529
|
code: "custom",
|
|
417
530
|
path: [],
|
|
418
531
|
params: {
|
|
@@ -421,13 +534,13 @@ const C = e.enum(["NO_REWARD", "VOUCHER", "LOYALTY"]), R = e.number().min(0, "We
|
|
|
421
534
|
});
|
|
422
535
|
}).nullish(),
|
|
423
536
|
targetLocation: e.array(t).nullish(),
|
|
424
|
-
event:
|
|
425
|
-
config:
|
|
537
|
+
event: Ie,
|
|
538
|
+
config: te.nullish(),
|
|
426
539
|
currentReceive: e.coerce.number().optional(),
|
|
427
540
|
// new group structure
|
|
428
541
|
group: t.nullish(),
|
|
429
542
|
templateId: t.nullish(),
|
|
430
|
-
pf_targetLocation: e.array(e.lazy(() =>
|
|
543
|
+
pf_targetLocation: e.array(e.lazy(() => B)).optional(),
|
|
431
544
|
deletedAt: e.coerce.date().optional()
|
|
432
545
|
}), r = {
|
|
433
546
|
[n.enum.VOUCHER]: [
|
|
@@ -439,6 +552,7 @@ const C = e.enum(["NO_REWARD", "VOUCHER", "LOYALTY"]), R = e.number().min(0, "We
|
|
|
439
552
|
"SIMPLE_CLAIM"
|
|
440
553
|
],
|
|
441
554
|
[n.enum.PROMOTION]: ["MAKING_ORDER"],
|
|
555
|
+
[n.enum.GRAB]: ["MAKING_ORDER"],
|
|
442
556
|
[n.enum.POINT]: [
|
|
443
557
|
"BILL_COMPLETED",
|
|
444
558
|
"FEEDBACK",
|
|
@@ -479,40 +593,40 @@ const C = e.enum(["NO_REWARD", "VOUCHER", "LOYALTY"]), R = e.number().min(0, "We
|
|
|
479
593
|
"FEEDBACK",
|
|
480
594
|
"SCHEDULE"
|
|
481
595
|
]
|
|
482
|
-
},
|
|
596
|
+
}, K = s.extend({
|
|
483
597
|
type: e.literal(n.enum.VOUCHER),
|
|
484
598
|
// event
|
|
485
599
|
code: e.string().min(0).max(15).regex(/^[A-Za-z0-9\-_.@]*$/, {
|
|
486
600
|
message: "Code can only contain letters, numbers, and - _ . @"
|
|
487
601
|
}).optional(),
|
|
488
|
-
event:
|
|
602
|
+
event: a.merge(
|
|
489
603
|
e.object({
|
|
490
604
|
type: e.enum(r[n.enum.VOUCHER])
|
|
491
605
|
})
|
|
492
606
|
),
|
|
493
|
-
earningOption:
|
|
607
|
+
earningOption: c.default({
|
|
494
608
|
amount: 1,
|
|
495
609
|
type: "FIXED"
|
|
496
610
|
}),
|
|
497
611
|
collectible: t,
|
|
498
612
|
hideInApp: e.boolean().optional(),
|
|
499
613
|
notify: e.boolean().optional(),
|
|
500
|
-
notifyMessage: e.lazy(() =>
|
|
614
|
+
notifyMessage: e.lazy(() => p).optional(),
|
|
501
615
|
notifyCampaign: t.nullish(),
|
|
502
|
-
pf_collectible: e.lazy(() =>
|
|
616
|
+
pf_collectible: e.lazy(() => u).optional(),
|
|
503
617
|
pf_notifyCampaign: e.lazy(() => E).optional()
|
|
504
|
-
}),
|
|
618
|
+
}), He = e.object({
|
|
505
619
|
gameType: e.string()
|
|
506
|
-
}),
|
|
620
|
+
}), V = s.extend({
|
|
507
621
|
type: e.literal(n.enum.PROMOTION),
|
|
508
622
|
// event
|
|
509
|
-
event:
|
|
623
|
+
event: a.merge(
|
|
510
624
|
e.object({
|
|
511
625
|
type: e.enum(r[n.enum.PROMOTION])
|
|
512
626
|
})
|
|
513
627
|
),
|
|
514
|
-
effect: e.custom().superRefine((
|
|
515
|
-
|
|
628
|
+
effect: e.custom().superRefine((i, d) => {
|
|
629
|
+
i || d.addIssue({
|
|
516
630
|
code: "custom",
|
|
517
631
|
path: [],
|
|
518
632
|
params: {
|
|
@@ -520,97 +634,143 @@ const C = e.enum(["NO_REWARD", "VOUCHER", "LOYALTY"]), R = e.number().min(0, "We
|
|
|
520
634
|
}
|
|
521
635
|
});
|
|
522
636
|
}),
|
|
523
|
-
gameConfig:
|
|
524
|
-
}),
|
|
637
|
+
gameConfig: He.nullish()
|
|
638
|
+
}), q = s.extend({
|
|
525
639
|
type: e.literal(n.enum.POINT),
|
|
526
640
|
// event
|
|
527
|
-
event:
|
|
641
|
+
event: a.merge(
|
|
528
642
|
e.object({
|
|
529
643
|
type: e.enum(r[n.enum.POINT])
|
|
530
644
|
})
|
|
531
645
|
),
|
|
532
|
-
earningOption:
|
|
646
|
+
earningOption: c,
|
|
533
647
|
collectible: t,
|
|
534
648
|
notify: e.boolean().optional(),
|
|
535
|
-
notifyMessage: e.lazy(() =>
|
|
649
|
+
notifyMessage: e.lazy(() => p).optional(),
|
|
536
650
|
notifyCampaign: t.nullish(),
|
|
537
|
-
pf_collectible: e.lazy(() =>
|
|
651
|
+
pf_collectible: e.lazy(() => u).optional(),
|
|
538
652
|
pf_notifyCampaign: e.lazy(() => E).optional()
|
|
539
|
-
}),
|
|
653
|
+
}), J = s.extend({
|
|
540
654
|
type: e.literal(n.enum.CREDIT),
|
|
541
655
|
// event
|
|
542
|
-
event:
|
|
656
|
+
event: a.merge(
|
|
543
657
|
e.object({
|
|
544
658
|
type: e.enum(r[n.enum.CREDIT])
|
|
545
659
|
})
|
|
546
660
|
),
|
|
547
|
-
earningOption:
|
|
661
|
+
earningOption: c,
|
|
548
662
|
collectible: t,
|
|
549
663
|
notify: e.boolean().optional(),
|
|
550
|
-
notifyMessage: e.lazy(() =>
|
|
664
|
+
notifyMessage: e.lazy(() => p).optional(),
|
|
551
665
|
notifyCampaign: t.nullish(),
|
|
552
|
-
pf_collectible: e.lazy(() =>
|
|
666
|
+
pf_collectible: e.lazy(() => u).optional(),
|
|
553
667
|
pf_notifyCampaign: e.lazy(() => E).optional()
|
|
554
668
|
}), E = s.extend({
|
|
555
669
|
type: e.literal(n.enum.BROADCAST),
|
|
556
670
|
// event
|
|
557
|
-
event:
|
|
671
|
+
event: a.merge(
|
|
558
672
|
e.object({
|
|
559
673
|
type: e.enum(r[n.enum.BROADCAST])
|
|
560
674
|
})
|
|
561
675
|
),
|
|
562
|
-
|
|
676
|
+
// Optional so a campaign can use only channels the legacy sender cannot
|
|
677
|
+
// route (App Inbox, Push). Campaigns with `delivery` take the multi-channel
|
|
678
|
+
// path, which never reads `message`; it is still mirrored when a routable
|
|
679
|
+
// channel exists (see toLegacyMessage) so an older reader degrades to
|
|
680
|
+
// sending one real message rather than nothing.
|
|
681
|
+
message: p.nullish(),
|
|
682
|
+
delivery: e.lazy(() => ae).nullish(),
|
|
563
683
|
linkedCampaign: t.nullish()
|
|
564
|
-
}),
|
|
684
|
+
}), Y = s.extend({
|
|
565
685
|
type: e.literal(n.enum.COIN),
|
|
566
686
|
// event
|
|
567
|
-
event:
|
|
687
|
+
event: a.merge(
|
|
568
688
|
e.object({
|
|
569
689
|
type: e.enum(r[n.enum.COIN])
|
|
570
690
|
})
|
|
571
691
|
),
|
|
572
|
-
earningOption:
|
|
692
|
+
earningOption: c,
|
|
573
693
|
collectible: t,
|
|
574
694
|
notify: e.boolean().optional(),
|
|
575
|
-
notifyMessage: e.lazy(() =>
|
|
695
|
+
notifyMessage: e.lazy(() => p).optional(),
|
|
576
696
|
notifyCampaign: t.nullish(),
|
|
577
|
-
pf_collectible: e.lazy(() =>
|
|
697
|
+
pf_collectible: e.lazy(() => u).optional(),
|
|
578
698
|
pf_notifyCampaign: e.lazy(() => E).optional()
|
|
579
|
-
}),
|
|
699
|
+
}), b = s.extend({
|
|
580
700
|
type: e.literal(n.enum.REWARD_POOL),
|
|
581
701
|
// event
|
|
582
|
-
event:
|
|
702
|
+
event: a.merge(
|
|
583
703
|
e.object({
|
|
584
704
|
type: e.enum(r[n.enum.REWARD_POOL])
|
|
585
705
|
})
|
|
586
706
|
),
|
|
587
|
-
rewards: e.array(e.lazy(() =>
|
|
588
|
-
}),
|
|
707
|
+
rewards: e.array(e.lazy(() => je)).min(1, "Requires at least 1 reward")
|
|
708
|
+
}), Z = s.extend({
|
|
589
709
|
type: e.literal(n.enum.GAME),
|
|
590
710
|
// event
|
|
591
|
-
event:
|
|
711
|
+
event: a.merge(
|
|
592
712
|
e.object({
|
|
593
713
|
type: e.enum(r[n.enum.GAME])
|
|
594
714
|
})
|
|
595
715
|
),
|
|
596
|
-
earningOption:
|
|
716
|
+
earningOption: c,
|
|
597
717
|
collectible: t,
|
|
598
|
-
game: e.lazy(() =>
|
|
599
|
-
pf_collectible: e.lazy(() =>
|
|
718
|
+
game: e.lazy(() => b).optional(),
|
|
719
|
+
pf_collectible: e.lazy(() => u).optional(),
|
|
600
720
|
rewardPool: t.optional()
|
|
601
|
-
}),
|
|
721
|
+
}), Q = s.extend({
|
|
602
722
|
type: e.literal(n.enum.MISSION),
|
|
603
|
-
event:
|
|
723
|
+
event: a.merge(
|
|
604
724
|
e.object({
|
|
605
725
|
type: e.enum(r[n.enum.MISSION])
|
|
606
726
|
})
|
|
607
727
|
),
|
|
608
|
-
earningOption:
|
|
728
|
+
earningOption: c,
|
|
609
729
|
collectible: t,
|
|
610
|
-
pf_collectible: e.lazy(() =>
|
|
611
|
-
mission: e.lazy(() =>
|
|
612
|
-
rewards: e.array(e.lazy(() =>
|
|
613
|
-
}),
|
|
730
|
+
pf_collectible: e.lazy(() => u).optional(),
|
|
731
|
+
mission: e.lazy(() => Ge),
|
|
732
|
+
rewards: e.array(e.lazy(() => k)).min(1, "Requires at least 1 reward")
|
|
733
|
+
}), $ = s.omit({
|
|
734
|
+
timeframeOptions: !0
|
|
735
|
+
}).extend({
|
|
736
|
+
type: e.literal(n.enum.GRAB),
|
|
737
|
+
event: a.merge(
|
|
738
|
+
e.object({
|
|
739
|
+
type: e.enum(r[n.enum.GRAB])
|
|
740
|
+
})
|
|
741
|
+
),
|
|
742
|
+
business: t,
|
|
743
|
+
name: e.string().min(1).max(50),
|
|
744
|
+
targetLocation: e.array(t).nullish(),
|
|
745
|
+
group: e.string().nullish(),
|
|
746
|
+
templateId: t.nullish(),
|
|
747
|
+
// Grab specific fields
|
|
748
|
+
conditions: R,
|
|
749
|
+
quotas: C,
|
|
750
|
+
discount: I,
|
|
751
|
+
grabCampaignMeta: e.array(
|
|
752
|
+
e.object({
|
|
753
|
+
locationId: e.string(),
|
|
754
|
+
campaignId: e.string()
|
|
755
|
+
})
|
|
756
|
+
).optional(),
|
|
757
|
+
// Make timeframeOptions required (remove .nullish() from parent)
|
|
758
|
+
timeframeOptions: x.superRefine((i, d) => {
|
|
759
|
+
(!i.start || !i.end) && d.addIssue({
|
|
760
|
+
code: "custom",
|
|
761
|
+
path: [],
|
|
762
|
+
params: {
|
|
763
|
+
i18n: { key: "timeframe.required" }
|
|
764
|
+
}
|
|
765
|
+
}), i.start && i.end && i.end < i.start && d.addIssue({
|
|
766
|
+
code: "custom",
|
|
767
|
+
path: [],
|
|
768
|
+
params: {
|
|
769
|
+
i18n: { key: "timeframe.end_before_start" }
|
|
770
|
+
}
|
|
771
|
+
});
|
|
772
|
+
})
|
|
773
|
+
}), ke = {
|
|
614
774
|
collectionName: "Campaigns",
|
|
615
775
|
transform: {
|
|
616
776
|
_id: "oid",
|
|
@@ -652,54 +812,58 @@ const C = e.enum(["NO_REWARD", "VOUCHER", "LOYALTY"]), R = e.number().min(0, "We
|
|
|
652
812
|
as: "game"
|
|
653
813
|
}
|
|
654
814
|
}
|
|
655
|
-
},
|
|
815
|
+
}, et = e.object({ _id: t }).and(
|
|
656
816
|
e.discriminatedUnion("type", [
|
|
657
|
-
U,
|
|
658
|
-
G,
|
|
659
|
-
w,
|
|
660
|
-
v,
|
|
661
|
-
z,
|
|
662
|
-
E,
|
|
663
|
-
H,
|
|
664
|
-
g,
|
|
665
817
|
W,
|
|
666
|
-
|
|
818
|
+
K,
|
|
819
|
+
V,
|
|
820
|
+
q,
|
|
821
|
+
J,
|
|
822
|
+
E,
|
|
823
|
+
Y,
|
|
824
|
+
b,
|
|
825
|
+
Z,
|
|
826
|
+
Q,
|
|
827
|
+
$
|
|
667
828
|
])
|
|
668
|
-
).describe(
|
|
669
|
-
|
|
829
|
+
).describe(g.describe(ke)), tt = e.discriminatedUnion("type", [
|
|
830
|
+
K.extend({
|
|
670
831
|
business: t.nullish()
|
|
671
832
|
}),
|
|
672
|
-
|
|
833
|
+
V.extend({
|
|
673
834
|
business: t.nullish()
|
|
674
835
|
}),
|
|
675
|
-
|
|
836
|
+
q.extend({
|
|
676
837
|
business: t.nullish()
|
|
677
838
|
}),
|
|
678
|
-
|
|
839
|
+
J.extend({
|
|
679
840
|
business: t.nullish()
|
|
680
841
|
}),
|
|
681
842
|
E.extend({
|
|
682
843
|
business: t.nullish()
|
|
683
844
|
}),
|
|
684
|
-
|
|
845
|
+
Y.extend({
|
|
685
846
|
business: t.nullish()
|
|
686
847
|
}),
|
|
687
|
-
|
|
688
|
-
rewards: e.array(e.lazy(() =>
|
|
848
|
+
b.extend({
|
|
849
|
+
rewards: e.array(e.lazy(() => D)).min(1, "Requires at least 1 reward")
|
|
689
850
|
}),
|
|
690
|
-
|
|
851
|
+
Z.extend({
|
|
691
852
|
business: t.nullish(),
|
|
692
|
-
game:
|
|
853
|
+
game: b.extend({
|
|
693
854
|
business: t.nullish(),
|
|
694
|
-
rewards: e.array(e.lazy(() =>
|
|
855
|
+
rewards: e.array(e.lazy(() => D)).min(1, "Requires at least 1 reward")
|
|
695
856
|
})
|
|
696
857
|
}),
|
|
697
|
-
|
|
858
|
+
Q.extend({
|
|
698
859
|
business: t.nullish(),
|
|
699
|
-
rewards: e.array(e.lazy(() =>
|
|
860
|
+
rewards: e.array(e.lazy(() => Ne)).min(1, "Requires at least 1 reward")
|
|
861
|
+
}),
|
|
862
|
+
$.extend({
|
|
863
|
+
business: t.nullish()
|
|
700
864
|
})
|
|
701
865
|
]);
|
|
702
|
-
|
|
866
|
+
W.pick({
|
|
703
867
|
business: !0,
|
|
704
868
|
name: !0,
|
|
705
869
|
image: !0,
|
|
@@ -707,7 +871,7 @@ U.pick({
|
|
|
707
871
|
tiers: !0,
|
|
708
872
|
// titles: true,
|
|
709
873
|
cardEnable: !0,
|
|
710
|
-
design:
|
|
874
|
+
// design: true,
|
|
711
875
|
targetLocation: !0,
|
|
712
876
|
brand: !0,
|
|
713
877
|
email: !0,
|
|
@@ -716,23 +880,23 @@ U.pick({
|
|
|
716
880
|
pf_title: !0,
|
|
717
881
|
pf_targetLocation: !0
|
|
718
882
|
}).extend({
|
|
719
|
-
allowedPhoneCountryDetails: e.array(
|
|
883
|
+
allowedPhoneCountryDetails: e.array(X).nullish()
|
|
720
884
|
});
|
|
721
885
|
export {
|
|
722
886
|
r as C,
|
|
723
887
|
n as F,
|
|
724
888
|
o as a,
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
889
|
+
et as b,
|
|
890
|
+
Ze as c,
|
|
891
|
+
Ie as d,
|
|
892
|
+
Xe as e,
|
|
893
|
+
tt as f,
|
|
894
|
+
Qe as g,
|
|
895
|
+
D as h,
|
|
896
|
+
Be as i,
|
|
897
|
+
$e as j,
|
|
898
|
+
Ne as k,
|
|
899
|
+
Ge as l,
|
|
900
|
+
W as m,
|
|
901
|
+
de as n
|
|
738
902
|
};
|