@feedmepos/mf-connect 0.1.126-prod → 0.1.127-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/dist/{App-DRHHPaMz.js → App-CLrxVFgX.js} +224 -216
- package/dist/AuditLogs-DYlfToAk.js +2016 -0
- package/dist/{Bin-FkcYLSTm.js → Bin-C0CugBW4.js} +8 -8
- package/dist/{Broadcast-Cgqp_BMa.js → Broadcast-DhVQa_WW.js} +22 -21
- package/dist/{CampaignAnalytic-kKZ_BwW0.js → CampaignAnalytic-6jeG5U90.js} +97 -97
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CX0mWLjO.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Cxydrkof.js} +9 -10
- package/dist/{Card-Bu1y37hV.js → Card-cpLj34Oy.js} +23 -23
- package/dist/{Collections-B3mJkBCT.js → Collections-CdRpJuHO.js} +197 -185
- package/dist/{Credit-Bn-2EcVy.js → Credit-E_N_yfnJ.js} +21 -20
- package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-Cz7pZ7LD.js → DateRangeChip.vue_vue_type_script_setup_true_lang-Dq-2vUqT.js} +1 -1
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-CSXO2bYC.js +4584 -0
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-B7XBiv4l.js → EffectSheet.vue_vue_type_style_index_0_lang-BeQZjLIw.js} +33 -33
- package/dist/{Experience-CunbmoAu.js → Experience-D9i0ax4C.js} +32 -31
- package/dist/{FileSaver.min-ChFSxYyS.js → FileSaver.min-BOE2RBne.js} +1 -1
- package/dist/{Game-dFDwx_UJ.js → Game-CirwX_l1.js} +19 -18
- package/dist/{GiftCardSetup-DYpEqqX0.js → GiftCardSetup-DpJb_azW.js} +31 -31
- package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-DxJdI6gc.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-ff6Nfvxe.js} +140 -128
- package/dist/{Goals-DuZzgM_K.js → Goals-TejbPs-I.js} +4 -4
- package/dist/Grab-CeUX-LlF.js +301 -0
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-lDulspkF.js → ImageInput.vue_vue_type_script_setup_true_lang-CnZzRDGS.js} +1 -1
- package/dist/{Index-BxB2ohT0.js → Index-gqWBDZBN.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-9sKJE1A5.js → LocationPicker.vue_vue_type_script_setup_true_lang-CzobgD7L.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CxBNYzcz.js → LottieAnimation.vue_vue_type_script_setup_true_lang-DgeD1RQq.js} +1 -1
- package/dist/{LoyaltyDashboard-DQzGvQ7j.js → LoyaltyDashboard-R22oQHTd.js} +82 -82
- package/dist/{MainLayout-MAZ1S06H.js → MainLayout-pJBEBaM-.js} +1 -1
- package/dist/{MainLayout.vue_vue_type_script_setup_true_lang-CeF3LU-N.js → MainLayout.vue_vue_type_script_setup_true_lang-IX_utv2Z.js} +3 -3
- package/dist/{Marketing-ACF6F7be.js → Marketing-5gMwO1jV.js} +4 -4
- package/dist/{MarketingMaterialEdit-B8NfkoHg.js → MarketingMaterialEdit-BaHNX_qE.js} +214 -211
- package/dist/{Member-rLxDUOr8.js → Member-Cd0oraEq.js} +7 -7
- package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-DzyM1fW_.js +1322 -0
- package/dist/{MemberImportHistory-BuG6DmdV.js → MemberImportHistory-C_RkY3fg.js} +7 -7
- package/dist/{MemberList-CC6zm_I6.js → MemberList-CJK1akUC.js} +103 -105
- package/dist/{MemberTransactions-Bw2xu6jZ.js → MemberTransactions-DP6schuy.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-Cav8gQUK.js → MessageInput.vue_vue_type_script_setup_true_lang-BaivunRx.js} +12 -12
- package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-8wdY4FnI.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-DOdYyPp2.js} +1 -1
- package/dist/{Mission-DnEcbALs.js → Mission-DJ40IcG9.js} +22 -21
- package/dist/{Overview-DShFohlk.js → Overview-CaQlLSBg.js} +145 -144
- package/dist/{Overview-COytI5xN.js → Overview-DXHjNmIO.js} +21 -21
- package/dist/{Point-CWYwlx0i.js → Point-D0Qqmgai.js} +22 -21
- package/dist/{Promotion-LBrQYtad.js → Promotion-CQU2-tpG.js} +137 -131
- package/dist/{Queue-DKg5EvDM.js → Queue-B-Uki3qh.js} +46 -46
- package/dist/{Record--lYpawLN.js → Record-BvQ0nVja.js} +9 -9
- package/dist/{Review-C4pNmJ7n.js → Review-DMfBPU_D.js} +2 -2
- package/dist/ReviewFacebookCallback-Bq6JQ7LR.js +225 -0
- package/dist/{ReviewGoogleCallback-ge8fL_A-.js → ReviewGoogleCallback-Bg9PFxog.js} +5 -5
- package/dist/{Reward-B67r1Bpz.js → Reward-CNC0z98e.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-Bt0Kx2--.js → RewardGroup.vue_vue_type_script_setup_true_lang-DXr-5wJE.js} +14 -14
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-OznhirAU.js +1923 -0
- package/dist/{Segment-DeSC3z5G.js → Segment-V0ZQJkN-.js} +304 -307
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-DdjC7X1V.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-BmFp2pst.js} +15 -15
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-Crys59UO.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-C0IbEZMG.js} +4 -4
- package/dist/{Setting-DiDcMU5E.js → Setting-DCb6IIrk.js} +17 -17
- package/dist/{SettingAdvertisements-3wMI9egH.js → SettingAdvertisements-Dc9XfzVl.js} +12 -12
- package/dist/Settings-BIjIfmFI.js +286 -0
- package/dist/{Store-DgefqByH.js → Store-DkoB_5IF.js} +29 -29
- package/dist/{StoreRewards-CS2h5RVB.js → StoreRewards-a4ujLMfY.js} +15 -15
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-gPR8sn4k.js → StoreTransactions.vue_vue_type_script_setup_true_lang-UbMY0RzG.js} +25 -25
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-BWjb1wHV.js +7007 -0
- package/dist/{Tier-Cye6888q.js → Tier-1WKuUirS.js} +2583 -688
- package/dist/{Title-B1eJh5oy.js → Title-CznZg4jL.js} +96 -95
- package/dist/{Transaction-ouzdsBUx.js → Transaction-DBRQDmA3.js} +2 -2
- package/dist/{Upselling-CdQd2Fuk.js → Upselling-CjZvUUqn.js} +3 -3
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BSlxe1Hf.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DS4hdSE9.js} +26 -26
- package/dist/{Voucher-CJJt8VlJ.js → Voucher-Di6VhoSM.js} +19 -19
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-BzbNaK6H.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BjSzCnBw.js} +12 -12
- package/dist/{WhatsappAccount-DIxSP6Tp.js → WhatsappAccount-DdXadlHI.js} +6 -6
- package/dist/{WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-L9Y5lAft.js → WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-Cnlvi-GG.js} +1 -1
- package/dist/WhatsappBot-DwhQmZLJ.js +882 -0
- package/dist/{WhatsappBotLogs-D8IfLHk3.js → WhatsappBotLogs-BAglKUAZ.js} +66 -66
- package/dist/WhatsappBotSettings-DslJTj2X.js +945 -0
- package/dist/{WhatsappLayout-3rWwmGRd.js → WhatsappLayout-14847AOz.js} +3 -3
- package/dist/{WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-C3N-loYJ.js → WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-otzgv6Jh.js} +3 -3
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-D1dORvMi.js → ZodTextField.vue_vue_type_script_setup_true_lang-BEY-LOVu.js} +2 -2
- package/dist/{app-BXqas0p1.js → app-KbxCI4gY.js} +4204 -3400
- package/dist/app.js +4 -3
- package/dist/{base.export-DQCZiS2E.js → base.export-DH8OxNrx.js} +2 -2
- package/dist/business-DuKNr9P7.js +83 -0
- package/dist/{campaign-C2X6aa7B.js → campaign-DR5xHhgA.js} +31 -25
- package/dist/{campaign-DASPASQ0.js → campaign-Ddv-RZgo.js} +121 -94
- package/dist/{campaign.enum-BqekIiiN.js → campaign.enum-DsaSpHDQ.js} +3 -2
- package/dist/campaign.fn-CJlEovlZ.js +776 -0
- package/dist/{collectible.enum-Liy2wH3s.js → collectible.enum-CDHT9uk3.js} +1 -1
- package/dist/{collection.fn-C7jNdh0A.js → collection.fn-DTZs-hUX.js} +2 -2
- package/dist/{currency-BvBM_Io9.js → currency-1-Yhpyv5.js} +1 -1
- package/dist/duplicateCampaign-BncSxYSg.js +51 -0
- package/dist/{effect-BA1yh6Mj.js → effect-TTD5--LN.js} +1 -1
- package/dist/{email-addresses-haS5P7hq.js → email-addresses-pxXp67Al.js} +2 -2
- package/dist/{feature-flag-B4bJnuei.js → feature-flag-CFVZl4ed.js} +84 -84
- package/dist/google-BQK68wbe.js +5 -0
- package/dist/{helper-BtTBvFuA.js → helper-BC_Cl5VR.js} +1 -1
- package/dist/{index-ChGZ_S3V.js → index-42Wl_5UE.js} +1 -1
- package/dist/{index-Dm2Dvxph.js → index-BRl7Besd.js} +23 -23
- package/dist/{index-DAtVp1NI.js → index-BxUMqeaY.js} +2700 -2614
- package/dist/{index-Dg972Dfv.js → index-ByFFDLTo.js} +1 -1
- package/dist/{index-DtbR7I4C.js → index-CBKbnJRo.js} +9 -9
- package/dist/index-CGtlXLTG.js +10767 -0
- package/dist/{index-CH-uRaZH.js → index-CRKdLbXL.js} +71 -52
- package/dist/{index-B1dAoOWi.js → index-CaHkqz0W.js} +19 -6
- package/dist/{index-DeomfIu9.js → index-CcXMYJxc.js} +609 -252
- package/dist/{index-B6A6sHpy.js → index-CkiP4iG6.js} +1 -1
- package/dist/{index-g_SHjVWE.js → index-D1iOPNg3.js} +1 -1
- package/dist/{index-D-D0s8PB.js → index-D2Nq0UoL.js} +381 -235
- package/dist/index-D4nA0Z7e.js +19528 -0
- package/dist/{index-BV-YiCDM.js → index-DHw8wo7T.js} +2 -2
- package/dist/{index-C2rjmdar.js → index-DKOoRHPf.js} +4 -4
- package/dist/{index-Q-iHraJ3.js → index-DcbPYZkw.js} +26 -19
- package/dist/{index-C7UBk5gq.js → index-DjwrfZk3.js} +35 -17
- package/dist/{index-BvFq5REc.js → index-EuZfRdBT.js} +10 -10
- package/dist/{index-CJ-BZCvB.js → index-H4XJDOoT.js} +1315 -1243
- package/dist/{index-CXznvd79.js → index-ImU7YXN7.js} +4 -4
- package/dist/{index-BRTy6G9c.js → index-N4EzkcEu.js} +2 -2
- package/dist/{index-CBfVFFME.js → index-j7eLKJK3.js} +198 -198
- package/dist/{index.esm2017-B7iE1Ggr.js → index.esm2017-CBo4j3U1.js} +93 -93
- package/dist/{loading-BvlSfSVK.js → loading-COAu2l7W.js} +1 -1
- package/dist/{lodash-Daey2k0N.js → lodash-Bu1ipIkR.js} +1 -1
- package/dist/{member-import-CF9aym_y.js → member-import-CkiTJIqy.js} +2 -2
- package/dist/{membership-DfG-fl80.js → membership-BSEeYyiz.js} +3 -3
- package/dist/{money-SBIQhxqf.js → money-BOaGQSGa.js} +1 -1
- package/dist/{number-Cp1bFK9U.js → number-B2AC2EMT.js} +1 -1
- package/dist/objectid-BKw48v5L.js +145 -0
- package/dist/{onboarding-bjc7C8O-.js → onboarding-ClA8xAnH.js} +25 -25
- package/dist/{onboardingSetup-BAu9TDI6.js → onboardingSetup-DHjnq0H1.js} +2 -2
- package/dist/{plugins-Def73Eyk.js → plugins-DewN43sP.js} +3 -3
- package/dist/{reward-KecVeztH.js → reward-deDdPQiR.js} +1 -1
- package/dist/{rule-kMIC0vOi.js → rule-B8ifutnO.js} +572 -492
- package/dist/style.css +1 -1
- package/dist/template-z3VMmWei.js +227 -0
- package/dist/timezone-BxJDy-bY.js +19 -0
- package/dist/{transaction.fn-Bjy5utxD.js → transaction.fn-CBBhq01K.js} +2 -2
- package/dist/{trigger-DnnOJVUi.js → trigger-B_quLwWr.js} +9 -9
- package/dist/{useMarketingMaterialActions-DMrNOpok.js → useMarketingMaterialActions-DqoRLx1M.js} +4 -4
- package/dist/{usePagination-BCY4a-dh.js → usePagination-Q1fPttcp.js} +1 -1
- package/dist/{user-BTc0S1Vx.js → user-Bw6h9xn-.js} +1 -1
- package/dist/vue-i18n-DpCS1FnK.js +2365 -0
- package/dist/{xlsx-DR5oLrEs.js → xlsx--toeD6hC.js} +1 -1
- package/dist/{zod-CMq39HWn.js → zod-BkNAcpay.js} +1 -1
- package/package.json +6 -2
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DIUEjCFW.js +0 -3638
- package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-Bq3UKX7v.js +0 -1308
- package/dist/ReviewFacebookCallback-BYXwKQNG.js +0 -238
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-fLtn32Rw.js +0 -1884
- package/dist/Settings-BR6Y1DBZ.js +0 -179
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-Cjnkpd1j.js +0 -142
- package/dist/WhatsappBot-BXxoaz7-.js +0 -878
- package/dist/WhatsappBotSettings-Bq9C7pNZ.js +0 -704
- package/dist/business-RsRhXSh8.js +0 -82
- package/dist/campaign.fn-BEX99lsa.js +0 -776
- package/dist/google-C3S8u0mT.js +0 -4
- package/dist/index-C_H8jFYf.js +0 -2743
- package/dist/index-D9zjHXFU.js +0 -27551
- package/dist/objectid-BMRA1fIL.js +0 -145
- package/dist/rule-builder-DgU6P24U.js +0 -102
- package/dist/template-BH9vS8A9.js +0 -275
- package/dist/timezone-CMX1sJ0a.js +0 -20
- package/dist/vue-i18n-7BKLPLxj.js +0 -2365
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { z as e } from "./index-
|
|
2
|
-
import { F as t, b as
|
|
3
|
-
import { F as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { c as
|
|
1
|
+
import { z as e } from "./index-CGtlXLTG.js";
|
|
2
|
+
import { F as t, b as _, m as g, d as X } from "./index-D4nA0Z7e.js";
|
|
3
|
+
import { F as M } from "./campaign.enum-DsaSpHDQ.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-BxUMqeaY.js";
|
|
5
|
+
import { o as P, m as S, n as ne, p as oe, q as ie } from "./index-H4XJDOoT.js";
|
|
6
|
+
import { c as p, f as ae } from "./index-j7eLKJK3.js";
|
|
7
7
|
e.object({
|
|
8
8
|
location: t,
|
|
9
9
|
memberId: t,
|
|
10
|
-
nettTotal:
|
|
10
|
+
nettTotal: _,
|
|
11
11
|
remark: e.string().optional()
|
|
12
12
|
});
|
|
13
|
-
const
|
|
13
|
+
const le = e.enum(["COUNTER", "POS"]);
|
|
14
14
|
e.object({
|
|
15
15
|
id: e.string(),
|
|
16
16
|
userId: e.string(),
|
|
@@ -21,9 +21,9 @@ e.object({
|
|
|
21
21
|
level: e.number().nullish(),
|
|
22
22
|
mostPurchasedItems: e.array(e.string()).nullish()
|
|
23
23
|
});
|
|
24
|
-
const
|
|
24
|
+
const se = {
|
|
25
25
|
collectionName: "Bills"
|
|
26
|
-
},
|
|
26
|
+
}, j = e.object({
|
|
27
27
|
_id: e.string(),
|
|
28
28
|
items: e.record(e.string(), e.number()).nullish(),
|
|
29
29
|
// business: z.string(),
|
|
@@ -32,8 +32,8 @@ const ee = {
|
|
|
32
32
|
user: e.string().nullish(),
|
|
33
33
|
memberid: e.string().nullish(),
|
|
34
34
|
// roundToNearest: z.number().nullish(),
|
|
35
|
-
nettTotal:
|
|
36
|
-
adjustedTotal:
|
|
35
|
+
nettTotal: _,
|
|
36
|
+
adjustedTotal: _.optional(),
|
|
37
37
|
// activeItems: z.array(z.string()),
|
|
38
38
|
remark: e.string().nullish(),
|
|
39
39
|
createdAt: e.coerce.date(),
|
|
@@ -41,18 +41,18 @@ const ee = {
|
|
|
41
41
|
refunded: e.boolean().nullish(),
|
|
42
42
|
refundRecord: e.array(e.string()).nullish(),
|
|
43
43
|
location: e.string(),
|
|
44
|
-
channel:
|
|
45
|
-
}).transform((
|
|
46
|
-
...
|
|
47
|
-
createdTime:
|
|
48
|
-
completedTime:
|
|
44
|
+
channel: le.optional()
|
|
45
|
+
}).transform((i) => ({
|
|
46
|
+
...i,
|
|
47
|
+
createdTime: i.createdAt,
|
|
48
|
+
completedTime: i.completedAt,
|
|
49
49
|
get amount() {
|
|
50
|
-
return
|
|
50
|
+
return i.nettTotal.amount / 10 ** i.nettTotal.precision;
|
|
51
51
|
},
|
|
52
52
|
get adjustmentAmount() {
|
|
53
|
-
return
|
|
53
|
+
return i.adjustedTotal ? i.adjustedTotal.amount / 10 ** i.adjustedTotal.precision : void 0;
|
|
54
54
|
}
|
|
55
|
-
})).describe(
|
|
55
|
+
})).describe(g.describe(se)), re = e.object({
|
|
56
56
|
_id: e.string(),
|
|
57
57
|
rating: e.coerce.number(),
|
|
58
58
|
user: e.string().optional(),
|
|
@@ -78,7 +78,7 @@ const ee = {
|
|
|
78
78
|
"REFERRAL_ADDED",
|
|
79
79
|
"MEMBER_IMPORTED",
|
|
80
80
|
"SEGMENTATION_IMPORTED"
|
|
81
|
-
]),
|
|
81
|
+
]), Ze = o.extract([
|
|
82
82
|
"BILL_COMPLETED",
|
|
83
83
|
"FEEDBACK",
|
|
84
84
|
"GAME_COMPLETED",
|
|
@@ -91,64 +91,64 @@ const ee = {
|
|
|
91
91
|
]);
|
|
92
92
|
e.enum(["START_OF", "BEFORE"]);
|
|
93
93
|
e.enum(["WEEK", "MONTH"]);
|
|
94
|
-
const
|
|
94
|
+
const de = e.enum([
|
|
95
95
|
"WAITING",
|
|
96
96
|
"ACTIVE",
|
|
97
97
|
"COMPLETED",
|
|
98
98
|
"FAILED"
|
|
99
|
-
]),
|
|
99
|
+
]), a = e.object({
|
|
100
100
|
// type: F_EVENT_TYPE,
|
|
101
|
-
rule:
|
|
102
|
-
}),
|
|
101
|
+
rule: T.optional()
|
|
102
|
+
}), ce = a.extend({
|
|
103
103
|
type: e.literal(o.enum.BILL_COMPLETED)
|
|
104
|
-
}),
|
|
104
|
+
}), me = a.extend({
|
|
105
105
|
type: e.literal(o.enum.FEEDBACK)
|
|
106
|
-
}),
|
|
106
|
+
}), ue = a.extend({
|
|
107
107
|
type: e.literal(o.enum.SIMPLE_CLAIM)
|
|
108
108
|
});
|
|
109
|
-
|
|
109
|
+
a.extend({
|
|
110
110
|
type: e.literal(o.enum.ENTER_SEGMENT),
|
|
111
111
|
segment: e.string()
|
|
112
112
|
});
|
|
113
|
-
const
|
|
113
|
+
const pe = a.extend({
|
|
114
114
|
type: e.literal(o.enum.MEMBER_REWARD)
|
|
115
|
-
}),
|
|
115
|
+
}), Ee = a.extend({
|
|
116
116
|
type: e.literal(o.enum.SCHEDULE)
|
|
117
117
|
// option: FdoCronRule,
|
|
118
|
-
}),
|
|
118
|
+
}), ge = a.extend({
|
|
119
119
|
type: e.literal(o.enum.MEMBERSHIP_JOINED)
|
|
120
|
-
}),
|
|
120
|
+
}), be = a.extend({
|
|
121
121
|
type: e.literal(o.enum.TIER_UPGRADED)
|
|
122
|
-
}),
|
|
122
|
+
}), ye = a.extend({
|
|
123
123
|
type: e.literal(o.enum.MAKING_ORDER)
|
|
124
|
-
}),
|
|
124
|
+
}), Ce = a.extend({
|
|
125
125
|
type: e.literal(o.enum.ISSUE_REWARD)
|
|
126
|
-
}),
|
|
126
|
+
}), Re = a.extend({
|
|
127
127
|
type: e.literal(o.enum.GAME_COMPLETED)
|
|
128
128
|
});
|
|
129
|
-
|
|
129
|
+
a.extend({
|
|
130
130
|
type: e.literal(o.enum.REFERRAL_ADDED)
|
|
131
131
|
});
|
|
132
|
-
|
|
132
|
+
a.extend({
|
|
133
133
|
type: e.literal(o.enum.MEMBER_IMPORTED)
|
|
134
134
|
});
|
|
135
|
-
const
|
|
136
|
-
|
|
137
|
-
oe,
|
|
138
|
-
se,
|
|
139
|
-
ie,
|
|
140
|
-
re,
|
|
141
|
-
de,
|
|
135
|
+
const Ie = e.discriminatedUnion("type", [
|
|
136
|
+
ue,
|
|
142
137
|
ce,
|
|
138
|
+
Ee,
|
|
143
139
|
me,
|
|
144
|
-
|
|
145
|
-
|
|
140
|
+
ge,
|
|
141
|
+
be,
|
|
142
|
+
ye,
|
|
143
|
+
Ce,
|
|
144
|
+
pe,
|
|
145
|
+
Re
|
|
146
146
|
]);
|
|
147
147
|
e.object({
|
|
148
148
|
_id: t,
|
|
149
149
|
type: o,
|
|
150
150
|
ref: e.string(),
|
|
151
|
-
status:
|
|
151
|
+
status: de.optional(),
|
|
152
152
|
context: e.record(e.string(), e.any()).optional(),
|
|
153
153
|
failedReason: e.any().optional()
|
|
154
154
|
}).describe(JSON.stringify({ collectionName: "EventLogs" }));
|
|
@@ -159,24 +159,24 @@ const l = e.object({
|
|
|
159
159
|
campaignIds: e.array(t).optional(),
|
|
160
160
|
slackWebhookUrl: e.string().optional(),
|
|
161
161
|
emittedAt: e.coerce.date().default(/* @__PURE__ */ new Date())
|
|
162
|
-
}),
|
|
162
|
+
}), _e = l.extend({
|
|
163
163
|
type: e.literal(o.enum.BILL_COMPLETED),
|
|
164
164
|
context: e.object({
|
|
165
|
-
bill:
|
|
165
|
+
bill: j,
|
|
166
166
|
rawBill: e.any()
|
|
167
167
|
})
|
|
168
|
-
}),
|
|
168
|
+
}), he = l.extend({
|
|
169
169
|
type: e.literal(o.enum.BILL_REFUNDED),
|
|
170
170
|
context: e.object({
|
|
171
|
-
bill:
|
|
171
|
+
bill: j,
|
|
172
172
|
rawBill: e.any()
|
|
173
173
|
})
|
|
174
|
-
}),
|
|
174
|
+
}), fe = l.extend({
|
|
175
175
|
type: e.literal(o.enum.SCHEDULE),
|
|
176
176
|
context: e.object({
|
|
177
177
|
triggeredAt: e.coerce.date()
|
|
178
178
|
})
|
|
179
|
-
}),
|
|
179
|
+
}), Fe = l.extend({
|
|
180
180
|
type: e.literal(o.enum.PAGINATE_SCHEDULE),
|
|
181
181
|
context: e.object({
|
|
182
182
|
triggeredAt: e.coerce.date(),
|
|
@@ -184,84 +184,85 @@ const l = e.object({
|
|
|
184
184
|
skip: e.coerce.number(),
|
|
185
185
|
limit: e.coerce.number()
|
|
186
186
|
})
|
|
187
|
-
}),
|
|
187
|
+
}), De = l.extend({
|
|
188
188
|
type: e.literal(o.enum.FEEDBACK),
|
|
189
189
|
context: e.object({
|
|
190
|
-
feedback:
|
|
190
|
+
feedback: re
|
|
191
191
|
})
|
|
192
|
-
}),
|
|
192
|
+
}), Ae = l.extend({
|
|
193
193
|
type: e.literal(o.enum.MEMBERSHIP_JOINED),
|
|
194
194
|
context: e.object({
|
|
195
|
-
user:
|
|
195
|
+
user: P
|
|
196
196
|
})
|
|
197
|
-
}),
|
|
197
|
+
}), Me = l.extend({
|
|
198
198
|
type: e.literal(o.enum.TIER_UPGRADED),
|
|
199
199
|
context: e.object({
|
|
200
|
-
transaction:
|
|
200
|
+
transaction: S
|
|
201
201
|
})
|
|
202
|
-
}),
|
|
202
|
+
}), Te = l.extend({
|
|
203
203
|
type: e.literal(o.enum.ISSUE_REWARD),
|
|
204
204
|
context: e.object({
|
|
205
|
-
transaction:
|
|
206
|
-
collection:
|
|
205
|
+
transaction: S,
|
|
206
|
+
collection: ne
|
|
207
207
|
})
|
|
208
|
-
}),
|
|
208
|
+
}), Le = l.extend({
|
|
209
209
|
type: e.literal(o.enum.REFERRAL_ADDED),
|
|
210
210
|
context: e.object({
|
|
211
|
-
user:
|
|
211
|
+
user: P
|
|
212
212
|
})
|
|
213
|
-
}),
|
|
213
|
+
}), N = e.object({
|
|
214
214
|
ref: t,
|
|
215
215
|
originalName: e.string(),
|
|
216
216
|
mimeType: e.string(),
|
|
217
217
|
size: e.number(),
|
|
218
218
|
fbFilePath: e.string(),
|
|
219
219
|
isFbFileDeleted: e.boolean().nullish()
|
|
220
|
-
}),
|
|
220
|
+
}), Oe = e.object({
|
|
221
221
|
resetCollectionExpiryBalance: e.boolean().nullish()
|
|
222
|
-
}),
|
|
222
|
+
}), xe = l.extend({
|
|
223
223
|
type: e.literal(o.enum.MEMBER_IMPORTED),
|
|
224
224
|
context: e.object({
|
|
225
225
|
business: e.string(),
|
|
226
|
-
file:
|
|
227
|
-
config:
|
|
226
|
+
file: N,
|
|
227
|
+
config: Oe.optional()
|
|
228
228
|
})
|
|
229
|
-
}),
|
|
229
|
+
}), Pe = l.extend({
|
|
230
230
|
type: e.literal(o.enum.SEGMENTATION_IMPORTED),
|
|
231
231
|
context: e.object({
|
|
232
232
|
business: e.string(),
|
|
233
233
|
segment: e.string(),
|
|
234
|
-
file:
|
|
234
|
+
file: N
|
|
235
235
|
})
|
|
236
236
|
});
|
|
237
237
|
e.discriminatedUnion("type", [
|
|
238
|
-
pe,
|
|
239
|
-
ge,
|
|
240
|
-
be,
|
|
241
|
-
Ce,
|
|
242
|
-
Re,
|
|
243
238
|
_e,
|
|
244
|
-
Ie,
|
|
245
|
-
ye,
|
|
246
239
|
he,
|
|
240
|
+
fe,
|
|
247
241
|
De,
|
|
248
|
-
|
|
242
|
+
Ae,
|
|
243
|
+
Me,
|
|
244
|
+
Te,
|
|
245
|
+
Fe,
|
|
246
|
+
Le,
|
|
247
|
+
xe,
|
|
248
|
+
Pe
|
|
249
249
|
]);
|
|
250
|
-
const
|
|
250
|
+
const Se = {
|
|
251
251
|
collectionName: "Locations",
|
|
252
252
|
transform: {
|
|
253
253
|
_id: "oid",
|
|
254
254
|
business: "oid"
|
|
255
255
|
}
|
|
256
|
-
},
|
|
256
|
+
}, B = e.object({
|
|
257
257
|
_id: t,
|
|
258
258
|
business: t,
|
|
259
259
|
name: e.string(),
|
|
260
260
|
code: e.string().nullish(),
|
|
261
261
|
otp: e.string().nullish(),
|
|
262
262
|
otpExpiredAt: e.coerce.date().nullish(),
|
|
263
|
-
apiToken: e.string().nullish()
|
|
264
|
-
|
|
263
|
+
apiToken: e.string().nullish(),
|
|
264
|
+
customAttribute: e.record(e.any()).nullish()
|
|
265
|
+
}).describe(g.describe(Se));
|
|
265
266
|
e.object({
|
|
266
267
|
_id: t,
|
|
267
268
|
name: e.string(),
|
|
@@ -269,7 +270,7 @@ e.object({
|
|
|
269
270
|
os: e.string(),
|
|
270
271
|
apiToken: e.string().nullish()
|
|
271
272
|
}).describe(
|
|
272
|
-
|
|
273
|
+
g.describe({
|
|
273
274
|
collectionName: "LocationDevices",
|
|
274
275
|
transform: {
|
|
275
276
|
_id: "oid",
|
|
@@ -281,76 +282,177 @@ e.object({
|
|
|
281
282
|
_id: e.string(),
|
|
282
283
|
name: e.string()
|
|
283
284
|
});
|
|
284
|
-
const
|
|
285
|
-
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),
|
|
286
287
|
collectible: e.null(),
|
|
287
|
-
weight:
|
|
288
|
-
}),
|
|
289
|
-
type: e.literal(
|
|
288
|
+
weight: f
|
|
289
|
+
}), U = e.object({
|
|
290
|
+
type: e.literal(h.enum.VOUCHER),
|
|
290
291
|
collectible: t,
|
|
291
|
-
collectibleConfig: e.lazy(() =>
|
|
292
|
-
earningOption: e.lazy(() =>
|
|
293
|
-
}),
|
|
294
|
-
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),
|
|
295
296
|
collectible: t,
|
|
296
|
-
earningOption: e.lazy(() =>
|
|
297
|
-
validityOption: e.lazy(() =>
|
|
298
|
-
}),
|
|
299
|
-
weight:
|
|
300
|
-
}),
|
|
297
|
+
earningOption: e.lazy(() => c),
|
|
298
|
+
validityOption: e.lazy(() => ee)
|
|
299
|
+
}), w = U.extend({
|
|
300
|
+
weight: f
|
|
301
|
+
}), v = y.extend({
|
|
301
302
|
weight: e.number().min(0, "Weight need to be at least 0")
|
|
302
|
-
}),
|
|
303
|
-
validityOption:
|
|
304
|
-
weight:
|
|
305
|
-
}),
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
]),
|
|
310
|
-
|
|
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({
|
|
311
312
|
collectible: t.nullish(),
|
|
312
313
|
business: t.nullish()
|
|
313
314
|
}),
|
|
314
|
-
|
|
315
|
+
v.extend({
|
|
315
316
|
collectible: t.nullish(),
|
|
316
317
|
business: t.nullish()
|
|
317
318
|
}),
|
|
318
|
-
|
|
319
|
-
]),
|
|
320
|
-
threshold:
|
|
321
|
-
}),
|
|
322
|
-
threshold:
|
|
323
|
-
}),
|
|
324
|
-
validityOption:
|
|
325
|
-
threshold:
|
|
326
|
-
}),
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
]),
|
|
330
|
-
|
|
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({
|
|
331
332
|
collectible: t.nullish(),
|
|
332
333
|
business: t.nullish()
|
|
333
334
|
}),
|
|
334
|
-
|
|
335
|
+
H.extend({
|
|
335
336
|
collectible: t.nullish(),
|
|
336
|
-
collectibleConfig:
|
|
337
|
+
collectibleConfig: L.nullish(),
|
|
337
338
|
business: t.nullish()
|
|
338
339
|
})
|
|
339
|
-
]),
|
|
340
|
-
type:
|
|
340
|
+
]), Be = e.enum(["PROGRESSIVE", "STAMP"]), Ge = e.object({
|
|
341
|
+
type: Be,
|
|
341
342
|
end: e.number().int().min(0, "Threshold need to be at least 1"),
|
|
342
|
-
rewards: e.array(e.lazy(() =>
|
|
343
|
-
}).superRefine((
|
|
344
|
-
|
|
343
|
+
rewards: e.array(e.lazy(() => k)).nullish()
|
|
344
|
+
}).superRefine((i, d) => {
|
|
345
|
+
i.type == "STAMP" && i.end > 40 && (d.addIssue({
|
|
345
346
|
code: "custom",
|
|
346
347
|
path: [],
|
|
347
348
|
message: "Stamp mission can have at most 40 threshold"
|
|
348
|
-
}),
|
|
349
|
+
}), d.addIssue({
|
|
349
350
|
code: "custom",
|
|
350
351
|
path: ["end"],
|
|
351
352
|
message: "Stamp mission can have at most 40 threshold"
|
|
352
353
|
}));
|
|
353
|
-
}),
|
|
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 = {
|
|
354
456
|
collectionName: "Groups",
|
|
355
457
|
transform: {
|
|
356
458
|
_id: "oid",
|
|
@@ -368,32 +470,34 @@ const C = e.enum(["NO_REWARD", "VOUCHER", "LOYALTY"]), R = e.number().min(0, "We
|
|
|
368
470
|
foreignField: "group"
|
|
369
471
|
}
|
|
370
472
|
}
|
|
371
|
-
},
|
|
473
|
+
}, Xe = e.object({
|
|
372
474
|
_id: t,
|
|
373
475
|
name: e.string().min(1).max(300),
|
|
374
476
|
business: t,
|
|
375
477
|
pf_campaigns: e.array(e.any()).optional()
|
|
376
|
-
}).describe(
|
|
478
|
+
}).describe(g.describe(we)), ve = e.object({
|
|
377
479
|
from: e.string().email().nullish(),
|
|
378
480
|
name: e.string().min(1).max(50).nullish()
|
|
379
|
-
}),
|
|
481
|
+
}), ze = e.object({
|
|
380
482
|
_id: e.string(),
|
|
381
483
|
url: e.string(),
|
|
382
484
|
targetLocation: e.array(t).nullish(),
|
|
383
485
|
// null/empty = all locations
|
|
384
486
|
order: e.number().optional()
|
|
385
|
-
}),
|
|
386
|
-
type: e.literal(
|
|
487
|
+
}), W = e.object({
|
|
488
|
+
type: e.literal(M.enum.MEMBERSHIP),
|
|
387
489
|
business: t,
|
|
388
490
|
name: e.string().min(1).max(50),
|
|
389
491
|
image: e.string().nullish(),
|
|
390
492
|
url: e.string().nullish(),
|
|
391
|
-
tiers: e.array(e.lazy(() =>
|
|
493
|
+
tiers: e.array(e.lazy(() => oe)),
|
|
392
494
|
titles: e.array(t),
|
|
393
495
|
tierCycleEnable: e.boolean().optional(),
|
|
394
|
-
tierCycle: e.lazy(() =>
|
|
395
|
-
|
|
396
|
-
|
|
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(),
|
|
397
501
|
cardEnable: e.boolean().optional(),
|
|
398
502
|
autoRevertReward: e.boolean().optional(),
|
|
399
503
|
design: e.array(
|
|
@@ -404,18 +508,15 @@ const C = e.enum(["NO_REWARD", "VOUCHER", "LOYALTY"]), R = e.number().min(0, "We
|
|
|
404
508
|
).optional(),
|
|
405
509
|
targetLocation: e.array(t).nullish(),
|
|
406
510
|
brand: e.string().nullish(),
|
|
407
|
-
email:
|
|
511
|
+
email: ve.nullish(),
|
|
408
512
|
freeCreditAsDiscount: e.boolean().optional(),
|
|
409
|
-
pf_title: e.array(e.lazy(() =>
|
|
410
|
-
pf_targetLocation: e.array(e.lazy(() =>
|
|
411
|
-
allowedPhoneCountries: e.union([
|
|
412
|
-
e.array(e.string().regex(/^\+\d{1,4}$/)),
|
|
413
|
-
e.null()
|
|
414
|
-
]).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(),
|
|
415
516
|
// new structure
|
|
416
517
|
group: e.string().nullish(),
|
|
417
518
|
templateId: t.nullish()
|
|
418
|
-
}), n =
|
|
519
|
+
}), n = M.exclude(["MEMBERSHIP"]), s = e.object({
|
|
419
520
|
_id: t.nullish(),
|
|
420
521
|
type: n,
|
|
421
522
|
// common information
|
|
@@ -423,8 +524,8 @@ const C = e.enum(["NO_REWARD", "VOUCHER", "LOYALTY"]), R = e.number().min(0, "We
|
|
|
423
524
|
name: e.string().min(1).max(50),
|
|
424
525
|
image: e.string().nullish(),
|
|
425
526
|
description: e.string().max(500).nullish(),
|
|
426
|
-
timeframeOptions:
|
|
427
|
-
|
|
527
|
+
timeframeOptions: x.superRefine((i, d) => {
|
|
528
|
+
i.start && i.end && i.end < i.start && d.addIssue({
|
|
428
529
|
code: "custom",
|
|
429
530
|
path: [],
|
|
430
531
|
params: {
|
|
@@ -433,13 +534,13 @@ const C = e.enum(["NO_REWARD", "VOUCHER", "LOYALTY"]), R = e.number().min(0, "We
|
|
|
433
534
|
});
|
|
434
535
|
}).nullish(),
|
|
435
536
|
targetLocation: e.array(t).nullish(),
|
|
436
|
-
event:
|
|
437
|
-
config:
|
|
537
|
+
event: Ie,
|
|
538
|
+
config: te.nullish(),
|
|
438
539
|
currentReceive: e.coerce.number().optional(),
|
|
439
540
|
// new group structure
|
|
440
541
|
group: t.nullish(),
|
|
441
542
|
templateId: t.nullish(),
|
|
442
|
-
pf_targetLocation: e.array(e.lazy(() =>
|
|
543
|
+
pf_targetLocation: e.array(e.lazy(() => B)).optional(),
|
|
443
544
|
deletedAt: e.coerce.date().optional()
|
|
444
545
|
}), r = {
|
|
445
546
|
[n.enum.VOUCHER]: [
|
|
@@ -451,6 +552,7 @@ const C = e.enum(["NO_REWARD", "VOUCHER", "LOYALTY"]), R = e.number().min(0, "We
|
|
|
451
552
|
"SIMPLE_CLAIM"
|
|
452
553
|
],
|
|
453
554
|
[n.enum.PROMOTION]: ["MAKING_ORDER"],
|
|
555
|
+
[n.enum.GRAB]: ["MAKING_ORDER"],
|
|
454
556
|
[n.enum.POINT]: [
|
|
455
557
|
"BILL_COMPLETED",
|
|
456
558
|
"FEEDBACK",
|
|
@@ -491,40 +593,40 @@ const C = e.enum(["NO_REWARD", "VOUCHER", "LOYALTY"]), R = e.number().min(0, "We
|
|
|
491
593
|
"FEEDBACK",
|
|
492
594
|
"SCHEDULE"
|
|
493
595
|
]
|
|
494
|
-
},
|
|
596
|
+
}, K = s.extend({
|
|
495
597
|
type: e.literal(n.enum.VOUCHER),
|
|
496
598
|
// event
|
|
497
599
|
code: e.string().min(0).max(15).regex(/^[A-Za-z0-9\-_.@]*$/, {
|
|
498
600
|
message: "Code can only contain letters, numbers, and - _ . @"
|
|
499
601
|
}).optional(),
|
|
500
|
-
event:
|
|
602
|
+
event: a.merge(
|
|
501
603
|
e.object({
|
|
502
604
|
type: e.enum(r[n.enum.VOUCHER])
|
|
503
605
|
})
|
|
504
606
|
),
|
|
505
|
-
earningOption:
|
|
607
|
+
earningOption: c.default({
|
|
506
608
|
amount: 1,
|
|
507
609
|
type: "FIXED"
|
|
508
610
|
}),
|
|
509
611
|
collectible: t,
|
|
510
612
|
hideInApp: e.boolean().optional(),
|
|
511
613
|
notify: e.boolean().optional(),
|
|
512
|
-
notifyMessage: e.lazy(() =>
|
|
614
|
+
notifyMessage: e.lazy(() => p).optional(),
|
|
513
615
|
notifyCampaign: t.nullish(),
|
|
514
|
-
pf_collectible: e.lazy(() =>
|
|
616
|
+
pf_collectible: e.lazy(() => u).optional(),
|
|
515
617
|
pf_notifyCampaign: e.lazy(() => E).optional()
|
|
516
|
-
}),
|
|
618
|
+
}), He = e.object({
|
|
517
619
|
gameType: e.string()
|
|
518
|
-
}),
|
|
620
|
+
}), V = s.extend({
|
|
519
621
|
type: e.literal(n.enum.PROMOTION),
|
|
520
622
|
// event
|
|
521
|
-
event:
|
|
623
|
+
event: a.merge(
|
|
522
624
|
e.object({
|
|
523
625
|
type: e.enum(r[n.enum.PROMOTION])
|
|
524
626
|
})
|
|
525
627
|
),
|
|
526
|
-
effect: e.custom().superRefine((
|
|
527
|
-
|
|
628
|
+
effect: e.custom().superRefine((i, d) => {
|
|
629
|
+
i || d.addIssue({
|
|
528
630
|
code: "custom",
|
|
529
631
|
path: [],
|
|
530
632
|
params: {
|
|
@@ -532,41 +634,41 @@ const C = e.enum(["NO_REWARD", "VOUCHER", "LOYALTY"]), R = e.number().min(0, "We
|
|
|
532
634
|
}
|
|
533
635
|
});
|
|
534
636
|
}),
|
|
535
|
-
gameConfig:
|
|
536
|
-
}),
|
|
637
|
+
gameConfig: He.nullish()
|
|
638
|
+
}), q = s.extend({
|
|
537
639
|
type: e.literal(n.enum.POINT),
|
|
538
640
|
// event
|
|
539
|
-
event:
|
|
641
|
+
event: a.merge(
|
|
540
642
|
e.object({
|
|
541
643
|
type: e.enum(r[n.enum.POINT])
|
|
542
644
|
})
|
|
543
645
|
),
|
|
544
|
-
earningOption:
|
|
646
|
+
earningOption: c,
|
|
545
647
|
collectible: t,
|
|
546
648
|
notify: e.boolean().optional(),
|
|
547
|
-
notifyMessage: e.lazy(() =>
|
|
649
|
+
notifyMessage: e.lazy(() => p).optional(),
|
|
548
650
|
notifyCampaign: t.nullish(),
|
|
549
|
-
pf_collectible: e.lazy(() =>
|
|
651
|
+
pf_collectible: e.lazy(() => u).optional(),
|
|
550
652
|
pf_notifyCampaign: e.lazy(() => E).optional()
|
|
551
|
-
}),
|
|
653
|
+
}), J = s.extend({
|
|
552
654
|
type: e.literal(n.enum.CREDIT),
|
|
553
655
|
// event
|
|
554
|
-
event:
|
|
656
|
+
event: a.merge(
|
|
555
657
|
e.object({
|
|
556
658
|
type: e.enum(r[n.enum.CREDIT])
|
|
557
659
|
})
|
|
558
660
|
),
|
|
559
|
-
earningOption:
|
|
661
|
+
earningOption: c,
|
|
560
662
|
collectible: t,
|
|
561
663
|
notify: e.boolean().optional(),
|
|
562
|
-
notifyMessage: e.lazy(() =>
|
|
664
|
+
notifyMessage: e.lazy(() => p).optional(),
|
|
563
665
|
notifyCampaign: t.nullish(),
|
|
564
|
-
pf_collectible: e.lazy(() =>
|
|
666
|
+
pf_collectible: e.lazy(() => u).optional(),
|
|
565
667
|
pf_notifyCampaign: e.lazy(() => E).optional()
|
|
566
668
|
}), E = s.extend({
|
|
567
669
|
type: e.literal(n.enum.BROADCAST),
|
|
568
670
|
// event
|
|
569
|
-
event:
|
|
671
|
+
event: a.merge(
|
|
570
672
|
e.object({
|
|
571
673
|
type: e.enum(r[n.enum.BROADCAST])
|
|
572
674
|
})
|
|
@@ -576,59 +678,99 @@ const C = e.enum(["NO_REWARD", "VOUCHER", "LOYALTY"]), R = e.number().min(0, "We
|
|
|
576
678
|
// path, which never reads `message`; it is still mirrored when a routable
|
|
577
679
|
// channel exists (see toLegacyMessage) so an older reader degrades to
|
|
578
680
|
// sending one real message rather than nothing.
|
|
579
|
-
message:
|
|
580
|
-
delivery: e.lazy(() =>
|
|
681
|
+
message: p.nullish(),
|
|
682
|
+
delivery: e.lazy(() => ae).nullish(),
|
|
581
683
|
linkedCampaign: t.nullish()
|
|
582
|
-
}),
|
|
684
|
+
}), Y = s.extend({
|
|
583
685
|
type: e.literal(n.enum.COIN),
|
|
584
686
|
// event
|
|
585
|
-
event:
|
|
687
|
+
event: a.merge(
|
|
586
688
|
e.object({
|
|
587
689
|
type: e.enum(r[n.enum.COIN])
|
|
588
690
|
})
|
|
589
691
|
),
|
|
590
|
-
earningOption:
|
|
692
|
+
earningOption: c,
|
|
591
693
|
collectible: t,
|
|
592
694
|
notify: e.boolean().optional(),
|
|
593
|
-
notifyMessage: e.lazy(() =>
|
|
695
|
+
notifyMessage: e.lazy(() => p).optional(),
|
|
594
696
|
notifyCampaign: t.nullish(),
|
|
595
|
-
pf_collectible: e.lazy(() =>
|
|
697
|
+
pf_collectible: e.lazy(() => u).optional(),
|
|
596
698
|
pf_notifyCampaign: e.lazy(() => E).optional()
|
|
597
|
-
}),
|
|
699
|
+
}), b = s.extend({
|
|
598
700
|
type: e.literal(n.enum.REWARD_POOL),
|
|
599
701
|
// event
|
|
600
|
-
event:
|
|
702
|
+
event: a.merge(
|
|
601
703
|
e.object({
|
|
602
704
|
type: e.enum(r[n.enum.REWARD_POOL])
|
|
603
705
|
})
|
|
604
706
|
),
|
|
605
|
-
rewards: e.array(e.lazy(() =>
|
|
606
|
-
}),
|
|
707
|
+
rewards: e.array(e.lazy(() => je)).min(1, "Requires at least 1 reward")
|
|
708
|
+
}), Z = s.extend({
|
|
607
709
|
type: e.literal(n.enum.GAME),
|
|
608
710
|
// event
|
|
609
|
-
event:
|
|
711
|
+
event: a.merge(
|
|
610
712
|
e.object({
|
|
611
713
|
type: e.enum(r[n.enum.GAME])
|
|
612
714
|
})
|
|
613
715
|
),
|
|
614
|
-
earningOption:
|
|
716
|
+
earningOption: c,
|
|
615
717
|
collectible: t,
|
|
616
|
-
game: e.lazy(() =>
|
|
617
|
-
pf_collectible: e.lazy(() =>
|
|
718
|
+
game: e.lazy(() => b).optional(),
|
|
719
|
+
pf_collectible: e.lazy(() => u).optional(),
|
|
618
720
|
rewardPool: t.optional()
|
|
619
|
-
}),
|
|
721
|
+
}), Q = s.extend({
|
|
620
722
|
type: e.literal(n.enum.MISSION),
|
|
621
|
-
event:
|
|
723
|
+
event: a.merge(
|
|
622
724
|
e.object({
|
|
623
725
|
type: e.enum(r[n.enum.MISSION])
|
|
624
726
|
})
|
|
625
727
|
),
|
|
626
|
-
earningOption:
|
|
728
|
+
earningOption: c,
|
|
627
729
|
collectible: t,
|
|
628
|
-
pf_collectible: e.lazy(() =>
|
|
629
|
-
mission: e.lazy(() =>
|
|
630
|
-
rewards: e.array(e.lazy(() =>
|
|
631
|
-
}),
|
|
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 = {
|
|
632
774
|
collectionName: "Campaigns",
|
|
633
775
|
transform: {
|
|
634
776
|
_id: "oid",
|
|
@@ -670,54 +812,58 @@ const C = e.enum(["NO_REWARD", "VOUCHER", "LOYALTY"]), R = e.number().min(0, "We
|
|
|
670
812
|
as: "game"
|
|
671
813
|
}
|
|
672
814
|
}
|
|
673
|
-
},
|
|
815
|
+
}, et = e.object({ _id: t }).and(
|
|
674
816
|
e.discriminatedUnion("type", [
|
|
675
|
-
G,
|
|
676
|
-
w,
|
|
677
|
-
v,
|
|
678
|
-
z,
|
|
679
|
-
H,
|
|
680
|
-
E,
|
|
681
817
|
W,
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
818
|
+
K,
|
|
819
|
+
V,
|
|
820
|
+
q,
|
|
821
|
+
J,
|
|
822
|
+
E,
|
|
823
|
+
Y,
|
|
824
|
+
b,
|
|
825
|
+
Z,
|
|
826
|
+
Q,
|
|
827
|
+
$
|
|
685
828
|
])
|
|
686
|
-
).describe(
|
|
687
|
-
|
|
829
|
+
).describe(g.describe(ke)), tt = e.discriminatedUnion("type", [
|
|
830
|
+
K.extend({
|
|
688
831
|
business: t.nullish()
|
|
689
832
|
}),
|
|
690
|
-
|
|
833
|
+
V.extend({
|
|
691
834
|
business: t.nullish()
|
|
692
835
|
}),
|
|
693
|
-
|
|
836
|
+
q.extend({
|
|
694
837
|
business: t.nullish()
|
|
695
838
|
}),
|
|
696
|
-
|
|
839
|
+
J.extend({
|
|
697
840
|
business: t.nullish()
|
|
698
841
|
}),
|
|
699
842
|
E.extend({
|
|
700
843
|
business: t.nullish()
|
|
701
844
|
}),
|
|
702
|
-
|
|
845
|
+
Y.extend({
|
|
703
846
|
business: t.nullish()
|
|
704
847
|
}),
|
|
705
|
-
|
|
706
|
-
rewards: e.array(e.lazy(() =>
|
|
848
|
+
b.extend({
|
|
849
|
+
rewards: e.array(e.lazy(() => D)).min(1, "Requires at least 1 reward")
|
|
707
850
|
}),
|
|
708
|
-
|
|
851
|
+
Z.extend({
|
|
709
852
|
business: t.nullish(),
|
|
710
|
-
game:
|
|
853
|
+
game: b.extend({
|
|
711
854
|
business: t.nullish(),
|
|
712
|
-
rewards: e.array(e.lazy(() =>
|
|
855
|
+
rewards: e.array(e.lazy(() => D)).min(1, "Requires at least 1 reward")
|
|
713
856
|
})
|
|
714
857
|
}),
|
|
715
|
-
|
|
858
|
+
Q.extend({
|
|
716
859
|
business: t.nullish(),
|
|
717
|
-
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()
|
|
718
864
|
})
|
|
719
865
|
]);
|
|
720
|
-
|
|
866
|
+
W.pick({
|
|
721
867
|
business: !0,
|
|
722
868
|
name: !0,
|
|
723
869
|
image: !0,
|
|
@@ -725,7 +871,7 @@ G.pick({
|
|
|
725
871
|
tiers: !0,
|
|
726
872
|
// titles: true,
|
|
727
873
|
cardEnable: !0,
|
|
728
|
-
design:
|
|
874
|
+
// design: true,
|
|
729
875
|
targetLocation: !0,
|
|
730
876
|
brand: !0,
|
|
731
877
|
email: !0,
|
|
@@ -734,23 +880,23 @@ G.pick({
|
|
|
734
880
|
pf_title: !0,
|
|
735
881
|
pf_targetLocation: !0
|
|
736
882
|
}).extend({
|
|
737
|
-
allowedPhoneCountryDetails: e.array(
|
|
883
|
+
allowedPhoneCountryDetails: e.array(X).nullish()
|
|
738
884
|
});
|
|
739
885
|
export {
|
|
740
886
|
r as C,
|
|
741
887
|
n as F,
|
|
742
888
|
o as a,
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
889
|
+
et as b,
|
|
890
|
+
Ie as c,
|
|
891
|
+
Xe as d,
|
|
892
|
+
tt as e,
|
|
893
|
+
Qe as f,
|
|
894
|
+
D as g,
|
|
895
|
+
Be as h,
|
|
896
|
+
$e as i,
|
|
897
|
+
Ne as j,
|
|
898
|
+
Ge as k,
|
|
899
|
+
Ze as l,
|
|
900
|
+
W as m,
|
|
901
|
+
de as n
|
|
756
902
|
};
|