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

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/dist/{App-CvJ0ASlp.js → App-BPFhGsvV.js} +812 -666
  2. package/dist/{AuditLogs-Bt9S2LKL.js → AuditLogs-CW8vs5kM.js} +14 -13
  3. package/dist/{Bin-ZSCDSioa.js → Bin-CgdkmL0M.js} +8 -8
  4. package/dist/Broadcast-CoRRvfXh.js +302 -0
  5. package/dist/CampaignAnalytic-UAwVz0E3.js +1830 -0
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-LweQ57aG.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B_IbtQLp.js} +6 -5
  7. package/dist/Card-D3-MgguK.js +1084 -0
  8. package/dist/{Collections-H7zhe9zN.js → Collections-BU7-Lz_-.js} +14 -13
  9. package/dist/Credit-C9gf6eCr.js +286 -0
  10. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-UK9GcPFC.js +53 -0
  11. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-B9A98JpX.js +4213 -0
  12. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-qNmiKaJc.js → EffectSheet.vue_vue_type_style_index_0_lang-nKD6CT3U.js} +35 -35
  13. package/dist/{Experience-CH5tg-tm.js → Experience-dKvKT4v4.js} +112 -86
  14. package/dist/{FileSaver.min-DNFqiyZb.js → FileSaver.min-CI8hZvUL.js} +1 -1
  15. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-3bH-tZAm.js +138 -0
  16. package/dist/Game-CBjdeb6F.js +356 -0
  17. package/dist/GiftCardSetup-DA9yMwPR.js +662 -0
  18. package/dist/{Grab-3s_sLewD.js → Grab-zCeZMSNI.js} +33 -32
  19. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-fbmoN1e9.js → ImageInput.vue_vue_type_script_setup_true_lang-CxhlYuM9.js} +1 -1
  20. package/dist/{Index-zTWZCiEo.js → Index-UGpjUfjV.js} +10 -10
  21. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-BOxYPkf5.js → LocationPicker.vue_vue_type_script_setup_true_lang-D21fIVUX.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-DrB7xzy1.js} +1 -1
  23. package/dist/LoyaltyDashboard-CBPnQReU.js +2865 -0
  24. package/dist/MainLayout-BBJUWsAz.js +143 -0
  25. package/dist/{Marketing-Bto1OvK1.js → Marketing-BjQG6Q41.js} +7 -6
  26. package/dist/{MarketingMaterialEdit-D7rIqF5U.js → MarketingMaterialEdit-CMUbiKjd.js} +15 -14
  27. package/dist/Member-B-7tGoFW.js +649 -0
  28. package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-BLmafK0n.js +1287 -0
  29. package/dist/MemberImportHistory-CDyHKO1L.js +187 -0
  30. package/dist/MemberList-f0dMdOF8.js +336 -0
  31. package/dist/{MemberTransactions-CjTtGB2y.js → MemberTransactions-DVcRoyxv.js} +1 -1
  32. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DvKL7BL5.js → MessageInput.vue_vue_type_script_setup_true_lang-CnpXUVvO.js} +5682 -5479
  33. package/dist/MetricInfoTooltip.vue_vue_type_script_setup_true_lang-BTBXutpq.js +40 -0
  34. package/dist/Mission-CrrXaD8F.js +360 -0
  35. package/dist/{Overview-mxGLyFvE.js → Overview-CAIxshHU.js} +21 -20
  36. package/dist/Overview-Y_hxLN7Y.js +1316 -0
  37. package/dist/Point-CE0G4oxW.js +288 -0
  38. package/dist/Promotion-C_NQWWOT.js +423 -0
  39. package/dist/{Queue-DgaFyyyH.js → Queue-BfZGOOsa.js} +14 -13
  40. package/dist/{Record-BRol__6_.js → Record-BR3Su26B.js} +9 -9
  41. package/dist/Review-FrIgV7vH.js +45 -0
  42. package/dist/ReviewFacebookCallback-DOyee73-.js +238 -0
  43. package/dist/ReviewGoogleCallback-CX0cbT4r.js +213 -0
  44. package/dist/{Reward-DQI0PvmR.js → Reward-COkgkVT-.js} +35 -35
  45. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-B6bvQNsU.js → RewardGroup.vue_vue_type_script_setup_true_lang-CUd-Gy5a.js} +14 -13
  46. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-DgAU7jGo.js → RuleGroup.vue_vue_type_script_setup_true_lang-eBVDv0Qy.js} +103 -109
  47. package/dist/{Segment-DFaLx0QZ.js → Segment-kh3FuWRP.js} +30 -29
  48. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-Cpb2i9iV.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-CUoiQlba.js} +31 -30
  49. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-MvoepHn9.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BkylJ859.js} +4 -4
  50. package/dist/{Setting-D2NjFJvq.js → Setting-UDrEIdF9.js} +14 -14
  51. package/dist/{SettingAdvertisements-CPWgSMaA.js → SettingAdvertisements-Dic4fC0u.js} +12 -12
  52. package/dist/Settings-Ct_ESMn8.js +230 -0
  53. package/dist/Store-CyG1FPWq.js +2612 -0
  54. package/dist/{StoreRewards-Ccj12pyq.js → StoreRewards-C9b_rMRT.js} +15 -15
  55. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-DaGFayps.js +1329 -0
  56. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-CfWTn0Xd.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-Dew6rC4d.js} +2 -2
  57. package/dist/{Tier-vaJoohiM.js → Tier-DgLEHrFJ.js} +2296 -750
  58. package/dist/{Title-BqHC7-v9.js → Title-C_8gMnYS.js} +39 -37
  59. package/dist/Transaction-B9E0jWw9.js +45 -0
  60. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-Dporb9KE.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DgW4dSkV.js} +26 -26
  61. package/dist/{Voucher-DeN6C6DQ.js → Voucher-DR3Eteh4.js} +156 -133
  62. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-De16fuC4.js → VoucherEditor.vue_vue_type_script_setup_true_lang-JexB74ky.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-ChOd_di8.js} +2 -2
  64. package/dist/{app-n4Y2jMee.js → app-BIjITpNJ.js} +29593 -25208
  65. package/dist/app.js +1 -1
  66. package/dist/base.export-DqZ38Nx2.js +75 -0
  67. package/dist/{business-jn-_l48y.js → business-j4ZuiLuJ.js} +5 -5
  68. package/dist/campaign-DxhXoOvw.js +100 -0
  69. package/dist/campaign-MS9awZ18.js +368 -0
  70. package/dist/{campaign.enum-C9HvoKuq.js → campaign.enum-Bk6qcWR3.js} +1 -1
  71. package/dist/campaign.fn-DR_X38U8.js +776 -0
  72. package/dist/{collectible.enum-_HVU4lWn.js → collectible.enum-C_E4CCGR.js} +1 -1
  73. package/dist/collection.fn-BfyWr7cC.js +26 -0
  74. package/dist/currency-DZzC-632.js +7 -0
  75. package/dist/{duplicateCampaign-gzVwrnWb.js → duplicateCampaign-BgTmR0T2.js} +11 -11
  76. package/dist/{effect-DhpIv1L3.js → effect-DPCjkqDR.js} +1 -1
  77. package/dist/{email-addresses-DPxYLSoa.js → email-addresses-BoPJkP5p.js} +209 -201
  78. package/dist/google-C3S8u0mT.js +4 -0
  79. package/dist/{helper-WYHUnHVy.js → helper-DwJK1iKj.js} +1 -1
  80. package/dist/{index-BPsofsGt.js → index-8vHynDvo.js} +1933 -2560
  81. package/dist/{index-BdqRrCt8.js → index-Bd4ErVnX.js} +5 -5
  82. package/dist/index-BkFxLxI6.js +137 -0
  83. package/dist/index-BvxBDSzh.js +72 -0
  84. package/dist/{index-DUTFNEn9.js → index-C5Jm1Was.js} +4 -4
  85. package/dist/{index-xao4ggML.js → index-CIuQyo1z.js} +5 -5
  86. package/dist/{index-C-5YgmkC.js → index-CMJCsyXT.js} +7 -5
  87. package/dist/index-CTo26AN3.js +14530 -0
  88. package/dist/{index-Cte6dHHy.js → index-CVMsPseO.js} +14 -14
  89. package/dist/{index-BdnHQSDd.js → index-CXbojcfi.js} +5 -4
  90. package/dist/index-Cso1GrEu.js +53 -0
  91. package/dist/{index-Cvfavr2M.js → index-DD24eHtV.js} +351 -216
  92. package/dist/index-DGOX45St.js +151 -0
  93. package/dist/index-DP6WMBRq.js +900 -0
  94. package/dist/{index-7HizF3GI.js → index-DfwXt9fy.js} +1588 -1522
  95. package/dist/{index--fNMSXUf.js → index-Dn2mOB0A.js} +1 -1
  96. package/dist/{index-BuLfxJyC.js → index-LJrZDUgh.js} +105 -123
  97. package/dist/{index-BN-FP9kx.js → index-a15EaBn7.js} +1 -1
  98. package/dist/{index.esm2017-CjzFPUCa.js → index.esm2017-CWii-ZqX.js} +164 -164
  99. package/dist/{loading-CojnK00V.js → loading-CibOtJVR.js} +1 -1
  100. package/dist/{lodash-CLkg5jTT.js → lodash-oHoQ9t6u.js} +1 -1
  101. package/dist/member-import-BgJP811X.js +187 -0
  102. package/dist/membership-CqFY6ya6.js +274 -0
  103. package/dist/{money-CyaLaEKo.js → money-tVvfE8ha.js} +1 -1
  104. package/dist/{number-DEtI4bEX.js → number-B4p37H0W.js} +1 -1
  105. package/dist/objectid-reVda6sT.js +145 -0
  106. package/dist/{plugins-MnP1vCcg.js → plugins-S4qmcyLz.js} +13 -12
  107. package/dist/remy-Qz_pNsUS.js +13 -0
  108. package/dist/{reward-Dk3D26xC.js → reward-CgHNw9uj.js} +1 -1
  109. package/dist/{rule-B1Agad1n.js → rule-BECsW_aD.js} +335 -275
  110. package/dist/style.css +1 -1
  111. package/dist/{template-DpqLCq1p.js → template-jOqP_F7D.js} +6 -6
  112. package/dist/timezone-BBXko2_m.js +20 -0
  113. package/dist/transaction.fn-3DOFgJNT.js +64 -0
  114. package/dist/{trigger-cwPN-4Ia.js → trigger-DBIaHlqi.js} +17 -17
  115. package/dist/useMarketingMaterialActions-Dnln39_O.js +96 -0
  116. package/dist/{usePagination-D8zBMxdJ.js → usePagination-BKN2uLM2.js} +1 -1
  117. package/dist/{user-EUGwaL2f.js → user-CTKTBdLx.js} +1 -1
  118. package/dist/{vue-i18n-BBj45p9N.js → vue-i18n-Di-6yoyq.js} +233 -233
  119. package/dist/{xlsx-DiMIlKmu.js → xlsx-Z1jRdg68.js} +584 -584
  120. package/dist/{zod-B1cU167C.js → zod-BmQ5EO9I.js} +1 -1
  121. package/package.json +6 -5
  122. package/dist/Broadcast-BT0R11RB.js +0 -266
  123. package/dist/Card-Wdh8lyUv.js +0 -910
  124. package/dist/Credit-BuKLrFtM.js +0 -260
  125. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +0 -58
  126. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-B2sZFWUF.js +0 -3377
  127. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
  128. package/dist/Game-C9s4qZz4.js +0 -330
  129. package/dist/LoyaltyDashboard-tOOk6zvV.js +0 -1082
  130. package/dist/MainLayout-iWi1DzXS.js +0 -41
  131. package/dist/Member-BdgdT-sa.js +0 -280
  132. package/dist/MemberList-DBIE-RWC.js +0 -1601
  133. package/dist/Mission-CWR6FBvN.js +0 -334
  134. package/dist/Point-BIt82fJk.js +0 -262
  135. package/dist/Promotion-Cl1vPi0B.js +0 -397
  136. package/dist/Review-DmV2YnFd.js +0 -1076
  137. package/dist/ReviewFacebookCallback-B5XgAWXo.js +0 -243
  138. package/dist/ReviewGoogleCallback-CYR03Wfd.js +0 -208
  139. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-CAImd3yc.js +0 -181
  140. package/dist/Store-DjUe8ady.js +0 -1996
  141. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-B7w69A3j.js +0 -1130
  142. package/dist/Transaction-BOmDOGnD.js +0 -39
  143. package/dist/campaign-BnI7-ceP.js +0 -219
  144. package/dist/campaign-rgDnocfT.js +0 -277
  145. package/dist/campaign.fn-D21ettpH.js +0 -776
  146. package/dist/export-CWAxYj7W.js +0 -97
  147. package/dist/index-B6EBgIUx.js +0 -85
  148. package/dist/index-CxR1baaG.js +0 -52
  149. package/dist/membership-CeX8E_I9.js +0 -255
  150. package/dist/objectid-CMau7CW-.js +0 -145
  151. package/dist/useMarketingMaterialActions-CGzfJ68e.js +0 -107
@@ -0,0 +1,900 @@
1
+ import { z as e, F as t, b as _, m as g, d as X } from "./index-CIuQyo1z.js";
2
+ import { F as M } from "./campaign.enum-Bk6qcWR3.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-DfwXt9fy.js";
4
+ import { C as P, A as S, B as ne, E as oe, H as ie } from "./index-8vHynDvo.js";
5
+ import { e as p, f as ae } from "./index-CTo26AN3.js";
6
+ e.object({
7
+ location: t,
8
+ memberId: t,
9
+ nettTotal: _,
10
+ remark: e.string().optional()
11
+ });
12
+ const le = 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 se = {
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: le.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(se)), re = 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
+ ]), Ye = 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 de = e.enum([
94
+ "WAITING",
95
+ "ACTIVE",
96
+ "COMPLETED",
97
+ "FAILED"
98
+ ]), a = e.object({
99
+ // type: F_EVENT_TYPE,
100
+ rule: T.optional()
101
+ }), ce = a.extend({
102
+ type: e.literal(o.enum.BILL_COMPLETED)
103
+ }), me = a.extend({
104
+ type: e.literal(o.enum.FEEDBACK)
105
+ }), ue = 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 pe = a.extend({
113
+ type: e.literal(o.enum.MEMBER_REWARD)
114
+ }), Ee = a.extend({
115
+ type: e.literal(o.enum.SCHEDULE)
116
+ // option: FdoCronRule,
117
+ }), ge = a.extend({
118
+ type: e.literal(o.enum.MEMBERSHIP_JOINED)
119
+ }), be = a.extend({
120
+ type: e.literal(o.enum.TIER_UPGRADED)
121
+ }), ye = a.extend({
122
+ type: e.literal(o.enum.MAKING_ORDER)
123
+ }), Ce = a.extend({
124
+ type: e.literal(o.enum.ISSUE_REWARD)
125
+ }), Re = 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 Ie = e.discriminatedUnion("type", [
135
+ ue,
136
+ ce,
137
+ Ee,
138
+ me,
139
+ ge,
140
+ be,
141
+ ye,
142
+ Ce,
143
+ pe,
144
+ Re
145
+ ]);
146
+ e.object({
147
+ _id: t,
148
+ type: o,
149
+ ref: e.string(),
150
+ status: de.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
+ }), _e = l.extend({
162
+ type: e.literal(o.enum.BILL_COMPLETED),
163
+ context: e.object({
164
+ bill: j,
165
+ rawBill: e.any()
166
+ })
167
+ }), he = l.extend({
168
+ type: e.literal(o.enum.BILL_REFUNDED),
169
+ context: e.object({
170
+ bill: j,
171
+ rawBill: e.any()
172
+ })
173
+ }), fe = 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
+ }), De = l.extend({
187
+ type: e.literal(o.enum.FEEDBACK),
188
+ context: e.object({
189
+ feedback: re
190
+ })
191
+ }), Ae = l.extend({
192
+ type: e.literal(o.enum.MEMBERSHIP_JOINED),
193
+ context: e.object({
194
+ user: P
195
+ })
196
+ }), Me = l.extend({
197
+ type: e.literal(o.enum.TIER_UPGRADED),
198
+ context: e.object({
199
+ transaction: S
200
+ })
201
+ }), Te = l.extend({
202
+ type: e.literal(o.enum.ISSUE_REWARD),
203
+ context: e.object({
204
+ transaction: S,
205
+ collection: ne
206
+ })
207
+ }), Le = l.extend({
208
+ type: e.literal(o.enum.REFERRAL_ADDED),
209
+ context: e.object({
210
+ user: P
211
+ })
212
+ }), B = 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
+ }), Oe = e.object({
220
+ resetCollectionExpiryBalance: e.boolean().nullish()
221
+ }), xe = l.extend({
222
+ type: e.literal(o.enum.MEMBER_IMPORTED),
223
+ context: e.object({
224
+ business: e.string(),
225
+ file: B,
226
+ config: Oe.optional()
227
+ })
228
+ }), Pe = l.extend({
229
+ type: e.literal(o.enum.SEGMENTATION_IMPORTED),
230
+ context: e.object({
231
+ business: e.string(),
232
+ segment: e.string(),
233
+ file: B
234
+ })
235
+ });
236
+ e.discriminatedUnion("type", [
237
+ _e,
238
+ he,
239
+ fe,
240
+ De,
241
+ Ae,
242
+ Me,
243
+ Te,
244
+ Fe,
245
+ Le,
246
+ xe,
247
+ Pe
248
+ ]);
249
+ const Se = {
250
+ collectionName: "Locations",
251
+ transform: {
252
+ _id: "oid",
253
+ business: "oid"
254
+ }
255
+ }, N = 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(Se));
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
+ }), v = y.extend({
301
+ weight: e.number().min(0, "Weight need to be at least 0")
302
+ }), Ze = y.extend({
303
+ validityOption: O,
304
+ weight: f
305
+ }), je = e.discriminatedUnion("type", [
306
+ w,
307
+ v,
308
+ G
309
+ ]), D = e.discriminatedUnion("type", [
310
+ w.extend({
311
+ collectible: t.nullish(),
312
+ business: t.nullish()
313
+ }),
314
+ v.extend({
315
+ collectible: t.nullish(),
316
+ business: t.nullish()
317
+ }),
318
+ G
319
+ ]), z = U.extend({
320
+ threshold: F
321
+ }), H = y.extend({
322
+ threshold: F
323
+ }), Qe = y.extend({
324
+ validityOption: O,
325
+ threshold: F
326
+ }), k = e.discriminatedUnion("type", [
327
+ z,
328
+ H
329
+ ]), Be = e.discriminatedUnion("type", [
330
+ z.extend({
331
+ collectible: t.nullish(),
332
+ business: t.nullish()
333
+ }),
334
+ H.extend({
335
+ collectible: t.nullish(),
336
+ collectibleConfig: L.nullish(),
337
+ business: t.nullish()
338
+ })
339
+ ]), Ne = e.enum(["PROGRESSIVE", "STAMP"]), Ge = 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
+ }), Ue = 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: Ue
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 we = {
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
+ }, $e = 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(we)), ve = 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: ve.nullish(),
510
+ freeCreditAsDiscount: e.boolean().optional(),
511
+ pf_title: e.array(e.lazy(() => u)).optional(),
512
+ pf_targetLocation: e.array(e.lazy(() => N)).optional(),
513
+ allowedPhoneCountries: e.union([e.array(e.string().regex(/^\+\d{1,4}$/)), e.null()]).optional(),
514
+ // new structure
515
+ group: e.string().nullish(),
516
+ templateId: t.nullish()
517
+ }), n = M.exclude(["MEMBERSHIP"]), s = e.object({
518
+ _id: t.nullish(),
519
+ type: n,
520
+ // common information
521
+ business: t,
522
+ name: e.string().min(1).max(50),
523
+ image: e.string().nullish(),
524
+ description: e.string().max(500).nullish(),
525
+ timeframeOptions: x.superRefine((i, d) => {
526
+ i.start && i.end && i.end < i.start && d.addIssue({
527
+ code: "custom",
528
+ path: [],
529
+ params: {
530
+ i18n: "connectZodCustom:timeframe.end_before_start"
531
+ }
532
+ });
533
+ }).nullish(),
534
+ targetLocation: e.array(t).nullish(),
535
+ event: Ie,
536
+ config: te.nullish(),
537
+ currentReceive: e.coerce.number().optional(),
538
+ // new group structure
539
+ group: t.nullish(),
540
+ templateId: t.nullish(),
541
+ pf_targetLocation: e.array(e.lazy(() => N)).optional(),
542
+ deletedAt: e.coerce.date().optional()
543
+ }), r = {
544
+ [n.enum.VOUCHER]: [
545
+ "BILL_COMPLETED",
546
+ "FEEDBACK",
547
+ "MEMBERSHIP_JOINED",
548
+ "TIER_UPGRADED",
549
+ "SCHEDULE",
550
+ "SIMPLE_CLAIM"
551
+ ],
552
+ [n.enum.PROMOTION]: ["MAKING_ORDER"],
553
+ [n.enum.GRAB]: ["MAKING_ORDER"],
554
+ [n.enum.POINT]: [
555
+ "BILL_COMPLETED",
556
+ "FEEDBACK",
557
+ "MEMBERSHIP_JOINED",
558
+ "TIER_UPGRADED",
559
+ "SCHEDULE"
560
+ ],
561
+ [n.enum.CREDIT]: [
562
+ "BILL_COMPLETED",
563
+ "FEEDBACK",
564
+ "MEMBERSHIP_JOINED",
565
+ "TIER_UPGRADED",
566
+ "SCHEDULE"
567
+ ],
568
+ [n.enum.BROADCAST]: [
569
+ "SCHEDULE",
570
+ "ISSUE_REWARD",
571
+ "FEEDBACK"
572
+ ],
573
+ [n.enum.COIN]: [
574
+ "BILL_COMPLETED",
575
+ "FEEDBACK",
576
+ "MEMBERSHIP_JOINED",
577
+ "TIER_UPGRADED",
578
+ "SCHEDULE"
579
+ ],
580
+ [n.enum.REWARD_POOL]: ["GAME_COMPLETED"],
581
+ [n.enum.GAME]: [
582
+ "BILL_COMPLETED",
583
+ "FEEDBACK",
584
+ "MEMBERSHIP_JOINED",
585
+ "TIER_UPGRADED",
586
+ "SCHEDULE",
587
+ "SIMPLE_CLAIM"
588
+ ],
589
+ [n.enum.MISSION]: [
590
+ "BILL_COMPLETED",
591
+ "FEEDBACK",
592
+ "SCHEDULE"
593
+ ]
594
+ }, K = s.extend({
595
+ type: e.literal(n.enum.VOUCHER),
596
+ // event
597
+ code: e.string().min(0).max(15).regex(/^[A-Za-z0-9\-_.@]*$/, {
598
+ message: "Code can only contain letters, numbers, and - _ . @"
599
+ }).optional(),
600
+ event: a.merge(
601
+ e.object({
602
+ type: e.enum(r[n.enum.VOUCHER])
603
+ })
604
+ ),
605
+ earningOption: c.default({
606
+ amount: 1,
607
+ type: "FIXED"
608
+ }),
609
+ collectible: t,
610
+ hideInApp: e.boolean().optional(),
611
+ notify: e.boolean().optional(),
612
+ notifyMessage: e.lazy(() => p).optional(),
613
+ notifyCampaign: t.nullish(),
614
+ pf_collectible: e.lazy(() => u).optional(),
615
+ pf_notifyCampaign: e.lazy(() => E).optional()
616
+ }), He = e.object({
617
+ gameType: e.string()
618
+ }), V = s.extend({
619
+ type: e.literal(n.enum.PROMOTION),
620
+ // event
621
+ event: a.merge(
622
+ e.object({
623
+ type: e.enum(r[n.enum.PROMOTION])
624
+ })
625
+ ),
626
+ effect: e.custom().superRefine((i, d) => {
627
+ i || d.addIssue({
628
+ code: "custom",
629
+ path: [],
630
+ params: {
631
+ i18n: "connectZodCustom:campaign.effect_required"
632
+ }
633
+ });
634
+ }),
635
+ gameConfig: He.nullish()
636
+ }), J = s.extend({
637
+ type: e.literal(n.enum.POINT),
638
+ // event
639
+ event: a.merge(
640
+ e.object({
641
+ type: e.enum(r[n.enum.POINT])
642
+ })
643
+ ),
644
+ earningOption: c,
645
+ collectible: t,
646
+ notify: e.boolean().optional(),
647
+ notifyMessage: e.lazy(() => p).optional(),
648
+ notifyCampaign: t.nullish(),
649
+ pf_collectible: e.lazy(() => u).optional(),
650
+ pf_notifyCampaign: e.lazy(() => E).optional()
651
+ }), q = s.extend({
652
+ type: e.literal(n.enum.CREDIT),
653
+ // event
654
+ event: a.merge(
655
+ e.object({
656
+ type: e.enum(r[n.enum.CREDIT])
657
+ })
658
+ ),
659
+ earningOption: c,
660
+ collectible: t,
661
+ notify: e.boolean().optional(),
662
+ notifyMessage: e.lazy(() => p).optional(),
663
+ notifyCampaign: t.nullish(),
664
+ pf_collectible: e.lazy(() => u).optional(),
665
+ pf_notifyCampaign: e.lazy(() => E).optional()
666
+ }), E = s.extend({
667
+ type: e.literal(n.enum.BROADCAST),
668
+ // event
669
+ event: a.merge(
670
+ e.object({
671
+ type: e.enum(r[n.enum.BROADCAST])
672
+ })
673
+ ),
674
+ // Optional so a campaign can use only channels the legacy sender cannot
675
+ // route (App Inbox, Push). Campaigns with `delivery` take the multi-channel
676
+ // path, which never reads `message`; it is still mirrored when a routable
677
+ // channel exists (see toLegacyMessage) so an older reader degrades to
678
+ // sending one real message rather than nothing.
679
+ message: p.nullish(),
680
+ delivery: e.lazy(() => ae).nullish(),
681
+ linkedCampaign: t.nullish()
682
+ }), Y = s.extend({
683
+ type: e.literal(n.enum.COIN),
684
+ // event
685
+ event: a.merge(
686
+ e.object({
687
+ type: e.enum(r[n.enum.COIN])
688
+ })
689
+ ),
690
+ earningOption: c,
691
+ collectible: t,
692
+ notify: e.boolean().optional(),
693
+ notifyMessage: e.lazy(() => p).optional(),
694
+ notifyCampaign: t.nullish(),
695
+ pf_collectible: e.lazy(() => u).optional(),
696
+ pf_notifyCampaign: e.lazy(() => E).optional()
697
+ }), b = s.extend({
698
+ type: e.literal(n.enum.REWARD_POOL),
699
+ // event
700
+ event: a.merge(
701
+ e.object({
702
+ type: e.enum(r[n.enum.REWARD_POOL])
703
+ })
704
+ ),
705
+ rewards: e.array(e.lazy(() => je)).min(1, "Requires at least 1 reward")
706
+ }), Z = s.extend({
707
+ type: e.literal(n.enum.GAME),
708
+ // event
709
+ event: a.merge(
710
+ e.object({
711
+ type: e.enum(r[n.enum.GAME])
712
+ })
713
+ ),
714
+ earningOption: c,
715
+ collectible: t,
716
+ game: e.lazy(() => b).optional(),
717
+ pf_collectible: e.lazy(() => u).optional(),
718
+ rewardPool: t.optional()
719
+ }), Q = s.extend({
720
+ type: e.literal(n.enum.MISSION),
721
+ event: a.merge(
722
+ e.object({
723
+ type: e.enum(r[n.enum.MISSION])
724
+ })
725
+ ),
726
+ earningOption: c,
727
+ collectible: t,
728
+ pf_collectible: e.lazy(() => u).optional(),
729
+ mission: e.lazy(() => Ge),
730
+ rewards: e.array(e.lazy(() => k)).min(1, "Requires at least 1 reward")
731
+ }), $ = s.omit({
732
+ timeframeOptions: !0
733
+ }).extend({
734
+ type: e.literal(n.enum.GRAB),
735
+ event: a.merge(
736
+ e.object({
737
+ type: e.enum(r[n.enum.GRAB])
738
+ })
739
+ ),
740
+ business: t,
741
+ name: e.string().min(1).max(50),
742
+ targetLocation: e.array(t).nullish(),
743
+ group: e.string().nullish(),
744
+ templateId: t.nullish(),
745
+ // Grab specific fields
746
+ conditions: R,
747
+ quotas: C,
748
+ discount: I,
749
+ grabCampaignMeta: e.array(
750
+ e.object({
751
+ locationId: e.string(),
752
+ campaignId: e.string()
753
+ })
754
+ ).optional(),
755
+ // Make timeframeOptions required (remove .nullish() from parent)
756
+ timeframeOptions: x.superRefine((i, d) => {
757
+ (!i.start || !i.end) && d.addIssue({
758
+ code: "custom",
759
+ path: [],
760
+ params: {
761
+ i18n: { key: "timeframe.required" }
762
+ }
763
+ }), i.start && i.end && i.end < i.start && d.addIssue({
764
+ code: "custom",
765
+ path: [],
766
+ params: {
767
+ i18n: { key: "timeframe.end_before_start" }
768
+ }
769
+ });
770
+ })
771
+ }), ke = {
772
+ collectionName: "Campaigns",
773
+ transform: {
774
+ _id: "oid",
775
+ business: "oid",
776
+ collectible: "oid",
777
+ templateId: "oid",
778
+ group: "oid",
779
+ notifyCampaign: "oid",
780
+ linkedCampaign: "oid",
781
+ rewardPool: "oid"
782
+ },
783
+ lookups: {
784
+ business: {
785
+ fromCollection: "Businesses",
786
+ as: "pf_business"
787
+ },
788
+ targetLocation: {
789
+ fromCollection: "Locations",
790
+ as: "pf_targetLocation"
791
+ },
792
+ collectible: {
793
+ fromCollection: "CollectibleConfigs",
794
+ as: "pf_collectible"
795
+ },
796
+ titles: {
797
+ fromCollection: "CollectibleConfigs",
798
+ as: "pf_title"
799
+ },
800
+ templateId: {
801
+ fromCollection: "Templates",
802
+ as: "template"
803
+ },
804
+ notifyCampaign: {
805
+ fromCollection: "Campaigns",
806
+ as: "pf_notifyCampaign"
807
+ },
808
+ rewardPool: {
809
+ fromCollection: "Campaigns",
810
+ as: "game"
811
+ }
812
+ }
813
+ }, Xe = e.object({ _id: t }).and(
814
+ e.discriminatedUnion("type", [
815
+ W,
816
+ K,
817
+ V,
818
+ J,
819
+ q,
820
+ E,
821
+ Y,
822
+ b,
823
+ Z,
824
+ Q,
825
+ $
826
+ ])
827
+ ).describe(g.describe(ke)), et = e.discriminatedUnion("type", [
828
+ K.extend({
829
+ business: t.nullish()
830
+ }),
831
+ V.extend({
832
+ business: t.nullish()
833
+ }),
834
+ J.extend({
835
+ business: t.nullish()
836
+ }),
837
+ q.extend({
838
+ business: t.nullish()
839
+ }),
840
+ E.extend({
841
+ business: t.nullish()
842
+ }),
843
+ Y.extend({
844
+ business: t.nullish()
845
+ }),
846
+ b.extend({
847
+ rewards: e.array(e.lazy(() => D)).min(1, "Requires at least 1 reward")
848
+ }),
849
+ Z.extend({
850
+ business: t.nullish(),
851
+ game: b.extend({
852
+ business: t.nullish(),
853
+ rewards: e.array(e.lazy(() => D)).min(1, "Requires at least 1 reward")
854
+ })
855
+ }),
856
+ Q.extend({
857
+ business: t.nullish(),
858
+ rewards: e.array(e.lazy(() => Be)).min(1, "Requires at least 1 reward")
859
+ }),
860
+ $.extend({
861
+ business: t.nullish()
862
+ })
863
+ ]);
864
+ W.pick({
865
+ business: !0,
866
+ name: !0,
867
+ image: !0,
868
+ // url: true,
869
+ tiers: !0,
870
+ // titles: true,
871
+ cardEnable: !0,
872
+ // design: true,
873
+ targetLocation: !0,
874
+ brand: !0,
875
+ email: !0,
876
+ freeCreditAsDiscount: !0,
877
+ allowedPhoneCountries: !0,
878
+ pf_title: !0,
879
+ pf_targetLocation: !0
880
+ }).extend({
881
+ allowedPhoneCountryDetails: e.array(X).nullish()
882
+ });
883
+ export {
884
+ r as C,
885
+ n as F,
886
+ o as a,
887
+ Xe as b,
888
+ Ye as c,
889
+ Ie as d,
890
+ $e as e,
891
+ et as f,
892
+ Ze as g,
893
+ D as h,
894
+ Ne as i,
895
+ Qe as j,
896
+ Be as k,
897
+ Ge as l,
898
+ W as m,
899
+ de as n
900
+ };