@feedmepos/mf-connect 0.1.115-prod → 0.1.117-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 +64 -1
- package/dist/{App-CvtSY8ZO.js → App-BpcsgH7K.js} +444 -427
- package/dist/AuditLogs-BNnUiVnD.js +2016 -0
- package/dist/{Bin-B3gS9QVZ.js → Bin-Cm0wjQeR.js} +8 -8
- package/dist/{Broadcast-DAeb-HaN.js → Broadcast-BoJaHqnO.js} +22 -21
- package/dist/{CampaignAnalytic-BfTaHVem.js → CampaignAnalytic-Eg4xZW0B.js} +7 -7
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-zsei4OfG.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BXylK6Ze.js} +9 -9
- package/dist/{Card-JFeVIwFs.js → Card-BfkMcFaG.js} +25 -24
- package/dist/{Collections-xcDpEhIm.js → Collections-RXmxQbII.js} +197 -185
- package/dist/{Credit-C9HJZjDS.js → Credit-CsRPM1jv.js} +21 -20
- package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-DSqVY91w.js → DateRangeChip.vue_vue_type_script_setup_true_lang-D2tvK7pw.js} +1 -1
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-BgPeHurN.js +4442 -0
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-C3J0rCTt.js → EffectSheet.vue_vue_type_style_index_0_lang-CUx8UIIq.js} +32 -32
- package/dist/{Experience-DszS8gto.js → Experience-BC8Pj-v9.js} +32 -31
- package/dist/{FileSaver.min-CFVQKaC-.js → FileSaver.min-DzmoQFA0.js} +1 -1
- package/dist/{Game-DhgeN7E2.js → Game-DJXNHFBs.js} +19 -18
- package/dist/{GiftCardSetup-CWm6IhrS.js → GiftCardSetup-_0n8lU-t.js} +75 -75
- package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-BuKADvmK.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-C-AiJdui.js} +7 -7
- package/dist/{Goals-DtRVierH.js → Goals-DSZwKpds.js} +4 -4
- package/dist/Grab-DDc7e-AC.js +301 -0
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-DlEFyu6h.js → ImageInput.vue_vue_type_script_setup_true_lang-BZb-H4fM.js} +1 -1
- package/dist/{Index-DFRcu_qE.js → Index-Cbi0bquE.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-B3Br4Xvi.js → LocationPicker.vue_vue_type_script_setup_true_lang-GLhMtvzi.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CjNJj3qj.js → LottieAnimation.vue_vue_type_script_setup_true_lang-Bt9CO_QR.js} +1 -1
- package/dist/{LoyaltyDashboard-BWHKDPzk.js → LoyaltyDashboard-fK90c27A.js} +15 -15
- package/dist/MainLayout-Bf-l9yL4.js +4 -0
- package/dist/{MainLayout-BmpNNAiE.js → MainLayout.vue_vue_type_script_setup_true_lang-COR6YYYI.js} +5 -4
- package/dist/Marketing-B7cZGsO-.js +269 -0
- package/dist/MarketingMaterialEdit-5IcV2ct6.js +1037 -0
- package/dist/{Member-xEzrBW_p.js → Member-BGTrRVdq.js} +7 -7
- package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-DRoC-I0t.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-DJr2hV2W.js} +43 -50
- package/dist/{MemberImportHistory-CEQpBBF8.js → MemberImportHistory--FxkTJmu.js} +7 -7
- package/dist/{MemberList-CCvzkHv8.js → MemberList-EjY5dgwt.js} +103 -105
- package/dist/{MemberTransactions-Bmh39J2W.js → MemberTransactions-Oia7LIFK.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-D3Pmk80l.js → MessageInput.vue_vue_type_script_setup_true_lang-CLOQZCYy.js} +14 -14
- package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-DIBKAwHP.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-Ev3bB8cg.js} +1 -1
- package/dist/{Mission-CpUo2Bgw.js → Mission-BFHYb4aT.js} +22 -21
- package/dist/{Overview-DcDZmDXA.js → Overview-BVNyQxFL.js} +23 -22
- package/dist/{Overview-CwQqQ1Tn.js → Overview-d5U37aot.js} +145 -144
- package/dist/{Point-CUNQsQIx.js → Point-CXkqH02Z.js} +22 -21
- package/dist/{Promotion-Cqdim7aW.js → Promotion-DdxNvlOO.js} +137 -131
- package/dist/{Queue-CNBVh1UG.js → Queue-C96oNKyP.js} +46 -45
- package/dist/{Record-BYwz4l4o.js → Record-Bj2e2Y4i.js} +9 -9
- package/dist/{Review-CqLcZFj8.js → Review-CJK5S1oI.js} +2 -2
- package/dist/ReviewFacebookCallback-ChG7TRy5.js +225 -0
- package/dist/{ReviewGoogleCallback-Dg8R7QlO.js → ReviewGoogleCallback-Dmk4VyGA.js} +5 -5
- package/dist/{Reward-M8GZ8eHq.js → Reward-Dh2YI0Xb.js} +29 -29
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-BkM9-Sx-.js → RewardGroup.vue_vue_type_script_setup_true_lang-U47m3AAn.js} +16 -15
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-2L6ZGMW7.js +1923 -0
- package/dist/{Segment-CrMi6xrp.js → Segment-FYvtCkqH.js} +304 -305
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-DKH5_9db.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DPZZz2e0.js} +31 -30
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-CyeAQ-hg.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-D8wBgLlS.js} +4 -4
- package/dist/Setting-CUAWjCqa.js +574 -0
- package/dist/{SettingAdvertisements-Dh7v4c1D.js → SettingAdvertisements-COIQwUD6.js} +12 -12
- package/dist/Settings-D2gFPvmW.js +286 -0
- package/dist/{Store-CV-BmK5b.js → Store-BAXwiyvx.js} +31 -30
- package/dist/{StoreRewards-DPhSLvSZ.js → StoreRewards-2mUavtUg.js} +15 -15
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-5g3yIL1a.js +1319 -0
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-DHi4rdT1.js +7007 -0
- package/dist/{Tier-ChvYps23.js → Tier-BmAOzRHL.js} +2576 -687
- package/dist/{Title-v-Ivswr1.js → Title-DMxiUg30.js} +94 -92
- package/dist/{Transaction-CRqE1Ix0.js → Transaction-CF6hXEpN.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-B0Uh9iuj.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BON_t0dL.js} +26 -26
- package/dist/{Voucher-Bg8FOuzD.js → Voucher-DrtITxq-.js} +19 -19
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-HKxivQMF.js → VoucherEditor.vue_vue_type_script_setup_true_lang-1DZOzJKx.js} +16 -16
- package/dist/WhatsappAccount-Bb0Y7ikk.js +159 -0
- package/dist/WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-CPlyzkp4.js +39 -0
- package/dist/WhatsappBot-DNvvaPey.js +876 -0
- package/dist/WhatsappBotLogs-C8M-1pvv.js +372 -0
- package/dist/WhatsappBotSettings-D6egqUyU.js +705 -0
- package/dist/WhatsappLayout-DeQTPuF6.js +21 -0
- package/dist/WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-DI0pcHcE.js +253 -0
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-8d290Dcp.js → ZodTextField.vue_vue_type_script_setup_true_lang-CKZscSjU.js} +2 -2
- package/dist/{app-DdNKsn2Q.js → app-BjdLqYQq.js} +8879 -7107
- package/dist/app.js +4 -3
- package/dist/{base.export-R97FrSQL.js → base.export-B68z5BF6.js} +2 -2
- package/dist/browser-BSAOEeIM.js +1478 -0
- package/dist/{business-Ce8vq3wQ.js → business-D9fgkHxb.js} +1 -1
- package/dist/{campaign-C19If7bW.js → campaign-Dw_ujovr.js} +121 -94
- package/dist/{campaign-BTllt2LH.js → campaign-eMaPX8r6.js} +31 -25
- package/dist/{campaign.enum-9CCbalR4.js → campaign.enum-Dx-Zo68Q.js} +3 -2
- package/dist/{campaign.fn-B4g03h0A.js → campaign.fn-DFjGNvmN.js} +78 -78
- package/dist/{collectible.enum-MvqF7mSg.js → collectible.enum-Liy2wH3s.js} +1 -1
- package/dist/{collection.fn-CR0bD33S.js → collection.fn-CCOWtB-c.js} +2 -2
- package/dist/{currency-DmlguGIM.js → currency-CTLKReFC.js} +1 -1
- package/dist/duplicateCampaign-BcpBfUGL.js +51 -0
- package/dist/{effect-Dx3zfl28.js → effect-CTI1ZH57.js} +1 -1
- package/dist/{email-addresses-De5PGOY4.js → email-addresses-B74e3bnB.js} +2 -2
- package/dist/{feature-flag-CD9V1V0h.js → feature-flag-DVdEaChJ.js} +182 -166
- package/dist/google-BQK68wbe.js +5 -0
- package/dist/{helper-CEiv7SaO.js → helper-as9K-piK.js} +1 -1
- package/dist/{index-CBJy9bxB.js → index-3LjKJhQa.js} +1 -1
- package/dist/{index-BW6eb3n6.js → index-8mBfDn3M.js} +611 -252
- package/dist/{index-D4d3l0gw.js → index-B0h0iYWP.js} +8 -7
- package/dist/{index-BAXKd9Gg.js → index-BEKMTiFb.js} +198 -198
- package/dist/{index-B8yWVB8P.js → index-BW7FoVEA.js} +4 -3
- package/dist/{index-BVdYxi3l.js → index-B_wRpO02.js} +29 -15
- package/dist/{index-B8meeQoD.js → index-Ba719MYq.js} +1 -1
- package/dist/{index-BDPnyro2.js → index-BbVbqe4Y.js} +19 -6
- package/dist/{index-CqOCJTeR.js → index-BhTrG89b.js} +390 -232
- package/dist/index-C-iwb2Ln.js +109 -0
- package/dist/{index-CPODug8b.js → index-C5V6u2Qd.js} +2700 -2613
- package/dist/{index-CWUrODxL.js → index-CHU3UePP.js} +1 -1
- package/dist/{index-IZRfmmde.js → index-CQxkDpX0.js} +683 -581
- package/dist/{index-DT3S00_Y.js → index-CWLOcQ6j.js} +11 -10
- package/dist/index-C_H8jFYf.js +2743 -0
- package/dist/{index-__UT3_Ey.js → index-Ckz6u3ac.js} +2 -2
- package/dist/{index-BYI9ttxy.js → index-Czg-2Ni0.js} +8028 -10767
- package/dist/{index-xct3mnu8.js → index-DKI8401o.js} +7 -7
- package/dist/{index-649OZ_e1.js → index-DcZiikOH.js} +2 -2
- package/dist/{index-BquSqx6K.js → index-QHqcSN2q.js} +4 -4
- package/dist/{index-BR9h5DTI.js → index-TAoQpeLQ.js} +1 -1
- package/dist/index-wsCCqwdr.js +74 -0
- package/dist/{index.esm2017-AVbZ9btd.js → index.esm2017-DL6rTGDW.js} +177 -177
- package/dist/{loading-BvHm1m3K.js → loading-x6IScY4K.js} +1 -1
- package/dist/{lodash-Dvrceo7x.js → lodash-nwnDizYo.js} +1 -1
- package/dist/{member-import-c9avpiSS.js → member-import-C-b01Tyd.js} +6 -5
- package/dist/{membership-D-pZS634.js → membership-DfarOMtO.js} +3 -3
- package/dist/{money-D4skwMkD.js → money-CFn-jR4W.js} +1 -1
- package/dist/{number-DJ6ncfT6.js → number-CSlyDL2x.js} +1 -1
- package/dist/objectid-zcT6ESET.js +145 -0
- package/dist/{onboarding-t7R1d3h-.js → onboarding-DyaFaaF2.js} +25 -25
- package/dist/{onboardingSetup-lTaJc0oT.js → onboardingSetup-DQt91O9f.js} +2 -2
- package/dist/{plugins-DQNOWwRC.js → plugins-DEHr0UOe.js} +3 -3
- package/dist/{MarketingMaterialEdit-x3c_N7Gs.js → remy-icon-BhUGu2NI.js} +2 -1031
- package/dist/{reward-BK150pjm.js → reward-Du_Pv-4p.js} +1 -1
- package/dist/{rule-COcdAnUu.js → rule-DfqmQTVK.js} +572 -492
- package/dist/style.css +1 -1
- package/dist/template-CcbNF4PF.js +188 -0
- package/dist/{timezone-BP6UC4KL.js → timezone-_4tabIaK.js} +1 -1
- package/dist/{transaction.fn-BY0hzon0.js → transaction.fn-C46PHwCV.js} +2 -2
- package/dist/{trigger-DVBjVPbN.js → trigger-Dipr6btC.js} +8 -8
- package/dist/useMarketingMaterialActions-BAw2ZjeF.js +125 -0
- package/dist/{usePagination-QT552XyF.js → usePagination-D6RZ18zS.js} +1 -1
- package/dist/{user-CmAxNc7T.js → user-BCexQj3Q.js} +1 -1
- package/dist/vue-i18n-DXvyTCZf.js +2365 -0
- package/dist/{xlsx-DAczoc8y.js → xlsx-BTxt_Jg6.js} +224 -224
- package/dist/{zod-Aj-GuVQL.js → zod-T4wMYjWT.js} +1 -1
- package/package.json +6 -2
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-D_jXVE2I.js +0 -3494
- package/dist/Marketing-BKK45Eve.js +0 -236
- package/dist/ReviewFacebookCallback-DbSCILNN.js +0 -238
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-CnaL93TF.js +0 -1883
- package/dist/Setting-BnFRI0Se.js +0 -2037
- package/dist/Settings-BvT8_tkQ.js +0 -179
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CDu1QySl.js +0 -1264
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-Dqz6jTlH.js +0 -142
- package/dist/google-C3S8u0mT.js +0 -4
- package/dist/objectid-DEMM_jdR.js +0 -145
- package/dist/rule-builder-Deufb6h_.js +0 -102
- package/dist/template-DeebIqJ_.js +0 -236
- package/dist/useMarketingMaterialActions-DpQCQHFI.js +0 -96
- package/dist/vue-i18n-Cze706-f.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-Czg-2Ni0.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-C5V6u2Qd.js";
|
|
5
|
+
import { o as P, m as S, n as ne, p as oe, q as ie } from "./index-CQxkDpX0.js";
|
|
6
|
+
import { c as p, f as ae } from "./index-BEKMTiFb.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 Q = {
|
|
|
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 Q = {
|
|
|
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 Q = {
|
|
|
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 Q = {
|
|
|
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
|
-
oe,
|
|
134
|
-
se,
|
|
135
|
-
ie,
|
|
136
|
-
re,
|
|
137
|
-
de,
|
|
135
|
+
const Ie = e.discriminatedUnion("type", [
|
|
136
|
+
ue,
|
|
138
137
|
ce,
|
|
138
|
+
Ee,
|
|
139
139
|
me,
|
|
140
|
-
|
|
141
|
-
|
|
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
|
-
pe,
|
|
229
|
-
ge,
|
|
230
|
-
ye,
|
|
231
|
-
Ce,
|
|
232
|
-
Re,
|
|
233
238
|
_e,
|
|
234
|
-
|
|
235
|
-
|
|
239
|
+
he,
|
|
240
|
+
fe,
|
|
241
|
+
De,
|
|
242
|
+
Ae,
|
|
243
|
+
Me,
|
|
244
|
+
Te,
|
|
236
245
|
Fe,
|
|
237
|
-
|
|
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,41 +634,41 @@ 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
|
})
|
|
@@ -564,59 +678,99 @@ const C = e.enum(["NO_REWARD", "VOUCHER", "LOYALTY"]), R = e.number().min(0, "We
|
|
|
564
678
|
// path, which never reads `message`; it is still mirrored when a routable
|
|
565
679
|
// channel exists (see toLegacyMessage) so an older reader degrades to
|
|
566
680
|
// sending one real message rather than nothing.
|
|
567
|
-
message:
|
|
568
|
-
delivery: e.lazy(() =>
|
|
681
|
+
message: p.nullish(),
|
|
682
|
+
delivery: e.lazy(() => ae).nullish(),
|
|
569
683
|
linkedCampaign: t.nullish()
|
|
570
|
-
}),
|
|
684
|
+
}), Y = s.extend({
|
|
571
685
|
type: e.literal(n.enum.COIN),
|
|
572
686
|
// event
|
|
573
|
-
event:
|
|
687
|
+
event: a.merge(
|
|
574
688
|
e.object({
|
|
575
689
|
type: e.enum(r[n.enum.COIN])
|
|
576
690
|
})
|
|
577
691
|
),
|
|
578
|
-
earningOption:
|
|
692
|
+
earningOption: c,
|
|
579
693
|
collectible: t,
|
|
580
694
|
notify: e.boolean().optional(),
|
|
581
|
-
notifyMessage: e.lazy(() =>
|
|
695
|
+
notifyMessage: e.lazy(() => p).optional(),
|
|
582
696
|
notifyCampaign: t.nullish(),
|
|
583
|
-
pf_collectible: e.lazy(() =>
|
|
697
|
+
pf_collectible: e.lazy(() => u).optional(),
|
|
584
698
|
pf_notifyCampaign: e.lazy(() => E).optional()
|
|
585
|
-
}),
|
|
699
|
+
}), b = s.extend({
|
|
586
700
|
type: e.literal(n.enum.REWARD_POOL),
|
|
587
701
|
// event
|
|
588
|
-
event:
|
|
702
|
+
event: a.merge(
|
|
589
703
|
e.object({
|
|
590
704
|
type: e.enum(r[n.enum.REWARD_POOL])
|
|
591
705
|
})
|
|
592
706
|
),
|
|
593
|
-
rewards: e.array(e.lazy(() =>
|
|
594
|
-
}),
|
|
707
|
+
rewards: e.array(e.lazy(() => je)).min(1, "Requires at least 1 reward")
|
|
708
|
+
}), Z = s.extend({
|
|
595
709
|
type: e.literal(n.enum.GAME),
|
|
596
710
|
// event
|
|
597
|
-
event:
|
|
711
|
+
event: a.merge(
|
|
598
712
|
e.object({
|
|
599
713
|
type: e.enum(r[n.enum.GAME])
|
|
600
714
|
})
|
|
601
715
|
),
|
|
602
|
-
earningOption:
|
|
716
|
+
earningOption: c,
|
|
603
717
|
collectible: t,
|
|
604
|
-
game: e.lazy(() =>
|
|
605
|
-
pf_collectible: e.lazy(() =>
|
|
718
|
+
game: e.lazy(() => b).optional(),
|
|
719
|
+
pf_collectible: e.lazy(() => u).optional(),
|
|
606
720
|
rewardPool: t.optional()
|
|
607
|
-
}),
|
|
721
|
+
}), Q = s.extend({
|
|
608
722
|
type: e.literal(n.enum.MISSION),
|
|
609
|
-
event:
|
|
723
|
+
event: a.merge(
|
|
610
724
|
e.object({
|
|
611
725
|
type: e.enum(r[n.enum.MISSION])
|
|
612
726
|
})
|
|
613
727
|
),
|
|
614
|
-
earningOption:
|
|
728
|
+
earningOption: c,
|
|
615
729
|
collectible: t,
|
|
616
|
-
pf_collectible: e.lazy(() =>
|
|
617
|
-
mission: e.lazy(() =>
|
|
618
|
-
rewards: e.array(e.lazy(() =>
|
|
619
|
-
}),
|
|
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 = {
|
|
620
774
|
collectionName: "Campaigns",
|
|
621
775
|
transform: {
|
|
622
776
|
_id: "oid",
|
|
@@ -658,54 +812,58 @@ const C = e.enum(["NO_REWARD", "VOUCHER", "LOYALTY"]), R = e.number().min(0, "We
|
|
|
658
812
|
as: "game"
|
|
659
813
|
}
|
|
660
814
|
}
|
|
661
|
-
},
|
|
815
|
+
}, et = e.object({ _id: t }).and(
|
|
662
816
|
e.discriminatedUnion("type", [
|
|
663
|
-
U,
|
|
664
|
-
G,
|
|
665
|
-
w,
|
|
666
|
-
v,
|
|
667
|
-
z,
|
|
668
|
-
E,
|
|
669
|
-
H,
|
|
670
|
-
g,
|
|
671
817
|
W,
|
|
672
|
-
|
|
818
|
+
K,
|
|
819
|
+
V,
|
|
820
|
+
q,
|
|
821
|
+
J,
|
|
822
|
+
E,
|
|
823
|
+
Y,
|
|
824
|
+
b,
|
|
825
|
+
Z,
|
|
826
|
+
Q,
|
|
827
|
+
$
|
|
673
828
|
])
|
|
674
|
-
).describe(
|
|
675
|
-
|
|
829
|
+
).describe(g.describe(ke)), tt = e.discriminatedUnion("type", [
|
|
830
|
+
K.extend({
|
|
676
831
|
business: t.nullish()
|
|
677
832
|
}),
|
|
678
|
-
|
|
833
|
+
V.extend({
|
|
679
834
|
business: t.nullish()
|
|
680
835
|
}),
|
|
681
|
-
|
|
836
|
+
q.extend({
|
|
682
837
|
business: t.nullish()
|
|
683
838
|
}),
|
|
684
|
-
|
|
839
|
+
J.extend({
|
|
685
840
|
business: t.nullish()
|
|
686
841
|
}),
|
|
687
842
|
E.extend({
|
|
688
843
|
business: t.nullish()
|
|
689
844
|
}),
|
|
690
|
-
|
|
845
|
+
Y.extend({
|
|
691
846
|
business: t.nullish()
|
|
692
847
|
}),
|
|
693
|
-
|
|
694
|
-
rewards: e.array(e.lazy(() =>
|
|
848
|
+
b.extend({
|
|
849
|
+
rewards: e.array(e.lazy(() => D)).min(1, "Requires at least 1 reward")
|
|
695
850
|
}),
|
|
696
|
-
|
|
851
|
+
Z.extend({
|
|
697
852
|
business: t.nullish(),
|
|
698
|
-
game:
|
|
853
|
+
game: b.extend({
|
|
699
854
|
business: t.nullish(),
|
|
700
|
-
rewards: e.array(e.lazy(() =>
|
|
855
|
+
rewards: e.array(e.lazy(() => D)).min(1, "Requires at least 1 reward")
|
|
701
856
|
})
|
|
702
857
|
}),
|
|
703
|
-
|
|
858
|
+
Q.extend({
|
|
704
859
|
business: t.nullish(),
|
|
705
|
-
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()
|
|
706
864
|
})
|
|
707
865
|
]);
|
|
708
|
-
|
|
866
|
+
W.pick({
|
|
709
867
|
business: !0,
|
|
710
868
|
name: !0,
|
|
711
869
|
image: !0,
|
|
@@ -713,7 +871,7 @@ U.pick({
|
|
|
713
871
|
tiers: !0,
|
|
714
872
|
// titles: true,
|
|
715
873
|
cardEnable: !0,
|
|
716
|
-
design:
|
|
874
|
+
// design: true,
|
|
717
875
|
targetLocation: !0,
|
|
718
876
|
brand: !0,
|
|
719
877
|
email: !0,
|
|
@@ -722,23 +880,23 @@ U.pick({
|
|
|
722
880
|
pf_title: !0,
|
|
723
881
|
pf_targetLocation: !0
|
|
724
882
|
}).extend({
|
|
725
|
-
allowedPhoneCountryDetails: e.array(
|
|
883
|
+
allowedPhoneCountryDetails: e.array(X).nullish()
|
|
726
884
|
});
|
|
727
885
|
export {
|
|
728
886
|
r as C,
|
|
729
887
|
n as F,
|
|
730
888
|
o as a,
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
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
|
|
744
902
|
};
|