@feedmepos/mf-connect 0.1.0-beta.32 → 0.1.0-beta.34

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 (82) hide show
  1. package/dist/{Analytic-DkxpZxXF.js → Analytic-DYfm1eg5.js} +24 -23
  2. package/dist/{App-cFnyNJX5.js → App-DV85I2xq.js} +6 -6
  3. package/dist/{Broadcast-VrvwW11m.js → Broadcast-CNpwvxRx.js} +8 -8
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DK8-e535.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Bv8Ki3vl.js} +7 -7
  5. package/dist/{Card-BRCliaB_.js → Card-Bk4hfK9U.js} +15 -15
  6. package/dist/{Collections-BBd3RN2S.js → Collections-CrND62Vz.js} +4 -4
  7. package/dist/{Credit-BiRfftdO.js → Credit-ICo98p8n.js} +8 -8
  8. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-BTST01U2.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-LFtf2JM3.js} +27 -26
  9. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-Bx_t1yPZ.js → EffectSheet.vue_vue_type_style_index_0_lang-CdVIbAT3.js} +6 -6
  10. package/dist/{Experience-C7aYCLot.js → Experience-BqMJUymq.js} +8 -8
  11. package/dist/{Game-CCTRHFCs.js → Game-DvjisU7I.js} +8 -8
  12. package/dist/{Index-yMSFQ15g.js → Index-Vbv5hpsB.js} +9 -9
  13. package/dist/{Marketing-BIWD_Zpv.js → Marketing-CU6GUm2L.js} +5 -5
  14. package/dist/{Member-B5VamwfR.js → Member-Dcyb6og-.js} +4 -4
  15. package/dist/{MemberList-CWkmf_WZ.js → MemberList-CBO6SVE-.js} +14 -14
  16. package/dist/{MemberTransactions-9xDEJ3qi.js → MemberTransactions-BuPoUtjA.js} +1 -1
  17. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CKBwCP0l.js → MessageInput.vue_vue_type_script_setup_true_lang-B_q37PEs.js} +2 -2
  18. package/dist/{Mission-Ck54cctg.js → Mission-_Vi8gaKQ.js} +8 -8
  19. package/dist/{Overview-DbuRGVWJ.js → Overview-8ZkvZh2U.js} +370 -346
  20. package/dist/{Point-C1EkvSWh.js → Point-BqmJ8ak3.js} +8 -8
  21. package/dist/{Promotion-B74-3O-2.js → Promotion-CDOtfUpE.js} +9 -9
  22. package/dist/{Record-CFRaQ1sc.js → Record-NUadzYL2.js} +5 -5
  23. package/dist/Reward-CgRFzQHO.js +432 -0
  24. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-C2iKpUoP.js → RewardGroup.vue_vue_type_script_setup_true_lang-Cg5cJLSS.js} +11 -11
  25. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CqqHClbc.js → RuleGroup.vue_vue_type_script_setup_true_lang-Bac_RiwJ.js} +13 -13
  26. package/dist/{Segment-DLHcW3Mm.js → Segment-bHLt_9xi.js} +13 -13
  27. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-BsrLR3Ry.js → SelectItems.vue_vue_type_script_setup_true_lang-DWulr5sA.js} +2 -2
  28. package/dist/{Setting-2fI8Ejy-.js → Setting-AQjJ0LBm.js} +8 -8
  29. package/dist/{Store-Ca9krNoR.js → Store-DzGhYzS9.js} +46 -46
  30. package/dist/{StoreRewards-B8e61zol.js → StoreRewards-BN33UZrN.js} +12 -12
  31. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-Bfx9iTzD.js → StoreTransactions.vue_vue_type_script_setup_true_lang-CF7R6Mbf.js} +17 -17
  32. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BNPKgK6S.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-C3wxmJBS.js} +1 -1
  33. package/dist/{Tier-JLf0R2xU.js → Tier-BaIm0-nO.js} +19 -19
  34. package/dist/{Title-CPBVpQgP.js → Title-CGU2TRSf.js} +19 -19
  35. package/dist/{Transaction-D138QUn6.js → Transaction-DA2CK2a4.js} +2 -2
  36. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-D2LKgS7h.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DSVVsk_u.js} +6 -6
  37. package/dist/{Voucher-haa-zTdM.js → Voucher-Bzh_fJpa.js} +11 -11
  38. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-BfYFnnl-.js → VoucherEditor.vue_vue_type_script_setup_true_lang-Bflyp1V0.js} +10 -10
  39. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DasKXslL.js → ZodTextField.vue_vue_type_script_setup_true_lang-Wh_Pc7qk.js} +1 -1
  40. package/dist/{app-C2HTy1nv.js → app-CBijF7l9.js} +1 -1
  41. package/dist/{app-C4fjdQtp.js → app-Ceasya0M.js} +28 -28
  42. package/dist/app.js +1 -1
  43. package/dist/{business-BTNYs-U5.js → business-BJ-cyfj6.js} +1 -1
  44. package/dist/{campaign-BK4EhzMc.js → campaign-B5Cvxv_n.js} +2 -2
  45. package/dist/campaign.enum-CwvY4pwh.js +20 -0
  46. package/dist/campaign.fn-CWcwUEiZ.js +758 -0
  47. package/dist/{collectible.enum-UDFRfReI.js → collectible.enum-COdcR96r.js} +1 -1
  48. package/dist/{collection.fn-BAqSI3np.js → collection.fn-BTQbGCVW.js} +2 -2
  49. package/dist/dto-BnknKYcg.js +2018 -0
  50. package/dist/{effect-BtvuGYY8.js → effect-DqWwcDoL.js} +1 -1
  51. package/dist/{email-addresses-CIg74qiD.js → email-addresses-DPPlvfPT.js} +1 -1
  52. package/dist/{export-BvHWTvqK.js → export-FXBFFRdK.js} +3 -3
  53. package/dist/{helper-gL8_tR2G.js → helper-C776lUH-.js} +1 -1
  54. package/dist/{index-CdAIjFbl.js → index-BG5txN30.js} +3 -3
  55. package/dist/{index-BuE8NeSd.js → index-BjAdYoh3.js} +7 -7
  56. package/dist/{index-IxRs9X0k.js → index-C1aWGTdZ.js} +1 -1
  57. package/dist/{index-YFt66ce1.js → index-CRlD2sul.js} +4 -4
  58. package/dist/{index-BJ4yupx3.js → index-CZaQ-veW.js} +1 -1
  59. package/dist/{index-BV2Ej5X-.js → index-Cgaj4reE.js} +1 -1
  60. package/dist/{index-B6sy9Hsd.js → index-CpD4ezv2.js} +1 -1
  61. package/dist/{index-BmgMTm44.js → index-CxU9mwRl.js} +1 -1
  62. package/dist/{index-CagyPdIB.js → index-D62SBn2q.js} +3 -3
  63. package/dist/{index-CIdcR8xz.js → index-DeMgVwv8.js} +2 -2
  64. package/dist/{index-856h6bc0.js → index-Dw1WniG7.js} +206 -222
  65. package/dist/{index-CC1h5CUP.js → index-I27oHD1a.js} +1 -1
  66. package/dist/{index.esm2017-StebtCHT.js → index.esm2017-Cf8UXsST.js} +1 -1
  67. package/dist/{loading-DbB9x1Ds.js → loading-DCSdIZqP.js} +4 -4
  68. package/dist/{membership-CyhUGayb.js → membership-KiKcnWxt.js} +4 -4
  69. package/dist/{money-BHQxTQaH.js → money-B_LMR19r.js} +1 -1
  70. package/dist/{number-DzEEwzMx.js → number-Bk18T5Xb.js} +1 -1
  71. package/dist/{objectid-BPMkce_-.js → objectid-CZ5qnZ1J.js} +4 -4
  72. package/dist/{reward-DZVkyjr0.js → reward-ozVC4wTW.js} +1 -1
  73. package/dist/{rule-BSKwXrMD.js → rule-CWT8hI3A.js} +3 -3
  74. package/dist/{rule-builder-SPJUHKuA.js → rule-builder-DTEvWEjJ.js} +1 -1
  75. package/dist/{template-CdZQFxGi.js → template-9N1FRXDZ.js} +4 -4
  76. package/dist/{trigger-BjdUQ1EH.js → trigger-C2-zYC46.js} +4 -4
  77. package/dist/{user--ig8oGw2.js → user-DBxVxr4P.js} +1 -1
  78. package/dist/{vue-i18n-gHmu9x4p.js → vue-i18n-BK0qKZu-.js} +158 -158
  79. package/dist/{xlsx-DClThkyy.js → xlsx-CmKV4f40.js} +1 -1
  80. package/package.json +1 -1
  81. package/dist/Reward-u4hM8gJX.js +0 -411
  82. package/dist/dto-BrNbKS-b.js +0 -2770
@@ -1,29 +1,15 @@
1
- import { z as e, F as n, e as b, m as l, g as se, d as _ } from "./loading-DbB9x1Ds.js";
2
- import { c as f, F as P, e as m, g as ae, f as re, i as p, j as le, k as ce } from "./index-CIdcR8xz.js";
3
- import { i as S, g as x, h as de } from "./index-CdAIjFbl.js";
1
+ import { z as e, F as n, e as E, m as l, g as ie, d as I } from "./loading-DCSdIZqP.js";
2
+ import { F as O } from "./campaign.enum-CwvY4pwh.js";
3
+ import { c as f, F as P, e as m, g as se, f as ae, i as p, j as re, k as le } from "./index-DeMgVwv8.js";
4
+ import { i as x, g as S, h as ce } from "./index-BG5txN30.js";
4
5
  import "vue";
5
- const L = e.enum([
6
- "VOUCHER",
7
- "PROMOTION",
8
- "POINT",
9
- "CREDIT",
10
- "MEMBERSHIP",
11
- "BROADCAST",
12
- "COIN",
13
- "REWARD_POOL",
14
- "GAME",
15
- "MISSION"
16
- ]), T = e.enum(["TIME_BASED_PROMOTION", "GAME_PROMOTION"]), En = {
17
- [T.enum.TIME_BASED_PROMOTION]: "7.7.4",
18
- [T.enum.GAME_PROMOTION]: "7.7.4"
19
- };
20
6
  e.object({
21
7
  location: n,
22
8
  memberId: n,
23
- nettTotal: b,
9
+ nettTotal: E,
24
10
  remark: e.string().optional()
25
11
  });
26
- const me = e.enum(["COUNTER", "POS"]);
12
+ const de = e.enum(["COUNTER", "POS"]);
27
13
  e.object({
28
14
  id: e.string(),
29
15
  userId: e.string(),
@@ -34,9 +20,9 @@ e.object({
34
20
  level: e.number().nullish(),
35
21
  mostPurchasedItems: e.array(e.string()).nullish()
36
22
  });
37
- const ue = {
23
+ const me = {
38
24
  collectionName: "Bills"
39
- }, pe = e.object({
25
+ }, ue = e.object({
40
26
  _id: e.string(),
41
27
  items: e.record(e.string(), e.number()).nullish(),
42
28
  // business: z.string(),
@@ -45,13 +31,13 @@ const ue = {
45
31
  user: e.string().nullish(),
46
32
  memberid: e.string().nullish(),
47
33
  // roundToNearest: z.number().nullish(),
48
- nettTotal: b,
34
+ nettTotal: E,
49
35
  // activeItems: z.array(z.string()),
50
36
  remark: e.string().nullish(),
51
37
  createdAt: e.coerce.date(),
52
38
  completedAt: e.coerce.date(),
53
39
  location: e.string(),
54
- channel: me.optional()
40
+ channel: de.optional()
55
41
  }).transform((t) => ({
56
42
  ...t,
57
43
  createdTime: t.createdAt,
@@ -59,7 +45,7 @@ const ue = {
59
45
  get amount() {
60
46
  return t.nettTotal.amount / 10 ** t.nettTotal.precision;
61
47
  }
62
- })).describe(l.describe(ue)), ge = e.object({
48
+ })).describe(l.describe(me)), pe = e.object({
63
49
  _id: e.string(),
64
50
  rating: e.coerce.number(),
65
51
  user: e.string(),
@@ -98,47 +84,47 @@ e.enum(["WEEK", "MONTH"]);
98
84
  const a = e.object({
99
85
  // type: F_EVENT_TYPE,
100
86
  rule: f.optional()
101
- }), Ee = a.extend({
87
+ }), ge = a.extend({
102
88
  type: e.literal(s.enum.BILL_COMPLETED)
103
89
  }), be = a.extend({
104
90
  type: e.literal(s.enum.FEEDBACK)
105
- }), ye = a.extend({
91
+ }), Ee = a.extend({
106
92
  type: e.literal(s.enum.SIMPLE_CLAIM)
107
93
  });
108
94
  a.extend({
109
95
  type: e.literal(s.enum.ENTER_SEGMENT),
110
96
  segment: e.string()
111
97
  });
112
- const he = a.extend({
98
+ const ye = a.extend({
113
99
  type: e.literal(s.enum.MEMBER_REWARD)
114
- }), Ce = a.extend({
100
+ }), he = a.extend({
115
101
  type: e.literal(s.enum.SCHEDULE)
116
102
  // option: FdoCronRule,
117
- }), fe = a.extend({
103
+ }), Ce = a.extend({
118
104
  type: e.literal(s.enum.MEMBERSHIP_JOINED)
119
- }), Ie = a.extend({
105
+ }), fe = a.extend({
120
106
  type: e.literal(s.enum.TIER_UPGRADED)
121
- }), Re = a.extend({
122
- type: e.literal(s.enum.MAKING_ORDER)
123
107
  }), _e = a.extend({
108
+ type: e.literal(s.enum.MAKING_ORDER)
109
+ }), Re = a.extend({
124
110
  type: e.literal(s.enum.ISSUE_REWARD)
125
- }), Fe = a.extend({
111
+ }), Ie = a.extend({
126
112
  type: e.literal(s.enum.GAME_COMPLETED)
127
113
  });
128
114
  a.extend({
129
115
  type: e.literal(s.enum.REFERRAL_ADDED)
130
116
  });
131
- const De = e.discriminatedUnion("type", [
132
- ye,
117
+ const Fe = e.discriminatedUnion("type", [
133
118
  Ee,
134
- Ce,
119
+ ge,
120
+ he,
135
121
  be,
122
+ Ce,
136
123
  fe,
137
- Ie,
138
- Re,
139
124
  _e,
140
- he,
141
- Fe
125
+ Re,
126
+ ye,
127
+ Ie
142
128
  ]);
143
129
  e.object({
144
130
  _id: n,
@@ -153,18 +139,18 @@ const u = e.object({
153
139
  campaignIds: e.array(n).optional(),
154
140
  slackWebhookUrl: e.string().optional(),
155
141
  emittedAt: e.coerce.date().default(/* @__PURE__ */ new Date())
156
- }), Me = u.extend({
142
+ }), De = u.extend({
157
143
  type: e.literal(s.enum.BILL_COMPLETED),
158
144
  context: e.object({
159
- bill: pe,
145
+ bill: ue,
160
146
  rawBill: e.any()
161
147
  })
162
- }), Oe = u.extend({
148
+ }), Te = u.extend({
163
149
  type: e.literal(s.enum.SCHEDULE),
164
150
  context: e.object({
165
151
  triggeredAt: e.coerce.date()
166
152
  })
167
- }), Te = u.extend({
153
+ }), Ae = u.extend({
168
154
  type: e.literal(s.enum.PAGINATE_SCHEDULE),
169
155
  context: e.object({
170
156
  triggeredAt: e.coerce.date(),
@@ -172,26 +158,26 @@ const u = e.object({
172
158
  skip: e.coerce.number(),
173
159
  limit: e.coerce.number()
174
160
  })
175
- }), Ae = u.extend({
161
+ }), Me = u.extend({
176
162
  type: e.literal(s.enum.FEEDBACK),
177
163
  context: e.object({
178
- feedback: ge
164
+ feedback: pe
179
165
  })
180
- }), Pe = u.extend({
166
+ }), Oe = u.extend({
181
167
  type: e.literal(s.enum.MEMBERSHIP_JOINED),
182
168
  context: e.object({
183
- user: S
169
+ user: x
184
170
  })
185
- }), Se = u.extend({
171
+ }), Pe = u.extend({
186
172
  type: e.literal(s.enum.TIER_UPGRADED),
187
173
  context: e.object({
188
- transaction: x
174
+ transaction: S
189
175
  })
190
176
  }), xe = u.extend({
191
177
  type: e.literal(s.enum.ISSUE_REWARD),
192
178
  context: e.object({
193
- transaction: x,
194
- collection: de
179
+ transaction: S,
180
+ collection: ce
195
181
  })
196
182
  });
197
183
  u.extend({
@@ -199,15 +185,15 @@ u.extend({
199
185
  context: e.object({})
200
186
  });
201
187
  e.discriminatedUnion("type", [
188
+ De,
189
+ Te,
202
190
  Me,
203
191
  Oe,
204
- Ae,
205
192
  Pe,
206
- Se,
207
193
  xe,
208
- Te
194
+ Ae
209
195
  ]);
210
- const Le = e.object({
196
+ const Se = e.object({
211
197
  from: e.coerce.number(),
212
198
  to: e.coerce.number().optional()
213
199
  }).superRefine((t, i) => {
@@ -215,11 +201,11 @@ const Le = e.object({
215
201
  code: "custom",
216
202
  message: "Max experience must be more than min experience"
217
203
  });
218
- }), Ne = e.enum(["MULTIPLIER", "FIXED"]);
204
+ }), Le = e.enum(["MULTIPLIER", "FIXED"]);
219
205
  e.object({
220
- type: Ne
206
+ type: Le
221
207
  });
222
- const je = e.object({
208
+ const Ne = e.object({
223
209
  _id: n.optional(),
224
210
  rule: f,
225
211
  tierExpression: e.string().nullish(),
@@ -228,20 +214,20 @@ const je = e.object({
228
214
  _id: n,
229
215
  name: e.string().min(1),
230
216
  image: e.string().nullish(),
231
- option: Le,
232
- cycleOptions: e.array(e.lazy(() => je)).nullish(),
217
+ option: Se,
218
+ cycleOptions: e.array(e.lazy(() => Ne)).nullish(),
233
219
  member_count: e.number().optional()
234
220
  });
235
221
  F.partial({
236
222
  _id: !0
237
223
  });
238
- const yn = F.partial({
224
+ const En = F.partial({
239
225
  _id: !0
240
- }), Be = e.object({
226
+ }), je = e.object({
241
227
  icon: e.string(),
242
228
  label: e.string(),
243
229
  value: e.string()
244
- }), Ue = e.object({
230
+ }), Be = e.object({
245
231
  gatewayKey: e.enum([
246
232
  "REVENUE_MONSTER",
247
233
  "FEEDME",
@@ -257,100 +243,100 @@ const yn = F.partial({
257
243
  currency: e.string().optional(),
258
244
  returnUrl: e.string().optional(),
259
245
  notifyUrl: e.string().optional(),
260
- channels: e.array(Be).optional(),
246
+ channels: e.array(je).optional(),
261
247
  transactionId: e.string().optional()
262
248
  });
263
249
  e.object({
264
- trx: e.lazy(() => H),
265
- onlineTrx: Ue.optional(),
250
+ trx: e.lazy(() => z),
251
+ onlineTrx: Be.optional(),
266
252
  url: e.string().optional()
267
253
  });
268
- const N = e.enum(["POS", "APP", "ADMIN"]), j = e.enum(["topupCount"]), Ge = e.object({
254
+ const L = e.enum(["POS", "APP", "ADMIN"]), N = e.enum(["topupCount"]), Ue = e.object({
269
255
  line1: e.string(),
270
256
  line2: e.string().optional(),
271
257
  state: e.string(),
272
258
  city: e.string(),
273
259
  postcode: e.string(),
274
260
  country: e.string()
275
- }), B = e.object({
261
+ }), j = e.object({
276
262
  name: e.string(),
277
263
  regNo: e.string(),
278
- address: Ge,
264
+ address: Ue,
279
265
  phoneNo: e.string(),
280
266
  sstRegNo: e.string().optional()
281
- }), U = e.object({
267
+ }), B = e.object({
282
268
  systemCode: e.string(),
283
269
  inclusive: e.boolean()
284
270
  }), we = e.object({
285
271
  id: n,
286
272
  dayToExpire: e.number()
287
- }), ze = e.object({
273
+ }), Ge = e.object({
288
274
  normal: e.coerce.number(),
289
275
  free: e.object({
290
276
  day: e.coerce.number(),
291
277
  amount: e.coerce.number(),
292
278
  remark: e.string().nullish()
293
279
  }).nullish()
294
- }), He = e.object({
280
+ }), ze = e.object({
295
281
  systemCode: e.string(),
296
282
  taxCode: e.string()
297
- }), ke = e.object({
283
+ }), He = e.object({
298
284
  name: e.string(),
299
285
  systemCode: e.string(),
300
286
  taxCode: e.string(),
301
- rate: se,
302
- total: b
287
+ rate: ie,
288
+ total: E
303
289
  });
304
290
  e.object({
305
291
  canPurchase: e.boolean(),
306
292
  reason: e.string()
307
293
  });
308
294
  e.object({
309
- type: j
295
+ type: N
310
296
  });
311
297
  e.object({
312
- type: j,
298
+ type: N,
313
299
  min: e.number().nullish(),
314
300
  max: e.number().nullish()
315
301
  });
316
- const ve = e.object({
302
+ const ke = e.object({
317
303
  options: e.object({
318
304
  maxReceive: e.number().min(0).nullish(),
319
305
  maxPerUser: e.number().min(0).nullish()
320
306
  }),
321
307
  rule: f.nullish()
322
- }), Ve = (t, i) => {
308
+ }), ve = (t, i) => {
323
309
  const r = t;
324
- r.isFeedvibe && _.Dinero.fromFdoDinero(r.price).toUnit() < 0.1 && i.addIssue({
310
+ r.isFeedvibe && I.Dinero.fromFdoDinero(r.price).toUnit() < 0.1 && i.addIssue({
325
311
  code: "custom",
326
312
  path: ["price"],
327
313
  message: "Price must be at least RM10"
328
314
  });
329
- }, G = e.object({
315
+ }, U = e.object({
330
316
  _id: e.string(),
331
317
  isFeedvibe: e.boolean().nullish(),
332
318
  // conditions: z.array(FdoTopupCountCondition),
333
319
  image: e.string().nullish(),
334
320
  rule: f.nullish(),
335
321
  name: e.string(),
336
- price: b,
337
- originalPrice: b.nullish(),
322
+ price: E,
323
+ originalPrice: E.nullish(),
338
324
  // new field to indicate coinPrice
339
325
  coinPrice: e.number().nullish(),
340
326
  titles: e.array(we),
341
- credit: ze,
342
- taxes: e.array(He),
343
- taxTotals: e.array(ke),
344
- priceWithTaxes: b.nullish(),
327
+ credit: Ge,
328
+ taxes: e.array(ze),
329
+ taxTotals: e.array(He),
330
+ priceWithTaxes: E.nullish(),
345
331
  vouchers: e.array(n),
346
- _inclusiveTaxes: e.array(U).nullish(),
332
+ _inclusiveTaxes: e.array(B).nullish(),
347
333
  _taxSystem: e.array(e.string()).nullish(),
348
334
  stripePriceId: e.string().nullish(),
349
335
  subscriptionValidity: e.number().min(1, "Must be at least 1 day").max(365, "Maximum is 365").nullish(),
350
336
  redeemWithCode: e.boolean().nullish(),
351
337
  internal: e.boolean().optional(),
352
338
  hideInPos: e.boolean().optional(),
353
- config: ve.optional(),
339
+ config: ke.optional(),
354
340
  pf_titles: e.array(e.any()).optional(),
355
341
  pf_vouchers: e.array(e.any()).optional(),
356
342
  pf_credit: e.number().optional()
@@ -388,13 +374,13 @@ const ve = e.object({
388
374
  code: "custom",
389
375
  message: "Bundle redeem with point cannot set normal credit.",
390
376
  path: ["credit", "normal"]
391
- }), t.credit.normal > _.Dinero.fromFdoDinero(t.price).toUnit() && i.addIssue({
377
+ }), t.credit.normal > I.Dinero.fromFdoDinero(t.price).toUnit() && i.addIssue({
392
378
  code: "custom",
393
- message: `Normal credit cannot be more than price. Max: ${_.Dinero.fromFdoDinero(
379
+ message: `Normal credit cannot be more than price. Max: ${I.Dinero.fromFdoDinero(
394
380
  t.price
395
381
  ).toUnit()}`,
396
382
  path: ["credit", "normal"]
397
- }), t.titles.length > 0 && t.titles.some((I) => I.dayToExpire < 0) && i.addIssue({
383
+ }), t.titles.length > 0 && t.titles.some((_) => _.dayToExpire < 0) && i.addIssue({
398
384
  code: "custom",
399
385
  path: ["titles"],
400
386
  message: "Title expiry must be at least 0 day (expire same day)"
@@ -403,42 +389,42 @@ const ve = e.object({
403
389
  path: ["config.options.maxPerUser"],
404
390
  message: "Max purchase per user cannot be negative"
405
391
  });
406
- }).superRefine(Ve), w = e.object({
392
+ }).superRefine(ve), w = e.object({
407
393
  name: e.string(),
408
- bundles: e.array(G)
394
+ bundles: e.array(U)
409
395
  });
410
396
  e.object({
411
397
  _id: e.string(),
412
398
  name: e.string(),
413
399
  expiredAt: e.string()
414
400
  });
415
- const We = e.object({
401
+ const Ve = e.object({
416
402
  apiKey: e.string(),
417
403
  webhookSecret: e.string()
418
- }), Ke = e.object({
419
- company: B.nullish(),
420
- inclusiveTaxes: e.array(U).nullish(),
421
- stripe: We.nullable().optional()
422
- }), Ye = {
404
+ }), We = e.object({
405
+ company: j.nullish(),
406
+ inclusiveTaxes: e.array(B).nullish(),
407
+ stripe: Ve.nullable().optional()
408
+ }), Ke = {
423
409
  collectionName: "Stores",
424
410
  transform: {
425
411
  _id: "oid",
426
412
  business: "oid"
427
413
  }
428
414
  };
429
- Ke.extend({
415
+ We.extend({
430
416
  _id: n,
431
417
  business: n,
432
418
  categories: e.array(w)
433
- }).describe(l.describe(Ye));
434
- const Je = e.object({
419
+ }).describe(l.describe(Ke));
420
+ const Ye = e.object({
435
421
  refundedAt: e.coerce.date(),
436
422
  reason: e.string(),
437
423
  transactions: e.array(n)
438
- }), z = e.object({
424
+ }), G = e.object({
439
425
  type: e.enum(["ONLINE", "OFFLINE", "COIN", "STRIPE", "CARD", "FEEDVIBE", "ADMIN"]),
440
426
  extra: e.string().nullish()
441
- }), qe = {
427
+ }), Je = {
442
428
  collectionName: "StoreTransactions",
443
429
  transform: {
444
430
  _id: "oid",
@@ -453,17 +439,17 @@ const Je = e.object({
453
439
  as: "pf_member"
454
440
  }
455
441
  }
456
- }, H = e.object({
442
+ }, z = e.object({
457
443
  _id: n,
458
- source: N,
444
+ source: L,
459
445
  // can be memberStorePurchase
460
446
  ref: e.string(),
461
447
  business: n,
462
- company: B,
448
+ company: j,
463
449
  location: n.optional(),
464
450
  member: n,
465
451
  // createdAt: z.coerce.date(),
466
- bundle: G,
452
+ bundle: U,
467
453
  transactions: e.array(n),
468
454
  // array of transaction id (voucher, credit, title)
469
455
  status: e.enum([
@@ -472,8 +458,8 @@ const Je = e.object({
472
458
  "COMPLETED",
473
459
  "REFUNDED"
474
460
  ]),
475
- refund: Je.nullish(),
476
- paymentType: z.nullish(),
461
+ refund: Ye.nullish(),
462
+ paymentType: G.nullish(),
477
463
  paymentRef: e.string().nullish(),
478
464
  webhookUrl: e.string().optional(),
479
465
  webhookSent: e.boolean().optional(),
@@ -481,16 +467,16 @@ const Je = e.object({
481
467
  pf_member: e.any().optional(),
482
468
  pf_location: e.any().optional(),
483
469
  pf_ref: e.any().optional()
484
- }).describe(l.describe(qe));
470
+ }).describe(l.describe(Je));
485
471
  e.object({
486
472
  bundle: n,
487
473
  member: e.string(),
488
474
  ref: e.string(),
489
- paymentType: z.nullish(),
475
+ paymentType: G.nullish(),
490
476
  withCoin: e.boolean().optional(),
491
477
  card: e.string().optional(),
492
478
  location: n.optional(),
493
- source: N,
479
+ source: L,
494
480
  webhookUrl: e.string().optional()
495
481
  });
496
482
  e.object({
@@ -525,7 +511,7 @@ e.object({
525
511
  member: e.string(),
526
512
  subscriptionId: e.string()
527
513
  });
528
- const Ze = {
514
+ const qe = {
529
515
  collectionName: "Cards",
530
516
  transform: {
531
517
  _id: "oid",
@@ -554,10 +540,10 @@ e.object({
554
540
  design: e.string().nullish(),
555
541
  bundle: e.string().nullish(),
556
542
  subscriptionBundle: e.string().nullish(),
557
- pf_member: e.lazy(() => S).nullish(),
558
- pf_transaction: e.lazy(() => H).nullish()
559
- }).describe(l.describe(Ze));
560
- const Xe = e.object({
543
+ pf_member: e.lazy(() => x).nullish(),
544
+ pf_transaction: e.lazy(() => z).nullish()
545
+ }).describe(l.describe(qe));
546
+ const Ze = e.object({
561
547
  length: e.coerce.number().optional(),
562
548
  charset: e.string(),
563
549
  prefix: e.string().optional(),
@@ -567,14 +553,14 @@ const Xe = e.object({
567
553
  e.object({
568
554
  quantity: e.number(),
569
555
  code: e.string(),
570
- codeConfig: Xe,
556
+ codeConfig: Ze,
571
557
  setCardOnBind: e.boolean().optional(),
572
558
  design: e.string().nullish(),
573
559
  bundle: e.string().optional(),
574
560
  subscriptionBundle: e.string().optional()
575
561
  });
576
- const $e = e.enum(["SMS", "EMAIL"]), y = e.object({
577
- channel: $e,
562
+ const Xe = e.enum(["SMS", "EMAIL"]), y = e.object({
563
+ channel: Xe,
578
564
  variables: e.array(e.string()),
579
565
  title: e.string().nullish(),
580
566
  design: e.any(),
@@ -586,77 +572,77 @@ const $e = e.enum(["SMS", "EMAIL"]), y = e.object({
586
572
  code: e.ZodIssueCode.custom,
587
573
  message: "Content is required"
588
574
  });
589
- const r = /{{(.*?)}}/g, g = [...t.content.matchAll(r)].map((E) => E[1]), I = t.variables, C = g.filter((E) => I.indexOf(E) < 0);
575
+ const r = /{{(.*?)}}/g, g = [...t.content.matchAll(r)].map((b) => b[1]), _ = t.variables, C = g.filter((b) => _.indexOf(b) < 0);
590
576
  C.length && i.addIssue({
591
577
  code: e.ZodIssueCode.custom,
592
578
  message: "Invalid variable(s): " + C.join(", ")
593
579
  });
594
580
  });
595
- function hn(t, i) {
581
+ function yn(t, i) {
596
582
  return t.replace(/{{(.*?)}}/g, (r, g) => {
597
- const C = g.trim().split(".").reduce((E, ie) => (E != null ? E[ie] : null) ?? null, i);
583
+ const C = g.trim().split(".").reduce((b, oe) => (b != null ? b[oe] : null) ?? null, i);
598
584
  return C !== null ? C : r;
599
585
  });
600
586
  }
601
- const D = e.enum(["NO_REWARD", "VOUCHER", "LOYALTY"]), M = e.number().min(0, "Weight need to be at least 0"), k = e.number().int("Must be integer").min(0, "Threshold need to be at least 0"), v = e.object({
587
+ const D = e.enum(["NO_REWARD", "VOUCHER", "LOYALTY"]), T = e.number().min(0, "Weight need to be at least 0"), H = e.number().int("Must be integer").min(0, "Threshold need to be at least 0"), k = e.object({
602
588
  type: e.literal(D.enum.NO_REWARD),
603
589
  collectible: e.null(),
604
- weight: M
605
- }), V = e.object({
590
+ weight: T
591
+ }), v = e.object({
606
592
  type: e.literal(D.enum.VOUCHER),
607
593
  collectible: n,
608
594
  collectibleConfig: e.lazy(() => P._def.right.options[0]),
609
595
  earningOption: e.lazy(() => m)
610
- }), O = e.object({
596
+ }), A = e.object({
611
597
  type: e.literal(D.enum.LOYALTY),
612
598
  collectible: n,
613
599
  earningOption: e.lazy(() => m),
614
- validityOption: e.lazy(() => ae)
615
- }), W = V.extend({
616
- weight: M
617
- }), K = O.extend({
600
+ validityOption: e.lazy(() => se)
601
+ }), V = v.extend({
602
+ weight: T
603
+ }), W = A.extend({
618
604
  weight: e.number().min(0, "Weight need to be at least 0")
619
- }), Cn = O.extend({
620
- validityOption: re,
621
- weight: M
622
- }), Qe = e.discriminatedUnion("type", [
605
+ }), hn = A.extend({
606
+ validityOption: ae,
607
+ weight: T
608
+ }), $e = e.discriminatedUnion("type", [
609
+ V,
623
610
  W,
624
- K,
625
- v
626
- ]), A = e.discriminatedUnion("type", [
627
- W.extend({
611
+ k
612
+ ]), M = e.discriminatedUnion("type", [
613
+ V.extend({
628
614
  collectible: n.nullish(),
629
615
  business: n.nullish()
630
616
  }),
631
- K.extend({
617
+ W.extend({
632
618
  collectible: n.nullish(),
633
619
  business: n.nullish()
634
620
  }),
635
- v
636
- ]), Y = V.extend({
637
- threshold: k
638
- }), J = O.extend({
639
- threshold: k
640
- }), q = e.discriminatedUnion("type", [
641
- Y,
642
- J
643
- ]), en = e.discriminatedUnion("type", [
644
- Y.extend({
621
+ k
622
+ ]), K = v.extend({
623
+ threshold: H
624
+ }), Y = A.extend({
625
+ threshold: H
626
+ }), J = e.discriminatedUnion("type", [
627
+ K,
628
+ Y
629
+ ]), Qe = e.discriminatedUnion("type", [
630
+ K.extend({
645
631
  collectible: n.nullish(),
646
632
  business: n.nullish()
647
633
  }),
648
- J.extend({
634
+ Y.extend({
649
635
  collectible: n.nullish(),
650
636
  collectibleConfig: P.nullish(),
651
637
  business: n.nullish()
652
638
  })
653
- ]), nn = {
639
+ ]), en = {
654
640
  collectionName: "Locations",
655
641
  transform: {
656
642
  _id: "oid",
657
643
  business: "oid"
658
644
  }
659
- }, Z = e.object({
645
+ }, q = e.object({
660
646
  _id: n,
661
647
  business: n,
662
648
  name: e.string(),
@@ -664,7 +650,7 @@ const D = e.enum(["NO_REWARD", "VOUCHER", "LOYALTY"]), M = e.number().min(0, "We
664
650
  otp: e.string().nullish(),
665
651
  otpExpiredAt: e.coerce.date().nullish(),
666
652
  apiToken: e.string().nullish()
667
- }).describe(l.describe(nn));
653
+ }).describe(l.describe(en));
668
654
  e.object({
669
655
  _id: n,
670
656
  name: e.string(),
@@ -678,10 +664,10 @@ e.object({
678
664
  location: "oid"
679
665
  }
680
666
  }));
681
- const tn = e.enum(["PROGRESSIVE", "STAMP"]), on = e.object({
682
- type: tn,
667
+ const nn = e.enum(["PROGRESSIVE", "STAMP"]), tn = e.object({
668
+ type: nn,
683
669
  end: e.number().int().min(0, "Threshold need to be at least 1"),
684
- rewards: e.array(e.lazy(() => q)).nullish()
670
+ rewards: e.array(e.lazy(() => J)).nullish()
685
671
  }).superRefine((t, i) => {
686
672
  t.type == "STAMP" && t.end > 40 && (i.addIssue({
687
673
  code: "custom",
@@ -692,7 +678,7 @@ const tn = e.enum(["PROGRESSIVE", "STAMP"]), on = e.object({
692
678
  path: ["end"],
693
679
  message: "Stamp mission can have at most 40 threshold"
694
680
  }));
695
- }), sn = {
681
+ }), on = {
696
682
  collectionName: "Groups",
697
683
  transform: {
698
684
  _id: "oid",
@@ -710,16 +696,16 @@ const tn = e.enum(["PROGRESSIVE", "STAMP"]), on = e.object({
710
696
  foreignField: "group"
711
697
  }
712
698
  }
713
- }, fn = e.object({
699
+ }, Cn = e.object({
714
700
  _id: n,
715
701
  name: e.string().min(1).max(300),
716
702
  business: n,
717
703
  pf_campaigns: e.array(e.any()).optional()
718
- }).describe(l.describe(sn)), an = e.object({
704
+ }).describe(l.describe(on)), sn = e.object({
719
705
  from: e.string().email().nullish(),
720
706
  name: e.string().min(1).max(50).nullish()
721
- }), rn = e.object({
722
- type: e.literal(L.enum.MEMBERSHIP),
707
+ }), an = e.object({
708
+ type: e.literal(O.enum.MEMBERSHIP),
723
709
  business: n,
724
710
  name: e.string().min(1).max(50),
725
711
  image: e.string().nullish(),
@@ -739,14 +725,14 @@ const tn = e.enum(["PROGRESSIVE", "STAMP"]), on = e.object({
739
725
  ).optional(),
740
726
  targetLocation: e.array(n).nullish(),
741
727
  brand: e.string().nullish(),
742
- email: an.nullish(),
728
+ email: sn.nullish(),
743
729
  freeCreditAsDiscount: e.boolean().optional(),
744
730
  pf_title: e.array(e.lazy(() => p)).optional(),
745
- pf_targetLocation: e.array(e.lazy(() => Z)).optional(),
731
+ pf_targetLocation: e.array(e.lazy(() => q)).optional(),
746
732
  // new structure
747
733
  group: e.string().nullish(),
748
734
  templateId: n.nullish()
749
- }), o = L.exclude(["MEMBERSHIP"]), c = e.object({
735
+ }), o = O.exclude(["MEMBERSHIP"]), c = e.object({
750
736
  _id: n.nullish(),
751
737
  type: o,
752
738
  // common information
@@ -754,7 +740,7 @@ const tn = e.enum(["PROGRESSIVE", "STAMP"]), on = e.object({
754
740
  name: e.string().min(1).max(50),
755
741
  image: e.string().nullish(),
756
742
  description: e.string().max(500).nullish(),
757
- timeframeOptions: le.superRefine((t, i) => {
743
+ timeframeOptions: re.superRefine((t, i) => {
758
744
  t.start && t.end && t.end < t.start && i.addIssue({
759
745
  code: "custom",
760
746
  path: [],
@@ -764,13 +750,13 @@ const tn = e.enum(["PROGRESSIVE", "STAMP"]), on = e.object({
764
750
  });
765
751
  }).nullish(),
766
752
  targetLocation: e.array(n).nullish(),
767
- event: De,
768
- config: ce.nullish(),
753
+ event: Fe,
754
+ config: le.nullish(),
769
755
  currentReceive: e.coerce.number().optional(),
770
756
  // new group structure
771
757
  group: n.nullish(),
772
758
  templateId: n.nullish(),
773
- pf_targetLocation: e.array(e.lazy(() => Z)).optional()
759
+ pf_targetLocation: e.array(e.lazy(() => q)).optional()
774
760
  }), d = {
775
761
  [o.enum.VOUCHER]: [
776
762
  "BILL_COMPLETED",
@@ -821,7 +807,7 @@ const tn = e.enum(["PROGRESSIVE", "STAMP"]), on = e.object({
821
807
  "FEEDBACK",
822
808
  "SCHEDULE"
823
809
  ]
824
- }, X = c.extend({
810
+ }, Z = c.extend({
825
811
  type: e.literal(o.enum.VOUCHER),
826
812
  // event
827
813
  code: e.string().min(0).max(15).optional(),
@@ -841,9 +827,9 @@ const tn = e.enum(["PROGRESSIVE", "STAMP"]), on = e.object({
841
827
  notifyCampaign: n.nullish(),
842
828
  pf_collectible: e.lazy(() => p).optional(),
843
829
  pf_notifyCampaign: e.lazy(() => h).optional()
844
- }), ln = e.object({
830
+ }), rn = e.object({
845
831
  gameType: e.string()
846
- }), $ = c.extend({
832
+ }), X = c.extend({
847
833
  type: e.literal(o.enum.PROMOTION),
848
834
  // event
849
835
  event: a.merge(
@@ -860,8 +846,8 @@ const tn = e.enum(["PROGRESSIVE", "STAMP"]), on = e.object({
860
846
  }
861
847
  });
862
848
  }),
863
- gameConfig: ln.nullish()
864
- }), Q = c.extend({
849
+ gameConfig: rn.nullish()
850
+ }), $ = c.extend({
865
851
  type: e.literal(o.enum.POINT),
866
852
  // event
867
853
  event: a.merge(
@@ -876,7 +862,7 @@ const tn = e.enum(["PROGRESSIVE", "STAMP"]), on = e.object({
876
862
  notifyCampaign: n.nullish(),
877
863
  pf_collectible: e.lazy(() => p).optional(),
878
864
  pf_notifyCampaign: e.lazy(() => h).optional()
879
- }), ee = c.extend({
865
+ }), Q = c.extend({
880
866
  type: e.literal(o.enum.CREDIT),
881
867
  // event
882
868
  event: a.merge(
@@ -901,7 +887,7 @@ const tn = e.enum(["PROGRESSIVE", "STAMP"]), on = e.object({
901
887
  ),
902
888
  message: y,
903
889
  linkedCampaign: n.nullish()
904
- }), ne = c.extend({
890
+ }), ee = c.extend({
905
891
  type: e.literal(o.enum.COIN),
906
892
  // event
907
893
  event: a.merge(
@@ -924,8 +910,8 @@ const tn = e.enum(["PROGRESSIVE", "STAMP"]), on = e.object({
924
910
  type: e.enum(d[o.enum.REWARD_POOL])
925
911
  })
926
912
  ),
927
- rewards: e.array(e.lazy(() => Qe)).min(1, "Requires at least 1 reward")
928
- }), te = c.extend({
913
+ rewards: e.array(e.lazy(() => $e)).min(1, "Requires at least 1 reward")
914
+ }), ne = c.extend({
929
915
  type: e.literal(o.enum.GAME),
930
916
  // event
931
917
  event: a.merge(
@@ -938,7 +924,7 @@ const tn = e.enum(["PROGRESSIVE", "STAMP"]), on = e.object({
938
924
  game: e.lazy(() => R).optional(),
939
925
  pf_collectible: e.lazy(() => p).optional(),
940
926
  rewardPool: n.optional()
941
- }), oe = c.extend({
927
+ }), te = c.extend({
942
928
  type: e.literal(o.enum.MISSION),
943
929
  event: a.merge(
944
930
  e.object({
@@ -948,9 +934,9 @@ const tn = e.enum(["PROGRESSIVE", "STAMP"]), on = e.object({
948
934
  earningOption: m,
949
935
  collectible: n,
950
936
  pf_collectible: e.lazy(() => p).optional(),
951
- mission: e.lazy(() => on),
952
- rewards: e.array(e.lazy(() => q)).min(1, "Requires at least 1 reward")
953
- }), cn = {
937
+ mission: e.lazy(() => tn),
938
+ rewards: e.array(e.lazy(() => J)).min(1, "Requires at least 1 reward")
939
+ }), ln = {
954
940
  collectionName: "Campaigns",
955
941
  transform: {
956
942
  _id: "oid",
@@ -992,20 +978,23 @@ const tn = e.enum(["PROGRESSIVE", "STAMP"]), on = e.object({
992
978
  as: "game"
993
979
  }
994
980
  }
995
- }, In = e.object({ _id: n }).and(
981
+ }, fn = e.object({ _id: n }).and(
996
982
  e.discriminatedUnion("type", [
997
- rn,
983
+ an,
984
+ Z,
998
985
  X,
999
986
  $,
1000
987
  Q,
1001
- ee,
1002
988
  h,
1003
- ne,
989
+ ee,
1004
990
  R,
1005
- te,
1006
- oe
991
+ ne,
992
+ te
1007
993
  ])
1008
- ).describe(l.describe(cn)), Rn = e.discriminatedUnion("type", [
994
+ ).describe(l.describe(ln)), _n = e.discriminatedUnion("type", [
995
+ Z.extend({
996
+ business: n.nullish()
997
+ }),
1009
998
  X.extend({
1010
999
  business: n.nullish()
1011
1000
  }),
@@ -1015,52 +1004,47 @@ const tn = e.enum(["PROGRESSIVE", "STAMP"]), on = e.object({
1015
1004
  Q.extend({
1016
1005
  business: n.nullish()
1017
1006
  }),
1018
- ee.extend({
1019
- business: n.nullish()
1020
- }),
1021
1007
  h.extend({
1022
1008
  business: n.nullish()
1023
1009
  }),
1024
- ne.extend({
1010
+ ee.extend({
1025
1011
  business: n.nullish()
1026
1012
  }),
1027
1013
  R.extend({
1028
- rewards: e.array(e.lazy(() => A)).min(1, "Requires at least 1 reward")
1014
+ rewards: e.array(e.lazy(() => M)).min(1, "Requires at least 1 reward")
1029
1015
  }),
1030
- te.extend({
1016
+ ne.extend({
1031
1017
  business: n.nullish(),
1032
1018
  game: R.extend({
1033
1019
  business: n.nullish(),
1034
- rewards: e.array(e.lazy(() => A)).min(1, "Requires at least 1 reward")
1020
+ rewards: e.array(e.lazy(() => M)).min(1, "Requires at least 1 reward")
1035
1021
  })
1036
1022
  }),
1037
- oe.extend({
1023
+ te.extend({
1038
1024
  business: n.nullish(),
1039
- rewards: e.array(e.lazy(() => en)).min(1, "Requires at least 1 reward")
1025
+ rewards: e.array(e.lazy(() => Qe)).min(1, "Requires at least 1 reward")
1040
1026
  })
1041
1027
  ]);
1042
1028
  export {
1043
1029
  d as C,
1044
- yn as F,
1030
+ En as F,
1045
1031
  o as a,
1046
- Cn as b,
1047
- A as c,
1048
- tn as d,
1049
- en as e,
1050
- on as f,
1051
- En as g,
1052
- L as h,
1032
+ hn as b,
1033
+ M as c,
1034
+ nn as d,
1035
+ Qe as e,
1036
+ tn as f,
1037
+ Cn as g,
1038
+ _n as h,
1053
1039
  fn as i,
1054
- Rn as j,
1055
- In as k,
1056
- bn as l,
1057
- s as m,
1058
- Ke as n,
1059
- B as o,
1060
- Ge as p,
1061
- G as q,
1062
- N as r,
1063
- De as s,
1064
- rn as t,
1065
- hn as u
1040
+ bn as j,
1041
+ s as k,
1042
+ We as l,
1043
+ j as m,
1044
+ Ue as n,
1045
+ U as o,
1046
+ L as p,
1047
+ Fe as q,
1048
+ an as r,
1049
+ yn as s
1066
1050
  };