@feedmepos/mf-connect 0.1.98-beta.6 → 0.1.98-beta.60

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 (147) hide show
  1. package/dist/{App-CvJ0ASlp.js → App-BUwQLdzG.js} +812 -666
  2. package/dist/{AuditLogs-Bt9S2LKL.js → AuditLogs-laNQB1ef.js} +14 -13
  3. package/dist/{Bin-ZSCDSioa.js → Bin-Bfboeea_.js} +8 -8
  4. package/dist/{Broadcast-BT0R11RB.js → Broadcast-CDz-_eDz.js} +40 -37
  5. package/dist/CampaignAnalytic-BiA-5XG3.js +1830 -0
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-LweQ57aG.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-VrTN-c_a.js} +6 -5
  7. package/dist/Card-CKHaW8N7.js +1084 -0
  8. package/dist/{Collections-H7zhe9zN.js → Collections-DRocQb1D.js} +14 -13
  9. package/dist/Credit-DWaoVhSP.js +286 -0
  10. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-B7ZdULCu.js +53 -0
  11. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-B2sZFWUF.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-3ERieT1j.js} +54 -52
  12. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-qNmiKaJc.js → EffectSheet.vue_vue_type_style_index_0_lang-yDUjXV2O.js} +35 -35
  13. package/dist/{Experience-CH5tg-tm.js → Experience-C1_LpneJ.js} +112 -86
  14. package/dist/{FileSaver.min-DNFqiyZb.js → FileSaver.min-CWJ-6CFP.js} +1 -1
  15. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-3bH-tZAm.js +138 -0
  16. package/dist/Game-DtTYcSZk.js +356 -0
  17. package/dist/GiftCardSetup-B770Rl1Q.js +662 -0
  18. package/dist/{Grab-3s_sLewD.js → Grab-CN0gmIxT.js} +33 -32
  19. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-fbmoN1e9.js → ImageInput.vue_vue_type_script_setup_true_lang-BaAhKWhX.js} +1 -1
  20. package/dist/{Index-zTWZCiEo.js → Index-0F6aq3f9.js} +10 -10
  21. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-BOxYPkf5.js → LocationPicker.vue_vue_type_script_setup_true_lang-BrKj8W2H.js} +1 -1
  22. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-wjJ_cwft.js → LottieAnimation.vue_vue_type_script_setup_true_lang-DOuHSVdR.js} +1 -1
  23. package/dist/LoyaltyDashboard-CtXyDFqa.js +2865 -0
  24. package/dist/MainLayout-BSWLr3gE.js +143 -0
  25. package/dist/{Marketing-Bto1OvK1.js → Marketing-Ci2haxRd.js} +7 -6
  26. package/dist/{MarketingMaterialEdit-D7rIqF5U.js → MarketingMaterialEdit-Cw6R0bNM.js} +15 -14
  27. package/dist/Member-DEzSTAQy.js +649 -0
  28. package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-BrhSxbrI.js +1287 -0
  29. package/dist/MemberImportHistory-BGfNLzma.js +187 -0
  30. package/dist/MemberList-Cq5Gsv3G.js +336 -0
  31. package/dist/{MemberTransactions-CjTtGB2y.js → MemberTransactions-BrUVZRtt.js} +1 -1
  32. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DvKL7BL5.js → MessageInput.vue_vue_type_script_setup_true_lang-DCQ6Fse-.js} +5434 -5279
  33. package/dist/MetricInfoTooltip.vue_vue_type_script_setup_true_lang-CETwYfZD.js +40 -0
  34. package/dist/Mission-Do4IonLo.js +360 -0
  35. package/dist/{Overview-mxGLyFvE.js → Overview-DA90l9Kb.js} +21 -20
  36. package/dist/Overview-DN-nJxw9.js +1316 -0
  37. package/dist/Point-DQ4w857n.js +288 -0
  38. package/dist/Promotion-Rgt9LcYi.js +423 -0
  39. package/dist/{Queue-DgaFyyyH.js → Queue-SzypUxgD.js} +14 -13
  40. package/dist/{Record-BRol__6_.js → Record-DYvPPhIW.js} +9 -9
  41. package/dist/Review-B0TERyHM.js +45 -0
  42. package/dist/ReviewFacebookCallback-BJ5jQ3Dv.js +238 -0
  43. package/dist/ReviewGoogleCallback-BKQD39dv.js +213 -0
  44. package/dist/{Reward-DQI0PvmR.js → Reward-BexlVT_C.js} +35 -35
  45. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-B6bvQNsU.js → RewardGroup.vue_vue_type_script_setup_true_lang-C-ygqNur.js} +14 -13
  46. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-DgAU7jGo.js → RuleGroup.vue_vue_type_script_setup_true_lang-DjxIJcdv.js} +103 -109
  47. package/dist/{Segment-DFaLx0QZ.js → Segment-CYa4GjtQ.js} +30 -29
  48. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-Cpb2i9iV.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-b-K-VDJC.js} +31 -30
  49. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-MvoepHn9.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-t2mlDDtn.js} +4 -4
  50. package/dist/{Setting-D2NjFJvq.js → Setting-Dmm5BKdF.js} +14 -14
  51. package/dist/{SettingAdvertisements-CPWgSMaA.js → SettingAdvertisements-cy4cRBop.js} +12 -12
  52. package/dist/Settings-DMQuLDM4.js +230 -0
  53. package/dist/Store-B7KflfSk.js +2612 -0
  54. package/dist/{StoreRewards-Ccj12pyq.js → StoreRewards-BKae8uZn.js} +15 -15
  55. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-sbIR-k1R.js +1329 -0
  56. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-CfWTn0Xd.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DRT3N9SD.js} +2 -2
  57. package/dist/{Tier-vaJoohiM.js → Tier-BeTz6LHH.js} +2296 -750
  58. package/dist/{Title-BqHC7-v9.js → Title-OEVVw5I-.js} +39 -37
  59. package/dist/Transaction-D-MZjntW.js +45 -0
  60. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-Dporb9KE.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-xIEOUOdo.js} +26 -26
  61. package/dist/{Voucher-DeN6C6DQ.js → Voucher-BJCf3pSa.js} +156 -133
  62. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-De16fuC4.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BFQ_CYub.js} +115 -121
  63. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DAC-j0Ln.js → ZodTextField.vue_vue_type_script_setup_true_lang-DGDw3Too.js} +2 -2
  64. package/dist/{app-n4Y2jMee.js → app-J8VIC7-H.js} +29852 -25997
  65. package/dist/app.js +1 -1
  66. package/dist/base.export-HYFFI4OS.js +75 -0
  67. package/dist/{business-jn-_l48y.js → business-BonuheMK.js} +5 -5
  68. package/dist/{campaign-rgDnocfT.js → campaign-7CI7gfS5.js} +74 -96
  69. package/dist/campaign-Ct7jhugP.js +100 -0
  70. package/dist/{campaign.enum-C9HvoKuq.js → campaign.enum-OzJ9IbAW.js} +1 -1
  71. package/dist/{campaign.fn-D21ettpH.js → campaign.fn-CDjxE9B2.js} +99 -99
  72. package/dist/{collectible.enum-_HVU4lWn.js → collectible.enum-Dw_tlI9E.js} +1 -1
  73. package/dist/collection.fn-CER0_NEn.js +26 -0
  74. package/dist/currency-CTUS4vS8.js +7 -0
  75. package/dist/{duplicateCampaign-gzVwrnWb.js → duplicateCampaign-CMQ-RMH-.js} +11 -11
  76. package/dist/{effect-DhpIv1L3.js → effect-DBeGoMNE.js} +1 -1
  77. package/dist/{email-addresses-DPxYLSoa.js → email-addresses-BH3mQzan.js} +209 -201
  78. package/dist/google-C3S8u0mT.js +4 -0
  79. package/dist/{helper-WYHUnHVy.js → helper-DJe_JbKJ.js} +1 -1
  80. package/dist/{index-BdnHQSDd.js → index-B14H1rLW.js} +5 -4
  81. package/dist/{index-7HizF3GI.js → index-BOVnM3gL.js} +1588 -1522
  82. package/dist/{index-Cvfavr2M.js → index-BRCB6yJ6.js} +232 -200
  83. package/dist/{index-BPsofsGt.js → index-BZKKS7jO.js} +1933 -2560
  84. package/dist/{index-BuLfxJyC.js → index-BlwAgY_z.js} +105 -123
  85. package/dist/index-BmN_Qcw7.js +151 -0
  86. package/dist/index-Bnk3vdb-.js +72 -0
  87. package/dist/index-BzVTqlVH.js +137 -0
  88. package/dist/{index--fNMSXUf.js → index-CEDhjZzd.js} +1 -1
  89. package/dist/{index-BdqRrCt8.js → index-CM9GTQIo.js} +5 -5
  90. package/dist/index-CN8VyVEB.js +53 -0
  91. package/dist/{index-Cte6dHHy.js → index-COuceEFz.js} +14 -14
  92. package/dist/{index-BN-FP9kx.js → index-CWR2s6Nt.js} +1 -1
  93. package/dist/index-CrMBqkKk.js +897 -0
  94. package/dist/{index-xao4ggML.js → index-D9f3AIaO.js} +5 -5
  95. package/dist/index-Do36kJeb.js +51 -0
  96. package/dist/{index-C-5YgmkC.js → index-bGByr1XM.js} +7 -5
  97. package/dist/{index-DUTFNEn9.js → index-bJX4zgh0.js} +4 -4
  98. package/dist/{index.esm2017-CjzFPUCa.js → index.esm2017-BpCPgTjc.js} +128 -128
  99. package/dist/{loading-CojnK00V.js → loading-D_rPJ-Yc.js} +1 -1
  100. package/dist/{lodash-CLkg5jTT.js → lodash-BM976Z2I.js} +1 -1
  101. package/dist/member-import-C5rhD3f8.js +187 -0
  102. package/dist/membership-CIQCEKiL.js +274 -0
  103. package/dist/{money-CyaLaEKo.js → money-BrMT193t.js} +1 -1
  104. package/dist/{number-DEtI4bEX.js → number-DOcD1tqL.js} +1 -1
  105. package/dist/objectid-CAdRRoFu.js +145 -0
  106. package/dist/{plugins-MnP1vCcg.js → plugins-696Z9K6A.js} +3 -3
  107. package/dist/remy-Qz_pNsUS.js +13 -0
  108. package/dist/{reward-Dk3D26xC.js → reward-lSVIBiE9.js} +1 -1
  109. package/dist/{rule-B1Agad1n.js → rule-BUGAimk8.js} +335 -275
  110. package/dist/style.css +1 -1
  111. package/dist/{template-DpqLCq1p.js → template-01_h2Gac.js} +6 -6
  112. package/dist/timezone-okTdM2YU.js +20 -0
  113. package/dist/transaction.fn-Nz0T33ex.js +64 -0
  114. package/dist/{trigger-cwPN-4Ia.js → trigger-CKj1X6zs.js} +17 -17
  115. package/dist/useMarketingMaterialActions-yKqKaPpe.js +96 -0
  116. package/dist/{usePagination-D8zBMxdJ.js → usePagination-D6cYlfni.js} +1 -1
  117. package/dist/{user-EUGwaL2f.js → user-DX5qCQfz.js} +1 -1
  118. package/dist/{vue-i18n-BBj45p9N.js → vue-i18n-DowpocqN.js} +204 -204
  119. package/dist/{xlsx-DiMIlKmu.js → xlsx-Dv4SuJbw.js} +1 -1
  120. package/dist/{zod-B1cU167C.js → zod-DVw24Ejy.js} +1 -1
  121. package/package.json +6 -5
  122. package/dist/Card-Wdh8lyUv.js +0 -910
  123. package/dist/Credit-BuKLrFtM.js +0 -260
  124. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +0 -58
  125. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
  126. package/dist/Game-C9s4qZz4.js +0 -330
  127. package/dist/LoyaltyDashboard-tOOk6zvV.js +0 -1082
  128. package/dist/MainLayout-iWi1DzXS.js +0 -41
  129. package/dist/Member-BdgdT-sa.js +0 -280
  130. package/dist/MemberList-DBIE-RWC.js +0 -1601
  131. package/dist/Mission-CWR6FBvN.js +0 -334
  132. package/dist/Point-BIt82fJk.js +0 -262
  133. package/dist/Promotion-Cl1vPi0B.js +0 -397
  134. package/dist/Review-DmV2YnFd.js +0 -1076
  135. package/dist/ReviewFacebookCallback-B5XgAWXo.js +0 -243
  136. package/dist/ReviewGoogleCallback-CYR03Wfd.js +0 -208
  137. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-CAImd3yc.js +0 -181
  138. package/dist/Store-DjUe8ady.js +0 -1996
  139. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-B7w69A3j.js +0 -1130
  140. package/dist/Transaction-BOmDOGnD.js +0 -39
  141. package/dist/campaign-BnI7-ceP.js +0 -219
  142. package/dist/export-CWAxYj7W.js +0 -97
  143. package/dist/index-B6EBgIUx.js +0 -85
  144. package/dist/index-CxR1baaG.js +0 -52
  145. package/dist/membership-CeX8E_I9.js +0 -255
  146. package/dist/objectid-CMau7CW-.js +0 -145
  147. package/dist/useMarketingMaterialActions-CGzfJ68e.js +0 -107
@@ -0,0 +1,897 @@
1
+ import { z as e, F as t, b as _, m as g, d as X } from "./index-D9f3AIaO.js";
2
+ import { F as M } from "./campaign.enum-OzJ9IbAW.js";
3
+ import { f as T, F as L, g as c, h as ee, i as O, j as u, k as x, e as te } from "./index-BOVnM3gL.js";
4
+ import { C as P, A as S, B as ne, E as oe, H as ie } from "./index-BZKKS7jO.js";
5
+ import { c as p } from "./index-Do36kJeb.js";
6
+ e.object({
7
+ location: t,
8
+ memberId: t,
9
+ nettTotal: _,
10
+ remark: e.string().optional()
11
+ });
12
+ const ae = e.enum(["COUNTER", "POS"]);
13
+ e.object({
14
+ id: e.string(),
15
+ userId: e.string(),
16
+ name: e.string().nullish(),
17
+ birthday: e.string().nullish(),
18
+ phoneNumber: e.string().nullish(),
19
+ balance: e.number().nullish(),
20
+ level: e.number().nullish(),
21
+ mostPurchasedItems: e.array(e.string()).nullish()
22
+ });
23
+ const le = {
24
+ collectionName: "Bills"
25
+ }, j = e.object({
26
+ _id: e.string(),
27
+ items: e.record(e.string(), e.number()).nullish(),
28
+ // business: z.string(),
29
+ // adjustments: z.record(FdoBillAdjustment),
30
+ // refundedFrom: z.string().nullish(),
31
+ user: e.string().nullish(),
32
+ memberid: e.string().nullish(),
33
+ // roundToNearest: z.number().nullish(),
34
+ nettTotal: _,
35
+ adjustedTotal: _.optional(),
36
+ // activeItems: z.array(z.string()),
37
+ remark: e.string().nullish(),
38
+ createdAt: e.coerce.date(),
39
+ completedAt: e.coerce.date(),
40
+ refunded: e.boolean().nullish(),
41
+ refundRecord: e.array(e.string()).nullish(),
42
+ location: e.string(),
43
+ channel: ae.optional()
44
+ }).transform((i) => ({
45
+ ...i,
46
+ createdTime: i.createdAt,
47
+ completedTime: i.completedAt,
48
+ get amount() {
49
+ return i.nettTotal.amount / 10 ** i.nettTotal.precision;
50
+ },
51
+ get adjustmentAmount() {
52
+ return i.adjustedTotal ? i.adjustedTotal.amount / 10 ** i.adjustedTotal.precision : void 0;
53
+ }
54
+ })).describe(g.describe(le)), se = e.object({
55
+ _id: e.string(),
56
+ rating: e.coerce.number(),
57
+ user: e.string().optional(),
58
+ restaurant: e.string(),
59
+ message: e.string(),
60
+ submittedAt: e.coerce.date()
61
+ }), o = e.enum([
62
+ "SIMPLE_CLAIM",
63
+ "LINK_CLAIM",
64
+ "BILL_COMPLETED",
65
+ "BILL_REFUNDED",
66
+ "SCHEDULE",
67
+ "BIRTHDAY",
68
+ "FEEDBACK",
69
+ "ENTER_SEGMENT",
70
+ "MEMBERSHIP_JOINED",
71
+ "TIER_UPGRADED",
72
+ "MAKING_ORDER",
73
+ "ISSUE_REWARD",
74
+ "MEMBER_REWARD",
75
+ "GAME_COMPLETED",
76
+ "PAGINATE_SCHEDULE",
77
+ "REFERRAL_ADDED",
78
+ "MEMBER_IMPORTED",
79
+ "SEGMENTATION_IMPORTED"
80
+ ]), qe = o.extract([
81
+ "BILL_COMPLETED",
82
+ "FEEDBACK",
83
+ "GAME_COMPLETED",
84
+ "MAKING_ORDER",
85
+ "MEMBERSHIP_JOINED",
86
+ "SCHEDULE",
87
+ "SIMPLE_CLAIM",
88
+ "TIER_UPGRADED",
89
+ "ISSUE_REWARD"
90
+ ]);
91
+ e.enum(["START_OF", "BEFORE"]);
92
+ e.enum(["WEEK", "MONTH"]);
93
+ const re = e.enum([
94
+ "WAITING",
95
+ "ACTIVE",
96
+ "COMPLETED",
97
+ "FAILED"
98
+ ]), a = e.object({
99
+ // type: F_EVENT_TYPE,
100
+ rule: T.optional()
101
+ }), de = a.extend({
102
+ type: e.literal(o.enum.BILL_COMPLETED)
103
+ }), ce = a.extend({
104
+ type: e.literal(o.enum.FEEDBACK)
105
+ }), me = a.extend({
106
+ type: e.literal(o.enum.SIMPLE_CLAIM)
107
+ });
108
+ a.extend({
109
+ type: e.literal(o.enum.ENTER_SEGMENT),
110
+ segment: e.string()
111
+ });
112
+ const ue = a.extend({
113
+ type: e.literal(o.enum.MEMBER_REWARD)
114
+ }), pe = a.extend({
115
+ type: e.literal(o.enum.SCHEDULE)
116
+ // option: FdoCronRule,
117
+ }), Ee = a.extend({
118
+ type: e.literal(o.enum.MEMBERSHIP_JOINED)
119
+ }), ge = a.extend({
120
+ type: e.literal(o.enum.TIER_UPGRADED)
121
+ }), be = a.extend({
122
+ type: e.literal(o.enum.MAKING_ORDER)
123
+ }), ye = a.extend({
124
+ type: e.literal(o.enum.ISSUE_REWARD)
125
+ }), Ce = a.extend({
126
+ type: e.literal(o.enum.GAME_COMPLETED)
127
+ });
128
+ a.extend({
129
+ type: e.literal(o.enum.REFERRAL_ADDED)
130
+ });
131
+ a.extend({
132
+ type: e.literal(o.enum.MEMBER_IMPORTED)
133
+ });
134
+ const Re = e.discriminatedUnion("type", [
135
+ me,
136
+ de,
137
+ pe,
138
+ ce,
139
+ Ee,
140
+ ge,
141
+ be,
142
+ ye,
143
+ ue,
144
+ Ce
145
+ ]);
146
+ e.object({
147
+ _id: t,
148
+ type: o,
149
+ ref: e.string(),
150
+ status: re.optional(),
151
+ context: e.record(e.string(), e.any()).optional(),
152
+ failedReason: e.any().optional()
153
+ }).describe(JSON.stringify({ collectionName: "EventLogs" }));
154
+ const l = e.object({
155
+ type: o,
156
+ context: e.any(),
157
+ businessIds: e.array(t).optional(),
158
+ campaignIds: e.array(t).optional(),
159
+ slackWebhookUrl: e.string().optional(),
160
+ emittedAt: e.coerce.date().default(/* @__PURE__ */ new Date())
161
+ }), Ie = l.extend({
162
+ type: e.literal(o.enum.BILL_COMPLETED),
163
+ context: e.object({
164
+ bill: j,
165
+ rawBill: e.any()
166
+ })
167
+ }), _e = l.extend({
168
+ type: e.literal(o.enum.BILL_REFUNDED),
169
+ context: e.object({
170
+ bill: j,
171
+ rawBill: e.any()
172
+ })
173
+ }), he = l.extend({
174
+ type: e.literal(o.enum.SCHEDULE),
175
+ context: e.object({
176
+ triggeredAt: e.coerce.date()
177
+ })
178
+ }), fe = l.extend({
179
+ type: e.literal(o.enum.PAGINATE_SCHEDULE),
180
+ context: e.object({
181
+ triggeredAt: e.coerce.date(),
182
+ business: t,
183
+ skip: e.coerce.number(),
184
+ limit: e.coerce.number()
185
+ })
186
+ }), Fe = l.extend({
187
+ type: e.literal(o.enum.FEEDBACK),
188
+ context: e.object({
189
+ feedback: se
190
+ })
191
+ }), De = l.extend({
192
+ type: e.literal(o.enum.MEMBERSHIP_JOINED),
193
+ context: e.object({
194
+ user: P
195
+ })
196
+ }), Ae = l.extend({
197
+ type: e.literal(o.enum.TIER_UPGRADED),
198
+ context: e.object({
199
+ transaction: S
200
+ })
201
+ }), Me = l.extend({
202
+ type: e.literal(o.enum.ISSUE_REWARD),
203
+ context: e.object({
204
+ transaction: S,
205
+ collection: ne
206
+ })
207
+ }), Te = l.extend({
208
+ type: e.literal(o.enum.REFERRAL_ADDED),
209
+ context: e.object({
210
+ user: P
211
+ })
212
+ }), N = e.object({
213
+ ref: t,
214
+ originalName: e.string(),
215
+ mimeType: e.string(),
216
+ size: e.number(),
217
+ fbFilePath: e.string(),
218
+ isFbFileDeleted: e.boolean().nullish()
219
+ }), Le = e.object({
220
+ resetCollectionExpiryBalance: e.boolean().nullish()
221
+ }), Oe = l.extend({
222
+ type: e.literal(o.enum.MEMBER_IMPORTED),
223
+ context: e.object({
224
+ business: e.string(),
225
+ file: N,
226
+ config: Le.optional()
227
+ })
228
+ }), xe = l.extend({
229
+ type: e.literal(o.enum.SEGMENTATION_IMPORTED),
230
+ context: e.object({
231
+ business: e.string(),
232
+ segment: e.string(),
233
+ file: N
234
+ })
235
+ });
236
+ e.discriminatedUnion("type", [
237
+ Ie,
238
+ _e,
239
+ he,
240
+ Fe,
241
+ De,
242
+ Ae,
243
+ Me,
244
+ fe,
245
+ Te,
246
+ Oe,
247
+ xe
248
+ ]);
249
+ const Pe = {
250
+ collectionName: "Locations",
251
+ transform: {
252
+ _id: "oid",
253
+ business: "oid"
254
+ }
255
+ }, B = e.object({
256
+ _id: t,
257
+ business: t,
258
+ name: e.string(),
259
+ code: e.string().nullish(),
260
+ otp: e.string().nullish(),
261
+ otpExpiredAt: e.coerce.date().nullish(),
262
+ apiToken: e.string().nullish(),
263
+ customAttribute: e.record(e.any()).nullish()
264
+ }).describe(g.describe(Pe));
265
+ e.object({
266
+ _id: t,
267
+ name: e.string(),
268
+ location: t,
269
+ os: e.string(),
270
+ apiToken: e.string().nullish()
271
+ }).describe(
272
+ g.describe({
273
+ collectionName: "LocationDevices",
274
+ transform: {
275
+ _id: "oid",
276
+ location: "oid"
277
+ }
278
+ })
279
+ );
280
+ e.object({
281
+ _id: e.string(),
282
+ name: e.string()
283
+ });
284
+ const h = e.enum(["NO_REWARD", "VOUCHER", "LOYALTY"]), f = e.number().min(0, "Weight need to be at least 0"), F = e.number().int("Must be integer").min(0, "Threshold need to be at least 0"), G = e.object({
285
+ type: e.literal(h.enum.NO_REWARD),
286
+ collectible: e.null(),
287
+ weight: f
288
+ }), U = e.object({
289
+ type: e.literal(h.enum.VOUCHER),
290
+ collectible: t,
291
+ collectibleConfig: e.lazy(() => L._def.right.options[0]),
292
+ earningOption: e.lazy(() => c)
293
+ }), y = e.object({
294
+ type: e.literal(h.enum.LOYALTY),
295
+ collectible: t,
296
+ earningOption: e.lazy(() => c),
297
+ validityOption: e.lazy(() => ee)
298
+ }), w = U.extend({
299
+ weight: f
300
+ }), z = y.extend({
301
+ weight: e.number().min(0, "Weight need to be at least 0")
302
+ }), Ye = y.extend({
303
+ validityOption: O,
304
+ weight: f
305
+ }), Se = e.discriminatedUnion("type", [
306
+ w,
307
+ z,
308
+ G
309
+ ]), D = e.discriminatedUnion("type", [
310
+ w.extend({
311
+ collectible: t.nullish(),
312
+ business: t.nullish()
313
+ }),
314
+ z.extend({
315
+ collectible: t.nullish(),
316
+ business: t.nullish()
317
+ }),
318
+ G
319
+ ]), H = U.extend({
320
+ threshold: F
321
+ }), v = y.extend({
322
+ threshold: F
323
+ }), Ze = y.extend({
324
+ validityOption: O,
325
+ threshold: F
326
+ }), k = e.discriminatedUnion("type", [
327
+ H,
328
+ v
329
+ ]), je = e.discriminatedUnion("type", [
330
+ H.extend({
331
+ collectible: t.nullish(),
332
+ business: t.nullish()
333
+ }),
334
+ v.extend({
335
+ collectible: t.nullish(),
336
+ collectibleConfig: L.nullish(),
337
+ business: t.nullish()
338
+ })
339
+ ]), Ne = e.enum(["PROGRESSIVE", "STAMP"]), Be = e.object({
340
+ type: Ne,
341
+ end: e.number().int().min(0, "Threshold need to be at least 1"),
342
+ rewards: e.array(e.lazy(() => k)).nullish()
343
+ }).superRefine((i, d) => {
344
+ i.type == "STAMP" && i.end > 40 && (d.addIssue({
345
+ code: "custom",
346
+ path: [],
347
+ message: "Stamp mission can have at most 40 threshold"
348
+ }), d.addIssue({
349
+ code: "custom",
350
+ path: ["end"],
351
+ message: "Stamp mission can have at most 40 threshold"
352
+ }));
353
+ }), C = e.object({
354
+ totalCount: e.number().optional(),
355
+ totalCountPerUser: e.number().optional()
356
+ }), m = e.object({
357
+ periods: e.array(
358
+ e.object({
359
+ startTime: e.string(),
360
+ endTime: e.string()
361
+ })
362
+ )
363
+ }), R = e.object({
364
+ startTime: e.string(),
365
+ // ISO 8601 date string
366
+ endTime: e.string(),
367
+ // ISO 8601 date string
368
+ eaterType: e.enum(["all", "new", "existing"]),
369
+ minBasketAmount: e.number().optional(),
370
+ bundleQuantity: e.number().optional(),
371
+ workingHour: e.object({
372
+ mon: m.optional(),
373
+ tue: m.optional(),
374
+ wed: m.optional(),
375
+ thu: m.optional(),
376
+ fri: m.optional(),
377
+ sat: m.optional(),
378
+ sun: m.optional()
379
+ }).optional()
380
+ }), Ge = e.object({
381
+ type: e.enum(["items", "category", "order"]),
382
+ objectIDs: e.array(e.string()).optional()
383
+ }), I = e.object({
384
+ type: e.enum([
385
+ "net",
386
+ // dollar off
387
+ "percentage",
388
+ // percentage off
389
+ "bundleSameFixPrice",
390
+ // bundle fix price (same item)
391
+ "bundleDiffFixPrice",
392
+ // bundle fix price (different items)
393
+ "bundleSameNet",
394
+ // bundle dollar off (same item)
395
+ "bundleDiffNet",
396
+ // bundle dollar off (different items)
397
+ "bundleSamePercentage",
398
+ // bundle percentage off (same item)
399
+ "bundleDiffPercentage",
400
+ // bundle percentage off (different items)
401
+ "delivery",
402
+ // delivery fee off
403
+ "freeItem"
404
+ // free item
405
+ ]),
406
+ value: e.number(),
407
+ cap: e.number().optional(),
408
+ // for percentage off campaigns
409
+ scope: Ge
410
+ });
411
+ e.object({
412
+ merchantID: e.string().optional(),
413
+ name: e.string().max(256),
414
+ quotas: C.optional(),
415
+ conditions: R,
416
+ discount: I,
417
+ customTag: e.string().max(22).optional()
418
+ });
419
+ e.object({
420
+ id: e.string()
421
+ });
422
+ e.object({
423
+ merchantID: e.string().optional(),
424
+ name: e.string().max(256).optional(),
425
+ quotas: C.optional(),
426
+ conditions: R.optional(),
427
+ discount: I.optional(),
428
+ customTag: e.string().max(22).optional()
429
+ });
430
+ const A = e.object({
431
+ id: e.string(),
432
+ merchantID: e.string(),
433
+ name: e.string(),
434
+ quotas: C.optional(),
435
+ conditions: R,
436
+ discount: I,
437
+ customTag: e.string().optional(),
438
+ status: e.enum(["ongoing", "upcoming", "expired", "cancelled"]).optional(),
439
+ createdAt: e.string().optional(),
440
+ updatedAt: e.string().optional()
441
+ });
442
+ e.object({
443
+ ongoing: e.array(A),
444
+ upcoming: e.array(A)
445
+ });
446
+ e.object({
447
+ merchantID: e.string()
448
+ });
449
+ e.object({
450
+ target: e.string(),
451
+ reason: e.string(),
452
+ message: e.string()
453
+ });
454
+ const Ue = {
455
+ collectionName: "Groups",
456
+ transform: {
457
+ _id: "oid",
458
+ business: "oid"
459
+ },
460
+ lookups: {
461
+ business: {
462
+ fromCollection: "Businesses",
463
+ as: "pf_business"
464
+ },
465
+ pf_campaigns: {
466
+ fromCollection: "Campaigns",
467
+ as: "pf_campaigns",
468
+ localField: "_id",
469
+ foreignField: "group"
470
+ }
471
+ }
472
+ }, Qe = e.object({
473
+ _id: t,
474
+ name: e.string().min(1).max(300),
475
+ business: t,
476
+ pf_campaigns: e.array(e.any()).optional()
477
+ }).describe(g.describe(Ue)), we = e.object({
478
+ from: e.string().email().nullish(),
479
+ name: e.string().min(1).max(50).nullish()
480
+ }), ze = e.object({
481
+ _id: e.string(),
482
+ url: e.string(),
483
+ targetLocation: e.array(t).nullish(),
484
+ // null/empty = all locations
485
+ order: e.number().optional()
486
+ }), W = e.object({
487
+ type: e.literal(M.enum.MEMBERSHIP),
488
+ business: t,
489
+ name: e.string().min(1).max(50),
490
+ image: e.string().nullish(),
491
+ url: e.string().nullish(),
492
+ tiers: e.array(e.lazy(() => oe)),
493
+ titles: e.array(t),
494
+ tierCycleEnable: e.boolean().optional(),
495
+ tierCycle: e.lazy(() => T).nullish(),
496
+ tierRules: e.array(e.lazy(() => ie)).nullish(),
497
+ welcomeMessage: p.optional(),
498
+ advertisements: e.union([e.array(e.string()), e.array(ze)]).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: we.nullish(),
510
+ freeCreditAsDiscount: e.boolean().optional(),
511
+ pf_title: e.array(e.lazy(() => u)).optional(),
512
+ pf_targetLocation: e.array(e.lazy(() => B)).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"]), s = 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: Re,
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(() => B)).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 = s.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
+ }), He = e.object({
620
+ gameType: e.string()
621
+ }), V = s.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: He.nullish()
639
+ }), J = s.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 = s.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 = s.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 = s.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 = s.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(() => Se)).min(1, "Requires at least 1 reward")
703
+ }), Z = s.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 = s.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(() => Be),
727
+ rewards: e.array(e.lazy(() => k)).min(1, "Requires at least 1 reward")
728
+ }), $ = s.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
+ }), ve = {
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(ve)), 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(() => D)).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(() => D)).min(1, "Requires at least 1 reward")
851
+ })
852
+ }),
853
+ Q.extend({
854
+ business: t.nullish(),
855
+ rewards: e.array(e.lazy(() => je)).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
+ Re as d,
887
+ Qe as e,
888
+ Xe as f,
889
+ Ye as g,
890
+ D as h,
891
+ Ne as i,
892
+ Ze as j,
893
+ je as k,
894
+ Be as l,
895
+ W as m,
896
+ re as n
897
+ };