@feedmepos/mf-connect 0.1.0-beta.17 → 0.1.0-beta.19

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.
Files changed (87) hide show
  1. package/dist/{Analytic-BvsvVIaJ.js → Analytic-C_VhRLv6.js} +8 -8
  2. package/dist/{App-B6i-kTvi.js → App-BfRWtnHD.js} +6 -6
  3. package/dist/{Broadcast-BMNY7jfz.js → Broadcast-CkP0D5Q0.js} +8 -8
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Cl-VwkQw.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-NtvMAKVf.js} +8 -9
  5. package/dist/{Card-BUxMxMv3.js → Card-B3LUbgFG.js} +16 -16
  6. package/dist/{Collections-fJ4dAA8O.js → Collections-auS6nQgP.js} +4 -4
  7. package/dist/{Credit-DeLJMW7U.js → Credit-DFCzt7yb.js} +8 -8
  8. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +108 -0
  9. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-KB_zk3f0.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BI0BX8t8.js} +27 -28
  10. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-Dy2q_1Kh.js → EffectSheet.vue_vue_type_style_index_0_lang-BrjVcauR.js} +6 -6
  11. package/dist/{Experience-DNlf2fYa.js → Experience-CVb3L3Nz.js} +8 -8
  12. package/dist/{Game-BXj3DErV.js → Game-CVtfz6Hq.js} +8 -8
  13. package/dist/{Index-FMFz2f9Z.js → Index-DFcZ4uTO.js} +7 -7
  14. package/dist/{Marketing-C8OjZOr2.js → Marketing-DLF6iuTD.js} +5 -5
  15. package/dist/{Member-BgwbYQrK.js → Member-CYtrF8IE.js} +4 -4
  16. package/dist/{MemberList-DMQUG_Kt.js → MemberList-CrUHnX69.js} +14 -14
  17. package/dist/{MemberTransactions-CQO2cHn6.js → MemberTransactions-DJGj_aav.js} +1 -1
  18. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-Ds_BwKa6.js → MessageInput.vue_vue_type_script_setup_true_lang-BEXdm4kC.js} +2 -2
  19. package/dist/{Mission-rHomcJXG.js → Mission-_LSdgxEz.js} +8 -8
  20. package/dist/Overview-CuIPJALM.js +879 -0
  21. package/dist/{Point-Du07BO13.js → Point-CVMEXAZ5.js} +23 -23
  22. package/dist/{Promotion-B1gbbfk2.js → Promotion-DSfbCLAe.js} +9 -9
  23. package/dist/{Record-0GtBWXRO.js → Record-BNzcMcpH.js} +4 -4
  24. package/dist/Reward-BCN44pw_.js +399 -0
  25. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-By5HgODg.js +151 -0
  26. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-E7ADhGR7.js → RuleGroup.vue_vue_type_script_setup_true_lang-X24tGtbC.js} +15 -15
  27. package/dist/{Segment-Ci4BDnan.js → Segment-MSDomTz2.js} +13 -13
  28. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-I2KT0px7.js → SelectItems.vue_vue_type_script_setup_true_lang-DyeY1fV7.js} +2 -2
  29. package/dist/{Setting-Dc9rLPuI.js → Setting-BOLu10II.js} +8 -8
  30. package/dist/Store-CtJ9sJol.js +1729 -0
  31. package/dist/{StoreRewards-Cho91MDd.js → StoreRewards-B5HCIRFt.js} +12 -12
  32. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-QNn_cpIj.js +957 -0
  33. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BmEP5mI5.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-arVZw_Lq.js} +1 -1
  34. package/dist/{Tier-DO9pTl_C.js → Tier-C3Y6q17j.js} +15 -15
  35. package/dist/{Title-CgQD-_3y.js → Title-_fk7AbId.js} +15 -15
  36. package/dist/{Transaction-DPmvpR7n.js → Transaction-D9CM1V_f.js} +2 -2
  37. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CJa-Tkws.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BIpPKUWx.js} +7 -7
  38. package/dist/{Voucher-Bq5Ev_fv.js → Voucher-Bo5QWYT0.js} +11 -11
  39. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DeQTAvCe.js → VoucherEditor.vue_vue_type_script_setup_true_lang-CjxmRY5U.js} +10 -10
  40. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DLFDd3Y3.js → ZodTextField.vue_vue_type_script_setup_true_lang-BK28WW3q.js} +1 -1
  41. package/dist/{app-BT6qeigc.js → app-C_djUlXx.js} +28 -28
  42. package/dist/{app-CtaeuBcs.js → app-ChpdgMfQ.js} +1 -1
  43. package/dist/app.js +1 -1
  44. package/dist/{business-Db2WFn9o.js → business-DJIj4b8e.js} +1 -1
  45. package/dist/{campaign-Bo2jmBiD.js → campaign-NrE6WI9q.js} +2 -2
  46. package/dist/{collectible.enum-BR9zmyJv.js → collectible.enum-BzLkFq1w.js} +1 -1
  47. package/dist/{collection.fn-Drj_6HD1.js → collection.fn-DQ71Nfut.js} +2 -2
  48. package/dist/{dto-BH8EtK7z.js → dto-12HT7-EA.js} +51 -51
  49. package/dist/{effect-l8oNjQBm.js → effect-CobPZ4Rb.js} +1 -1
  50. package/dist/{email-addresses-CBqWAs9Z.js → email-addresses-DiWLZMlA.js} +1 -1
  51. package/dist/{export-D6S3dr04.js → export-BrJSwHlS.js} +3 -3
  52. package/dist/{helper-CS2Hx33Q.js → helper-CCRX-fvI.js} +1 -1
  53. package/dist/{index-D2d2rTPz.js → index--wa67pRl.js} +1 -1
  54. package/dist/{index-CATw-eQI.js → index-BBkLSHsJ.js} +2 -2
  55. package/dist/{index-C7kr1TMO.js → index-BCyJY05i.js} +135 -229
  56. package/dist/{index-CXEJbUAO.js → index-BS_AxWZH.js} +1 -1
  57. package/dist/{index-Z61r-lWj.js → index-B__nVNTt.js} +1 -1
  58. package/dist/{index-5mZIFDhm.js → index-Bt2_f4Oi.js} +3 -3
  59. package/dist/index-CC2lo_Wb.js +1067 -0
  60. package/dist/{index-XoOcBFvx.js → index-C_KMGXv9.js} +4 -4
  61. package/dist/index-Ct8B2VHH.js +53 -0
  62. package/dist/{index-BsfC7C2D.js → index-DtnUFcfv.js} +1 -1
  63. package/dist/{index-BfhjAqeE.js → index-DwU8LaVM.js} +3 -3
  64. package/dist/{index-Bj5M_at2.js → index-DzJUULpT.js} +7 -1
  65. package/dist/{index-DVryx2wz.js → index-bsRZyOPx.js} +1 -1
  66. package/dist/{index.esm2017-Dg7M2BO7.js → index.esm2017-B_FgkPTh.js} +1 -1
  67. package/dist/{loading-DxWIhKJX.js → loading-fHk0Jjet.js} +4 -4
  68. package/dist/{membership-Df7gtzWJ.js → membership-BW1NS-Ql.js} +3 -3
  69. package/dist/{money-Ck4ZGH4F.js → money-CmeLOjIj.js} +1 -1
  70. package/dist/{number-D8umDJ-5.js → number-D0Hk2ezY.js} +1 -1
  71. package/dist/{objectid-BGnepAUg.js → objectid-hW6Oa6sR.js} +1 -1
  72. package/dist/{reward-5b5G4KYr.js → reward-BRZhngDm.js} +3 -3
  73. package/dist/{rule-BcLntzKp.js → rule-CECp9iUW.js} +3 -3
  74. package/dist/{rule-builder-B_RDlrnZ.js → rule-builder-BQpTUVhb.js} +1 -1
  75. package/dist/{template-C-myFW3k.js → template-CLAh7Qcz.js} +4 -4
  76. package/dist/{trigger-CAK3-5M9.js → trigger-BTbRRpH9.js} +4 -4
  77. package/dist/{vue-i18n-BC0lAbnG.js → vue-i18n-BQqGhLq-.js} +248 -248
  78. package/dist/{xlsx-DNZb1t3l.js → xlsx-BxwhyUvM.js} +1 -1
  79. package/package.json +3 -3
  80. package/dist/Overview-CmwJjXeT.js +0 -864
  81. package/dist/Reward-aH7S8WL3.js +0 -375
  82. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-XdyqSqlC.js +0 -138
  83. package/dist/Store-B94H-jff.js +0 -1531
  84. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CDiZz1AW.js +0 -890
  85. package/dist/index-CVfN0Gmc.js +0 -298
  86. package/dist/index-CmN2dQk5.js +0 -774
  87. package/dist/index-Ct847l9G.js +0 -50
@@ -1,774 +0,0 @@
1
- import { z as e, F as n, e as D, m as p } from "./loading-DxWIhKJX.js";
2
- import { c as _, F as T, e as c, f as X, g as Z, i as m, j as Q, k as $ } from "./index-CATw-eQI.js";
3
- import { b as L } from "./index-XoOcBFvx.js";
4
- import { d as P, e as ee } from "./index-5mZIFDhm.js";
5
- import { d as ne } from "./index-CVfN0Gmc.js";
6
- const S = e.enum([
7
- "VOUCHER",
8
- "PROMOTION",
9
- "POINT",
10
- "CREDIT",
11
- "MEMBERSHIP",
12
- "BROADCAST",
13
- "COIN",
14
- "REWARD_POOL",
15
- "GAME",
16
- "MISSION"
17
- ]), A = e.enum(["TIME_BASED_PROMOTION", "GAME_PROMOTION"]), Ke = {
18
- [A.enum.TIME_BASED_PROMOTION]: "7.7.4",
19
- [A.enum.GAME_PROMOTION]: "7.7.4"
20
- };
21
- e.object({
22
- location: n,
23
- memberId: n,
24
- nettTotal: D,
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: D,
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
- "REFERRAL_ADDED"
86
- ]), Je = i.extract([
87
- "BILL_COMPLETED",
88
- "FEEDBACK",
89
- "GAME_COMPLETED",
90
- "MAKING_ORDER",
91
- "MEMBERSHIP_JOINED",
92
- "SCHEDULE",
93
- "SIMPLE_CLAIM",
94
- "TIER_UPGRADED",
95
- "ISSUE_REWARD"
96
- ]);
97
- e.enum(["START_OF", "BEFORE"]);
98
- e.enum(["WEEK", "MONTH"]);
99
- const s = e.object({
100
- // type: F_EVENT_TYPE,
101
- rule: _.optional()
102
- }), ae = s.extend({
103
- type: e.literal(i.enum.BILL_COMPLETED)
104
- }), le = s.extend({
105
- type: e.literal(i.enum.FEEDBACK)
106
- }), re = s.extend({
107
- type: e.literal(i.enum.SIMPLE_CLAIM)
108
- });
109
- s.extend({
110
- type: e.literal(i.enum.ENTER_SEGMENT),
111
- segment: e.string()
112
- });
113
- const ce = s.extend({
114
- type: e.literal(i.enum.MEMBER_REWARD)
115
- }), de = s.extend({
116
- type: e.literal(i.enum.SCHEDULE)
117
- // option: FdoCronRule,
118
- }), me = s.extend({
119
- type: e.literal(i.enum.MEMBERSHIP_JOINED)
120
- }), ue = s.extend({
121
- type: e.literal(i.enum.TIER_UPGRADED)
122
- }), pe = s.extend({
123
- type: e.literal(i.enum.MAKING_ORDER)
124
- }), Ee = s.extend({
125
- type: e.literal(i.enum.ISSUE_REWARD)
126
- }), ge = s.extend({
127
- type: e.literal(i.enum.GAME_COMPLETED)
128
- });
129
- s.extend({
130
- type: e.literal(i.enum.REFERRAL_ADDED)
131
- });
132
- const be = e.discriminatedUnion("type", [
133
- re,
134
- ae,
135
- de,
136
- le,
137
- me,
138
- ue,
139
- pe,
140
- Ee,
141
- ce,
142
- ge
143
- ]);
144
- e.object({
145
- _id: n,
146
- type: i,
147
- ref: e.string(),
148
- context: e.record(e.string(), e.any()).optional()
149
- }).describe(JSON.stringify({ collectionName: "EventLogs" }));
150
- const d = e.object({
151
- type: i,
152
- context: e.any(),
153
- businessIds: e.array(n).optional(),
154
- campaignIds: e.array(n).optional(),
155
- slackWebhookUrl: e.string().optional(),
156
- emittedAt: e.coerce.date().default(/* @__PURE__ */ new Date())
157
- }), ye = d.extend({
158
- type: e.literal(i.enum.BILL_COMPLETED),
159
- context: e.object({
160
- bill: ie,
161
- rawBill: e.any()
162
- })
163
- }), Ce = d.extend({
164
- type: e.literal(i.enum.SCHEDULE),
165
- context: e.object({
166
- triggeredAt: e.coerce.date()
167
- })
168
- }), Re = d.extend({
169
- type: e.literal(i.enum.PAGINATE_SCHEDULE),
170
- context: e.object({
171
- triggeredAt: e.coerce.date(),
172
- business: n,
173
- skip: e.coerce.number(),
174
- limit: e.coerce.number()
175
- })
176
- }), _e = d.extend({
177
- type: e.literal(i.enum.FEEDBACK),
178
- context: e.object({
179
- feedback: se
180
- })
181
- }), Ie = d.extend({
182
- type: e.literal(i.enum.MEMBERSHIP_JOINED),
183
- context: e.object({
184
- user: L
185
- })
186
- }), he = d.extend({
187
- type: e.literal(i.enum.TIER_UPGRADED),
188
- context: e.object({
189
- transaction: P
190
- })
191
- }), fe = d.extend({
192
- type: e.literal(i.enum.ISSUE_REWARD),
193
- context: e.object({
194
- transaction: P,
195
- collection: ee
196
- })
197
- });
198
- d.extend({
199
- type: e.literal(i.enum.ISSUE_REWARD),
200
- context: e.object({})
201
- });
202
- e.discriminatedUnion("type", [
203
- ye,
204
- Ce,
205
- _e,
206
- Ie,
207
- he,
208
- fe,
209
- Re
210
- ]);
211
- const Oe = e.object({
212
- from: e.coerce.number(),
213
- to: e.coerce.number().optional()
214
- }).superRefine((o, a) => {
215
- o.from && o.to && o.from > o.to && a.addIssue({
216
- code: "custom",
217
- message: "Max experience must be more than min experience"
218
- });
219
- }), Me = e.enum(["MULTIPLIER", "FIXED"]);
220
- e.object({
221
- type: Me
222
- });
223
- const Ae = e.object({
224
- _id: n.optional(),
225
- rule: _,
226
- tierExpression: e.string().nullish(),
227
- expExpression: e.string().nullish()
228
- }), I = e.object({
229
- _id: n,
230
- name: e.string().min(1),
231
- image: e.string().nullish(),
232
- option: Oe,
233
- cycleOptions: e.array(e.lazy(() => Ae)).nullish(),
234
- member_count: e.number().optional()
235
- });
236
- I.partial({
237
- _id: !0
238
- });
239
- const Ye = I.partial({
240
- _id: !0
241
- }), Fe = {
242
- collectionName: "Cards",
243
- transform: {
244
- _id: "oid",
245
- business: "oid",
246
- member: "oid",
247
- redeemedAt: "date"
248
- },
249
- lookups: {
250
- business: {
251
- as: "business",
252
- fromCollection: "Business"
253
- },
254
- member: {
255
- as: "pf_member",
256
- fromCollection: "UsersV2"
257
- }
258
- }
259
- };
260
- e.object({
261
- _id: n,
262
- business: n,
263
- serialNumber: e.string(),
264
- setCardOnBind: e.boolean().nullish(),
265
- redeemedAt: e.date().nullish(),
266
- member: n.nullish(),
267
- design: e.string().nullish(),
268
- bundle: e.string().nullish(),
269
- subscriptionBundle: e.string().nullish(),
270
- pf_member: e.lazy(() => L).nullish(),
271
- pf_transaction: e.lazy(() => ne).nullish()
272
- }).describe(p.describe(Fe));
273
- const De = e.object({
274
- length: e.coerce.number().optional(),
275
- charset: e.string(),
276
- prefix: e.string().optional(),
277
- suffix: e.string().optional(),
278
- pattern: e.string().optional()
279
- });
280
- e.object({
281
- quantity: e.number(),
282
- code: e.string(),
283
- codeConfig: De,
284
- setCardOnBind: e.boolean().optional(),
285
- design: e.string().nullish(),
286
- bundle: e.string().optional(),
287
- subscriptionBundle: e.string().optional()
288
- });
289
- const Te = e.enum(["SMS", "EMAIL"]), E = e.object({
290
- channel: Te,
291
- variables: e.array(e.string()),
292
- title: e.string().nullish(),
293
- design: e.any(),
294
- content: e.string(),
295
- language: e.string(),
296
- imageUrl: e.string().nullish()
297
- }).superRefine((o, a) => {
298
- o.content.length == 0 && a.addIssue({
299
- code: e.ZodIssueCode.custom,
300
- message: "Content is required"
301
- });
302
- const C = /{{(.*?)}}/g, R = [...o.content.matchAll(C)].map((u) => u[1]), M = o.variables, b = R.filter((u) => M.indexOf(u) < 0);
303
- b.length && a.addIssue({
304
- code: e.ZodIssueCode.custom,
305
- message: "Invalid variable(s): " + b.join(", ")
306
- });
307
- });
308
- function qe(o, a) {
309
- return o.replace(/{{(.*?)}}/g, (C, R) => {
310
- const b = R.trim().split(".").reduce((u, q) => (u != null ? u[q] : null) ?? null, a);
311
- return b !== null ? b : C;
312
- });
313
- }
314
- const h = e.enum(["NO_REWARD", "VOUCHER", "LOYALTY"]), f = 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({
315
- type: e.literal(h.enum.NO_REWARD),
316
- collectible: e.null(),
317
- weight: f
318
- }), B = e.object({
319
- type: e.literal(h.enum.VOUCHER),
320
- collectible: n,
321
- collectibleConfig: e.lazy(() => T._def.right.options[0]),
322
- earningOption: e.lazy(() => c)
323
- }), O = e.object({
324
- type: e.literal(h.enum.LOYALTY),
325
- collectible: n,
326
- earningOption: e.lazy(() => c),
327
- validityOption: e.lazy(() => X)
328
- }), U = B.extend({
329
- weight: f
330
- }), j = O.extend({
331
- weight: e.number().min(0, "Weight need to be at least 0")
332
- }), Xe = O.extend({
333
- validityOption: Z,
334
- weight: f
335
- }), Le = e.discriminatedUnion("type", [
336
- U,
337
- j,
338
- N
339
- ]), F = e.discriminatedUnion("type", [
340
- U.extend({
341
- collectible: n.nullish(),
342
- business: n.nullish()
343
- }),
344
- j.extend({
345
- collectible: n.nullish(),
346
- business: n.nullish()
347
- }),
348
- N
349
- ]), G = B.extend({
350
- threshold: x
351
- }), z = O.extend({
352
- threshold: x
353
- }), v = e.discriminatedUnion("type", [
354
- G,
355
- z
356
- ]), Pe = e.discriminatedUnion("type", [
357
- G.extend({
358
- collectible: n.nullish(),
359
- business: n.nullish()
360
- }),
361
- z.extend({
362
- collectible: n.nullish(),
363
- collectibleConfig: T.nullish(),
364
- business: n.nullish()
365
- })
366
- ]), Se = {
367
- collectionName: "Locations",
368
- transform: {
369
- _id: "oid",
370
- business: "oid"
371
- }
372
- }, w = e.object({
373
- _id: n,
374
- business: n,
375
- name: e.string(),
376
- code: e.string().nullish(),
377
- otp: e.string().nullish(),
378
- otpExpiredAt: e.coerce.date().nullish(),
379
- apiToken: e.string().nullish()
380
- }).describe(p.describe(Se));
381
- e.object({
382
- _id: n,
383
- name: e.string(),
384
- location: n,
385
- os: e.string(),
386
- apiToken: e.string().nullish()
387
- }).describe(p.describe({
388
- collectionName: "LocationDevices",
389
- transform: {
390
- _id: "oid",
391
- location: "oid"
392
- }
393
- }));
394
- const xe = e.enum(["PROGRESSIVE", "STAMP"]), Ne = e.object({
395
- type: xe,
396
- end: e.number().int().min(0, "Threshold need to be at least 1"),
397
- rewards: e.array(e.lazy(() => v)).nullish()
398
- }).superRefine((o, a) => {
399
- o.type == "STAMP" && o.end > 40 && (a.addIssue({
400
- code: "custom",
401
- path: [],
402
- message: "Stamp mission can have at most 40 threshold"
403
- }), a.addIssue({
404
- code: "custom",
405
- path: ["end"],
406
- message: "Stamp mission can have at most 40 threshold"
407
- }));
408
- }), Be = {
409
- collectionName: "Groups",
410
- transform: {
411
- _id: "oid",
412
- business: "oid"
413
- },
414
- lookups: {
415
- business: {
416
- fromCollection: "Businesses",
417
- as: "pf_business"
418
- },
419
- pf_campaigns: {
420
- fromCollection: "Campaigns",
421
- as: "pf_campaigns",
422
- localField: "_id",
423
- foreignField: "group"
424
- }
425
- }
426
- }, Ze = e.object({
427
- _id: n,
428
- name: e.string().min(1).max(300),
429
- business: n,
430
- pf_campaigns: e.array(e.any()).optional()
431
- }).describe(p.describe(Be)), Ue = e.object({
432
- from: e.string().email().nullish(),
433
- name: e.string().min(1).max(50).nullish()
434
- }), je = e.object({
435
- type: e.literal(S.enum.MEMBERSHIP),
436
- business: n,
437
- name: e.string().min(1).max(50),
438
- image: e.string().nullish(),
439
- url: e.string().nullish(),
440
- tiers: e.array(e.lazy(() => I)),
441
- titles: e.array(n),
442
- tierCycleEnable: e.boolean().optional(),
443
- tierCycle: e.lazy(() => _).nullish(),
444
- welcomeMessage: E.optional(),
445
- advertisements: e.array(e.string()).optional(),
446
- cardEnable: e.boolean().optional(),
447
- design: e.array(
448
- e.object({
449
- _id: n,
450
- image: e.string()
451
- })
452
- ).optional(),
453
- targetLocation: e.array(n).nullish(),
454
- brand: e.string().nullish(),
455
- email: Ue.nullish(),
456
- freeCreditAsDiscount: e.boolean().optional(),
457
- pf_title: e.array(e.lazy(() => m)).optional(),
458
- pf_targetLocation: e.array(e.lazy(() => w)).optional(),
459
- // new structure
460
- group: e.string().nullish(),
461
- templateId: n.nullish()
462
- }), t = S.exclude(["MEMBERSHIP"]), l = e.object({
463
- _id: n.nullish(),
464
- type: t,
465
- // common information
466
- business: n,
467
- name: e.string().min(1).max(50),
468
- image: e.string().nullish(),
469
- description: e.string().max(500).nullish(),
470
- timeframeOptions: Q.superRefine((o, a) => {
471
- o.start && o.end && o.end < o.start && a.addIssue({
472
- code: "custom",
473
- path: [],
474
- params: {
475
- i18n: { key: "timeframe.end_before_start" }
476
- }
477
- });
478
- }).nullish(),
479
- targetLocation: e.array(n).nullish(),
480
- event: be,
481
- config: $.nullish(),
482
- currentReceive: e.coerce.number().optional(),
483
- // new group structure
484
- group: n.nullish(),
485
- templateId: n.nullish(),
486
- pf_targetLocation: e.array(e.lazy(() => w)).optional()
487
- }), r = {
488
- [t.enum.VOUCHER]: [
489
- "BILL_COMPLETED",
490
- "FEEDBACK",
491
- "MEMBERSHIP_JOINED",
492
- "TIER_UPGRADED",
493
- "SCHEDULE",
494
- "SIMPLE_CLAIM"
495
- ],
496
- [t.enum.PROMOTION]: ["MAKING_ORDER"],
497
- [t.enum.POINT]: [
498
- "BILL_COMPLETED",
499
- "FEEDBACK",
500
- "MEMBERSHIP_JOINED",
501
- "TIER_UPGRADED",
502
- "SCHEDULE"
503
- ],
504
- [t.enum.CREDIT]: [
505
- "BILL_COMPLETED",
506
- "FEEDBACK",
507
- "MEMBERSHIP_JOINED",
508
- "TIER_UPGRADED",
509
- "SCHEDULE"
510
- ],
511
- [t.enum.BROADCAST]: [
512
- "SCHEDULE",
513
- "ISSUE_REWARD",
514
- "FEEDBACK"
515
- ],
516
- [t.enum.COIN]: [
517
- "BILL_COMPLETED",
518
- "FEEDBACK",
519
- "MEMBERSHIP_JOINED",
520
- "TIER_UPGRADED",
521
- "SCHEDULE"
522
- ],
523
- [t.enum.REWARD_POOL]: ["GAME_COMPLETED"],
524
- [t.enum.GAME]: [
525
- "BILL_COMPLETED",
526
- "FEEDBACK",
527
- "MEMBERSHIP_JOINED",
528
- "TIER_UPGRADED",
529
- "SCHEDULE",
530
- "SIMPLE_CLAIM"
531
- ],
532
- [t.enum.MISSION]: [
533
- "BILL_COMPLETED",
534
- "FEEDBACK",
535
- "SCHEDULE"
536
- ]
537
- }, H = l.extend({
538
- type: e.literal(t.enum.VOUCHER),
539
- // event
540
- code: e.string().min(0).max(15).optional(),
541
- event: s.merge(
542
- e.object({
543
- type: e.enum(r[t.enum.VOUCHER])
544
- })
545
- ),
546
- earningOption: c.default({
547
- amount: 1,
548
- type: "FIXED"
549
- }),
550
- collectible: n,
551
- hideInApp: e.boolean().optional(),
552
- notify: e.boolean().optional(),
553
- notifyMessage: e.lazy(() => E).optional(),
554
- notifyCampaign: n.nullish(),
555
- pf_collectible: e.lazy(() => m).optional(),
556
- pf_notifyCampaign: e.lazy(() => g).optional()
557
- }), Ge = e.object({
558
- gameType: e.string()
559
- }), k = l.extend({
560
- type: e.literal(t.enum.PROMOTION),
561
- // event
562
- event: s.merge(
563
- e.object({
564
- type: e.enum(r[t.enum.PROMOTION])
565
- })
566
- ),
567
- effect: e.custom().superRefine((o, a) => {
568
- o || a.addIssue({
569
- code: "custom",
570
- path: [],
571
- params: {
572
- i18n: { key: "zodCustom.campaign.effect_required" }
573
- }
574
- });
575
- }),
576
- gameConfig: Ge.nullish()
577
- }), W = l.extend({
578
- type: e.literal(t.enum.POINT),
579
- // event
580
- event: s.merge(
581
- e.object({
582
- type: e.enum(r[t.enum.POINT])
583
- })
584
- ),
585
- earningOption: c,
586
- collectible: n,
587
- notify: e.boolean().optional(),
588
- notifyMessage: e.lazy(() => E).optional(),
589
- notifyCampaign: n.nullish(),
590
- pf_collectible: e.lazy(() => m).optional(),
591
- pf_notifyCampaign: e.lazy(() => g).optional()
592
- }), V = l.extend({
593
- type: e.literal(t.enum.CREDIT),
594
- // event
595
- event: s.merge(
596
- e.object({
597
- type: e.enum(r[t.enum.CREDIT])
598
- })
599
- ),
600
- earningOption: c,
601
- collectible: n,
602
- notify: e.boolean().optional(),
603
- notifyMessage: e.lazy(() => E).optional(),
604
- notifyCampaign: n.nullish(),
605
- pf_collectible: e.lazy(() => m).optional(),
606
- pf_notifyCampaign: e.lazy(() => g).optional()
607
- }), g = l.extend({
608
- type: e.literal(t.enum.BROADCAST),
609
- // event
610
- event: s.merge(
611
- e.object({
612
- type: e.enum(r[t.enum.BROADCAST])
613
- })
614
- ),
615
- message: E,
616
- linkedCampaign: n.nullish()
617
- }), K = l.extend({
618
- type: e.literal(t.enum.COIN),
619
- // event
620
- event: s.merge(
621
- e.object({
622
- type: e.enum(r[t.enum.COIN])
623
- })
624
- ),
625
- earningOption: c,
626
- collectible: n,
627
- notify: e.boolean().optional(),
628
- notifyMessage: e.lazy(() => E).optional(),
629
- notifyCampaign: n.nullish(),
630
- pf_collectible: e.lazy(() => m).optional(),
631
- pf_notifyCampaign: e.lazy(() => g).optional()
632
- }), y = l.extend({
633
- type: e.literal(t.enum.REWARD_POOL),
634
- // event
635
- event: s.merge(
636
- e.object({
637
- type: e.enum(r[t.enum.REWARD_POOL])
638
- })
639
- ),
640
- rewards: e.array(e.lazy(() => Le)).min(1, "Requires at least 1 reward")
641
- }), J = l.extend({
642
- type: e.literal(t.enum.GAME),
643
- // event
644
- event: s.merge(
645
- e.object({
646
- type: e.enum(r[t.enum.GAME])
647
- })
648
- ),
649
- earningOption: c,
650
- collectible: n,
651
- game: e.lazy(() => y).optional(),
652
- pf_collectible: e.lazy(() => m).optional(),
653
- rewardPool: n.optional()
654
- }), Y = l.extend({
655
- type: e.literal(t.enum.MISSION),
656
- event: s.merge(
657
- e.object({
658
- type: e.enum(r[t.enum.MISSION])
659
- })
660
- ),
661
- earningOption: c,
662
- collectible: n,
663
- pf_collectible: e.lazy(() => m).optional(),
664
- mission: e.lazy(() => Ne),
665
- rewards: e.array(e.lazy(() => v)).min(1, "Requires at least 1 reward")
666
- }), ze = {
667
- collectionName: "Campaigns",
668
- transform: {
669
- _id: "oid",
670
- business: "oid",
671
- collectible: "oid",
672
- templateId: "oid",
673
- group: "oid",
674
- notifyCampaign: "oid",
675
- linkedCampaign: "oid",
676
- rewardPool: "oid"
677
- },
678
- lookups: {
679
- business: {
680
- fromCollection: "Businesses",
681
- as: "pf_business"
682
- },
683
- targetLocation: {
684
- fromCollection: "Locations",
685
- as: "pf_targetLocation"
686
- },
687
- collectible: {
688
- fromCollection: "CollectibleConfigs",
689
- as: "pf_collectible"
690
- },
691
- titles: {
692
- fromCollection: "CollectibleConfigs",
693
- as: "pf_title"
694
- },
695
- templateId: {
696
- fromCollection: "Templates",
697
- as: "template"
698
- },
699
- notifyCampaign: {
700
- fromCollection: "Campaigns",
701
- as: "pf_notifyCampaign"
702
- },
703
- rewardPool: {
704
- fromCollection: "Campaigns",
705
- as: "game"
706
- }
707
- }
708
- }, Qe = e.object({ _id: n }).and(
709
- e.discriminatedUnion("type", [
710
- je,
711
- H,
712
- k,
713
- W,
714
- V,
715
- g,
716
- K,
717
- y,
718
- J,
719
- Y
720
- ])
721
- ).describe(p.describe(ze)), $e = e.discriminatedUnion("type", [
722
- H.extend({
723
- business: n.nullish()
724
- }),
725
- k.extend({
726
- business: n.nullish()
727
- }),
728
- W.extend({
729
- business: n.nullish()
730
- }),
731
- V.extend({
732
- business: n.nullish()
733
- }),
734
- g.extend({
735
- business: n.nullish()
736
- }),
737
- K.extend({
738
- business: n.nullish()
739
- }),
740
- y.extend({
741
- rewards: e.array(e.lazy(() => F)).min(1, "Requires at least 1 reward")
742
- }),
743
- J.extend({
744
- business: n.nullish(),
745
- game: y.extend({
746
- business: n.nullish(),
747
- rewards: e.array(e.lazy(() => F)).min(1, "Requires at least 1 reward")
748
- })
749
- }),
750
- Y.extend({
751
- business: n.nullish(),
752
- rewards: e.array(e.lazy(() => Pe)).min(1, "Requires at least 1 reward")
753
- })
754
- ]);
755
- export {
756
- r as C,
757
- Ye as F,
758
- t as a,
759
- Xe as b,
760
- F as c,
761
- xe as d,
762
- Pe as e,
763
- Ne as f,
764
- Ke as g,
765
- S as h,
766
- Ze as i,
767
- $e as j,
768
- Qe as k,
769
- Je as l,
770
- i as m,
771
- be as n,
772
- je as o,
773
- qe as r
774
- };