@feedmepos/mf-connect 0.1.9-prod → 0.1.11-prod

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 (90) hide show
  1. package/dist/{Analytic-8Ew7y5t9.js → Analytic-Bbt1kP2U.js} +24 -23
  2. package/dist/{App-3BVNH3r-.js → App-CVA65EVC.js} +56 -51
  3. package/dist/{Broadcast-CrsPUhLT.js → Broadcast-BJXK8OE5.js} +8 -8
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DE300Y56.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DDEx0cK9.js} +7 -7
  5. package/dist/Card-DFiUkfYj.js +895 -0
  6. package/dist/{Collections-djS9hLI8.js → Collections-qVnvveUf.js} +24 -29
  7. package/dist/{Credit-D4KEvIov.js → Credit-BWHTbAG-.js} +8 -8
  8. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-BjM81fmS.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-4_cHlWUJ.js} +648 -1284
  9. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-aEWfdpCg.js → EffectSheet.vue_vue_type_style_index_0_lang-DLgZd4HU.js} +19 -19
  10. package/dist/{Experience-2FPLO7aV.js → Experience-BmGSus53.js} +8 -8
  11. package/dist/{Game-e_UjVJgU.js → Game-49w7XN5k.js} +8 -8
  12. package/dist/Index-D-7hsAaE.js +258 -0
  13. package/dist/{Marketing-B2hCjZ2r.js → Marketing-DtbJxS_j.js} +5 -5
  14. package/dist/{Member-D_ykRIBb.js → Member-jZks4pw_.js} +4 -4
  15. package/dist/{MemberList-LmzzYxEn.js → MemberList-BqO54kPC.js} +193 -189
  16. package/dist/{MemberTransactions-B2vqlKaP.js → MemberTransactions-CLK7VmPw.js} +1 -1
  17. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DQ2ubF0N.js → MessageInput.vue_vue_type_script_setup_true_lang-ef2Qrdvd.js} +2 -2
  18. package/dist/Mission-LGC1CGrB.js +273 -0
  19. package/dist/Overview-Dm_ycoqZ.js +1078 -0
  20. package/dist/{Point-DFriwWWY.js → Point-BBNJ9cc5.js} +8 -8
  21. package/dist/{Promotion-Db3IEs2F.js → Promotion-DFh9IEmP.js} +9 -9
  22. package/dist/Record-oBmJTn3G.js +338 -0
  23. package/dist/Reward-DR_HzrrM.js +441 -0
  24. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-Du_0o2b9.js +150 -0
  25. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-CxXugphA.js +1638 -0
  26. package/dist/{Segment-CE8q9JV2.js → Segment-DjyHLWZC.js} +13 -13
  27. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-stTwgie4.js +181 -0
  28. package/dist/{Setting-Vcz1S27V.js → Setting-a7Tw-3ht.js} +31 -31
  29. package/dist/Store-HWGWswEm.js +1744 -0
  30. package/dist/{StoreRewards-Dt30AkWo.js → StoreRewards-s4cX1bFH.js} +12 -12
  31. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Dq4qIXZu.js +1132 -0
  32. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-f59onlgt.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BQpbScyf.js} +1 -1
  33. package/dist/{Tier-a6yXEtLd.js → Tier-C7kiLjzE.js} +19 -19
  34. package/dist/{Title-A3-2EI0w.js → Title-BPv1ZiHg.js} +19 -19
  35. package/dist/{Transaction-DswABr2P.js → Transaction-HdR7RiGY.js} +2 -2
  36. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-D3VgIQb-.js +130 -0
  37. package/dist/{Voucher-DEoVgZYa.js → Voucher-Y5Lh5xms.js} +11 -11
  38. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-CFKID7mS.js +419 -0
  39. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-ccc1vxjS.js → ZodTextField.vue_vue_type_script_setup_true_lang-6asSbt53.js} +1 -1
  40. package/dist/{app-C23GfQGq.js → app-Bh2mviM1.js} +1 -1
  41. package/dist/{app-C66C2KLW.js → app-MbHo43vs.js} +982 -698
  42. package/dist/app.js +1 -1
  43. package/dist/{business-DNAVZOSH.js → business-DMzeDNMd.js} +1 -1
  44. package/dist/{campaign-Cv0HaUD1.js → campaign-2swZVVbi.js} +2 -2
  45. package/dist/campaign.enum-CHI6p9lH.js +20 -0
  46. package/dist/campaign.fn-DNwV5ZWO.js +758 -0
  47. package/dist/collectible.enum-Y3ALLTcR.js +19 -0
  48. package/dist/{collection.fn-Dxzr2oPt.js → collection.fn-CfvnmVQa.js} +2 -2
  49. package/dist/dto-DseG41FR.js +2018 -0
  50. package/dist/{effect-CUuL8Tci.js → effect-BH4hGy1N.js} +1 -1
  51. package/dist/{email-addresses-Yt3s7i2b.js → email-addresses-doOfKmSj.js} +1 -1
  52. package/dist/{export-CNg5YWMm.js → export-DGrsZa4F.js} +3 -3
  53. package/dist/{helper-DzmKNFue.js → helper-3ohDu5Tn.js} +1 -1
  54. package/dist/{index-BK8X9RF6.js → index-B8HMoADH.js} +3 -3
  55. package/dist/{index-D0obMrAS.js → index-BUzeShnL.js} +173 -62
  56. package/dist/index-BWwF7uuk.js +1049 -0
  57. package/dist/index-BXw9yi-G.js +32 -0
  58. package/dist/{index-yzH5eyKW.js → index-C-ozJGq6.js} +1 -1
  59. package/dist/{index-CsCgQ8gt.js → index-CDT7BpQ3.js} +1 -1
  60. package/dist/{index-Dnf7j71V.js → index-CKfeyWFN.js} +9 -3
  61. package/dist/{index-9CXt2kbQ.js → index-CKji0U5N.js} +293 -287
  62. package/dist/{index-QuBsnXgx.js → index-CVlbqA1t.js} +1 -1
  63. package/dist/{index-B88e_9YI.js → index-D5CHO7oc.js} +1 -1
  64. package/dist/{index-O9lB54LY.js → index-rYTZxC9p.js} +1348 -1342
  65. package/dist/index-vh86FiIQ.js +10 -0
  66. package/dist/index-wBdTUnZ6.js +54 -0
  67. package/dist/{index.esm2017-TpBElhnN.js → index.esm2017-D-hthfW3.js} +1 -1
  68. package/dist/{loading-ChoC5E9d.js → loading-DQnXnCXT.js} +156 -153
  69. package/dist/{membership-CU-k0-Tf.js → membership-C3envHTy.js} +52 -44
  70. package/dist/{money-DANmyTBj.js → money-Dm7B8wUJ.js} +1 -1
  71. package/dist/{number-DrocTWDD.js → number-Swjcamr8.js} +1 -1
  72. package/dist/objectid-xH_8eWzr.js +145 -0
  73. package/dist/reward-DOggYNm3.js +36 -0
  74. package/dist/{rule-BQLmpER9.js → rule-BQy3e3DE.js} +4 -3
  75. package/dist/{rule-builder-3YRdr18A.js → rule-builder-CPWmw5lP.js} +1 -1
  76. package/dist/{template-DOKU1QkY.js → template-Dprn2jD_.js} +4 -4
  77. package/dist/trigger-BUY-zCBi.js +144 -0
  78. package/dist/{usePagination-JGI7x0W7.js → usePagination-CEQLUMQ7.js} +1 -1
  79. package/dist/user-DIK4sBIA.js +54 -0
  80. package/dist/{vue-i18n-Bch1JmhI.js → vue-i18n-B7ledd-g.js} +120 -120
  81. package/package.json +2 -2
  82. package/dist/Card-DndggRLr.js +0 -1036
  83. package/dist/Mission-CsLdMq1M.js +0 -261
  84. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-_P2yImhi.js +0 -1804
  85. package/dist/Store-C8kT7JN5.js +0 -1531
  86. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Cc2F_06x.js +0 -1065
  87. package/dist/dto-CcrufW2j.js +0 -2770
  88. package/dist/index-C7745kXl.js +0 -755
  89. package/dist/index-CZ28ywyB.js +0 -298
  90. package/dist/user-Bm4KttFq.js +0 -37
@@ -1,755 +0,0 @@
1
- import { z as e, F as n, e as D, m as p } from "./loading-ChoC5E9d.js";
2
- import { e as _, F as T, a as c, h as X, g as Z, k as d, m as Q, n as $ } from "./index-O9lB54LY.js";
3
- import { i as L, g as P, h as ee } from "./index-9CXt2kbQ.js";
4
- import { d as ne } from "./index-CZ28ywyB.js";
5
- const S = e.enum([
6
- "VOUCHER",
7
- "PROMOTION",
8
- "POINT",
9
- "CREDIT",
10
- "MEMBERSHIP",
11
- "BROADCAST",
12
- "COIN",
13
- "REWARD_POOL",
14
- "GAME",
15
- "MISSION"
16
- ]), F = e.enum(["TIME_BASED_PROMOTION", "GAME_PROMOTION"]), We = {
17
- [F.enum.TIME_BASED_PROMOTION]: "7.7.4",
18
- [F.enum.GAME_PROMOTION]: "7.7.4"
19
- };
20
- e.object({
21
- location: n,
22
- memberId: n,
23
- nettTotal: D,
24
- remark: e.string().optional()
25
- });
26
- const te = e.enum(["COUNTER", "POS"]);
27
- e.object({
28
- id: e.string(),
29
- userId: e.string(),
30
- name: e.string().nullish(),
31
- birthday: e.string().nullish(),
32
- phoneNumber: e.string().nullish(),
33
- balance: e.number().nullish(),
34
- level: e.number().nullish(),
35
- mostPurchasedItems: e.array(e.string()).nullish()
36
- });
37
- const oe = {
38
- collectionName: "Bills"
39
- }, ie = e.object({
40
- _id: e.string(),
41
- items: e.record(e.string(), e.number()).nullish(),
42
- // business: z.string(),
43
- // adjustments: z.record(FdoBillAdjustment),
44
- // refundedFrom: z.string().nullish(),
45
- user: e.string().nullish(),
46
- memberid: e.string().nullish(),
47
- // roundToNearest: z.number().nullish(),
48
- nettTotal: D,
49
- // activeItems: z.array(z.string()),
50
- remark: e.string().nullish(),
51
- createdAt: e.coerce.date(),
52
- completedAt: e.coerce.date(),
53
- location: e.string(),
54
- channel: te.optional()
55
- }).transform((o) => ({
56
- ...o,
57
- createdTime: o.createdAt,
58
- completedTime: o.completedAt,
59
- get amount() {
60
- return o.nettTotal.amount / 10 ** o.nettTotal.precision;
61
- }
62
- })).describe(p.describe(oe)), ae = e.object({
63
- _id: e.string(),
64
- rating: e.coerce.number(),
65
- user: e.string(),
66
- restaurant: e.string(),
67
- message: e.string(),
68
- submittedAt: e.coerce.date()
69
- }), i = e.enum([
70
- "SIMPLE_CLAIM",
71
- "LINK_CLAIM",
72
- "BILL_COMPLETED",
73
- "SCHEDULE",
74
- "BIRTHDAY",
75
- "FEEDBACK",
76
- "ENTER_SEGMENT",
77
- "MEMBERSHIP_JOINED",
78
- "TIER_UPGRADED",
79
- "MAKING_ORDER",
80
- "ISSUE_REWARD",
81
- "MEMBER_REWARD",
82
- "GAME_COMPLETED",
83
- "PAGINATE_SCHEDULE"
84
- ]), Ve = i.extract([
85
- "BILL_COMPLETED",
86
- "FEEDBACK",
87
- "GAME_COMPLETED",
88
- "MAKING_ORDER",
89
- "MEMBERSHIP_JOINED",
90
- "SCHEDULE",
91
- "SIMPLE_CLAIM",
92
- "TIER_UPGRADED",
93
- "ISSUE_REWARD"
94
- ]);
95
- e.enum(["START_OF", "BEFORE"]);
96
- e.enum(["WEEK", "MONTH"]);
97
- const a = e.object({
98
- // type: F_EVENT_TYPE,
99
- rule: _.optional()
100
- }), se = a.extend({
101
- type: e.literal(i.enum.BILL_COMPLETED)
102
- }), le = a.extend({
103
- type: e.literal(i.enum.FEEDBACK)
104
- }), re = a.extend({
105
- type: e.literal(i.enum.SIMPLE_CLAIM)
106
- });
107
- a.extend({
108
- type: e.literal(i.enum.ENTER_SEGMENT),
109
- segment: e.string()
110
- });
111
- const ce = a.extend({
112
- type: e.literal(i.enum.MEMBER_REWARD)
113
- }), de = a.extend({
114
- type: e.literal(i.enum.SCHEDULE)
115
- // option: FdoCronRule,
116
- }), me = a.extend({
117
- type: e.literal(i.enum.MEMBERSHIP_JOINED)
118
- }), ue = a.extend({
119
- type: e.literal(i.enum.TIER_UPGRADED)
120
- }), pe = a.extend({
121
- type: e.literal(i.enum.MAKING_ORDER)
122
- }), Ee = a.extend({
123
- type: e.literal(i.enum.ISSUE_REWARD)
124
- }), ge = a.extend({
125
- type: e.literal(i.enum.GAME_COMPLETED)
126
- }), be = e.discriminatedUnion("type", [
127
- re,
128
- se,
129
- de,
130
- le,
131
- me,
132
- ue,
133
- pe,
134
- Ee,
135
- ce,
136
- ge
137
- ]);
138
- e.object({
139
- _id: n,
140
- type: i,
141
- ref: e.string(),
142
- context: e.record(e.string(), e.any()).optional()
143
- }).describe(JSON.stringify({ collectionName: "EventLogs" }));
144
- const m = e.object({
145
- type: i,
146
- context: e.any(),
147
- businessIds: e.array(n).optional(),
148
- campaignIds: e.array(n).optional(),
149
- slackWebhookUrl: e.string().optional(),
150
- emittedAt: e.coerce.date().default(/* @__PURE__ */ new Date())
151
- }), ye = m.extend({
152
- type: e.literal(i.enum.BILL_COMPLETED),
153
- context: e.object({
154
- bill: ie,
155
- rawBill: e.any()
156
- })
157
- }), Ce = m.extend({
158
- type: e.literal(i.enum.SCHEDULE),
159
- context: e.object({
160
- triggeredAt: e.coerce.date()
161
- })
162
- }), Re = m.extend({
163
- type: e.literal(i.enum.PAGINATE_SCHEDULE),
164
- context: e.object({
165
- triggeredAt: e.coerce.date(),
166
- business: n,
167
- skip: e.coerce.number(),
168
- limit: e.coerce.number()
169
- })
170
- }), _e = m.extend({
171
- type: e.literal(i.enum.FEEDBACK),
172
- context: e.object({
173
- feedback: ae
174
- })
175
- }), Ie = m.extend({
176
- type: e.literal(i.enum.MEMBERSHIP_JOINED),
177
- context: e.object({
178
- user: L
179
- })
180
- }), he = m.extend({
181
- type: e.literal(i.enum.TIER_UPGRADED),
182
- context: e.object({
183
- transaction: P
184
- })
185
- }), fe = m.extend({
186
- type: e.literal(i.enum.ISSUE_REWARD),
187
- context: e.object({
188
- transaction: P,
189
- collection: ee
190
- })
191
- });
192
- e.discriminatedUnion("type", [
193
- ye,
194
- Ce,
195
- _e,
196
- Ie,
197
- he,
198
- fe,
199
- Re
200
- ]);
201
- const Oe = e.object({
202
- from: e.coerce.number(),
203
- to: e.coerce.number().optional()
204
- }).superRefine((o, s) => {
205
- o.from && o.to && o.from > o.to && s.addIssue({
206
- code: "custom",
207
- message: "Max experience must be more than min experience"
208
- });
209
- }), Me = e.enum(["MULTIPLIER", "FIXED"]);
210
- e.object({
211
- type: Me
212
- });
213
- const Fe = e.object({
214
- _id: n.optional(),
215
- rule: _,
216
- tierExpression: e.string().nullish(),
217
- expExpression: e.string().nullish()
218
- }), I = e.object({
219
- _id: n,
220
- name: e.string().min(1),
221
- image: e.string().nullish(),
222
- option: Oe,
223
- cycleOptions: e.array(e.lazy(() => Fe)).nullish(),
224
- member_count: e.number().optional()
225
- });
226
- I.partial({
227
- _id: !0
228
- });
229
- const Ke = I.partial({
230
- _id: !0
231
- }), Ae = {
232
- collectionName: "Cards",
233
- transform: {
234
- _id: "oid",
235
- business: "oid",
236
- member: "oid",
237
- redeemedAt: "date"
238
- },
239
- lookups: {
240
- business: {
241
- as: "business",
242
- fromCollection: "Business"
243
- },
244
- member: {
245
- as: "pf_member",
246
- fromCollection: "UsersV2"
247
- }
248
- }
249
- };
250
- e.object({
251
- _id: n,
252
- business: n,
253
- serialNumber: e.string(),
254
- setCardOnBind: e.boolean().nullish(),
255
- redeemedAt: e.date().nullish(),
256
- member: n.nullish(),
257
- design: e.string().nullish(),
258
- bundle: e.string().nullish(),
259
- subscriptionBundle: e.string().nullish(),
260
- pf_member: e.lazy(() => L).nullish(),
261
- pf_transaction: e.lazy(() => ne).nullish()
262
- }).describe(p.describe(Ae));
263
- const De = e.object({
264
- length: e.coerce.number().optional(),
265
- charset: e.string(),
266
- prefix: e.string().optional(),
267
- suffix: e.string().optional(),
268
- pattern: e.string().optional()
269
- });
270
- e.object({
271
- quantity: e.number(),
272
- code: e.string(),
273
- codeConfig: De,
274
- setCardOnBind: e.boolean().optional(),
275
- design: e.string().nullish(),
276
- bundle: e.string().optional(),
277
- subscriptionBundle: e.string().optional()
278
- });
279
- const Te = e.enum(["SMS", "WHATSAPP"]), E = e.object({
280
- channel: Te,
281
- variables: e.array(e.string()),
282
- content: e.string(),
283
- language: e.string(),
284
- imageUrl: e.string().optional()
285
- }).superRefine((o, s) => {
286
- o.content.length == 0 && s.addIssue({
287
- code: e.ZodIssueCode.custom,
288
- message: "Content is required"
289
- });
290
- const C = /{{(.*?)}}/g, R = [...o.content.matchAll(C)].map((u) => u[1]), M = o.variables, b = R.filter((u) => M.indexOf(u) < 0);
291
- b.length && s.addIssue({
292
- code: e.ZodIssueCode.custom,
293
- message: "Invalid variable(s): " + b.join(", ")
294
- });
295
- });
296
- function Je(o, s) {
297
- return o.replace(/{{(.*?)}}/g, (C, R) => {
298
- const b = R.trim().split(".").reduce((u, q) => (u != null ? u[q] : null) ?? null, s);
299
- return b !== null ? b : C;
300
- });
301
- }
302
- 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({
303
- type: e.literal(h.enum.NO_REWARD),
304
- collectible: e.null(),
305
- weight: f
306
- }), B = e.object({
307
- type: e.literal(h.enum.VOUCHER),
308
- collectible: n,
309
- collectibleConfig: e.lazy(() => T._def.right.options[0]),
310
- earningOption: e.lazy(() => c)
311
- }), O = e.object({
312
- type: e.literal(h.enum.LOYALTY),
313
- collectible: n,
314
- earningOption: e.lazy(() => c),
315
- validityOption: e.lazy(() => X)
316
- }), U = B.extend({
317
- weight: f
318
- }), j = O.extend({
319
- weight: e.number().min(0, "Weight need to be at least 0")
320
- }), Ye = O.extend({
321
- validityOption: Z,
322
- weight: f
323
- }), Le = e.discriminatedUnion("type", [
324
- U,
325
- j,
326
- N
327
- ]), A = e.discriminatedUnion("type", [
328
- U.extend({
329
- collectible: n.nullish(),
330
- business: n.nullish()
331
- }),
332
- j.extend({
333
- collectible: n.nullish(),
334
- business: n.nullish()
335
- }),
336
- N
337
- ]), G = B.extend({
338
- threshold: x
339
- }), z = O.extend({
340
- threshold: x
341
- }), H = e.discriminatedUnion("type", [
342
- G,
343
- z
344
- ]), Pe = e.discriminatedUnion("type", [
345
- G.extend({
346
- collectible: n.nullish(),
347
- business: n.nullish()
348
- }),
349
- z.extend({
350
- collectible: n.nullish(),
351
- collectibleConfig: T.nullish(),
352
- business: n.nullish()
353
- })
354
- ]), Se = {
355
- collectionName: "Locations",
356
- transform: {
357
- _id: "oid",
358
- business: "oid"
359
- }
360
- }, v = e.object({
361
- _id: n,
362
- business: n,
363
- name: e.string(),
364
- code: e.string().nullish(),
365
- otp: e.string().nullish(),
366
- otpExpiredAt: e.coerce.date().nullish(),
367
- apiToken: e.string().nullish()
368
- }).describe(p.describe(Se));
369
- e.object({
370
- _id: n,
371
- name: e.string(),
372
- location: n,
373
- os: e.string(),
374
- apiToken: e.string().nullish()
375
- }).describe(p.describe({
376
- collectionName: "LocationDevices",
377
- transform: {
378
- _id: "oid",
379
- location: "oid"
380
- }
381
- }));
382
- const xe = e.enum(["PROGRESSIVE", "STAMP"]), Ne = e.object({
383
- type: xe,
384
- end: e.number().int().min(0, "Threshold need to be at least 1"),
385
- rewards: e.array(e.lazy(() => H)).nullish()
386
- }).superRefine((o, s) => {
387
- o.type == "STAMP" && o.end > 40 && (s.addIssue({
388
- code: "custom",
389
- path: [],
390
- message: "Stamp mission can have at most 40 threshold"
391
- }), s.addIssue({
392
- code: "custom",
393
- path: ["end"],
394
- message: "Stamp mission can have at most 40 threshold"
395
- }));
396
- }), Be = {
397
- collectionName: "Groups",
398
- transform: {
399
- _id: "oid",
400
- business: "oid"
401
- },
402
- lookups: {
403
- business: {
404
- fromCollection: "Businesses",
405
- as: "pf_business"
406
- },
407
- pf_campaigns: {
408
- fromCollection: "Campaigns",
409
- as: "pf_campaigns",
410
- localField: "_id",
411
- foreignField: "group"
412
- }
413
- }
414
- }, qe = e.object({
415
- _id: n,
416
- name: e.string().min(1).max(300),
417
- business: n,
418
- pf_campaigns: e.array(e.any()).optional()
419
- }).describe(p.describe(Be)), Ue = e.object({
420
- type: e.literal(S.enum.MEMBERSHIP),
421
- business: n,
422
- name: e.string().min(1).max(50),
423
- image: e.string().nullish(),
424
- url: e.string().nullish(),
425
- tiers: e.array(e.lazy(() => I)),
426
- titles: e.array(n),
427
- tierCycleEnable: e.boolean().optional(),
428
- tierCycle: e.lazy(() => _).nullish(),
429
- welcomeMessage: E.optional(),
430
- advertisements: e.array(e.string()).optional(),
431
- cardEnable: e.boolean().optional(),
432
- design: e.array(
433
- e.object({
434
- _id: n,
435
- image: e.string()
436
- })
437
- ).optional(),
438
- targetLocation: e.array(n).nullish(),
439
- brand: e.string().nullish(),
440
- freeCreditAsDiscount: e.boolean().optional(),
441
- pf_title: e.array(e.lazy(() => d)).optional(),
442
- pf_targetLocation: e.array(e.lazy(() => v)).optional(),
443
- // new structure
444
- group: e.string().nullish(),
445
- templateId: n.nullish()
446
- }), t = S.exclude(["MEMBERSHIP"]), l = e.object({
447
- _id: n.nullish(),
448
- type: t,
449
- // common information
450
- business: n,
451
- name: e.string().min(1).max(50),
452
- image: e.string().nullish(),
453
- description: e.string().max(500).nullish(),
454
- timeframeOptions: Q.superRefine((o, s) => {
455
- o.start && o.end && o.end < o.start && s.addIssue({
456
- code: "custom",
457
- path: [],
458
- params: {
459
- i18n: { key: "timeframe.end_before_start" }
460
- }
461
- });
462
- }).nullish(),
463
- targetLocation: e.array(n).nullish(),
464
- event: be,
465
- config: $.nullish(),
466
- currentReceive: e.coerce.number().optional(),
467
- // new group structure
468
- group: n.nullish(),
469
- templateId: n.nullish(),
470
- pf_targetLocation: e.array(e.lazy(() => v)).optional()
471
- }), r = {
472
- [t.enum.VOUCHER]: [
473
- "BILL_COMPLETED",
474
- "FEEDBACK",
475
- "MEMBERSHIP_JOINED",
476
- "TIER_UPGRADED",
477
- "SCHEDULE",
478
- "SIMPLE_CLAIM"
479
- ],
480
- [t.enum.PROMOTION]: ["MAKING_ORDER"],
481
- [t.enum.POINT]: [
482
- "BILL_COMPLETED",
483
- "FEEDBACK",
484
- "MEMBERSHIP_JOINED",
485
- "TIER_UPGRADED",
486
- "SCHEDULE"
487
- ],
488
- [t.enum.CREDIT]: [
489
- "BILL_COMPLETED",
490
- "FEEDBACK",
491
- "MEMBERSHIP_JOINED",
492
- "TIER_UPGRADED",
493
- "SCHEDULE"
494
- ],
495
- [t.enum.BROADCAST]: [
496
- "SCHEDULE",
497
- "ISSUE_REWARD",
498
- "FEEDBACK"
499
- ],
500
- [t.enum.COIN]: [
501
- "BILL_COMPLETED",
502
- "FEEDBACK",
503
- "MEMBERSHIP_JOINED",
504
- "TIER_UPGRADED",
505
- "SCHEDULE"
506
- ],
507
- [t.enum.REWARD_POOL]: ["GAME_COMPLETED"],
508
- [t.enum.GAME]: [
509
- "BILL_COMPLETED",
510
- "FEEDBACK",
511
- "MEMBERSHIP_JOINED",
512
- "TIER_UPGRADED",
513
- "SCHEDULE",
514
- "SIMPLE_CLAIM"
515
- ],
516
- [t.enum.MISSION]: [
517
- "BILL_COMPLETED",
518
- "FEEDBACK",
519
- "SCHEDULE"
520
- ]
521
- }, w = l.extend({
522
- type: e.literal(t.enum.VOUCHER),
523
- // event
524
- code: e.string().min(0).max(15).optional(),
525
- event: a.merge(
526
- e.object({
527
- type: e.enum(r[t.enum.VOUCHER])
528
- })
529
- ),
530
- earningOption: c.default({
531
- amount: 1,
532
- type: "FIXED"
533
- }),
534
- collectible: n,
535
- hideInApp: e.boolean().optional(),
536
- notify: e.boolean().optional(),
537
- notifyMessage: e.lazy(() => E).optional(),
538
- notifyCampaign: n.nullish(),
539
- pf_collectible: e.lazy(() => d).optional(),
540
- pf_notifyCampaign: e.lazy(() => g).optional()
541
- }), je = e.object({
542
- gameType: e.string()
543
- }), k = l.extend({
544
- type: e.literal(t.enum.PROMOTION),
545
- // event
546
- event: a.merge(
547
- e.object({
548
- type: e.enum(r[t.enum.PROMOTION])
549
- })
550
- ),
551
- effect: e.custom().superRefine((o, s) => {
552
- o || s.addIssue({
553
- code: "custom",
554
- path: [],
555
- params: {
556
- i18n: { key: "zodCustom.campaign.effect_required" }
557
- }
558
- });
559
- }),
560
- gameConfig: je.nullish()
561
- }), W = l.extend({
562
- type: e.literal(t.enum.POINT),
563
- // event
564
- event: a.merge(
565
- e.object({
566
- type: e.enum(r[t.enum.POINT])
567
- })
568
- ),
569
- earningOption: c,
570
- collectible: n,
571
- notify: e.boolean().optional(),
572
- notifyMessage: e.lazy(() => E).optional(),
573
- notifyCampaign: n.nullish(),
574
- pf_collectible: e.lazy(() => d).optional(),
575
- pf_notifyCampaign: e.lazy(() => g).optional()
576
- }), V = l.extend({
577
- type: e.literal(t.enum.CREDIT),
578
- // event
579
- event: a.merge(
580
- e.object({
581
- type: e.enum(r[t.enum.CREDIT])
582
- })
583
- ),
584
- earningOption: c,
585
- collectible: n,
586
- notify: e.boolean().optional(),
587
- notifyMessage: e.lazy(() => E).optional(),
588
- notifyCampaign: n.nullish(),
589
- pf_collectible: e.lazy(() => d).optional(),
590
- pf_notifyCampaign: e.lazy(() => g).optional()
591
- }), g = l.extend({
592
- type: e.literal(t.enum.BROADCAST),
593
- // event
594
- event: a.merge(
595
- e.object({
596
- type: e.enum(r[t.enum.BROADCAST])
597
- })
598
- ),
599
- message: E,
600
- linkedCampaign: n.nullish()
601
- }), K = l.extend({
602
- type: e.literal(t.enum.COIN),
603
- // event
604
- event: a.merge(
605
- e.object({
606
- type: e.enum(r[t.enum.COIN])
607
- })
608
- ),
609
- earningOption: c,
610
- collectible: n,
611
- notify: e.boolean().optional(),
612
- notifyMessage: e.lazy(() => E).optional(),
613
- notifyCampaign: n.nullish(),
614
- pf_collectible: e.lazy(() => d).optional(),
615
- pf_notifyCampaign: e.lazy(() => g).optional()
616
- }), y = l.extend({
617
- type: e.literal(t.enum.REWARD_POOL),
618
- // event
619
- event: a.merge(
620
- e.object({
621
- type: e.enum(r[t.enum.REWARD_POOL])
622
- })
623
- ),
624
- rewards: e.array(e.lazy(() => Le)).min(1, "Requires at least 1 reward")
625
- }), J = l.extend({
626
- type: e.literal(t.enum.GAME),
627
- // event
628
- event: a.merge(
629
- e.object({
630
- type: e.enum(r[t.enum.GAME])
631
- })
632
- ),
633
- earningOption: c,
634
- collectible: n,
635
- game: e.lazy(() => y).optional(),
636
- pf_collectible: e.lazy(() => d).optional(),
637
- rewardPool: n.optional()
638
- }), Y = l.extend({
639
- type: e.literal(t.enum.MISSION),
640
- event: a.merge(
641
- e.object({
642
- type: e.enum(r[t.enum.MISSION])
643
- })
644
- ),
645
- earningOption: c,
646
- collectible: n,
647
- pf_collectible: e.lazy(() => d).optional(),
648
- mission: e.lazy(() => Ne),
649
- rewards: e.array(e.lazy(() => H)).min(1, "Requires at least 1 reward")
650
- }), Ge = {
651
- collectionName: "Campaigns",
652
- transform: {
653
- _id: "oid",
654
- business: "oid",
655
- collectible: "oid",
656
- templateId: "oid",
657
- group: "oid",
658
- notifyCampaign: "oid",
659
- linkedCampaign: "oid",
660
- rewardPool: "oid"
661
- },
662
- lookups: {
663
- business: {
664
- fromCollection: "Businesses",
665
- as: "pf_business"
666
- },
667
- targetLocation: {
668
- fromCollection: "Locations",
669
- as: "pf_targetLocation"
670
- },
671
- collectible: {
672
- fromCollection: "CollectibleConfigs",
673
- as: "pf_collectible"
674
- },
675
- titles: {
676
- fromCollection: "CollectibleConfigs",
677
- as: "pf_title"
678
- },
679
- templateId: {
680
- fromCollection: "Templates",
681
- as: "template"
682
- },
683
- notifyCampaign: {
684
- fromCollection: "Campaigns",
685
- as: "pf_notifyCampaign"
686
- },
687
- rewardPool: {
688
- fromCollection: "Campaigns",
689
- as: "game"
690
- }
691
- }
692
- }, Xe = e.object({ _id: n }).and(
693
- e.discriminatedUnion("type", [
694
- Ue,
695
- w,
696
- k,
697
- W,
698
- V,
699
- g,
700
- K,
701
- y,
702
- J,
703
- Y
704
- ])
705
- ).describe(p.describe(Ge)), Ze = e.discriminatedUnion("type", [
706
- w.extend({
707
- business: n.nullish()
708
- }),
709
- k.extend({
710
- business: n.nullish()
711
- }),
712
- W.extend({
713
- business: n.nullish()
714
- }),
715
- V.extend({
716
- business: n.nullish()
717
- }),
718
- g.extend({
719
- business: n.nullish()
720
- }),
721
- K.extend({
722
- business: n.nullish()
723
- }),
724
- y.extend({
725
- rewards: e.array(e.lazy(() => A)).min(1, "Requires at least 1 reward")
726
- }),
727
- J.extend({
728
- business: n.nullish(),
729
- game: y.extend({
730
- business: n.nullish(),
731
- rewards: e.array(e.lazy(() => A)).min(1, "Requires at least 1 reward")
732
- })
733
- }),
734
- Y.extend({
735
- business: n.nullish(),
736
- rewards: e.array(e.lazy(() => Pe)).min(1, "Requires at least 1 reward")
737
- })
738
- ]);
739
- export {
740
- r as C,
741
- Ke as F,
742
- t as a,
743
- Ve as b,
744
- Ye as c,
745
- A as d,
746
- xe as e,
747
- Pe as f,
748
- Ne as g,
749
- We as h,
750
- S as i,
751
- qe as j,
752
- Ze as k,
753
- Xe as l,
754
- Je as r
755
- };