@feedmepos/mf-connect 0.1.98-beta.39 → 0.1.98-beta.40

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 (151) hide show
  1. package/package.json +1 -1
  2. package/dist/App-DwjQisFZ.js +0 -4785
  3. package/dist/AuditLogs-DMGqmriL.js +0 -2014
  4. package/dist/Bin-4wvIqogM.js +0 -166
  5. package/dist/Broadcast-DPpuSZ8_.js +0 -269
  6. package/dist/CampaignAnalytic-CXFDo2X_.js +0 -1826
  7. package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-SLoy1-Kd.js +0 -122
  8. package/dist/Card-C8SA6un0.js +0 -911
  9. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +0 -97
  10. package/dist/Collections-BCpSiM_4.js +0 -541
  11. package/dist/Credit-C8RTBpP7.js +0 -286
  12. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +0 -128
  13. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +0 -58
  14. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-0OI5QzpR.js +0 -3382
  15. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-CJTduNh3.js +0 -351
  16. package/dist/Experience-Bg3kFQQE.js +0 -285
  17. package/dist/FileSaver.min-DMUuMi9w.js +0 -74
  18. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
  19. package/dist/FmTableSelection.vue_vue_type_script_setup_true_lang-DzcUc0_w.js +0 -52
  20. package/dist/Game-D3DbkRUj.js +0 -356
  21. package/dist/GiftCardSetup-CxlMM4up.js +0 -542
  22. package/dist/Grab-DvEK8ixP.js +0 -301
  23. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-BBK-UrEe.js +0 -145
  24. package/dist/Index-Do_9DXuY.js +0 -259
  25. package/dist/JsonViewer-v8_C7l5N.js +0 -87
  26. package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-BKPGBYiU.js +0 -48
  27. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-D6wJN9Gj.js +0 -18737
  28. package/dist/LoyaltyDashboard-B4WqycGN.js +0 -1345
  29. package/dist/MainLayout-DdxLaufS.js +0 -143
  30. package/dist/Marketing-CcFEMwKB.js +0 -236
  31. package/dist/MarketingMaterialEdit-DoYFaMf7.js +0 -1036
  32. package/dist/Member-BussgBln.js +0 -281
  33. package/dist/MemberList-BXJxSsjo.js +0 -1603
  34. package/dist/MemberOverview-wL_ailso.js +0 -58
  35. package/dist/MemberTransactions-O-XY5nz3.js +0 -45
  36. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-DsxrIO0r.js +0 -60957
  37. package/dist/MetricInfoTooltip.vue_vue_type_script_setup_true_lang-Bg_0YlwG.js +0 -38
  38. package/dist/Mission-CPkM-8Ns.js +0 -360
  39. package/dist/Overview-BJjpYUJN.js +0 -1080
  40. package/dist/Overview-C5KF_Jxj.js +0 -1316
  41. package/dist/Point-FDFwR3Hk.js +0 -288
  42. package/dist/Promotion-qtucKxn0.js +0 -423
  43. package/dist/Queue-d91tocPX.js +0 -261
  44. package/dist/Record-CvkK2iLq.js +0 -342
  45. package/dist/Review-C_zLGtzU.js +0 -45
  46. package/dist/ReviewFacebookCallback-Bidg3P76.js +0 -238
  47. package/dist/ReviewGoogleCallback-DL0lxMBL.js +0 -213
  48. package/dist/Reward-BTsQaI-J.js +0 -442
  49. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-BjxA4eMX.js +0 -150
  50. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-D4NIDc-C.js +0 -1913
  51. package/dist/Segment-BgFyB3BK.js +0 -1017
  52. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-CkhjFNvZ.js +0 -181
  53. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-HYbRyACe.js +0 -189
  54. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-7dv3cAW3.js +0 -226
  55. package/dist/Setting-BxHoCSxw.js +0 -2047
  56. package/dist/SettingAdvertisements-WfvuE4fA.js +0 -264
  57. package/dist/Settings-B42SAvEx.js +0 -179
  58. package/dist/Store-BnvWfCy-.js +0 -2413
  59. package/dist/StoreRewards-BRzAMqR-.js +0 -540
  60. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-C3FJr1L5.js +0 -1075
  61. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-UZYzUcif.js +0 -7007
  62. package/dist/Tier-BrzLNat2.js +0 -972
  63. package/dist/Title-EnlaNXld.js +0 -569
  64. package/dist/Transaction-BiXNxUGX.js +0 -39
  65. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-Db5_DKQ0.js +0 -130
  66. package/dist/Voucher-C2dyk-jj.js +0 -444
  67. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DPE24a-J.js +0 -421
  68. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-CI1HM9HA.js +0 -56
  69. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
  70. package/dist/app-Bt8HrAEr.js +0 -60740
  71. package/dist/app-wDQR6dpb.js +0 -39
  72. package/dist/app.js +0 -7
  73. package/dist/business-BwtQpfUr.js +0 -82
  74. package/dist/campaign-B6U9lwKi.js +0 -255
  75. package/dist/campaign-C6Cb9s3C.js +0 -100
  76. package/dist/campaign-CpzFl8Vr.js +0 -4
  77. package/dist/campaign.enum-Dx-Zo68Q.js +0 -26
  78. package/dist/campaign.fn-B0x2EGhw.js +0 -776
  79. package/dist/collectible.enum-Liy2wH3s.js +0 -19
  80. package/dist/collection.fn-DfoA9sJV.js +0 -26
  81. package/dist/duplicateCampaign-Cnq5N-V8.js +0 -51
  82. package/dist/effect-B2REbrv8.js +0 -89
  83. package/dist/email-addresses-BzmOsxLn.js +0 -705
  84. package/dist/export-jHpRhPQu.js +0 -97
  85. package/dist/feedme.ico +0 -0
  86. package/dist/google-C3S8u0mT.js +0 -4
  87. package/dist/helper-DQAHX1kX.js +0 -86
  88. package/dist/index-4GG-yjdN.js +0 -2963
  89. package/dist/index-BWgMbKOB.js +0 -85
  90. package/dist/index-BccUpf0U.js +0 -3
  91. package/dist/index-BkgkJkVs.js +0 -8919
  92. package/dist/index-C0PKVTf9.js +0 -32
  93. package/dist/index-C8cXXcLk.js +0 -45
  94. package/dist/index-CTTGf4TM.js +0 -151
  95. package/dist/index-C_H8jFYf.js +0 -2743
  96. package/dist/index-CuvNtC_M.js +0 -61
  97. package/dist/index-DJN4auwx.js +0 -146
  98. package/dist/index-DMr9ohGV.js +0 -1139
  99. package/dist/index-DQTo_ytu.js +0 -31
  100. package/dist/index-DW7-0rf_.js +0 -53
  101. package/dist/index-Da7J83jM.js +0 -2706
  102. package/dist/index-Di1Z4vLS.js +0 -27550
  103. package/dist/index-FoKZGh7Z.js +0 -67
  104. package/dist/index-N25Px7RQ.js +0 -72
  105. package/dist/index-PgblELTo.js +0 -897
  106. package/dist/index-STBMTK1u.js +0 -28900
  107. package/dist/index-hP3Mgc0u.js +0 -55
  108. package/dist/index-vh86FiIQ.js +0 -10
  109. package/dist/index.esm2017-DV56jzfJ.js +0 -3069
  110. package/dist/loading-D__sDcq1.js +0 -72
  111. package/dist/lodash-DgkDIHoV.js +0 -3678
  112. package/dist/membership-CBjt1MGx.js +0 -255
  113. package/dist/moment-D7p2TMB-.js +0 -2583
  114. package/dist/money-BFUbPKDM.js +0 -15
  115. package/dist/number-CJb8OUa3.js +0 -12
  116. package/dist/object-BYyQ0PZp.js +0 -18
  117. package/dist/objectId-dwaoBfJX.js +0 -7
  118. package/dist/objectid-BMUFNR9T.js +0 -145
  119. package/dist/plugins-D95ZeD-9.js +0 -1788
  120. package/dist/remy-Qz_pNsUS.js +0 -13
  121. package/dist/reward-CSfV_XFK.js +0 -36
  122. package/dist/rule-DIzVHy2z.js +0 -1969
  123. package/dist/rule-builder-DF7fCvec.js +0 -126
  124. package/dist/string-Gcy5IM_H.js +0 -32
  125. package/dist/style.css +0 -4
  126. package/dist/template-r3lAQP1B.js +0 -188
  127. package/dist/tier-BJDhpH6X.js +0 -4
  128. package/dist/tiers/tier=1.png +0 -0
  129. package/dist/tiers/tier=2.png +0 -0
  130. package/dist/tiers/tier=3.png +0 -0
  131. package/dist/tiers/tier=4.png +0 -0
  132. package/dist/timezone-D40qRUoz.js +0 -20
  133. package/dist/titles/type=diamond.png +0 -0
  134. package/dist/titles/type=drinks.png +0 -0
  135. package/dist/titles/type=food.png +0 -0
  136. package/dist/titles/type=heart.png +0 -0
  137. package/dist/titles/type=medal.png +0 -0
  138. package/dist/titles/type=spend.png +0 -0
  139. package/dist/titles/type=thank-you.png +0 -0
  140. package/dist/titles/type=thumbs-up.png +0 -0
  141. package/dist/titles/type=years.png +0 -0
  142. package/dist/transaction.fn-DV-cpfOj.js +0 -64
  143. package/dist/trigger-BEJaSv5R.js +0 -213
  144. package/dist/tslib.es6-BCqqvLQ_.js +0 -44
  145. package/dist/type_drinks-D6jnpvwV.js +0 -4
  146. package/dist/useMarketingMaterialActions-Bd5BDfE1.js +0 -96
  147. package/dist/usePagination-DLIo76-X.js +0 -220
  148. package/dist/user-DtEjuhyM.js +0 -55
  149. package/dist/vue-i18n-dQ1XCaUv.js +0 -2365
  150. package/dist/xlsx-BUMZsTov.js +0 -15491
  151. package/dist/zod-B_pVZhsV.js +0 -91
@@ -1,897 +0,0 @@
1
- import { z as e } from "./index-C_H8jFYf.js";
2
- import { F as t, a as _, m as g, b as X } from "./index-Di1Z4vLS.js";
3
- import { F as M } from "./campaign.enum-Dx-Zo68Q.js";
4
- import { a as T, F as L, b as c, c as ee, d as O, e as u, f as x, g as te } from "./index-BkgkJkVs.js";
5
- import { t as P, u as S, v as ne, w as oe } from "./index-4GG-yjdN.js";
6
- import { a as p } from "./index-C8cXXcLk.js";
7
- e.object({
8
- location: t,
9
- memberId: t,
10
- nettTotal: _,
11
- remark: e.string().optional()
12
- });
13
- const ie = e.enum(["COUNTER", "POS"]);
14
- e.object({
15
- id: e.string(),
16
- userId: e.string(),
17
- name: e.string().nullish(),
18
- birthday: e.string().nullish(),
19
- phoneNumber: e.string().nullish(),
20
- balance: e.number().nullish(),
21
- level: e.number().nullish(),
22
- mostPurchasedItems: e.array(e.string()).nullish()
23
- });
24
- const ae = {
25
- collectionName: "Bills"
26
- }, j = e.object({
27
- _id: e.string(),
28
- items: e.record(e.string(), e.number()).nullish(),
29
- // business: z.string(),
30
- // adjustments: z.record(FdoBillAdjustment),
31
- // refundedFrom: z.string().nullish(),
32
- user: e.string().nullish(),
33
- memberid: e.string().nullish(),
34
- // roundToNearest: z.number().nullish(),
35
- nettTotal: _,
36
- adjustedTotal: _.optional(),
37
- // activeItems: z.array(z.string()),
38
- remark: e.string().nullish(),
39
- createdAt: e.coerce.date(),
40
- completedAt: e.coerce.date(),
41
- refunded: e.boolean().nullish(),
42
- refundRecord: e.array(e.string()).nullish(),
43
- location: e.string(),
44
- channel: ie.optional()
45
- }).transform((i) => ({
46
- ...i,
47
- createdTime: i.createdAt,
48
- completedTime: i.completedAt,
49
- get amount() {
50
- return i.nettTotal.amount / 10 ** i.nettTotal.precision;
51
- },
52
- get adjustmentAmount() {
53
- return i.adjustedTotal ? i.adjustedTotal.amount / 10 ** i.adjustedTotal.precision : void 0;
54
- }
55
- })).describe(g.describe(ae)), se = e.object({
56
- _id: e.string(),
57
- rating: e.coerce.number(),
58
- user: e.string().optional(),
59
- restaurant: e.string(),
60
- message: e.string(),
61
- submittedAt: e.coerce.date()
62
- }), o = e.enum([
63
- "SIMPLE_CLAIM",
64
- "LINK_CLAIM",
65
- "BILL_COMPLETED",
66
- "BILL_REFUNDED",
67
- "SCHEDULE",
68
- "BIRTHDAY",
69
- "FEEDBACK",
70
- "ENTER_SEGMENT",
71
- "MEMBERSHIP_JOINED",
72
- "TIER_UPGRADED",
73
- "MAKING_ORDER",
74
- "ISSUE_REWARD",
75
- "MEMBER_REWARD",
76
- "GAME_COMPLETED",
77
- "PAGINATE_SCHEDULE",
78
- "REFERRAL_ADDED",
79
- "MEMBER_IMPORTED",
80
- "SEGMENTATION_IMPORTED"
81
- ]), qe = o.extract([
82
- "BILL_COMPLETED",
83
- "FEEDBACK",
84
- "GAME_COMPLETED",
85
- "MAKING_ORDER",
86
- "MEMBERSHIP_JOINED",
87
- "SCHEDULE",
88
- "SIMPLE_CLAIM",
89
- "TIER_UPGRADED",
90
- "ISSUE_REWARD"
91
- ]);
92
- e.enum(["START_OF", "BEFORE"]);
93
- e.enum(["WEEK", "MONTH"]);
94
- const le = e.enum([
95
- "WAITING",
96
- "ACTIVE",
97
- "COMPLETED",
98
- "FAILED"
99
- ]), a = e.object({
100
- // type: F_EVENT_TYPE,
101
- rule: T.optional()
102
- }), re = a.extend({
103
- type: e.literal(o.enum.BILL_COMPLETED)
104
- }), de = a.extend({
105
- type: e.literal(o.enum.FEEDBACK)
106
- }), ce = a.extend({
107
- type: e.literal(o.enum.SIMPLE_CLAIM)
108
- });
109
- a.extend({
110
- type: e.literal(o.enum.ENTER_SEGMENT),
111
- segment: e.string()
112
- });
113
- const me = a.extend({
114
- type: e.literal(o.enum.MEMBER_REWARD)
115
- }), ue = a.extend({
116
- type: e.literal(o.enum.SCHEDULE)
117
- // option: FdoCronRule,
118
- }), pe = a.extend({
119
- type: e.literal(o.enum.MEMBERSHIP_JOINED)
120
- }), Ee = a.extend({
121
- type: e.literal(o.enum.TIER_UPGRADED)
122
- }), ge = a.extend({
123
- type: e.literal(o.enum.MAKING_ORDER)
124
- }), be = a.extend({
125
- type: e.literal(o.enum.ISSUE_REWARD)
126
- }), ye = a.extend({
127
- type: e.literal(o.enum.GAME_COMPLETED)
128
- });
129
- a.extend({
130
- type: e.literal(o.enum.REFERRAL_ADDED)
131
- });
132
- a.extend({
133
- type: e.literal(o.enum.MEMBER_IMPORTED)
134
- });
135
- const Ce = e.discriminatedUnion("type", [
136
- ce,
137
- re,
138
- ue,
139
- de,
140
- pe,
141
- Ee,
142
- ge,
143
- be,
144
- me,
145
- ye
146
- ]);
147
- e.object({
148
- _id: t,
149
- type: o,
150
- ref: e.string(),
151
- status: le.optional(),
152
- context: e.record(e.string(), e.any()).optional(),
153
- failedReason: e.any().optional()
154
- }).describe(JSON.stringify({ collectionName: "EventLogs" }));
155
- const s = e.object({
156
- type: o,
157
- context: e.any(),
158
- businessIds: e.array(t).optional(),
159
- campaignIds: e.array(t).optional(),
160
- slackWebhookUrl: e.string().optional(),
161
- emittedAt: e.coerce.date().default(/* @__PURE__ */ new Date())
162
- }), Re = s.extend({
163
- type: e.literal(o.enum.BILL_COMPLETED),
164
- context: e.object({
165
- bill: j,
166
- rawBill: e.any()
167
- })
168
- }), Ie = s.extend({
169
- type: e.literal(o.enum.BILL_REFUNDED),
170
- context: e.object({
171
- bill: j,
172
- rawBill: e.any()
173
- })
174
- }), _e = s.extend({
175
- type: e.literal(o.enum.SCHEDULE),
176
- context: e.object({
177
- triggeredAt: e.coerce.date()
178
- })
179
- }), he = s.extend({
180
- type: e.literal(o.enum.PAGINATE_SCHEDULE),
181
- context: e.object({
182
- triggeredAt: e.coerce.date(),
183
- business: t,
184
- skip: e.coerce.number(),
185
- limit: e.coerce.number()
186
- })
187
- }), fe = s.extend({
188
- type: e.literal(o.enum.FEEDBACK),
189
- context: e.object({
190
- feedback: se
191
- })
192
- }), De = s.extend({
193
- type: e.literal(o.enum.MEMBERSHIP_JOINED),
194
- context: e.object({
195
- user: P
196
- })
197
- }), Fe = s.extend({
198
- type: e.literal(o.enum.TIER_UPGRADED),
199
- context: e.object({
200
- transaction: S
201
- })
202
- }), Ae = s.extend({
203
- type: e.literal(o.enum.ISSUE_REWARD),
204
- context: e.object({
205
- transaction: S,
206
- collection: ne
207
- })
208
- }), Me = s.extend({
209
- type: e.literal(o.enum.REFERRAL_ADDED),
210
- context: e.object({
211
- user: P
212
- })
213
- }), N = e.object({
214
- ref: t,
215
- originalName: e.string(),
216
- mimeType: e.string(),
217
- size: e.number(),
218
- fbFilePath: e.string(),
219
- isFbFileDeleted: e.boolean().nullish()
220
- }), Te = e.object({
221
- resetCollectionExpiryBalance: e.boolean().nullish()
222
- }), Le = s.extend({
223
- type: e.literal(o.enum.MEMBER_IMPORTED),
224
- context: e.object({
225
- business: e.string(),
226
- file: N,
227
- config: Te.optional()
228
- })
229
- }), Oe = s.extend({
230
- type: e.literal(o.enum.SEGMENTATION_IMPORTED),
231
- context: e.object({
232
- business: e.string(),
233
- segment: e.string(),
234
- file: N
235
- })
236
- });
237
- e.discriminatedUnion("type", [
238
- Re,
239
- Ie,
240
- _e,
241
- fe,
242
- De,
243
- Fe,
244
- Ae,
245
- he,
246
- Me,
247
- Le,
248
- Oe
249
- ]);
250
- const h = e.enum(["NO_REWARD", "VOUCHER", "LOYALTY"]), f = e.number().min(0, "Weight need to be at least 0"), D = e.number().int("Must be integer").min(0, "Threshold need to be at least 0"), B = e.object({
251
- type: e.literal(h.enum.NO_REWARD),
252
- collectible: e.null(),
253
- weight: f
254
- }), G = e.object({
255
- type: e.literal(h.enum.VOUCHER),
256
- collectible: t,
257
- collectibleConfig: e.lazy(() => L._def.right.options[0]),
258
- earningOption: e.lazy(() => c)
259
- }), y = e.object({
260
- type: e.literal(h.enum.LOYALTY),
261
- collectible: t,
262
- earningOption: e.lazy(() => c),
263
- validityOption: e.lazy(() => ee)
264
- }), U = G.extend({
265
- weight: f
266
- }), w = y.extend({
267
- weight: e.number().min(0, "Weight need to be at least 0")
268
- }), Ye = y.extend({
269
- validityOption: O,
270
- weight: f
271
- }), xe = e.discriminatedUnion("type", [
272
- U,
273
- w,
274
- B
275
- ]), F = e.discriminatedUnion("type", [
276
- U.extend({
277
- collectible: t.nullish(),
278
- business: t.nullish()
279
- }),
280
- w.extend({
281
- collectible: t.nullish(),
282
- business: t.nullish()
283
- }),
284
- B
285
- ]), v = G.extend({
286
- threshold: D
287
- }), z = y.extend({
288
- threshold: D
289
- }), Ze = y.extend({
290
- validityOption: O,
291
- threshold: D
292
- }), H = e.discriminatedUnion("type", [
293
- v,
294
- z
295
- ]), Pe = e.discriminatedUnion("type", [
296
- v.extend({
297
- collectible: t.nullish(),
298
- business: t.nullish()
299
- }),
300
- z.extend({
301
- collectible: t.nullish(),
302
- collectibleConfig: L.nullish(),
303
- business: t.nullish()
304
- })
305
- ]), Se = {
306
- collectionName: "Locations",
307
- transform: {
308
- _id: "oid",
309
- business: "oid"
310
- }
311
- }, k = e.object({
312
- _id: t,
313
- business: t,
314
- name: e.string(),
315
- code: e.string().nullish(),
316
- otp: e.string().nullish(),
317
- otpExpiredAt: e.coerce.date().nullish(),
318
- apiToken: e.string().nullish(),
319
- customAttribute: e.record(e.any()).nullish()
320
- }).describe(g.describe(Se));
321
- e.object({
322
- _id: t,
323
- name: e.string(),
324
- location: t,
325
- os: e.string(),
326
- apiToken: e.string().nullish()
327
- }).describe(
328
- g.describe({
329
- collectionName: "LocationDevices",
330
- transform: {
331
- _id: "oid",
332
- location: "oid"
333
- }
334
- })
335
- );
336
- e.object({
337
- _id: e.string(),
338
- name: e.string()
339
- });
340
- const je = e.enum(["PROGRESSIVE", "STAMP"]), Ne = e.object({
341
- type: je,
342
- end: e.number().int().min(0, "Threshold need to be at least 1"),
343
- rewards: e.array(e.lazy(() => H)).nullish()
344
- }).superRefine((i, d) => {
345
- i.type == "STAMP" && i.end > 40 && (d.addIssue({
346
- code: "custom",
347
- path: [],
348
- message: "Stamp mission can have at most 40 threshold"
349
- }), d.addIssue({
350
- code: "custom",
351
- path: ["end"],
352
- message: "Stamp mission can have at most 40 threshold"
353
- }));
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
- }), Be = 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: Be
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 Ge = {
456
- collectionName: "Groups",
457
- transform: {
458
- _id: "oid",
459
- business: "oid"
460
- },
461
- lookups: {
462
- business: {
463
- fromCollection: "Businesses",
464
- as: "pf_business"
465
- },
466
- pf_campaigns: {
467
- fromCollection: "Campaigns",
468
- as: "pf_campaigns",
469
- localField: "_id",
470
- foreignField: "group"
471
- }
472
- }
473
- }, Qe = e.object({
474
- _id: t,
475
- name: e.string().min(1).max(300),
476
- business: t,
477
- pf_campaigns: e.array(e.any()).optional()
478
- }).describe(g.describe(Ge)), Ue = e.object({
479
- from: e.string().email().nullish(),
480
- name: e.string().min(1).max(50).nullish()
481
- }), we = e.object({
482
- _id: e.string(),
483
- url: e.string(),
484
- targetLocation: e.array(t).nullish(),
485
- // null/empty = all locations
486
- order: e.number().optional()
487
- }), W = e.object({
488
- type: e.literal(M.enum.MEMBERSHIP),
489
- business: t,
490
- name: e.string().min(1).max(50),
491
- image: e.string().nullish(),
492
- url: e.string().nullish(),
493
- tiers: e.array(e.lazy(() => oe)),
494
- titles: e.array(t),
495
- tierCycleEnable: e.boolean().optional(),
496
- tierCycle: e.lazy(() => T).nullish(),
497
- welcomeMessage: p.optional(),
498
- advertisements: e.union([e.array(e.string()), e.array(we)]).optional(),
499
- cardEnable: e.boolean().optional(),
500
- autoRevertReward: e.boolean().optional(),
501
- design: e.array(
502
- e.object({
503
- _id: t,
504
- image: e.string()
505
- })
506
- ).optional(),
507
- targetLocation: e.array(t).nullish(),
508
- brand: e.string().nullish(),
509
- email: Ue.nullish(),
510
- freeCreditAsDiscount: e.boolean().optional(),
511
- pf_title: e.array(e.lazy(() => u)).optional(),
512
- pf_targetLocation: e.array(e.lazy(() => k)).optional(),
513
- allowedPhoneCountries: e.union([
514
- e.array(e.string().regex(/^\+\d{1,4}$/)),
515
- e.null()
516
- ]).optional(),
517
- // new structure
518
- group: e.string().nullish(),
519
- templateId: t.nullish()
520
- }), n = M.exclude(["MEMBERSHIP"]), l = e.object({
521
- _id: t.nullish(),
522
- type: n,
523
- // common information
524
- business: t,
525
- name: e.string().min(1).max(50),
526
- image: e.string().nullish(),
527
- description: e.string().max(500).nullish(),
528
- timeframeOptions: x.superRefine((i, d) => {
529
- i.start && i.end && i.end < i.start && d.addIssue({
530
- code: "custom",
531
- path: [],
532
- params: {
533
- i18n: "connectZodCustom:timeframe.end_before_start"
534
- }
535
- });
536
- }).nullish(),
537
- targetLocation: e.array(t).nullish(),
538
- event: Ce,
539
- config: te.nullish(),
540
- currentReceive: e.coerce.number().optional(),
541
- // new group structure
542
- group: t.nullish(),
543
- templateId: t.nullish(),
544
- pf_targetLocation: e.array(e.lazy(() => k)).optional(),
545
- deletedAt: e.coerce.date().optional()
546
- }), r = {
547
- [n.enum.VOUCHER]: [
548
- "BILL_COMPLETED",
549
- "FEEDBACK",
550
- "MEMBERSHIP_JOINED",
551
- "TIER_UPGRADED",
552
- "SCHEDULE",
553
- "SIMPLE_CLAIM"
554
- ],
555
- [n.enum.PROMOTION]: ["MAKING_ORDER"],
556
- [n.enum.GRAB]: ["MAKING_ORDER"],
557
- [n.enum.POINT]: [
558
- "BILL_COMPLETED",
559
- "FEEDBACK",
560
- "MEMBERSHIP_JOINED",
561
- "TIER_UPGRADED",
562
- "SCHEDULE"
563
- ],
564
- [n.enum.CREDIT]: [
565
- "BILL_COMPLETED",
566
- "FEEDBACK",
567
- "MEMBERSHIP_JOINED",
568
- "TIER_UPGRADED",
569
- "SCHEDULE"
570
- ],
571
- [n.enum.BROADCAST]: [
572
- "SCHEDULE",
573
- "ISSUE_REWARD",
574
- "FEEDBACK"
575
- ],
576
- [n.enum.COIN]: [
577
- "BILL_COMPLETED",
578
- "FEEDBACK",
579
- "MEMBERSHIP_JOINED",
580
- "TIER_UPGRADED",
581
- "SCHEDULE"
582
- ],
583
- [n.enum.REWARD_POOL]: ["GAME_COMPLETED"],
584
- [n.enum.GAME]: [
585
- "BILL_COMPLETED",
586
- "FEEDBACK",
587
- "MEMBERSHIP_JOINED",
588
- "TIER_UPGRADED",
589
- "SCHEDULE",
590
- "SIMPLE_CLAIM"
591
- ],
592
- [n.enum.MISSION]: [
593
- "BILL_COMPLETED",
594
- "FEEDBACK",
595
- "SCHEDULE"
596
- ]
597
- }, K = l.extend({
598
- type: e.literal(n.enum.VOUCHER),
599
- // event
600
- code: e.string().min(0).max(15).regex(/^[A-Za-z0-9\-_.@]*$/, {
601
- message: "Code can only contain letters, numbers, and - _ . @"
602
- }).optional(),
603
- event: a.merge(
604
- e.object({
605
- type: e.enum(r[n.enum.VOUCHER])
606
- })
607
- ),
608
- earningOption: c.default({
609
- amount: 1,
610
- type: "FIXED"
611
- }),
612
- collectible: t,
613
- hideInApp: e.boolean().optional(),
614
- notify: e.boolean().optional(),
615
- notifyMessage: e.lazy(() => p).optional(),
616
- notifyCampaign: t.nullish(),
617
- pf_collectible: e.lazy(() => u).optional(),
618
- pf_notifyCampaign: e.lazy(() => E).optional()
619
- }), ve = e.object({
620
- gameType: e.string()
621
- }), V = l.extend({
622
- type: e.literal(n.enum.PROMOTION),
623
- // event
624
- event: a.merge(
625
- e.object({
626
- type: e.enum(r[n.enum.PROMOTION])
627
- })
628
- ),
629
- effect: e.custom().superRefine((i, d) => {
630
- i || d.addIssue({
631
- code: "custom",
632
- path: [],
633
- params: {
634
- i18n: "connectZodCustom:campaign.effect_required"
635
- }
636
- });
637
- }),
638
- gameConfig: ve.nullish()
639
- }), J = l.extend({
640
- type: e.literal(n.enum.POINT),
641
- // event
642
- event: a.merge(
643
- e.object({
644
- type: e.enum(r[n.enum.POINT])
645
- })
646
- ),
647
- earningOption: c,
648
- collectible: t,
649
- notify: e.boolean().optional(),
650
- notifyMessage: e.lazy(() => p).optional(),
651
- notifyCampaign: t.nullish(),
652
- pf_collectible: e.lazy(() => u).optional(),
653
- pf_notifyCampaign: e.lazy(() => E).optional()
654
- }), q = l.extend({
655
- type: e.literal(n.enum.CREDIT),
656
- // event
657
- event: a.merge(
658
- e.object({
659
- type: e.enum(r[n.enum.CREDIT])
660
- })
661
- ),
662
- earningOption: c,
663
- collectible: t,
664
- notify: e.boolean().optional(),
665
- notifyMessage: e.lazy(() => p).optional(),
666
- notifyCampaign: t.nullish(),
667
- pf_collectible: e.lazy(() => u).optional(),
668
- pf_notifyCampaign: e.lazy(() => E).optional()
669
- }), E = l.extend({
670
- type: e.literal(n.enum.BROADCAST),
671
- // event
672
- event: a.merge(
673
- e.object({
674
- type: e.enum(r[n.enum.BROADCAST])
675
- })
676
- ),
677
- message: p,
678
- linkedCampaign: t.nullish()
679
- }), Y = l.extend({
680
- type: e.literal(n.enum.COIN),
681
- // event
682
- event: a.merge(
683
- e.object({
684
- type: e.enum(r[n.enum.COIN])
685
- })
686
- ),
687
- earningOption: c,
688
- collectible: t,
689
- notify: e.boolean().optional(),
690
- notifyMessage: e.lazy(() => p).optional(),
691
- notifyCampaign: t.nullish(),
692
- pf_collectible: e.lazy(() => u).optional(),
693
- pf_notifyCampaign: e.lazy(() => E).optional()
694
- }), b = l.extend({
695
- type: e.literal(n.enum.REWARD_POOL),
696
- // event
697
- event: a.merge(
698
- e.object({
699
- type: e.enum(r[n.enum.REWARD_POOL])
700
- })
701
- ),
702
- rewards: e.array(e.lazy(() => xe)).min(1, "Requires at least 1 reward")
703
- }), Z = l.extend({
704
- type: e.literal(n.enum.GAME),
705
- // event
706
- event: a.merge(
707
- e.object({
708
- type: e.enum(r[n.enum.GAME])
709
- })
710
- ),
711
- earningOption: c,
712
- collectible: t,
713
- game: e.lazy(() => b).optional(),
714
- pf_collectible: e.lazy(() => u).optional(),
715
- rewardPool: t.optional()
716
- }), Q = l.extend({
717
- type: e.literal(n.enum.MISSION),
718
- event: a.merge(
719
- e.object({
720
- type: e.enum(r[n.enum.MISSION])
721
- })
722
- ),
723
- earningOption: c,
724
- collectible: t,
725
- pf_collectible: e.lazy(() => u).optional(),
726
- mission: e.lazy(() => Ne),
727
- rewards: e.array(e.lazy(() => H)).min(1, "Requires at least 1 reward")
728
- }), $ = l.omit({
729
- timeframeOptions: !0
730
- }).extend({
731
- type: e.literal(n.enum.GRAB),
732
- event: a.merge(
733
- e.object({
734
- type: e.enum(r[n.enum.GRAB])
735
- })
736
- ),
737
- business: t,
738
- name: e.string().min(1).max(50),
739
- targetLocation: e.array(t).nullish(),
740
- group: e.string().nullish(),
741
- templateId: t.nullish(),
742
- // Grab specific fields
743
- conditions: R,
744
- quotas: C,
745
- discount: I,
746
- grabCampaignMeta: e.array(
747
- e.object({
748
- locationId: e.string(),
749
- campaignId: e.string()
750
- })
751
- ).optional(),
752
- // Make timeframeOptions required (remove .nullish() from parent)
753
- timeframeOptions: x.superRefine((i, d) => {
754
- (!i.start || !i.end) && d.addIssue({
755
- code: "custom",
756
- path: [],
757
- params: {
758
- i18n: { key: "timeframe.required" }
759
- }
760
- }), i.start && i.end && i.end < i.start && d.addIssue({
761
- code: "custom",
762
- path: [],
763
- params: {
764
- i18n: { key: "timeframe.end_before_start" }
765
- }
766
- });
767
- })
768
- }), ze = {
769
- collectionName: "Campaigns",
770
- transform: {
771
- _id: "oid",
772
- business: "oid",
773
- collectible: "oid",
774
- templateId: "oid",
775
- group: "oid",
776
- notifyCampaign: "oid",
777
- linkedCampaign: "oid",
778
- rewardPool: "oid"
779
- },
780
- lookups: {
781
- business: {
782
- fromCollection: "Businesses",
783
- as: "pf_business"
784
- },
785
- targetLocation: {
786
- fromCollection: "Locations",
787
- as: "pf_targetLocation"
788
- },
789
- collectible: {
790
- fromCollection: "CollectibleConfigs",
791
- as: "pf_collectible"
792
- },
793
- titles: {
794
- fromCollection: "CollectibleConfigs",
795
- as: "pf_title"
796
- },
797
- templateId: {
798
- fromCollection: "Templates",
799
- as: "template"
800
- },
801
- notifyCampaign: {
802
- fromCollection: "Campaigns",
803
- as: "pf_notifyCampaign"
804
- },
805
- rewardPool: {
806
- fromCollection: "Campaigns",
807
- as: "game"
808
- }
809
- }
810
- }, $e = e.object({ _id: t }).and(
811
- e.discriminatedUnion("type", [
812
- W,
813
- K,
814
- V,
815
- J,
816
- q,
817
- E,
818
- Y,
819
- b,
820
- Z,
821
- Q,
822
- $
823
- ])
824
- ).describe(g.describe(ze)), Xe = e.discriminatedUnion("type", [
825
- K.extend({
826
- business: t.nullish()
827
- }),
828
- V.extend({
829
- business: t.nullish()
830
- }),
831
- J.extend({
832
- business: t.nullish()
833
- }),
834
- q.extend({
835
- business: t.nullish()
836
- }),
837
- E.extend({
838
- business: t.nullish()
839
- }),
840
- Y.extend({
841
- business: t.nullish()
842
- }),
843
- b.extend({
844
- rewards: e.array(e.lazy(() => F)).min(1, "Requires at least 1 reward")
845
- }),
846
- Z.extend({
847
- business: t.nullish(),
848
- game: b.extend({
849
- business: t.nullish(),
850
- rewards: e.array(e.lazy(() => F)).min(1, "Requires at least 1 reward")
851
- })
852
- }),
853
- Q.extend({
854
- business: t.nullish(),
855
- rewards: e.array(e.lazy(() => Pe)).min(1, "Requires at least 1 reward")
856
- }),
857
- $.extend({
858
- business: t.nullish()
859
- })
860
- ]);
861
- W.pick({
862
- business: !0,
863
- name: !0,
864
- image: !0,
865
- // url: true,
866
- tiers: !0,
867
- // titles: true,
868
- cardEnable: !0,
869
- // design: true,
870
- targetLocation: !0,
871
- brand: !0,
872
- email: !0,
873
- freeCreditAsDiscount: !0,
874
- allowedPhoneCountries: !0,
875
- pf_title: !0,
876
- pf_targetLocation: !0
877
- }).extend({
878
- allowedPhoneCountryDetails: e.array(X).nullish()
879
- });
880
- export {
881
- r as C,
882
- n as F,
883
- o as a,
884
- $e as b,
885
- qe as c,
886
- Qe as d,
887
- Xe as e,
888
- Ye as f,
889
- F as g,
890
- je as h,
891
- Ze as i,
892
- Pe as j,
893
- Ne as k,
894
- Ce as l,
895
- W as m,
896
- le as n
897
- };