@feedmepos/mf-connect 0.1.117-prod → 0.1.118-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 +68 -1
- package/dist/{App-CAo1izHr.js → App-CBFNBDb2.js} +435 -418
- package/dist/AuditLogs-BtSA8b08.js +2016 -0
- package/dist/{Bin-DDDfjisJ.js → Bin-CjmS_Tfn.js} +8 -8
- package/dist/{Broadcast-BsCulZhE.js → Broadcast-BeePmZa1.js} +22 -21
- package/dist/{CampaignAnalytic-CnVYFSkT.js → CampaignAnalytic-CZlnyvOi.js} +7 -7
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-ZTHyZ_0y.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Du3Ah4HP.js} +9 -9
- package/dist/{Card-DPyQH9qZ.js → Card-C8SzQQ0z.js} +25 -24
- package/dist/{Collections-CZCVA969.js → Collections-BXNWTSZH.js} +197 -185
- package/dist/{Credit-BTg364-i.js → Credit-CK0-0yD1.js} +21 -20
- package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-BJx8K6Ja.js → DateRangeChip.vue_vue_type_script_setup_true_lang-BXYpYC7Y.js} +1 -1
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-CdpnNDzR.js +4439 -0
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-CfEnSXzg.js → EffectSheet.vue_vue_type_style_index_0_lang--Oyj3KYg.js} +32 -32
- package/dist/{Experience-Bk_eUcSX.js → Experience-CWJaj62g.js} +32 -31
- package/dist/{FileSaver.min-CXFiZAp7.js → FileSaver.min-lV9H82L5.js} +1 -1
- package/dist/{Game-CBnKpFdl.js → Game-zBV1LYAg.js} +19 -18
- package/dist/{GiftCardSetup-q75wNV_F.js → GiftCardSetup-Cnq9353j.js} +75 -75
- package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-Cga0Th2O.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-CdgSBdrX.js} +7 -7
- package/dist/{Goals-Bbbgurfd.js → Goals-Utk08egN.js} +4 -4
- package/dist/Grab-DwMmWmbT.js +301 -0
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-CZS05h1r.js → ImageInput.vue_vue_type_script_setup_true_lang-CNPeU9xm.js} +1 -1
- package/dist/{Index-C8_OWllb.js → Index-Bjgs18xf.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-BlCg-jI7.js → LocationPicker.vue_vue_type_script_setup_true_lang-DWnf4lXH.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CACxChIo.js → LottieAnimation.vue_vue_type_script_setup_true_lang-Dy_oWJaZ.js} +1 -1
- package/dist/{LoyaltyDashboard-DJlE0371.js → LoyaltyDashboard-DmUfujX_.js} +15 -15
- package/dist/MainLayout-DlDZQJfy.js +4 -0
- package/dist/{MainLayout-Bs2UPvFx.js → MainLayout.vue_vue_type_script_setup_true_lang-yAflY70k.js} +5 -4
- package/dist/Marketing-B0iKlHP-.js +269 -0
- package/dist/MarketingMaterialEdit-BNHxVb8A.js +1037 -0
- package/dist/{Member-C4yqwsMH.js → Member-Bcm3_pWB.js} +7 -7
- package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-BbumjyC_.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-CPp4OpOx.js} +43 -50
- package/dist/{MemberImportHistory-CbuXCdxC.js → MemberImportHistory-AQgLzB3g.js} +7 -7
- package/dist/{MemberList-CpAepPBe.js → MemberList-CkMTo2uD.js} +103 -105
- package/dist/{MemberTransactions-BbpXvsSk.js → MemberTransactions-CxLCVjvw.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-BaWgxbad.js → MessageInput.vue_vue_type_script_setup_true_lang-4N20f8Sj.js} +14 -14
- package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-CEgMElLo.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-DghbYpSQ.js} +1 -1
- package/dist/{Mission-Bdb9KVeP.js → Mission-CQS1CoDN.js} +22 -21
- package/dist/{Overview-CEiyGMcf.js → Overview-NQ287sgq.js} +23 -22
- package/dist/{Overview-D_9JwnFU.js → Overview-UG1IjY7-.js} +145 -144
- package/dist/{Point-Bd5cMXQx.js → Point-krMa_mb1.js} +22 -21
- package/dist/{Promotion-D9gZDvgR.js → Promotion-vFBmJSti.js} +137 -131
- package/dist/{Queue-BnAOL_rp.js → Queue-BusxSPt-.js} +46 -45
- package/dist/{Record-D6TWFKe0.js → Record-DjKqn0za.js} +9 -9
- package/dist/{Review-DLEgvnc-.js → Review-CqLp8l7U.js} +2 -2
- package/dist/ReviewFacebookCallback-D2kMSVFC.js +225 -0
- package/dist/{ReviewGoogleCallback-BgAbO3pI.js → ReviewGoogleCallback-B1cHR-o2.js} +5 -5
- package/dist/Reward-FeSxgzuS.js +444 -0
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-Bt-EqsiH.js → RewardGroup.vue_vue_type_script_setup_true_lang-CCxVjBsO.js} +16 -15
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-U403emCF.js +1923 -0
- package/dist/{Segment-B9Se5FFw.js → Segment-Nj59F9Nr.js} +304 -305
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-f7AS5vwv.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-Kg9m-0DS.js} +31 -30
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-3BKA0UFI.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BLbDApPL.js} +4 -4
- package/dist/Setting-CCIzNxv-.js +574 -0
- package/dist/{SettingAdvertisements-CLw-dqiA.js → SettingAdvertisements-CkPyAg5y.js} +12 -12
- package/dist/Settings-CYjKGCpa.js +286 -0
- package/dist/{Store-B5PPP5zM.js → Store-Bp8Zkzi2.js} +31 -30
- package/dist/{StoreRewards-DllyaVBY.js → StoreRewards-DXW5nVyW.js} +15 -15
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BYVezFI2.js +1319 -0
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-CS6b1cM3.js +7007 -0
- package/dist/{Tier-M_TApfju.js → Tier-B8Utn9Qb.js} +2576 -687
- package/dist/{Title-Cpltm-I2.js → Title-CwaNSFer.js} +94 -92
- package/dist/{Transaction-BYfAYRpv.js → Transaction-ieciAdXP.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BOhfGxVj.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-CMwZl4E6.js} +26 -26
- package/dist/{Voucher-DHoyg0YZ.js → Voucher-BKfujj6r.js} +19 -19
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DWHwM6AJ.js → VoucherEditor.vue_vue_type_script_setup_true_lang-CkH-rNqZ.js} +16 -16
- package/dist/WhatsappAccount-D73WDP7a.js +161 -0
- package/dist/WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-C3L7vWZE.js +39 -0
- package/dist/WhatsappBot-DTWZAXhi.js +878 -0
- package/dist/WhatsappBotLogs-DtDcrjs9.js +372 -0
- package/dist/WhatsappBotSettings-7_mH9U4y.js +704 -0
- package/dist/WhatsappLayout-BVpaFJ8H.js +21 -0
- package/dist/WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-CMeaNKJt.js +261 -0
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-B6tTjLAZ.js → ZodTextField.vue_vue_type_script_setup_true_lang-BO1zA9AR.js} +2 -2
- package/dist/{app-B_doYklh.js → app-DX7OWVY2.js} +9159 -7383
- package/dist/app.js +4 -3
- package/dist/{base.export-DmbnT_bp.js → base.export-bamzzexi.js} +2 -2
- package/dist/browser-BSAOEeIM.js +1478 -0
- package/dist/{business-DdVGtTvx.js → business-D3U9HSu9.js} +1 -1
- package/dist/{campaign-jEhKmpKg.js → campaign-BqRf2VUO.js} +121 -94
- package/dist/{campaign-CVkA08zl.js → campaign-CKfeN2xN.js} +31 -25
- package/dist/{campaign.enum-DWu6-kOo.js → campaign.enum-Dx-Zo68Q.js} +3 -2
- package/dist/{campaign.fn-BlgEyeFz.js → campaign.fn-DQe5LZuT.js} +82 -82
- package/dist/{collectible.enum-CVLkXKml.js → collectible.enum-Liy2wH3s.js} +1 -1
- package/dist/{collection.fn-DLNGTrPf.js → collection.fn-BcGqExuE.js} +2 -2
- package/dist/{currency-DKS1md4e.js → currency-sjMYWoI8.js} +1 -1
- package/dist/duplicateCampaign-CJF3ZLNd.js +51 -0
- package/dist/{effect-Bk-zYexf.js → effect-Cv8ugBR3.js} +1 -1
- package/dist/{email-addresses-I9A5iLzf.js → email-addresses-CWqtseTn.js} +2 -2
- package/dist/{feature-flag-DQti61iR.js → feature-flag-BIh6MM4i.js} +152 -136
- package/dist/google-BQK68wbe.js +5 -0
- package/dist/{helper-9cPlo6ae.js → helper-WnxOxoRK.js} +1 -1
- package/dist/{index-DuvnRxeo.js → index-5TTGGDnF.js} +1 -1
- package/dist/{index-CuyzSc1l.js → index-B3CkAr-6.js} +1 -1
- package/dist/{index-cgtAlOl9.js → index-B9XVyhtC.js} +8028 -10767
- package/dist/{index-ClYX4COd.js → index-BGguMtc0.js} +4 -3
- package/dist/{index-CNUXbXvG.js → index-Bdg48Cus.js} +19 -6
- package/dist/{index-fHiFL1dW.js → index-BoAmM8QH.js} +29 -15
- package/dist/{index-C-OnJpT8.js → index-BtmVXdRR.js} +1 -1
- package/dist/{index-1Cdj34z1.js → index-CDTETsXQ.js} +1 -1
- package/dist/index-C_H8jFYf.js +2743 -0
- package/dist/{index-BxpbI0GH.js → index-CeafUn1o.js} +7 -7
- package/dist/{index-Dj51vqab.js → index-CiSTQhs9.js} +4 -4
- package/dist/{index-CIwdXphn.js → index-ClvaVYkG.js} +2700 -2613
- package/dist/{index-Cj6oxbl0.js → index-CnsSd5Dg.js} +11 -10
- package/dist/{index-oNMFyOGe.js → index-D3yYjyaj.js} +8 -7
- package/dist/{index-BRm0LMTo.js → index-DDzi_-Lu.js} +611 -252
- package/dist/{index-3V8E9GaZ.js → index-DOgDR_QH.js} +2 -2
- package/dist/{index-DOE2VR99.js → index-DqZX-A6e.js} +198 -198
- package/dist/{index-vKvGJ4Ve.js → index-DxhNNZ-a.js} +2 -2
- package/dist/index-DzYFQGSw.js +74 -0
- package/dist/index-I9lmcd2w.js +109 -0
- package/dist/{index-728mP6kW.js → index-iiWxryxo.js} +683 -581
- package/dist/{index-DWkuIfHy.js → index-qI1yx02a.js} +390 -232
- package/dist/{index.esm2017-CsF37oA-.js → index.esm2017-GI2alVO5.js} +177 -177
- package/dist/{loading-BJJmTFoe.js → loading-Qx5K2WL0.js} +1 -1
- package/dist/{lodash-BMJ6_hsa.js → lodash-CeSjJptg.js} +1 -1
- package/dist/{member-import-DrGxVJt9.js → member-import-Cq8G7SsW.js} +6 -5
- package/dist/{membership-CAqKihwy.js → membership-BbeavSNs.js} +3 -3
- package/dist/{money-Bf9d2ZUH.js → money-D8YIFaGA.js} +1 -1
- package/dist/{number-CWXlGZa5.js → number-DAubZ5bt.js} +1 -1
- package/dist/objectid-DeXFWDMh.js +145 -0
- package/dist/{onboarding-Dn9O7r3a.js → onboarding-SyFxaTJY.js} +25 -25
- package/dist/{onboardingSetup-BMkDoGy-.js → onboardingSetup-CLpHlBn8.js} +2 -2
- package/dist/{plugins-KDgceFWV.js → plugins-BHuaMEYA.js} +3 -3
- package/dist/{MarketingMaterialEdit-o88sdvTM.js → remy-icon-BhUGu2NI.js} +2 -1031
- package/dist/{reward-eilGRaXi.js → reward-dYWnmAC8.js} +1 -1
- package/dist/{rule-Dr9Zjg_o.js → rule-BVsfOP2h.js} +572 -492
- package/dist/style.css +1 -1
- package/dist/template-BcdtbhUJ.js +188 -0
- package/dist/{timezone-C5CIfvHs.js → timezone-CUc7q5Ii.js} +1 -1
- package/dist/{transaction.fn-Cr-FLjh0.js → transaction.fn-jF9u_cBy.js} +2 -2
- package/dist/{trigger-B0Fv6wbN.js → trigger-COlbQlaB.js} +8 -8
- package/dist/useMarketingMaterialActions-Dq6-gsOW.js +125 -0
- package/dist/{usePagination-BcA-imTr.js → usePagination-BYZB6ORK.js} +1 -1
- package/dist/{user-DRvLwlBE.js → user-DK7L8VFR.js} +1 -1
- package/dist/vue-i18n-CDSTH7g5.js +2365 -0
- package/dist/{xlsx-CBObn76o.js → xlsx-CKxXlDzD.js} +224 -224
- package/dist/{zod-DWU5EdQV.js → zod-DjtAaF0U.js} +1 -1
- package/package.json +6 -2
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Ijya9Cho.js +0 -3494
- package/dist/Marketing-BvRYzFV8.js +0 -236
- package/dist/ReviewFacebookCallback-jVlm2O8f.js +0 -238
- package/dist/Reward-DBheQiFu.js +0 -442
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-CKL8MEld.js +0 -1883
- package/dist/Setting-B92JT_Y4.js +0 -2037
- package/dist/Settings-BmmM8ZnR.js +0 -179
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-3Vvqf6_H.js +0 -1264
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-7ZZ0e5tQ.js +0 -142
- package/dist/google-C3S8u0mT.js +0 -4
- package/dist/objectid-2DN5a9sY.js +0 -145
- package/dist/rule-builder-cz6Dy-no.js +0 -102
- package/dist/template-DwbazO8p.js +0 -236
- package/dist/useMarketingMaterialActions-CNk3LR9M.js +0 -96
- package/dist/vue-i18n-y7bHQpNx.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-B9XVyhtC.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-ClvaVYkG.js";
|
|
5
|
+
import { o as P, m as S, n as ne, p as oe, q as ie } from "./index-iiWxryxo.js";
|
|
6
|
+
import { c as p, f as ae } from "./index-DqZX-A6e.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
|
};
|