@feedmepos/mf-connect 0.1.0-beta.5 → 0.1.0-beta.50
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/Analytic-D-yp03jJ.js +427 -0
- package/dist/{App-C8Qfnkhz.js → App-CeQWTGNK.js} +441 -420
- package/dist/AuditLogs-2qzwcMXR.js +1885 -0
- package/dist/Bin-D1b2NbbA.js +191 -0
- package/dist/{Broadcast-BK-1MQkL.js → Broadcast-bKF9mIns.js} +13 -12
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BLzpFQoc.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B_q5K-cx.js} +6 -8
- package/dist/Card-BCAyfBLi.js +896 -0
- package/dist/{Collections-TA4iW1r0.js → Collections-Yz3F55bv.js} +27 -31
- package/dist/{Credit-Df9iFQjZ.js → Credit-Ceptt_g_.js} +17 -16
- package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +108 -0
- package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-CLFeMi0j.js +169 -0
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-TjNinQ8e.js +2181 -0
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BCRVyPwl.js → EffectSheet.vue_vue_type_style_index_0_lang-D3Bt-Vuu.js} +6 -6
- package/dist/{Experience-ByLFXKn6.js → Experience-DskHKzfo.js} +26 -25
- package/dist/{Game-B6Ez0pfW.js → Game-IJ6X0AXM.js} +21 -20
- package/dist/Index-CEl2y9X6.js +259 -0
- package/dist/Marketing-CWekLb4c.js +20071 -0
- package/dist/{Member-TobP1ISp.js → Member-BUZPQ5Lb.js} +4 -4
- package/dist/MemberList-BmVNqvbm.js +1598 -0
- package/dist/MemberTransactions-B3XhEOK_.js +45 -0
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CZ-w6iZi.js → MessageInput.vue_vue_type_script_setup_true_lang-C6YIbQtM.js} +6 -6
- package/dist/{Mission-D9uTVo0G.js → Mission-Ci9ed_ph.js} +97 -84
- package/dist/Overview-CU9uhC-k.js +1078 -0
- package/dist/{Point-4rDr-53e.js → Point-wuuR7AEb.js} +26 -25
- package/dist/{Promotion-BKO_dtQk.js → Promotion-BMi3kyE8.js} +55 -48
- package/dist/Record-Wmh-g8WY.js +340 -0
- package/dist/Reward-BL4lxhIB.js +442 -0
- package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-CqXuTxun.js +150 -0
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Dbik0PEw.js +1637 -0
- package/dist/Segment-DObdjyYi.js +568 -0
- package/dist/SelectItems.vue_vue_type_script_setup_true_lang-BAuM6qP5.js +181 -0
- package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-BfyRVxWM.js +147 -0
- package/dist/{Setting-B7oISD0D.js → Setting-Dqgnd7TR.js} +610 -586
- package/dist/Store--Z4So__g.js +1744 -0
- package/dist/{StoreRewards-AMxIYhjZ.js → StoreRewards-DPFVXWwm.js} +33 -32
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CNsdA106.js +939 -0
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-B2szciPk.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-CGOmGozY.js} +1 -1
- package/dist/{Tier-DkxdNj-K.js → Tier-36IfhsnP.js} +327 -318
- package/dist/{Title-VFpCOsMO.js → Title-XH56OOug.js} +199 -184
- package/dist/{Transaction-BgKD8n2L.js → Transaction-BUQcSmBs.js} +2 -2
- package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-BVCfeG5T.js +130 -0
- package/dist/Voucher-CvmH0kcF.js +353 -0
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-BQOD6uEf.js +419 -0
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-B2FGvyza.js → ZodTextField.vue_vue_type_script_setup_true_lang-CcIcCt4N.js} +1 -1
- package/dist/{app-DUl5dav5.js → app-DeW5_DB0.js} +1754 -1496
- package/dist/{app-DA-t-2Zt.js → app-TN8KEPMu.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/{business-CeCitOY4.js → business-D1mLhSME.js} +1 -1
- package/dist/campaign-0tnkhu78.js +1810 -0
- package/dist/{campaign-CcLM6e4s.js → campaign-B-12Im0w.js} +2 -2
- package/dist/campaign.enum-C8m-HHZE.js +20 -0
- package/dist/campaign.fn-CxkhbK9i.js +758 -0
- package/dist/collectible.enum-6Syq-vQ6.js +19 -0
- package/dist/{collection.fn-CAEP7YxB.js → collection.fn-BUj75Jp2.js} +2 -2
- package/dist/dto-8wODhIIC.js +214 -0
- package/dist/{effect-Dt7rXOBy.js → effect-BEZEjcJu.js} +9 -9
- package/dist/email-addresses-PwjkdYYD.js +705 -0
- package/dist/{export-CyioiboQ.js → export-BB-0vgwy.js} +5 -5
- package/dist/{helper-FA_9AhGV.js → helper-DOt8-wns.js} +1 -1
- package/dist/{index-DLN4Kzz_.js → index-B1qUjniH.js} +1 -1
- package/dist/index-BTMIZz4v.js +44 -0
- package/dist/{index-igxrd5jC.js → index-By-GlmG7.js} +1500 -1479
- package/dist/index-C7zBkoZ4.js +115 -0
- package/dist/{index-CyNdsVrw.js → index-CNlHabtk.js} +1 -1
- package/dist/{index-DbbO3wip.js → index-CXGiIgdK.js} +48 -4
- package/dist/{index-C20XBD7G.js → index-Cjn1LVjC.js} +2192 -931
- package/dist/index-CpfUrdgw.js +29000 -0
- package/dist/index-CsaQJMAR.js +66 -0
- package/dist/index-DZuEmMyY.js +54 -0
- package/dist/{index-CCdXvb92.js → index-D_zwqIhq.js} +1 -1
- package/dist/index-DabUEw_c.js +32 -0
- package/dist/{index-BiFueJiF.js → index-X-FfC49l.js} +258 -192
- package/dist/index-vh86FiIQ.js +10 -0
- package/dist/{index.esm2017-Dl_CdTcK.js → index.esm2017-DJOUiVjR.js} +33 -33
- package/dist/loading-aCWVsOPY.js +71 -0
- package/dist/{membership-DFiY8aVd.js → membership-1etsHC5G.js} +54 -46
- package/dist/money-DzWRURZ5.js +15 -0
- package/dist/number-BxIQO1i3.js +12 -0
- package/dist/objectid-DjhmYkn-.js +145 -0
- package/dist/{loading-CZ0fiViM.js → plugins-CSPFAU50.js} +2990 -3062
- package/dist/remy-vue-client-Cpppk9h-.js +1693 -0
- package/dist/reward-Bh4Li9f0.js +36 -0
- package/dist/{rule-C3e1xTqN.js → rule-CHTTTUFB.js} +180 -177
- package/dist/{rule-builder-MEVb_AiZ.js → rule-builder-OHfUJTIA.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{template-C2OKWd_e.js → template-ZGxXqkaC.js} +5 -5
- package/dist/trigger-Ogu5FDs0.js +144 -0
- package/dist/user-DBuU81tO.js +54 -0
- package/dist/{vue-i18n-CjxDUnX6.js → vue-i18n-CKpKQ6iE.js} +216 -216
- package/dist/{xlsx-CtXdl3ls.js → xlsx-DJDZBIeg.js} +1 -1
- package/package.json +9 -7
- package/dist/Analytic-C_ZFR5jh.js +0 -622
- package/dist/Card-C7dUFJKe.js +0 -825
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bgl90veU.js +0 -2813
- package/dist/Marketing-BaqZUeVI.js +0 -316
- package/dist/MemberList-B9cutmEh.js +0 -1733
- package/dist/MemberTransactions-DRHA7AOF.js +0 -38
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BHCoDSTg.js +0 -1753
- package/dist/Segment-Dj8nc3AE.js +0 -437
- package/dist/Store-CJ3wcohQ.js +0 -1511
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-wXUTfQQF.js +0 -890
- package/dist/Voucher-BbTLt8Pt.js +0 -490
- package/dist/dto-CRJma6eX.js +0 -2770
- package/dist/index-B1e0LtDe.js +0 -99
- package/dist/index-Be2ZYDy_.js +0 -298
- package/dist/index-CDkITvze.js +0 -762
- package/dist/index-CuvNtC_M.js +0 -61
- package/dist/index-DPP5F3bT.js +0 -206
- package/dist/index-Dbo3DDwp.js +0 -29193
- package/dist/money-D8hUEfP4.js +0 -15
- package/dist/number-DL3GAeVt.js +0 -12
- package/dist/user-Bm4KttFq.js +0 -37
package/dist/index-CDkITvze.js
DELETED
|
@@ -1,762 +0,0 @@
|
|
|
1
|
-
import { z as e, F as n, e as A, m as p } from "./loading-CZ0fiViM.js";
|
|
2
|
-
import { e as _, F as D, a as c, h as X, g as Z, j as d, k as Q, m as $ } from "./index-igxrd5jC.js";
|
|
3
|
-
import { b as T } from "./index-C20XBD7G.js";
|
|
4
|
-
import { b as L, c as ee } from "./index-DPP5F3bT.js";
|
|
5
|
-
import { d as ne } from "./index-Be2ZYDy_.js";
|
|
6
|
-
const P = e.enum([
|
|
7
|
-
"VOUCHER",
|
|
8
|
-
"PROMOTION",
|
|
9
|
-
"POINT",
|
|
10
|
-
"CREDIT",
|
|
11
|
-
"MEMBERSHIP",
|
|
12
|
-
"BROADCAST",
|
|
13
|
-
"COIN",
|
|
14
|
-
"REWARD_POOL",
|
|
15
|
-
"GAME",
|
|
16
|
-
"MISSION"
|
|
17
|
-
]), M = e.enum(["TIME_BASED_PROMOTION", "GAME_PROMOTION"]), Ke = {
|
|
18
|
-
[M.enum.TIME_BASED_PROMOTION]: "7.7.4",
|
|
19
|
-
[M.enum.GAME_PROMOTION]: "7.7.4"
|
|
20
|
-
};
|
|
21
|
-
e.object({
|
|
22
|
-
location: n,
|
|
23
|
-
memberId: n,
|
|
24
|
-
nettTotal: A,
|
|
25
|
-
remark: e.string().optional()
|
|
26
|
-
});
|
|
27
|
-
const te = e.enum(["COUNTER", "POS"]);
|
|
28
|
-
e.object({
|
|
29
|
-
id: e.string(),
|
|
30
|
-
userId: e.string(),
|
|
31
|
-
name: e.string().nullish(),
|
|
32
|
-
birthday: e.string().nullish(),
|
|
33
|
-
phoneNumber: e.string().nullish(),
|
|
34
|
-
balance: e.number().nullish(),
|
|
35
|
-
level: e.number().nullish(),
|
|
36
|
-
mostPurchasedItems: e.array(e.string()).nullish()
|
|
37
|
-
});
|
|
38
|
-
const oe = {
|
|
39
|
-
collectionName: "Bills"
|
|
40
|
-
}, ie = e.object({
|
|
41
|
-
_id: e.string(),
|
|
42
|
-
items: e.record(e.string(), e.number()).nullish(),
|
|
43
|
-
// business: z.string(),
|
|
44
|
-
// adjustments: z.record(FdoBillAdjustment),
|
|
45
|
-
// refundedFrom: z.string().nullish(),
|
|
46
|
-
user: e.string().nullish(),
|
|
47
|
-
memberid: e.string().nullish(),
|
|
48
|
-
// roundToNearest: z.number().nullish(),
|
|
49
|
-
nettTotal: A,
|
|
50
|
-
// activeItems: z.array(z.string()),
|
|
51
|
-
remark: e.string().nullish(),
|
|
52
|
-
createdAt: e.coerce.date(),
|
|
53
|
-
completedAt: e.coerce.date(),
|
|
54
|
-
location: e.string(),
|
|
55
|
-
channel: te.optional()
|
|
56
|
-
}).transform((o) => ({
|
|
57
|
-
...o,
|
|
58
|
-
createdTime: o.createdAt,
|
|
59
|
-
completedTime: o.completedAt,
|
|
60
|
-
get amount() {
|
|
61
|
-
return o.nettTotal.amount / 10 ** o.nettTotal.precision;
|
|
62
|
-
}
|
|
63
|
-
})).describe(p.describe(oe)), se = e.object({
|
|
64
|
-
_id: e.string(),
|
|
65
|
-
rating: e.coerce.number(),
|
|
66
|
-
user: e.string(),
|
|
67
|
-
restaurant: e.string(),
|
|
68
|
-
message: e.string(),
|
|
69
|
-
submittedAt: e.coerce.date()
|
|
70
|
-
}), i = e.enum([
|
|
71
|
-
"SIMPLE_CLAIM",
|
|
72
|
-
"LINK_CLAIM",
|
|
73
|
-
"BILL_COMPLETED",
|
|
74
|
-
"SCHEDULE",
|
|
75
|
-
"BIRTHDAY",
|
|
76
|
-
"FEEDBACK",
|
|
77
|
-
"ENTER_SEGMENT",
|
|
78
|
-
"MEMBERSHIP_JOINED",
|
|
79
|
-
"TIER_UPGRADED",
|
|
80
|
-
"MAKING_ORDER",
|
|
81
|
-
"ISSUE_REWARD",
|
|
82
|
-
"MEMBER_REWARD",
|
|
83
|
-
"GAME_COMPLETED",
|
|
84
|
-
"PAGINATE_SCHEDULE"
|
|
85
|
-
]), Je = i.extract([
|
|
86
|
-
"BILL_COMPLETED",
|
|
87
|
-
"FEEDBACK",
|
|
88
|
-
"GAME_COMPLETED",
|
|
89
|
-
"MAKING_ORDER",
|
|
90
|
-
"MEMBERSHIP_JOINED",
|
|
91
|
-
"SCHEDULE",
|
|
92
|
-
"SIMPLE_CLAIM",
|
|
93
|
-
"TIER_UPGRADED",
|
|
94
|
-
"ISSUE_REWARD"
|
|
95
|
-
]);
|
|
96
|
-
e.enum(["START_OF", "BEFORE"]);
|
|
97
|
-
e.enum(["WEEK", "MONTH"]);
|
|
98
|
-
const s = e.object({
|
|
99
|
-
// type: F_EVENT_TYPE,
|
|
100
|
-
rule: _.optional()
|
|
101
|
-
}), ae = s.extend({
|
|
102
|
-
type: e.literal(i.enum.BILL_COMPLETED)
|
|
103
|
-
}), le = s.extend({
|
|
104
|
-
type: e.literal(i.enum.FEEDBACK)
|
|
105
|
-
}), re = s.extend({
|
|
106
|
-
type: e.literal(i.enum.SIMPLE_CLAIM)
|
|
107
|
-
});
|
|
108
|
-
s.extend({
|
|
109
|
-
type: e.literal(i.enum.ENTER_SEGMENT),
|
|
110
|
-
segment: e.string()
|
|
111
|
-
});
|
|
112
|
-
const ce = s.extend({
|
|
113
|
-
type: e.literal(i.enum.MEMBER_REWARD)
|
|
114
|
-
}), de = s.extend({
|
|
115
|
-
type: e.literal(i.enum.SCHEDULE)
|
|
116
|
-
// option: FdoCronRule,
|
|
117
|
-
}), me = s.extend({
|
|
118
|
-
type: e.literal(i.enum.MEMBERSHIP_JOINED)
|
|
119
|
-
}), ue = s.extend({
|
|
120
|
-
type: e.literal(i.enum.TIER_UPGRADED)
|
|
121
|
-
}), pe = s.extend({
|
|
122
|
-
type: e.literal(i.enum.MAKING_ORDER)
|
|
123
|
-
}), Ee = s.extend({
|
|
124
|
-
type: e.literal(i.enum.ISSUE_REWARD)
|
|
125
|
-
}), ge = s.extend({
|
|
126
|
-
type: e.literal(i.enum.GAME_COMPLETED)
|
|
127
|
-
}), be = e.discriminatedUnion("type", [
|
|
128
|
-
re,
|
|
129
|
-
ae,
|
|
130
|
-
de,
|
|
131
|
-
le,
|
|
132
|
-
me,
|
|
133
|
-
ue,
|
|
134
|
-
pe,
|
|
135
|
-
Ee,
|
|
136
|
-
ce,
|
|
137
|
-
ge
|
|
138
|
-
]);
|
|
139
|
-
e.object({
|
|
140
|
-
_id: n,
|
|
141
|
-
type: i,
|
|
142
|
-
ref: e.string(),
|
|
143
|
-
context: e.record(e.string(), e.any()).optional()
|
|
144
|
-
}).describe(JSON.stringify({ collectionName: "EventLogs" }));
|
|
145
|
-
const m = e.object({
|
|
146
|
-
type: i,
|
|
147
|
-
context: e.any(),
|
|
148
|
-
businessIds: e.array(n).optional(),
|
|
149
|
-
campaignIds: e.array(n).optional(),
|
|
150
|
-
slackWebhookUrl: e.string().optional(),
|
|
151
|
-
emittedAt: e.coerce.date().default(/* @__PURE__ */ new Date())
|
|
152
|
-
}), ye = m.extend({
|
|
153
|
-
type: e.literal(i.enum.BILL_COMPLETED),
|
|
154
|
-
context: e.object({
|
|
155
|
-
bill: ie,
|
|
156
|
-
rawBill: e.any()
|
|
157
|
-
})
|
|
158
|
-
}), Ce = m.extend({
|
|
159
|
-
type: e.literal(i.enum.SCHEDULE),
|
|
160
|
-
context: e.object({
|
|
161
|
-
triggeredAt: e.coerce.date()
|
|
162
|
-
})
|
|
163
|
-
}), Re = m.extend({
|
|
164
|
-
type: e.literal(i.enum.PAGINATE_SCHEDULE),
|
|
165
|
-
context: e.object({
|
|
166
|
-
triggeredAt: e.coerce.date(),
|
|
167
|
-
business: n,
|
|
168
|
-
skip: e.coerce.number(),
|
|
169
|
-
limit: e.coerce.number()
|
|
170
|
-
})
|
|
171
|
-
}), _e = m.extend({
|
|
172
|
-
type: e.literal(i.enum.FEEDBACK),
|
|
173
|
-
context: e.object({
|
|
174
|
-
feedback: se
|
|
175
|
-
})
|
|
176
|
-
}), Ie = m.extend({
|
|
177
|
-
type: e.literal(i.enum.MEMBERSHIP_JOINED),
|
|
178
|
-
context: e.object({
|
|
179
|
-
user: T
|
|
180
|
-
})
|
|
181
|
-
}), he = m.extend({
|
|
182
|
-
type: e.literal(i.enum.TIER_UPGRADED),
|
|
183
|
-
context: e.object({
|
|
184
|
-
transaction: L
|
|
185
|
-
})
|
|
186
|
-
}), fe = m.extend({
|
|
187
|
-
type: e.literal(i.enum.ISSUE_REWARD),
|
|
188
|
-
context: e.object({
|
|
189
|
-
transaction: L,
|
|
190
|
-
collection: ee
|
|
191
|
-
})
|
|
192
|
-
});
|
|
193
|
-
e.discriminatedUnion("type", [
|
|
194
|
-
ye,
|
|
195
|
-
Ce,
|
|
196
|
-
_e,
|
|
197
|
-
Ie,
|
|
198
|
-
he,
|
|
199
|
-
fe,
|
|
200
|
-
Re
|
|
201
|
-
]);
|
|
202
|
-
const Oe = e.object({
|
|
203
|
-
from: e.coerce.number(),
|
|
204
|
-
to: e.coerce.number().optional()
|
|
205
|
-
}).superRefine((o, a) => {
|
|
206
|
-
o.from && o.to && o.from > o.to && a.addIssue({
|
|
207
|
-
code: "custom",
|
|
208
|
-
message: "Max experience must be more than min experience"
|
|
209
|
-
});
|
|
210
|
-
}), Me = e.enum(["MULTIPLIER", "FIXED"]);
|
|
211
|
-
e.object({
|
|
212
|
-
type: Me
|
|
213
|
-
});
|
|
214
|
-
const Fe = e.object({
|
|
215
|
-
_id: n.optional(),
|
|
216
|
-
rule: _,
|
|
217
|
-
tierExpression: e.string().nullish(),
|
|
218
|
-
expExpression: e.string().nullish()
|
|
219
|
-
}), I = e.object({
|
|
220
|
-
_id: n,
|
|
221
|
-
name: e.string().min(1),
|
|
222
|
-
image: e.string().nullish(),
|
|
223
|
-
option: Oe,
|
|
224
|
-
cycleOptions: e.array(e.lazy(() => Fe)).nullish(),
|
|
225
|
-
member_count: e.number().optional()
|
|
226
|
-
});
|
|
227
|
-
I.partial({
|
|
228
|
-
_id: !0
|
|
229
|
-
});
|
|
230
|
-
const Ye = I.partial({
|
|
231
|
-
_id: !0
|
|
232
|
-
}), Ae = {
|
|
233
|
-
collectionName: "Cards",
|
|
234
|
-
transform: {
|
|
235
|
-
_id: "oid",
|
|
236
|
-
business: "oid",
|
|
237
|
-
member: "oid",
|
|
238
|
-
redeemedAt: "date"
|
|
239
|
-
},
|
|
240
|
-
lookups: {
|
|
241
|
-
business: {
|
|
242
|
-
as: "business",
|
|
243
|
-
fromCollection: "Business"
|
|
244
|
-
},
|
|
245
|
-
member: {
|
|
246
|
-
as: "pf_member",
|
|
247
|
-
fromCollection: "UsersV2"
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
};
|
|
251
|
-
e.object({
|
|
252
|
-
_id: n,
|
|
253
|
-
business: n,
|
|
254
|
-
serialNumber: e.string(),
|
|
255
|
-
setCardOnBind: e.boolean().nullish(),
|
|
256
|
-
redeemedAt: e.date().nullish(),
|
|
257
|
-
member: n.nullish(),
|
|
258
|
-
design: e.string().nullish(),
|
|
259
|
-
bundle: e.string().nullish(),
|
|
260
|
-
subscriptionBundle: e.string().nullish(),
|
|
261
|
-
pf_member: e.lazy(() => T).nullish(),
|
|
262
|
-
pf_transaction: e.lazy(() => ne).nullish()
|
|
263
|
-
}).describe(p.describe(Ae));
|
|
264
|
-
const De = e.object({
|
|
265
|
-
length: e.coerce.number().optional(),
|
|
266
|
-
charset: e.string(),
|
|
267
|
-
prefix: e.string().optional(),
|
|
268
|
-
suffix: e.string().optional(),
|
|
269
|
-
pattern: e.string().optional()
|
|
270
|
-
});
|
|
271
|
-
e.object({
|
|
272
|
-
quantity: e.number(),
|
|
273
|
-
code: e.string(),
|
|
274
|
-
codeConfig: De,
|
|
275
|
-
setCardOnBind: e.boolean().optional(),
|
|
276
|
-
design: e.string().nullish(),
|
|
277
|
-
bundle: e.string().optional(),
|
|
278
|
-
subscriptionBundle: e.string().optional()
|
|
279
|
-
});
|
|
280
|
-
const Te = e.enum(["SMS", "EMAIL"]), E = e.object({
|
|
281
|
-
channel: Te,
|
|
282
|
-
variables: e.array(e.string()),
|
|
283
|
-
title: e.string().nullish(),
|
|
284
|
-
design: e.any(),
|
|
285
|
-
content: e.string(),
|
|
286
|
-
language: e.string(),
|
|
287
|
-
imageUrl: e.string().nullish()
|
|
288
|
-
}).superRefine((o, a) => {
|
|
289
|
-
o.content.length == 0 && a.addIssue({
|
|
290
|
-
code: e.ZodIssueCode.custom,
|
|
291
|
-
message: "Content is required"
|
|
292
|
-
});
|
|
293
|
-
const C = /{{(.*?)}}/g, R = [...o.content.matchAll(C)].map((u) => u[1]), O = o.variables, b = R.filter((u) => O.indexOf(u) < 0);
|
|
294
|
-
b.length && a.addIssue({
|
|
295
|
-
code: e.ZodIssueCode.custom,
|
|
296
|
-
message: "Invalid variable(s): " + b.join(", ")
|
|
297
|
-
});
|
|
298
|
-
});
|
|
299
|
-
function qe(o, a) {
|
|
300
|
-
return o.replace(/{{(.*?)}}/g, (C, R) => {
|
|
301
|
-
const b = R.trim().split(".").reduce((u, q) => (u != null ? u[q] : null) ?? null, a);
|
|
302
|
-
return b !== null ? b : C;
|
|
303
|
-
});
|
|
304
|
-
}
|
|
305
|
-
const h = e.enum(["NO_REWARD", "VOUCHER", "LOYALTY"]), S = e.number().min(0, "Weight need to be at least 0"), x = e.number().int("Must be integer").min(0, "Threshold need to be at least 0"), N = e.object({
|
|
306
|
-
type: e.literal(h.enum.NO_REWARD),
|
|
307
|
-
collectible: e.null(),
|
|
308
|
-
weight: S
|
|
309
|
-
}), B = e.object({
|
|
310
|
-
type: e.literal(h.enum.VOUCHER),
|
|
311
|
-
collectible: n,
|
|
312
|
-
collectibleConfig: e.lazy(() => D._def.right.options[0]),
|
|
313
|
-
earningOption: e.lazy(() => c)
|
|
314
|
-
}), f = e.object({
|
|
315
|
-
type: e.literal(h.enum.LOYALTY),
|
|
316
|
-
collectible: n,
|
|
317
|
-
earningOption: e.lazy(() => c),
|
|
318
|
-
validityOption: e.lazy(() => X)
|
|
319
|
-
}), U = B.extend({
|
|
320
|
-
weight: S
|
|
321
|
-
}), j = f.extend({
|
|
322
|
-
weight: e.number().min(0, "Weight need to be at least 0")
|
|
323
|
-
}), Xe = f.extend({
|
|
324
|
-
validityOption: Z
|
|
325
|
-
}), Le = e.discriminatedUnion("type", [
|
|
326
|
-
U,
|
|
327
|
-
j,
|
|
328
|
-
N
|
|
329
|
-
]), F = e.discriminatedUnion("type", [
|
|
330
|
-
U.extend({
|
|
331
|
-
collectible: n.nullish(),
|
|
332
|
-
business: n.nullish()
|
|
333
|
-
}),
|
|
334
|
-
j.extend({
|
|
335
|
-
collectible: n.nullish(),
|
|
336
|
-
business: n.nullish()
|
|
337
|
-
}),
|
|
338
|
-
N
|
|
339
|
-
]), G = B.extend({
|
|
340
|
-
threshold: x
|
|
341
|
-
}), z = f.extend({
|
|
342
|
-
threshold: x
|
|
343
|
-
}), v = e.discriminatedUnion("type", [
|
|
344
|
-
G,
|
|
345
|
-
z
|
|
346
|
-
]), Pe = e.discriminatedUnion("type", [
|
|
347
|
-
G.extend({
|
|
348
|
-
collectible: n.nullish(),
|
|
349
|
-
business: n.nullish()
|
|
350
|
-
}),
|
|
351
|
-
z.extend({
|
|
352
|
-
collectible: n.nullish(),
|
|
353
|
-
collectibleConfig: D.nullish(),
|
|
354
|
-
business: n.nullish()
|
|
355
|
-
})
|
|
356
|
-
]), Se = {
|
|
357
|
-
collectionName: "Locations",
|
|
358
|
-
transform: {
|
|
359
|
-
_id: "oid",
|
|
360
|
-
business: "oid"
|
|
361
|
-
}
|
|
362
|
-
}, w = e.object({
|
|
363
|
-
_id: n,
|
|
364
|
-
business: n,
|
|
365
|
-
name: e.string(),
|
|
366
|
-
code: e.string().nullish(),
|
|
367
|
-
otp: e.string().nullish(),
|
|
368
|
-
otpExpiredAt: e.coerce.date().nullish(),
|
|
369
|
-
apiToken: e.string().nullish()
|
|
370
|
-
}).describe(p.describe(Se));
|
|
371
|
-
e.object({
|
|
372
|
-
_id: n,
|
|
373
|
-
name: e.string(),
|
|
374
|
-
location: n,
|
|
375
|
-
os: e.string(),
|
|
376
|
-
apiToken: e.string().nullish()
|
|
377
|
-
}).describe(p.describe({
|
|
378
|
-
collectionName: "LocationDevices",
|
|
379
|
-
transform: {
|
|
380
|
-
_id: "oid",
|
|
381
|
-
location: "oid"
|
|
382
|
-
}
|
|
383
|
-
}));
|
|
384
|
-
const xe = e.enum(["PROGRESSIVE", "STAMP"]), Ne = e.object({
|
|
385
|
-
type: xe,
|
|
386
|
-
end: e.number().int().min(0, "Threshold need to be at least 1"),
|
|
387
|
-
rewards: e.array(e.lazy(() => v)).nullish()
|
|
388
|
-
}).superRefine((o, a) => {
|
|
389
|
-
o.type == "STAMP" && o.end > 40 && (a.addIssue({
|
|
390
|
-
code: "custom",
|
|
391
|
-
path: [],
|
|
392
|
-
message: "Stamp mission can have at most 40 threshold"
|
|
393
|
-
}), a.addIssue({
|
|
394
|
-
code: "custom",
|
|
395
|
-
path: ["end"],
|
|
396
|
-
message: "Stamp mission can have at most 40 threshold"
|
|
397
|
-
}));
|
|
398
|
-
}), Be = {
|
|
399
|
-
collectionName: "Groups",
|
|
400
|
-
transform: {
|
|
401
|
-
_id: "oid",
|
|
402
|
-
business: "oid"
|
|
403
|
-
},
|
|
404
|
-
lookups: {
|
|
405
|
-
business: {
|
|
406
|
-
fromCollection: "Businesses",
|
|
407
|
-
as: "pf_business"
|
|
408
|
-
},
|
|
409
|
-
pf_campaigns: {
|
|
410
|
-
fromCollection: "Campaigns",
|
|
411
|
-
as: "pf_campaigns",
|
|
412
|
-
localField: "_id",
|
|
413
|
-
foreignField: "group"
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
}, Ze = e.object({
|
|
417
|
-
_id: n,
|
|
418
|
-
name: e.string().min(1).max(300),
|
|
419
|
-
business: n,
|
|
420
|
-
pf_campaigns: e.array(e.any()).optional()
|
|
421
|
-
}).describe(p.describe(Be)), Ue = e.object({
|
|
422
|
-
from: e.string().email().nullish(),
|
|
423
|
-
name: e.string().min(1).max(50).nullish()
|
|
424
|
-
}), je = e.object({
|
|
425
|
-
type: e.literal(P.enum.MEMBERSHIP),
|
|
426
|
-
business: n,
|
|
427
|
-
name: e.string().min(1).max(50),
|
|
428
|
-
image: e.string().nullish(),
|
|
429
|
-
url: e.string().nullish(),
|
|
430
|
-
tiers: e.array(e.lazy(() => I)),
|
|
431
|
-
titles: e.array(n),
|
|
432
|
-
tierCycleEnable: e.boolean().optional(),
|
|
433
|
-
tierCycle: e.lazy(() => _).nullish(),
|
|
434
|
-
welcomeMessage: E.optional(),
|
|
435
|
-
advertisements: e.array(e.string()).optional(),
|
|
436
|
-
cardEnable: e.boolean().optional(),
|
|
437
|
-
design: e.array(
|
|
438
|
-
e.object({
|
|
439
|
-
_id: n,
|
|
440
|
-
image: e.string()
|
|
441
|
-
})
|
|
442
|
-
).optional(),
|
|
443
|
-
targetLocation: e.array(n).nullish(),
|
|
444
|
-
brand: e.string().nullish(),
|
|
445
|
-
email: Ue.nullish(),
|
|
446
|
-
freeCreditAsDiscount: e.boolean().optional(),
|
|
447
|
-
pf_title: e.array(e.lazy(() => d)).optional(),
|
|
448
|
-
pf_targetLocation: e.array(e.lazy(() => w)).optional(),
|
|
449
|
-
// new structure
|
|
450
|
-
group: e.string().nullish(),
|
|
451
|
-
templateId: n.nullish()
|
|
452
|
-
}), t = P.exclude(["MEMBERSHIP"]), l = e.object({
|
|
453
|
-
_id: n.nullish(),
|
|
454
|
-
type: t,
|
|
455
|
-
// common information
|
|
456
|
-
business: n,
|
|
457
|
-
name: e.string().min(1).max(50),
|
|
458
|
-
image: e.string().nullish(),
|
|
459
|
-
description: e.string().max(500).nullish(),
|
|
460
|
-
timeframeOptions: Q.superRefine((o, a) => {
|
|
461
|
-
o.start && o.end && o.end < o.start && a.addIssue({
|
|
462
|
-
code: "custom",
|
|
463
|
-
path: [],
|
|
464
|
-
params: {
|
|
465
|
-
i18n: { key: "timeframe.end_before_start" }
|
|
466
|
-
}
|
|
467
|
-
});
|
|
468
|
-
}).nullish(),
|
|
469
|
-
targetLocation: e.array(n).nullish(),
|
|
470
|
-
event: be,
|
|
471
|
-
config: $.nullish(),
|
|
472
|
-
currentReceive: e.coerce.number().optional(),
|
|
473
|
-
// new group structure
|
|
474
|
-
group: n.nullish(),
|
|
475
|
-
templateId: n.nullish(),
|
|
476
|
-
pf_targetLocation: e.array(e.lazy(() => w)).optional()
|
|
477
|
-
}), r = {
|
|
478
|
-
[t.enum.VOUCHER]: [
|
|
479
|
-
"BILL_COMPLETED",
|
|
480
|
-
"FEEDBACK",
|
|
481
|
-
"MEMBERSHIP_JOINED",
|
|
482
|
-
"TIER_UPGRADED",
|
|
483
|
-
"SCHEDULE",
|
|
484
|
-
"SIMPLE_CLAIM"
|
|
485
|
-
],
|
|
486
|
-
[t.enum.PROMOTION]: ["MAKING_ORDER"],
|
|
487
|
-
[t.enum.POINT]: [
|
|
488
|
-
"BILL_COMPLETED",
|
|
489
|
-
"FEEDBACK",
|
|
490
|
-
"MEMBERSHIP_JOINED",
|
|
491
|
-
"TIER_UPGRADED",
|
|
492
|
-
"SCHEDULE"
|
|
493
|
-
],
|
|
494
|
-
[t.enum.CREDIT]: [
|
|
495
|
-
"BILL_COMPLETED",
|
|
496
|
-
"FEEDBACK",
|
|
497
|
-
"MEMBERSHIP_JOINED",
|
|
498
|
-
"TIER_UPGRADED",
|
|
499
|
-
"SCHEDULE"
|
|
500
|
-
],
|
|
501
|
-
[t.enum.BROADCAST]: [
|
|
502
|
-
"SCHEDULE",
|
|
503
|
-
"ISSUE_REWARD",
|
|
504
|
-
"FEEDBACK"
|
|
505
|
-
],
|
|
506
|
-
[t.enum.COIN]: [
|
|
507
|
-
"BILL_COMPLETED",
|
|
508
|
-
"FEEDBACK",
|
|
509
|
-
"MEMBERSHIP_JOINED",
|
|
510
|
-
"TIER_UPGRADED",
|
|
511
|
-
"SCHEDULE"
|
|
512
|
-
],
|
|
513
|
-
[t.enum.REWARD_POOL]: ["GAME_COMPLETED"],
|
|
514
|
-
[t.enum.GAME]: [
|
|
515
|
-
"BILL_COMPLETED",
|
|
516
|
-
"FEEDBACK",
|
|
517
|
-
"MEMBERSHIP_JOINED",
|
|
518
|
-
"TIER_UPGRADED",
|
|
519
|
-
"SCHEDULE",
|
|
520
|
-
"SIMPLE_CLAIM"
|
|
521
|
-
],
|
|
522
|
-
[t.enum.MISSION]: [
|
|
523
|
-
"BILL_COMPLETED",
|
|
524
|
-
"FEEDBACK",
|
|
525
|
-
"SCHEDULE"
|
|
526
|
-
]
|
|
527
|
-
}, H = l.extend({
|
|
528
|
-
type: e.literal(t.enum.VOUCHER),
|
|
529
|
-
// event
|
|
530
|
-
code: e.string().min(0).max(15).optional(),
|
|
531
|
-
event: s.merge(
|
|
532
|
-
e.object({
|
|
533
|
-
type: e.enum(r[t.enum.VOUCHER])
|
|
534
|
-
})
|
|
535
|
-
),
|
|
536
|
-
earningOption: c.default({
|
|
537
|
-
amount: 1,
|
|
538
|
-
type: "FIXED"
|
|
539
|
-
}),
|
|
540
|
-
collectible: n,
|
|
541
|
-
hideInApp: e.boolean().optional(),
|
|
542
|
-
notify: e.boolean().optional(),
|
|
543
|
-
notifyMessage: e.lazy(() => E).optional(),
|
|
544
|
-
notifyCampaign: n.nullish(),
|
|
545
|
-
pf_collectible: e.lazy(() => d).optional(),
|
|
546
|
-
pf_notifyCampaign: e.lazy(() => g).optional()
|
|
547
|
-
}), Ge = e.object({
|
|
548
|
-
gameType: e.string()
|
|
549
|
-
}), k = l.extend({
|
|
550
|
-
type: e.literal(t.enum.PROMOTION),
|
|
551
|
-
// event
|
|
552
|
-
event: s.merge(
|
|
553
|
-
e.object({
|
|
554
|
-
type: e.enum(r[t.enum.PROMOTION])
|
|
555
|
-
})
|
|
556
|
-
),
|
|
557
|
-
effect: e.custom().superRefine((o, a) => {
|
|
558
|
-
o || a.addIssue({
|
|
559
|
-
code: "custom",
|
|
560
|
-
path: [],
|
|
561
|
-
params: {
|
|
562
|
-
i18n: { key: "zodCustom.campaign.effect_required" }
|
|
563
|
-
}
|
|
564
|
-
});
|
|
565
|
-
}),
|
|
566
|
-
gameConfig: Ge.nullish()
|
|
567
|
-
}), W = l.extend({
|
|
568
|
-
type: e.literal(t.enum.POINT),
|
|
569
|
-
// event
|
|
570
|
-
event: s.merge(
|
|
571
|
-
e.object({
|
|
572
|
-
type: e.enum(r[t.enum.POINT])
|
|
573
|
-
})
|
|
574
|
-
),
|
|
575
|
-
earningOption: c,
|
|
576
|
-
collectible: n,
|
|
577
|
-
notify: e.boolean().optional(),
|
|
578
|
-
notifyMessage: e.lazy(() => E).optional(),
|
|
579
|
-
notifyCampaign: n.nullish(),
|
|
580
|
-
pf_collectible: e.lazy(() => d).optional(),
|
|
581
|
-
pf_notifyCampaign: e.lazy(() => g).optional()
|
|
582
|
-
}), V = l.extend({
|
|
583
|
-
type: e.literal(t.enum.CREDIT),
|
|
584
|
-
// event
|
|
585
|
-
event: s.merge(
|
|
586
|
-
e.object({
|
|
587
|
-
type: e.enum(r[t.enum.CREDIT])
|
|
588
|
-
})
|
|
589
|
-
),
|
|
590
|
-
earningOption: c,
|
|
591
|
-
collectible: n,
|
|
592
|
-
notify: e.boolean().optional(),
|
|
593
|
-
notifyMessage: e.lazy(() => E).optional(),
|
|
594
|
-
notifyCampaign: n.nullish(),
|
|
595
|
-
pf_collectible: e.lazy(() => d).optional(),
|
|
596
|
-
pf_notifyCampaign: e.lazy(() => g).optional()
|
|
597
|
-
}), g = l.extend({
|
|
598
|
-
type: e.literal(t.enum.BROADCAST),
|
|
599
|
-
// event
|
|
600
|
-
event: s.merge(
|
|
601
|
-
e.object({
|
|
602
|
-
type: e.enum(r[t.enum.BROADCAST])
|
|
603
|
-
})
|
|
604
|
-
),
|
|
605
|
-
message: E,
|
|
606
|
-
linkedCampaign: n.nullish()
|
|
607
|
-
}), K = l.extend({
|
|
608
|
-
type: e.literal(t.enum.COIN),
|
|
609
|
-
// event
|
|
610
|
-
event: s.merge(
|
|
611
|
-
e.object({
|
|
612
|
-
type: e.enum(r[t.enum.COIN])
|
|
613
|
-
})
|
|
614
|
-
),
|
|
615
|
-
earningOption: c,
|
|
616
|
-
collectible: n,
|
|
617
|
-
notify: e.boolean().optional(),
|
|
618
|
-
notifyMessage: e.lazy(() => E).optional(),
|
|
619
|
-
notifyCampaign: n.nullish(),
|
|
620
|
-
pf_collectible: e.lazy(() => d).optional(),
|
|
621
|
-
pf_notifyCampaign: e.lazy(() => g).optional()
|
|
622
|
-
}), y = l.extend({
|
|
623
|
-
type: e.literal(t.enum.REWARD_POOL),
|
|
624
|
-
// event
|
|
625
|
-
event: s.merge(
|
|
626
|
-
e.object({
|
|
627
|
-
type: e.enum(r[t.enum.REWARD_POOL])
|
|
628
|
-
})
|
|
629
|
-
),
|
|
630
|
-
rewards: e.array(e.lazy(() => Le)).min(1, "Requires at least 1 reward")
|
|
631
|
-
}), J = l.extend({
|
|
632
|
-
type: e.literal(t.enum.GAME),
|
|
633
|
-
// event
|
|
634
|
-
event: s.merge(
|
|
635
|
-
e.object({
|
|
636
|
-
type: e.enum(r[t.enum.GAME])
|
|
637
|
-
})
|
|
638
|
-
),
|
|
639
|
-
earningOption: c,
|
|
640
|
-
collectible: n,
|
|
641
|
-
game: e.lazy(() => y).optional(),
|
|
642
|
-
pf_collectible: e.lazy(() => d).optional(),
|
|
643
|
-
rewardPool: n.optional()
|
|
644
|
-
}), Y = l.extend({
|
|
645
|
-
type: e.literal(t.enum.MISSION),
|
|
646
|
-
event: s.merge(
|
|
647
|
-
e.object({
|
|
648
|
-
type: e.enum(r[t.enum.MISSION])
|
|
649
|
-
})
|
|
650
|
-
),
|
|
651
|
-
earningOption: c,
|
|
652
|
-
collectible: n,
|
|
653
|
-
pf_collectible: e.lazy(() => d).optional(),
|
|
654
|
-
mission: e.lazy(() => Ne),
|
|
655
|
-
rewards: e.array(e.lazy(() => v)).min(1, "Requires at least 1 reward")
|
|
656
|
-
}), ze = {
|
|
657
|
-
collectionName: "Campaigns",
|
|
658
|
-
transform: {
|
|
659
|
-
_id: "oid",
|
|
660
|
-
business: "oid",
|
|
661
|
-
collectible: "oid",
|
|
662
|
-
templateId: "oid",
|
|
663
|
-
group: "oid",
|
|
664
|
-
notifyCampaign: "oid",
|
|
665
|
-
linkedCampaign: "oid",
|
|
666
|
-
rewardPool: "oid"
|
|
667
|
-
},
|
|
668
|
-
lookups: {
|
|
669
|
-
business: {
|
|
670
|
-
fromCollection: "Businesses",
|
|
671
|
-
as: "pf_business"
|
|
672
|
-
},
|
|
673
|
-
targetLocation: {
|
|
674
|
-
fromCollection: "Locations",
|
|
675
|
-
as: "pf_targetLocation"
|
|
676
|
-
},
|
|
677
|
-
collectible: {
|
|
678
|
-
fromCollection: "CollectibleConfigs",
|
|
679
|
-
as: "pf_collectible"
|
|
680
|
-
},
|
|
681
|
-
titles: {
|
|
682
|
-
fromCollection: "CollectibleConfigs",
|
|
683
|
-
as: "pf_title"
|
|
684
|
-
},
|
|
685
|
-
templateId: {
|
|
686
|
-
fromCollection: "Templates",
|
|
687
|
-
as: "template"
|
|
688
|
-
},
|
|
689
|
-
notifyCampaign: {
|
|
690
|
-
fromCollection: "Campaigns",
|
|
691
|
-
as: "pf_notifyCampaign"
|
|
692
|
-
},
|
|
693
|
-
rewardPool: {
|
|
694
|
-
fromCollection: "Campaigns",
|
|
695
|
-
as: "game"
|
|
696
|
-
}
|
|
697
|
-
}
|
|
698
|
-
}, Qe = e.object({ _id: n }).and(
|
|
699
|
-
e.discriminatedUnion("type", [
|
|
700
|
-
je,
|
|
701
|
-
H,
|
|
702
|
-
k,
|
|
703
|
-
W,
|
|
704
|
-
V,
|
|
705
|
-
g,
|
|
706
|
-
K,
|
|
707
|
-
y,
|
|
708
|
-
J,
|
|
709
|
-
Y
|
|
710
|
-
])
|
|
711
|
-
).describe(p.describe(ze)), $e = e.discriminatedUnion("type", [
|
|
712
|
-
H.extend({
|
|
713
|
-
business: n.nullish()
|
|
714
|
-
}),
|
|
715
|
-
k.extend({
|
|
716
|
-
business: n.nullish()
|
|
717
|
-
}),
|
|
718
|
-
W.extend({
|
|
719
|
-
business: n.nullish()
|
|
720
|
-
}),
|
|
721
|
-
V.extend({
|
|
722
|
-
business: n.nullish()
|
|
723
|
-
}),
|
|
724
|
-
g.extend({
|
|
725
|
-
business: n.nullish()
|
|
726
|
-
}),
|
|
727
|
-
K.extend({
|
|
728
|
-
business: n.nullish()
|
|
729
|
-
}),
|
|
730
|
-
y.extend({
|
|
731
|
-
rewards: e.array(e.lazy(() => F)).min(1, "Requires at least 1 reward")
|
|
732
|
-
}),
|
|
733
|
-
J.extend({
|
|
734
|
-
business: n.nullish(),
|
|
735
|
-
game: y.extend({
|
|
736
|
-
business: n.nullish(),
|
|
737
|
-
rewards: e.array(e.lazy(() => F)).min(1, "Requires at least 1 reward")
|
|
738
|
-
})
|
|
739
|
-
}),
|
|
740
|
-
Y.extend({
|
|
741
|
-
business: n.nullish(),
|
|
742
|
-
rewards: e.array(e.lazy(() => Pe)).min(1, "Requires at least 1 reward")
|
|
743
|
-
})
|
|
744
|
-
]);
|
|
745
|
-
export {
|
|
746
|
-
r as C,
|
|
747
|
-
Ye as F,
|
|
748
|
-
t as a,
|
|
749
|
-
Je as b,
|
|
750
|
-
Xe as c,
|
|
751
|
-
F as d,
|
|
752
|
-
xe as e,
|
|
753
|
-
Pe as f,
|
|
754
|
-
Ne as g,
|
|
755
|
-
Ke as h,
|
|
756
|
-
P as i,
|
|
757
|
-
Ze as j,
|
|
758
|
-
$e as k,
|
|
759
|
-
Qe as l,
|
|
760
|
-
je as m,
|
|
761
|
-
qe as r
|
|
762
|
-
};
|