@feedmepos/mf-connect 0.1.0-beta.33 → 0.1.0-beta.35

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 (83) hide show
  1. package/dist/{Analytic-COFvmYc_.js → Analytic-BMdB7x5F.js} +24 -23
  2. package/dist/{App-Di7kbEH7.js → App-AakWqQHx.js} +6 -6
  3. package/dist/{Broadcast-CAku3lNW.js → Broadcast-Bf5GOV7p.js} +8 -8
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B1Ozu6-2.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BBTBapxi.js} +7 -7
  5. package/dist/{Card-CcRmp6aK.js → Card-DmxekNts.js} +15 -15
  6. package/dist/{Collections-BRLR37TF.js → Collections-CL7hOycU.js} +4 -4
  7. package/dist/{Credit-BEViCbtH.js → Credit-0eGxacBN.js} +8 -8
  8. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-DDSSHrcX.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BLWeJ73S.js} +27 -26
  9. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-CGBjH5AK.js → EffectSheet.vue_vue_type_style_index_0_lang-q7qJ9Ec5.js} +6 -6
  10. package/dist/{Experience-BL71InUh.js → Experience-NjmDx3_p.js} +8 -8
  11. package/dist/{Game-vmhBTg3f.js → Game-q19qmf8t.js} +8 -8
  12. package/dist/{Index-DGkT3yms.js → Index-BmzHphDm.js} +9 -9
  13. package/dist/{Marketing-BCqFnOrR.js → Marketing-BgL2CqkH.js} +5 -5
  14. package/dist/{Member-C7uOPBUa.js → Member-DXO7yer0.js} +4 -4
  15. package/dist/{MemberList-CaY2SRSx.js → MemberList-WGMopz-y.js} +14 -14
  16. package/dist/{MemberTransactions-v2sui0Sy.js → MemberTransactions-DmQgrLdy.js} +1 -1
  17. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-za7Jz9uG.js → MessageInput.vue_vue_type_script_setup_true_lang-DFiCQcTe.js} +2 -2
  18. package/dist/{Mission-DZG8d3vM.js → Mission-DOdkoytR.js} +8 -8
  19. package/dist/Overview-Bizp0BGu.js +1064 -0
  20. package/dist/{Point-DW_SHWMs.js → Point-Bvyg1zuh.js} +8 -8
  21. package/dist/{Promotion-C8tygVa7.js → Promotion-B75LcnHm.js} +9 -9
  22. package/dist/{Record-D7XgEVn_.js → Record-BjAbPbiI.js} +5 -5
  23. package/dist/Reward-l1gt8pwu.js +432 -0
  24. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-Dyj14jcj.js → RewardGroup.vue_vue_type_script_setup_true_lang-C76emk8A.js} +11 -11
  25. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-Cmv-8YZd.js → RuleGroup.vue_vue_type_script_setup_true_lang-B4ak1Gem.js} +13 -13
  26. package/dist/{Segment-DAYnubHq.js → Segment-DJSkWWH8.js} +13 -13
  27. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-BviSuL4I.js → SelectItems.vue_vue_type_script_setup_true_lang-ByqgSxPo.js} +2 -2
  28. package/dist/{Setting-Dd-PlldV.js → Setting-DTV24iE5.js} +8 -8
  29. package/dist/{Store-DmBeTkdi.js → Store-C1obQwdr.js} +46 -46
  30. package/dist/{StoreRewards-VrmRII1r.js → StoreRewards-apMVv0Ca.js} +12 -12
  31. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-Bx1AwHhj.js → StoreTransactions.vue_vue_type_script_setup_true_lang-DBzA_4gb.js} +17 -17
  32. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DanZYVUH.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-PxZ5Au5X.js} +1 -1
  33. package/dist/{Tier-h5t-OofQ.js → Tier-DSvMUZJG.js} +19 -19
  34. package/dist/{Title-BIGAZzv4.js → Title-CWoqOkd2.js} +19 -19
  35. package/dist/{Transaction-WfW0gCVl.js → Transaction-CaCsXoB5.js} +2 -2
  36. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-KB8LAOv_.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DaT8PyWl.js} +6 -6
  37. package/dist/{Voucher-CzA0AnCo.js → Voucher-BBtDXr9q.js} +11 -11
  38. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-BbYPy9pR.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BCSO2-oB.js} +10 -10
  39. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BPHAIlP5.js → ZodTextField.vue_vue_type_script_setup_true_lang-BTm3pDid.js} +1 -1
  40. package/dist/{app-C2GiWW62.js → app-B8JBXu5M.js} +212 -186
  41. package/dist/{app-BhP-DVoF.js → app-D8kcy7_R.js} +1 -1
  42. package/dist/app.js +1 -1
  43. package/dist/{business-BjQMXRkL.js → business-DN4-BTel.js} +1 -1
  44. package/dist/{campaign-tqh1zOQn.js → campaign-Cf6jJz3e.js} +2 -2
  45. package/dist/campaign.enum-DVOwgVTa.js +20 -0
  46. package/dist/campaign.fn-D8apF_YE.js +758 -0
  47. package/dist/{collectible.enum-904x3SQw.js → collectible.enum-DPsEC03C.js} +1 -1
  48. package/dist/{collection.fn-B1wW3tQk.js → collection.fn-CzeGWVx2.js} +2 -2
  49. package/dist/dto-D94IgAXy.js +2018 -0
  50. package/dist/{effect-DlIXzIWd.js → effect-CDg44P_g.js} +1 -1
  51. package/dist/{email-addresses-bquAp7UR.js → email-addresses-CDozpvzz.js} +1 -1
  52. package/dist/{export-9ZU9HjO9.js → export-DQLXrn4F.js} +3 -3
  53. package/dist/{helper-D0S39he1.js → helper-DJMf--V-.js} +1 -1
  54. package/dist/{index-DN5WVCu6.js → index-B0n_PU3b.js} +1 -1
  55. package/dist/{index-BoJwjzpx.js → index-BUZR5Bkw.js} +1 -1
  56. package/dist/{index-kkystjJw.js → index-BbPavTej.js} +3 -3
  57. package/dist/{index-D4QKa9x3.js → index-BgXfVzZF.js} +7 -7
  58. package/dist/{index-l_74COL_.js → index-BmblCnlD.js} +1 -1
  59. package/dist/{index-DF3fzy-k.js → index-BnbkejyF.js} +1 -1
  60. package/dist/{index-Dszb1Xy-.js → index-CVV5I3bh.js} +1 -1
  61. package/dist/{index-B6SrZyMF.js → index-DFbITElv.js} +214 -228
  62. package/dist/{index-DTsmbmOR.js → index-Df84_Ww3.js} +3 -3
  63. package/dist/{index-DNa1m2cM.js → index-DrvefOT4.js} +3 -3
  64. package/dist/{index-DnGzf-f8.js → index-DvE5xL4s.js} +2 -2
  65. package/dist/{index-BwDwKkyV.js → index-V6yWwXYr.js} +1 -1
  66. package/dist/{index.esm2017-CNuwLU2a.js → index.esm2017-C90-ettH.js} +1 -1
  67. package/dist/{loading-CiI8Y9Fj.js → loading-B56wz_ef.js} +4 -4
  68. package/dist/{membership-CPNrhOk0.js → membership-CF1jgR11.js} +4 -4
  69. package/dist/{money-DnAxVjb7.js → money-BEEp2WdU.js} +1 -1
  70. package/dist/{number-B5VKL1Yu.js → number-u7HbwLPt.js} +1 -1
  71. package/dist/{objectid-C-IOC4JL.js → objectid-S3_nH1F7.js} +10 -10
  72. package/dist/{reward-D4RyiYb6.js → reward-BUY77BiP.js} +1 -1
  73. package/dist/{rule-DVMHVRWb.js → rule-BdAPBN8_.js} +3 -3
  74. package/dist/{rule-builder-CFUNraRE.js → rule-builder-z51VUtHk.js} +1 -1
  75. package/dist/{template-OBoSoTcO.js → template-B_J4Q9D6.js} +4 -4
  76. package/dist/{trigger-R6mF8LNa.js → trigger-CGrv0M0q.js} +4 -4
  77. package/dist/{user-BGP1BTAw.js → user-D02jOhtd.js} +1 -1
  78. package/dist/{vue-i18n-_ooGZZRG.js → vue-i18n-rCSjqg2P.js} +333 -333
  79. package/dist/{xlsx-ByJGlrKD.js → xlsx-CL102mzm.js} +1 -1
  80. package/package.json +1 -1
  81. package/dist/Overview-egVspSvq.js +0 -1023
  82. package/dist/Reward-DqP89Pqb.js +0 -413
  83. package/dist/dto-C9SOa-xs.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-CiI8Y9Fj.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-DnGzf-f8.js";
3
- import { i as S, g as x, h as de } from "./index-DTsmbmOR.js";
1
+ import { z as e, F as n, e as E, m as l, g as ie, d as I } from "./loading-B56wz_ef.js";
2
+ import { F as P } from "./campaign.enum-DVOwgVTa.js";
3
+ import { c as f, F as x, e as m, g as se, f as ae, i as p, j as re, k as le } from "./index-DvE5xL4s.js";
4
+ import { i as F, g as L, h as ce } from "./index-Df84_Ww3.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,13 +139,13 @@ 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
+ }), Ae = u.extend({
163
149
  type: e.literal(s.enum.SCHEDULE),
164
150
  context: e.object({
165
151
  triggeredAt: e.coerce.date()
@@ -172,38 +158,40 @@ 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: F
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: L
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: L,
180
+ collection: ce
195
181
  })
196
182
  });
197
183
  u.extend({
198
- type: e.literal(s.enum.ISSUE_REWARD),
199
- context: e.object({})
184
+ type: e.literal(s.enum.REFERRAL_ADDED),
185
+ context: e.object({
186
+ user: F
187
+ })
200
188
  });
201
189
  e.discriminatedUnion("type", [
190
+ De,
191
+ Ae,
202
192
  Me,
203
193
  Oe,
204
- Ae,
205
194
  Pe,
206
- Se,
207
195
  xe,
208
196
  Te
209
197
  ]);
@@ -215,33 +203,33 @@ const Le = e.object({
215
203
  code: "custom",
216
204
  message: "Max experience must be more than min experience"
217
205
  });
218
- }), Ne = e.enum(["MULTIPLIER", "FIXED"]);
206
+ }), Se = e.enum(["MULTIPLIER", "FIXED"]);
219
207
  e.object({
220
- type: Ne
208
+ type: Se
221
209
  });
222
- const je = e.object({
210
+ const Ne = e.object({
223
211
  _id: n.optional(),
224
212
  rule: f,
225
213
  tierExpression: e.string().nullish(),
226
214
  expExpression: e.string().nullish()
227
- }), F = e.object({
215
+ }), D = e.object({
228
216
  _id: n,
229
217
  name: e.string().min(1),
230
218
  image: e.string().nullish(),
231
219
  option: Le,
232
- cycleOptions: e.array(e.lazy(() => je)).nullish(),
220
+ cycleOptions: e.array(e.lazy(() => Ne)).nullish(),
233
221
  member_count: e.number().optional()
234
222
  });
235
- F.partial({
223
+ D.partial({
236
224
  _id: !0
237
225
  });
238
- const yn = F.partial({
226
+ const En = D.partial({
239
227
  _id: !0
240
- }), Be = e.object({
228
+ }), je = e.object({
241
229
  icon: e.string(),
242
230
  label: e.string(),
243
231
  value: e.string()
244
- }), Ue = e.object({
232
+ }), Be = e.object({
245
233
  gatewayKey: e.enum([
246
234
  "REVENUE_MONSTER",
247
235
  "FEEDME",
@@ -257,100 +245,100 @@ const yn = F.partial({
257
245
  currency: e.string().optional(),
258
246
  returnUrl: e.string().optional(),
259
247
  notifyUrl: e.string().optional(),
260
- channels: e.array(Be).optional(),
248
+ channels: e.array(je).optional(),
261
249
  transactionId: e.string().optional()
262
250
  });
263
251
  e.object({
264
- trx: e.lazy(() => H),
265
- onlineTrx: Ue.optional(),
252
+ trx: e.lazy(() => z),
253
+ onlineTrx: Be.optional(),
266
254
  url: e.string().optional()
267
255
  });
268
- const N = e.enum(["POS", "APP", "ADMIN"]), j = e.enum(["topupCount"]), Ge = e.object({
256
+ const S = e.enum(["POS", "APP", "ADMIN"]), N = e.enum(["topupCount"]), Ue = e.object({
269
257
  line1: e.string(),
270
258
  line2: e.string().optional(),
271
259
  state: e.string(),
272
260
  city: e.string(),
273
261
  postcode: e.string(),
274
262
  country: e.string()
275
- }), B = e.object({
263
+ }), j = e.object({
276
264
  name: e.string(),
277
265
  regNo: e.string(),
278
- address: Ge,
266
+ address: Ue,
279
267
  phoneNo: e.string(),
280
268
  sstRegNo: e.string().optional()
281
- }), U = e.object({
269
+ }), B = e.object({
282
270
  systemCode: e.string(),
283
271
  inclusive: e.boolean()
284
272
  }), we = e.object({
285
273
  id: n,
286
274
  dayToExpire: e.number()
287
- }), ze = e.object({
275
+ }), Ge = e.object({
288
276
  normal: e.coerce.number(),
289
277
  free: e.object({
290
278
  day: e.coerce.number(),
291
279
  amount: e.coerce.number(),
292
280
  remark: e.string().nullish()
293
281
  }).nullish()
294
- }), He = e.object({
282
+ }), ze = e.object({
295
283
  systemCode: e.string(),
296
284
  taxCode: e.string()
297
- }), ke = e.object({
285
+ }), He = e.object({
298
286
  name: e.string(),
299
287
  systemCode: e.string(),
300
288
  taxCode: e.string(),
301
- rate: se,
302
- total: b
289
+ rate: ie,
290
+ total: E
303
291
  });
304
292
  e.object({
305
293
  canPurchase: e.boolean(),
306
294
  reason: e.string()
307
295
  });
308
296
  e.object({
309
- type: j
297
+ type: N
310
298
  });
311
299
  e.object({
312
- type: j,
300
+ type: N,
313
301
  min: e.number().nullish(),
314
302
  max: e.number().nullish()
315
303
  });
316
- const ve = e.object({
304
+ const ke = e.object({
317
305
  options: e.object({
318
306
  maxReceive: e.number().min(0).nullish(),
319
307
  maxPerUser: e.number().min(0).nullish()
320
308
  }),
321
309
  rule: f.nullish()
322
- }), Ve = (t, i) => {
310
+ }), ve = (t, i) => {
323
311
  const r = t;
324
- r.isFeedvibe && _.Dinero.fromFdoDinero(r.price).toUnit() < 0.1 && i.addIssue({
312
+ r.isFeedvibe && I.Dinero.fromFdoDinero(r.price).toUnit() < 0.1 && i.addIssue({
325
313
  code: "custom",
326
314
  path: ["price"],
327
315
  message: "Price must be at least RM10"
328
316
  });
329
- }, G = e.object({
317
+ }, U = e.object({
330
318
  _id: e.string(),
331
319
  isFeedvibe: e.boolean().nullish(),
332
320
  // conditions: z.array(FdoTopupCountCondition),
333
321
  image: e.string().nullish(),
334
322
  rule: f.nullish(),
335
323
  name: e.string(),
336
- price: b,
337
- originalPrice: b.nullish(),
324
+ price: E,
325
+ originalPrice: E.nullish(),
338
326
  // new field to indicate coinPrice
339
327
  coinPrice: e.number().nullish(),
340
328
  titles: e.array(we),
341
- credit: ze,
342
- taxes: e.array(He),
343
- taxTotals: e.array(ke),
344
- priceWithTaxes: b.nullish(),
329
+ credit: Ge,
330
+ taxes: e.array(ze),
331
+ taxTotals: e.array(He),
332
+ priceWithTaxes: E.nullish(),
345
333
  vouchers: e.array(n),
346
- _inclusiveTaxes: e.array(U).nullish(),
334
+ _inclusiveTaxes: e.array(B).nullish(),
347
335
  _taxSystem: e.array(e.string()).nullish(),
348
336
  stripePriceId: e.string().nullish(),
349
337
  subscriptionValidity: e.number().min(1, "Must be at least 1 day").max(365, "Maximum is 365").nullish(),
350
338
  redeemWithCode: e.boolean().nullish(),
351
339
  internal: e.boolean().optional(),
352
340
  hideInPos: e.boolean().optional(),
353
- config: ve.optional(),
341
+ config: ke.optional(),
354
342
  pf_titles: e.array(e.any()).optional(),
355
343
  pf_vouchers: e.array(e.any()).optional(),
356
344
  pf_credit: e.number().optional()
@@ -388,13 +376,13 @@ const ve = e.object({
388
376
  code: "custom",
389
377
  message: "Bundle redeem with point cannot set normal credit.",
390
378
  path: ["credit", "normal"]
391
- }), t.credit.normal > _.Dinero.fromFdoDinero(t.price).toUnit() && i.addIssue({
379
+ }), t.credit.normal > I.Dinero.fromFdoDinero(t.price).toUnit() && i.addIssue({
392
380
  code: "custom",
393
- message: `Normal credit cannot be more than price. Max: ${_.Dinero.fromFdoDinero(
381
+ message: `Normal credit cannot be more than price. Max: ${I.Dinero.fromFdoDinero(
394
382
  t.price
395
383
  ).toUnit()}`,
396
384
  path: ["credit", "normal"]
397
- }), t.titles.length > 0 && t.titles.some((I) => I.dayToExpire < 0) && i.addIssue({
385
+ }), t.titles.length > 0 && t.titles.some((_) => _.dayToExpire < 0) && i.addIssue({
398
386
  code: "custom",
399
387
  path: ["titles"],
400
388
  message: "Title expiry must be at least 0 day (expire same day)"
@@ -403,42 +391,42 @@ const ve = e.object({
403
391
  path: ["config.options.maxPerUser"],
404
392
  message: "Max purchase per user cannot be negative"
405
393
  });
406
- }).superRefine(Ve), w = e.object({
394
+ }).superRefine(ve), w = e.object({
407
395
  name: e.string(),
408
- bundles: e.array(G)
396
+ bundles: e.array(U)
409
397
  });
410
398
  e.object({
411
399
  _id: e.string(),
412
400
  name: e.string(),
413
401
  expiredAt: e.string()
414
402
  });
415
- const We = e.object({
403
+ const Ve = e.object({
416
404
  apiKey: e.string(),
417
405
  webhookSecret: e.string()
418
- }), Ke = e.object({
419
- company: B.nullish(),
420
- inclusiveTaxes: e.array(U).nullish(),
421
- stripe: We.nullable().optional()
422
- }), Ye = {
406
+ }), We = e.object({
407
+ company: j.nullish(),
408
+ inclusiveTaxes: e.array(B).nullish(),
409
+ stripe: Ve.nullable().optional()
410
+ }), Ke = {
423
411
  collectionName: "Stores",
424
412
  transform: {
425
413
  _id: "oid",
426
414
  business: "oid"
427
415
  }
428
416
  };
429
- Ke.extend({
417
+ We.extend({
430
418
  _id: n,
431
419
  business: n,
432
420
  categories: e.array(w)
433
- }).describe(l.describe(Ye));
434
- const Je = e.object({
421
+ }).describe(l.describe(Ke));
422
+ const Ye = e.object({
435
423
  refundedAt: e.coerce.date(),
436
424
  reason: e.string(),
437
425
  transactions: e.array(n)
438
- }), z = e.object({
426
+ }), G = e.object({
439
427
  type: e.enum(["ONLINE", "OFFLINE", "COIN", "STRIPE", "CARD", "FEEDVIBE", "ADMIN"]),
440
428
  extra: e.string().nullish()
441
- }), qe = {
429
+ }), Je = {
442
430
  collectionName: "StoreTransactions",
443
431
  transform: {
444
432
  _id: "oid",
@@ -453,17 +441,17 @@ const Je = e.object({
453
441
  as: "pf_member"
454
442
  }
455
443
  }
456
- }, H = e.object({
444
+ }, z = e.object({
457
445
  _id: n,
458
- source: N,
446
+ source: S,
459
447
  // can be memberStorePurchase
460
448
  ref: e.string(),
461
449
  business: n,
462
- company: B,
450
+ company: j,
463
451
  location: n.optional(),
464
452
  member: n,
465
453
  // createdAt: z.coerce.date(),
466
- bundle: G,
454
+ bundle: U,
467
455
  transactions: e.array(n),
468
456
  // array of transaction id (voucher, credit, title)
469
457
  status: e.enum([
@@ -472,8 +460,8 @@ const Je = e.object({
472
460
  "COMPLETED",
473
461
  "REFUNDED"
474
462
  ]),
475
- refund: Je.nullish(),
476
- paymentType: z.nullish(),
463
+ refund: Ye.nullish(),
464
+ paymentType: G.nullish(),
477
465
  paymentRef: e.string().nullish(),
478
466
  webhookUrl: e.string().optional(),
479
467
  webhookSent: e.boolean().optional(),
@@ -481,16 +469,16 @@ const Je = e.object({
481
469
  pf_member: e.any().optional(),
482
470
  pf_location: e.any().optional(),
483
471
  pf_ref: e.any().optional()
484
- }).describe(l.describe(qe));
472
+ }).describe(l.describe(Je));
485
473
  e.object({
486
474
  bundle: n,
487
475
  member: e.string(),
488
476
  ref: e.string(),
489
- paymentType: z.nullish(),
477
+ paymentType: G.nullish(),
490
478
  withCoin: e.boolean().optional(),
491
479
  card: e.string().optional(),
492
480
  location: n.optional(),
493
- source: N,
481
+ source: S,
494
482
  webhookUrl: e.string().optional()
495
483
  });
496
484
  e.object({
@@ -525,7 +513,7 @@ e.object({
525
513
  member: e.string(),
526
514
  subscriptionId: e.string()
527
515
  });
528
- const Ze = {
516
+ const qe = {
529
517
  collectionName: "Cards",
530
518
  transform: {
531
519
  _id: "oid",
@@ -554,10 +542,10 @@ e.object({
554
542
  design: e.string().nullish(),
555
543
  bundle: e.string().nullish(),
556
544
  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({
545
+ pf_member: e.lazy(() => F).nullish(),
546
+ pf_transaction: e.lazy(() => z).nullish()
547
+ }).describe(l.describe(qe));
548
+ const Ze = e.object({
561
549
  length: e.coerce.number().optional(),
562
550
  charset: e.string(),
563
551
  prefix: e.string().optional(),
@@ -567,14 +555,14 @@ const Xe = e.object({
567
555
  e.object({
568
556
  quantity: e.number(),
569
557
  code: e.string(),
570
- codeConfig: Xe,
558
+ codeConfig: Ze,
571
559
  setCardOnBind: e.boolean().optional(),
572
560
  design: e.string().nullish(),
573
561
  bundle: e.string().optional(),
574
562
  subscriptionBundle: e.string().optional()
575
563
  });
576
- const $e = e.enum(["SMS", "EMAIL"]), y = e.object({
577
- channel: $e,
564
+ const Xe = e.enum(["SMS", "EMAIL"]), y = e.object({
565
+ channel: Xe,
578
566
  variables: e.array(e.string()),
579
567
  title: e.string().nullish(),
580
568
  design: e.any(),
@@ -586,77 +574,77 @@ const $e = e.enum(["SMS", "EMAIL"]), y = e.object({
586
574
  code: e.ZodIssueCode.custom,
587
575
  message: "Content is required"
588
576
  });
589
- const r = /{{(.*?)}}/g, g = [...t.content.matchAll(r)].map((E) => E[1]), I = t.variables, C = g.filter((E) => I.indexOf(E) < 0);
577
+ const r = /{{(.*?)}}/g, g = [...t.content.matchAll(r)].map((b) => b[1]), _ = t.variables, C = g.filter((b) => _.indexOf(b) < 0);
590
578
  C.length && i.addIssue({
591
579
  code: e.ZodIssueCode.custom,
592
580
  message: "Invalid variable(s): " + C.join(", ")
593
581
  });
594
582
  });
595
- function hn(t, i) {
583
+ function yn(t, i) {
596
584
  return t.replace(/{{(.*?)}}/g, (r, g) => {
597
- const C = g.trim().split(".").reduce((E, ie) => (E != null ? E[ie] : null) ?? null, i);
585
+ const C = g.trim().split(".").reduce((b, oe) => (b != null ? b[oe] : null) ?? null, i);
598
586
  return C !== null ? C : r;
599
587
  });
600
588
  }
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({
602
- type: e.literal(D.enum.NO_REWARD),
589
+ const A = 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({
590
+ type: e.literal(A.enum.NO_REWARD),
603
591
  collectible: e.null(),
604
- weight: M
605
- }), V = e.object({
606
- type: e.literal(D.enum.VOUCHER),
592
+ weight: T
593
+ }), v = e.object({
594
+ type: e.literal(A.enum.VOUCHER),
607
595
  collectible: n,
608
- collectibleConfig: e.lazy(() => P._def.right.options[0]),
596
+ collectibleConfig: e.lazy(() => x._def.right.options[0]),
609
597
  earningOption: e.lazy(() => m)
610
- }), O = e.object({
611
- type: e.literal(D.enum.LOYALTY),
598
+ }), M = e.object({
599
+ type: e.literal(A.enum.LOYALTY),
612
600
  collectible: n,
613
601
  earningOption: e.lazy(() => m),
614
- validityOption: e.lazy(() => ae)
615
- }), W = V.extend({
616
- weight: M
617
- }), K = O.extend({
602
+ validityOption: e.lazy(() => se)
603
+ }), V = v.extend({
604
+ weight: T
605
+ }), W = M.extend({
618
606
  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", [
607
+ }), hn = M.extend({
608
+ validityOption: ae,
609
+ weight: T
610
+ }), $e = e.discriminatedUnion("type", [
611
+ V,
623
612
  W,
624
- K,
625
- v
626
- ]), A = e.discriminatedUnion("type", [
627
- W.extend({
613
+ k
614
+ ]), O = e.discriminatedUnion("type", [
615
+ V.extend({
628
616
  collectible: n.nullish(),
629
617
  business: n.nullish()
630
618
  }),
631
- K.extend({
619
+ W.extend({
632
620
  collectible: n.nullish(),
633
621
  business: n.nullish()
634
622
  }),
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({
623
+ k
624
+ ]), K = v.extend({
625
+ threshold: H
626
+ }), Y = M.extend({
627
+ threshold: H
628
+ }), J = e.discriminatedUnion("type", [
629
+ K,
630
+ Y
631
+ ]), Qe = e.discriminatedUnion("type", [
632
+ K.extend({
645
633
  collectible: n.nullish(),
646
634
  business: n.nullish()
647
635
  }),
648
- J.extend({
636
+ Y.extend({
649
637
  collectible: n.nullish(),
650
- collectibleConfig: P.nullish(),
638
+ collectibleConfig: x.nullish(),
651
639
  business: n.nullish()
652
640
  })
653
- ]), nn = {
641
+ ]), en = {
654
642
  collectionName: "Locations",
655
643
  transform: {
656
644
  _id: "oid",
657
645
  business: "oid"
658
646
  }
659
- }, Z = e.object({
647
+ }, q = e.object({
660
648
  _id: n,
661
649
  business: n,
662
650
  name: e.string(),
@@ -664,7 +652,7 @@ const D = e.enum(["NO_REWARD", "VOUCHER", "LOYALTY"]), M = e.number().min(0, "We
664
652
  otp: e.string().nullish(),
665
653
  otpExpiredAt: e.coerce.date().nullish(),
666
654
  apiToken: e.string().nullish()
667
- }).describe(l.describe(nn));
655
+ }).describe(l.describe(en));
668
656
  e.object({
669
657
  _id: n,
670
658
  name: e.string(),
@@ -678,10 +666,10 @@ e.object({
678
666
  location: "oid"
679
667
  }
680
668
  }));
681
- const tn = e.enum(["PROGRESSIVE", "STAMP"]), on = e.object({
682
- type: tn,
669
+ const nn = e.enum(["PROGRESSIVE", "STAMP"]), tn = e.object({
670
+ type: nn,
683
671
  end: e.number().int().min(0, "Threshold need to be at least 1"),
684
- rewards: e.array(e.lazy(() => q)).nullish()
672
+ rewards: e.array(e.lazy(() => J)).nullish()
685
673
  }).superRefine((t, i) => {
686
674
  t.type == "STAMP" && t.end > 40 && (i.addIssue({
687
675
  code: "custom",
@@ -692,7 +680,7 @@ const tn = e.enum(["PROGRESSIVE", "STAMP"]), on = e.object({
692
680
  path: ["end"],
693
681
  message: "Stamp mission can have at most 40 threshold"
694
682
  }));
695
- }), sn = {
683
+ }), on = {
696
684
  collectionName: "Groups",
697
685
  transform: {
698
686
  _id: "oid",
@@ -710,21 +698,21 @@ const tn = e.enum(["PROGRESSIVE", "STAMP"]), on = e.object({
710
698
  foreignField: "group"
711
699
  }
712
700
  }
713
- }, fn = e.object({
701
+ }, Cn = e.object({
714
702
  _id: n,
715
703
  name: e.string().min(1).max(300),
716
704
  business: n,
717
705
  pf_campaigns: e.array(e.any()).optional()
718
- }).describe(l.describe(sn)), an = e.object({
706
+ }).describe(l.describe(on)), sn = e.object({
719
707
  from: e.string().email().nullish(),
720
708
  name: e.string().min(1).max(50).nullish()
721
- }), rn = e.object({
722
- type: e.literal(L.enum.MEMBERSHIP),
709
+ }), an = e.object({
710
+ type: e.literal(P.enum.MEMBERSHIP),
723
711
  business: n,
724
712
  name: e.string().min(1).max(50),
725
713
  image: e.string().nullish(),
726
714
  url: e.string().nullish(),
727
- tiers: e.array(e.lazy(() => F)),
715
+ tiers: e.array(e.lazy(() => D)),
728
716
  titles: e.array(n),
729
717
  tierCycleEnable: e.boolean().optional(),
730
718
  tierCycle: e.lazy(() => f).nullish(),
@@ -739,14 +727,14 @@ const tn = e.enum(["PROGRESSIVE", "STAMP"]), on = e.object({
739
727
  ).optional(),
740
728
  targetLocation: e.array(n).nullish(),
741
729
  brand: e.string().nullish(),
742
- email: an.nullish(),
730
+ email: sn.nullish(),
743
731
  freeCreditAsDiscount: e.boolean().optional(),
744
732
  pf_title: e.array(e.lazy(() => p)).optional(),
745
- pf_targetLocation: e.array(e.lazy(() => Z)).optional(),
733
+ pf_targetLocation: e.array(e.lazy(() => q)).optional(),
746
734
  // new structure
747
735
  group: e.string().nullish(),
748
736
  templateId: n.nullish()
749
- }), o = L.exclude(["MEMBERSHIP"]), c = e.object({
737
+ }), o = P.exclude(["MEMBERSHIP"]), c = e.object({
750
738
  _id: n.nullish(),
751
739
  type: o,
752
740
  // common information
@@ -754,7 +742,7 @@ const tn = e.enum(["PROGRESSIVE", "STAMP"]), on = e.object({
754
742
  name: e.string().min(1).max(50),
755
743
  image: e.string().nullish(),
756
744
  description: e.string().max(500).nullish(),
757
- timeframeOptions: le.superRefine((t, i) => {
745
+ timeframeOptions: re.superRefine((t, i) => {
758
746
  t.start && t.end && t.end < t.start && i.addIssue({
759
747
  code: "custom",
760
748
  path: [],
@@ -764,13 +752,13 @@ const tn = e.enum(["PROGRESSIVE", "STAMP"]), on = e.object({
764
752
  });
765
753
  }).nullish(),
766
754
  targetLocation: e.array(n).nullish(),
767
- event: De,
768
- config: ce.nullish(),
755
+ event: Fe,
756
+ config: le.nullish(),
769
757
  currentReceive: e.coerce.number().optional(),
770
758
  // new group structure
771
759
  group: n.nullish(),
772
760
  templateId: n.nullish(),
773
- pf_targetLocation: e.array(e.lazy(() => Z)).optional()
761
+ pf_targetLocation: e.array(e.lazy(() => q)).optional()
774
762
  }), d = {
775
763
  [o.enum.VOUCHER]: [
776
764
  "BILL_COMPLETED",
@@ -821,7 +809,7 @@ const tn = e.enum(["PROGRESSIVE", "STAMP"]), on = e.object({
821
809
  "FEEDBACK",
822
810
  "SCHEDULE"
823
811
  ]
824
- }, X = c.extend({
812
+ }, Z = c.extend({
825
813
  type: e.literal(o.enum.VOUCHER),
826
814
  // event
827
815
  code: e.string().min(0).max(15).optional(),
@@ -841,9 +829,9 @@ const tn = e.enum(["PROGRESSIVE", "STAMP"]), on = e.object({
841
829
  notifyCampaign: n.nullish(),
842
830
  pf_collectible: e.lazy(() => p).optional(),
843
831
  pf_notifyCampaign: e.lazy(() => h).optional()
844
- }), ln = e.object({
832
+ }), rn = e.object({
845
833
  gameType: e.string()
846
- }), $ = c.extend({
834
+ }), X = c.extend({
847
835
  type: e.literal(o.enum.PROMOTION),
848
836
  // event
849
837
  event: a.merge(
@@ -860,8 +848,8 @@ const tn = e.enum(["PROGRESSIVE", "STAMP"]), on = e.object({
860
848
  }
861
849
  });
862
850
  }),
863
- gameConfig: ln.nullish()
864
- }), Q = c.extend({
851
+ gameConfig: rn.nullish()
852
+ }), $ = c.extend({
865
853
  type: e.literal(o.enum.POINT),
866
854
  // event
867
855
  event: a.merge(
@@ -876,7 +864,7 @@ const tn = e.enum(["PROGRESSIVE", "STAMP"]), on = e.object({
876
864
  notifyCampaign: n.nullish(),
877
865
  pf_collectible: e.lazy(() => p).optional(),
878
866
  pf_notifyCampaign: e.lazy(() => h).optional()
879
- }), ee = c.extend({
867
+ }), Q = c.extend({
880
868
  type: e.literal(o.enum.CREDIT),
881
869
  // event
882
870
  event: a.merge(
@@ -901,7 +889,7 @@ const tn = e.enum(["PROGRESSIVE", "STAMP"]), on = e.object({
901
889
  ),
902
890
  message: y,
903
891
  linkedCampaign: n.nullish()
904
- }), ne = c.extend({
892
+ }), ee = c.extend({
905
893
  type: e.literal(o.enum.COIN),
906
894
  // event
907
895
  event: a.merge(
@@ -924,8 +912,8 @@ const tn = e.enum(["PROGRESSIVE", "STAMP"]), on = e.object({
924
912
  type: e.enum(d[o.enum.REWARD_POOL])
925
913
  })
926
914
  ),
927
- rewards: e.array(e.lazy(() => Qe)).min(1, "Requires at least 1 reward")
928
- }), te = c.extend({
915
+ rewards: e.array(e.lazy(() => $e)).min(1, "Requires at least 1 reward")
916
+ }), ne = c.extend({
929
917
  type: e.literal(o.enum.GAME),
930
918
  // event
931
919
  event: a.merge(
@@ -938,7 +926,7 @@ const tn = e.enum(["PROGRESSIVE", "STAMP"]), on = e.object({
938
926
  game: e.lazy(() => R).optional(),
939
927
  pf_collectible: e.lazy(() => p).optional(),
940
928
  rewardPool: n.optional()
941
- }), oe = c.extend({
929
+ }), te = c.extend({
942
930
  type: e.literal(o.enum.MISSION),
943
931
  event: a.merge(
944
932
  e.object({
@@ -948,9 +936,9 @@ const tn = e.enum(["PROGRESSIVE", "STAMP"]), on = e.object({
948
936
  earningOption: m,
949
937
  collectible: n,
950
938
  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 = {
939
+ mission: e.lazy(() => tn),
940
+ rewards: e.array(e.lazy(() => J)).min(1, "Requires at least 1 reward")
941
+ }), ln = {
954
942
  collectionName: "Campaigns",
955
943
  transform: {
956
944
  _id: "oid",
@@ -992,20 +980,23 @@ const tn = e.enum(["PROGRESSIVE", "STAMP"]), on = e.object({
992
980
  as: "game"
993
981
  }
994
982
  }
995
- }, In = e.object({ _id: n }).and(
983
+ }, fn = e.object({ _id: n }).and(
996
984
  e.discriminatedUnion("type", [
997
- rn,
985
+ an,
986
+ Z,
998
987
  X,
999
988
  $,
1000
989
  Q,
1001
- ee,
1002
990
  h,
1003
- ne,
991
+ ee,
1004
992
  R,
1005
- te,
1006
- oe
993
+ ne,
994
+ te
1007
995
  ])
1008
- ).describe(l.describe(cn)), Rn = e.discriminatedUnion("type", [
996
+ ).describe(l.describe(ln)), _n = e.discriminatedUnion("type", [
997
+ Z.extend({
998
+ business: n.nullish()
999
+ }),
1009
1000
  X.extend({
1010
1001
  business: n.nullish()
1011
1002
  }),
@@ -1015,52 +1006,47 @@ const tn = e.enum(["PROGRESSIVE", "STAMP"]), on = e.object({
1015
1006
  Q.extend({
1016
1007
  business: n.nullish()
1017
1008
  }),
1018
- ee.extend({
1019
- business: n.nullish()
1020
- }),
1021
1009
  h.extend({
1022
1010
  business: n.nullish()
1023
1011
  }),
1024
- ne.extend({
1012
+ ee.extend({
1025
1013
  business: n.nullish()
1026
1014
  }),
1027
1015
  R.extend({
1028
- rewards: e.array(e.lazy(() => A)).min(1, "Requires at least 1 reward")
1016
+ rewards: e.array(e.lazy(() => O)).min(1, "Requires at least 1 reward")
1029
1017
  }),
1030
- te.extend({
1018
+ ne.extend({
1031
1019
  business: n.nullish(),
1032
1020
  game: R.extend({
1033
1021
  business: n.nullish(),
1034
- rewards: e.array(e.lazy(() => A)).min(1, "Requires at least 1 reward")
1022
+ rewards: e.array(e.lazy(() => O)).min(1, "Requires at least 1 reward")
1035
1023
  })
1036
1024
  }),
1037
- oe.extend({
1025
+ te.extend({
1038
1026
  business: n.nullish(),
1039
- rewards: e.array(e.lazy(() => en)).min(1, "Requires at least 1 reward")
1027
+ rewards: e.array(e.lazy(() => Qe)).min(1, "Requires at least 1 reward")
1040
1028
  })
1041
1029
  ]);
1042
1030
  export {
1043
1031
  d as C,
1044
- yn as F,
1032
+ En as F,
1045
1033
  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,
1034
+ hn as b,
1035
+ O as c,
1036
+ nn as d,
1037
+ Qe as e,
1038
+ tn as f,
1039
+ Cn as g,
1040
+ _n as h,
1053
1041
  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
1042
+ bn as j,
1043
+ s as k,
1044
+ We as l,
1045
+ j as m,
1046
+ Ue as n,
1047
+ U as o,
1048
+ S as p,
1049
+ Fe as q,
1050
+ an as r,
1051
+ yn as s
1066
1052
  };