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

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-C6JJ9uQ8.js +4785 -0
  2. package/dist/AuditLogs-CAlgtDgx.js +2014 -0
  3. package/dist/Bin-D8jwhwER.js +166 -0
  4. package/dist/Broadcast-CP8DRfkT.js +269 -0
  5. package/dist/CampaignAnalytic-MVjYBFvu.js +1826 -0
  6. package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DeLURz87.js +122 -0
  7. package/dist/Card-QribXJwZ.js +911 -0
  8. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +97 -0
  9. package/dist/Collections-X9xbt43V.js +541 -0
  10. package/dist/Credit-QmbsW1eb.js +286 -0
  11. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +128 -0
  12. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +58 -0
  13. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-ClNieHSo.js +3382 -0
  14. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-CrGHTNhg.js +351 -0
  15. package/dist/Experience-CPGMg847.js +285 -0
  16. package/dist/FileSaver.min-CK67LsPG.js +74 -0
  17. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
  18. package/dist/FmTableSelection.vue_vue_type_script_setup_true_lang-DzcUc0_w.js +52 -0
  19. package/dist/Game-BrkiEFCS.js +356 -0
  20. package/dist/GiftCardSetup-DXNBHF1A.js +542 -0
  21. package/dist/Grab-BgtDzK1B.js +301 -0
  22. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-Dzv2AkKN.js +145 -0
  23. package/dist/Index-KJgzalOd.js +259 -0
  24. package/dist/JsonViewer-v8_C7l5N.js +87 -0
  25. package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-C6SBLJGQ.js +48 -0
  26. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-Dj74lJ7b.js +18737 -0
  27. package/dist/LoyaltyDashboard-B2JpbC01.js +1345 -0
  28. package/dist/MainLayout-DlfTKHQ-.js +143 -0
  29. package/dist/Marketing-Crx_JQpi.js +236 -0
  30. package/dist/MarketingMaterialEdit-BfsdcMXJ.js +1036 -0
  31. package/dist/Member-C50Nrsko.js +281 -0
  32. package/dist/MemberList-C9uUKw1o.js +1603 -0
  33. package/dist/MemberOverview-wL_ailso.js +58 -0
  34. package/dist/MemberTransactions-DZ7zPOHX.js +45 -0
  35. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-Du_ZGsbX.js +60957 -0
  36. package/dist/MetricInfoTooltip.vue_vue_type_script_setup_true_lang-Bg_0YlwG.js +38 -0
  37. package/dist/Mission-D_km8zi6.js +360 -0
  38. package/dist/Overview-BBieK6qQ.js +1080 -0
  39. package/dist/Overview-B_kmLOcc.js +1316 -0
  40. package/dist/Point-D0q9N7f9.js +288 -0
  41. package/dist/Promotion-DoFTy-NK.js +423 -0
  42. package/dist/Queue-Dh5sDRHW.js +261 -0
  43. package/dist/Record-0owEBKqN.js +342 -0
  44. package/dist/Review-DV2fnpOH.js +45 -0
  45. package/dist/ReviewFacebookCallback-D8mnAPzR.js +238 -0
  46. package/dist/ReviewGoogleCallback-CLzt_ox2.js +213 -0
  47. package/dist/Reward-Co20Xrss.js +442 -0
  48. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-0qU49c47.js +150 -0
  49. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-qdvaXPhJ.js +1913 -0
  50. package/dist/Segment-7dQKeHWK.js +1017 -0
  51. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-BUVrUifO.js +181 -0
  52. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-DDsV9TD9.js +189 -0
  53. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-DqPZpddc.js +226 -0
  54. package/dist/Setting-Bvahxs-y.js +2047 -0
  55. package/dist/SettingAdvertisements-fbXLRwfb.js +264 -0
  56. package/dist/Settings-C_HWDFN8.js +179 -0
  57. package/dist/Store-8yBKDR1b.js +2413 -0
  58. package/dist/StoreRewards-DKaJvoJs.js +540 -0
  59. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-D23XzJD7.js +1075 -0
  60. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-JaFhCK_L.js +7007 -0
  61. package/dist/Tier-CD-CjXC3.js +972 -0
  62. package/dist/Title-C_lcgye8.js +569 -0
  63. package/dist/Transaction-BvUYm-rT.js +39 -0
  64. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-C3Yacz7K.js +130 -0
  65. package/dist/Voucher-CYaG0GLU.js +444 -0
  66. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DF2JqzRe.js +421 -0
  67. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-B4UPqSNc.js +56 -0
  68. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  69. package/dist/app-CE5hQ4Uq.js +60740 -0
  70. package/dist/app-wDQR6dpb.js +39 -0
  71. package/dist/app.js +7 -0
  72. package/dist/business-CE_4siXc.js +82 -0
  73. package/dist/campaign-BP6rvSpg.js +255 -0
  74. package/dist/campaign-CXQtKpeb.js +100 -0
  75. package/dist/campaign-CpzFl8Vr.js +4 -0
  76. package/dist/campaign.enum-Dx-Zo68Q.js +26 -0
  77. package/dist/campaign.fn-DKnBpE1N.js +776 -0
  78. package/dist/collectible.enum-Liy2wH3s.js +19 -0
  79. package/dist/collection.fn-Cg16QZSp.js +26 -0
  80. package/dist/duplicateCampaign-DbtVAGsT.js +51 -0
  81. package/dist/effect-CLI8NI4O.js +89 -0
  82. package/dist/email-addresses-DlLiZ1io.js +705 -0
  83. package/dist/export-6Hr34dBU.js +97 -0
  84. package/dist/feedme.ico +0 -0
  85. package/dist/google-C3S8u0mT.js +4 -0
  86. package/dist/helper-vkjFqj70.js +86 -0
  87. package/dist/index-BIyKgw4m.js +72 -0
  88. package/dist/index-BLQJ-rv3.js +31 -0
  89. package/dist/index-BbTIqReL.js +67 -0
  90. package/dist/index-BuMfQxMf.js +897 -0
  91. package/dist/index-C8cXXcLk.js +45 -0
  92. package/dist/index-CSVhIZSY.js +8919 -0
  93. package/dist/index-CVHacTbc.js +151 -0
  94. package/dist/index-C_H8jFYf.js +2743 -0
  95. package/dist/index-CmNsGhDf.js +2706 -0
  96. package/dist/index-CnTeeRyJ.js +53 -0
  97. package/dist/index-CuvNtC_M.js +61 -0
  98. package/dist/index-CzbNobLv.js +1139 -0
  99. package/dist/index-D06n1h1b.js +146 -0
  100. package/dist/index-D4SDAfbP.js +27550 -0
  101. package/dist/index-DVnYQ3Hs.js +85 -0
  102. package/dist/index-DcjnS5Sv.js +28900 -0
  103. package/dist/index-Dx9h0FNH.js +3 -0
  104. package/dist/index-YgP4ihQL.js +32 -0
  105. package/dist/index-kedErkLZ.js +2963 -0
  106. package/dist/index-lnQT4P3d.js +55 -0
  107. package/dist/index-vh86FiIQ.js +10 -0
  108. package/dist/index.esm2017-Jhv2lkrq.js +3069 -0
  109. package/dist/loading-NY-FPxVY.js +72 -0
  110. package/dist/lodash-BC_P6kLg.js +3678 -0
  111. package/dist/membership-BWaK-9FY.js +255 -0
  112. package/dist/moment-D7p2TMB-.js +2583 -0
  113. package/dist/money-COoh4GXK.js +15 -0
  114. package/dist/number-BX5OEXgq.js +12 -0
  115. package/dist/object-BYyQ0PZp.js +18 -0
  116. package/dist/objectId-dwaoBfJX.js +7 -0
  117. package/dist/objectid-1SUSRtmY.js +145 -0
  118. package/dist/plugins-ur-FAoye.js +1788 -0
  119. package/dist/remy-Qz_pNsUS.js +13 -0
  120. package/dist/reward-DSsylZ22.js +36 -0
  121. package/dist/rule-BM9GUd1C.js +1969 -0
  122. package/dist/rule-builder-gC9LH2AC.js +126 -0
  123. package/dist/string-Gcy5IM_H.js +32 -0
  124. package/dist/style.css +4 -0
  125. package/dist/template-CUV3AMFI.js +188 -0
  126. package/dist/tier-BJDhpH6X.js +4 -0
  127. package/dist/tiers/tier=1.png +0 -0
  128. package/dist/tiers/tier=2.png +0 -0
  129. package/dist/tiers/tier=3.png +0 -0
  130. package/dist/tiers/tier=4.png +0 -0
  131. package/dist/timezone-BFZhekOU.js +20 -0
  132. package/dist/titles/type=diamond.png +0 -0
  133. package/dist/titles/type=drinks.png +0 -0
  134. package/dist/titles/type=food.png +0 -0
  135. package/dist/titles/type=heart.png +0 -0
  136. package/dist/titles/type=medal.png +0 -0
  137. package/dist/titles/type=spend.png +0 -0
  138. package/dist/titles/type=thank-you.png +0 -0
  139. package/dist/titles/type=thumbs-up.png +0 -0
  140. package/dist/titles/type=years.png +0 -0
  141. package/dist/transaction.fn-C5MlkEIC.js +64 -0
  142. package/dist/trigger-CbjiuoSo.js +213 -0
  143. package/dist/tslib.es6-BCqqvLQ_.js +44 -0
  144. package/dist/type_drinks-D6jnpvwV.js +4 -0
  145. package/dist/useMarketingMaterialActions-BLisTieA.js +96 -0
  146. package/dist/usePagination-Caah4sJr.js +220 -0
  147. package/dist/user-BZC4P_jL.js +55 -0
  148. package/dist/vue-i18n-BYz7XAr_.js +2365 -0
  149. package/dist/xlsx-Bn7BqUFA.js +15491 -0
  150. package/dist/zod-DHH42rXG.js +91 -0
  151. package/package.json +1 -1
@@ -0,0 +1,2706 @@
1
+ import { F as a, m as i, a as U } from "./index-D4SDAfbP.js";
2
+ import { z as e } from "./index-C_H8jFYf.js";
3
+ import { x as P, u as j, v as J, t as r } from "./index-kedErkLZ.js";
4
+ import { a as E } from "./index-CSVhIZSY.js";
5
+ import { R as t } from "./rule-builder-gC9LH2AC.js";
6
+ import { i as o } from "./helper-vkjFqj70.js";
7
+ import { l as O } from "./index-BuMfQxMf.js";
8
+ import { F as d } from "./index-lnQT4P3d.js";
9
+ const I = {
10
+ collectionName: "AuditLogs",
11
+ transform: {
12
+ _id: "oid",
13
+ business: "oid",
14
+ timestamp: "date"
15
+ },
16
+ lookups: {
17
+ business: {
18
+ as: "pf_business",
19
+ fromCollection: "Businesses"
20
+ }
21
+ }
22
+ }, R = e.enum([
23
+ "GET",
24
+ "POST",
25
+ "PUT",
26
+ "PATCH",
27
+ "DELETE",
28
+ "OPTIONS",
29
+ "HEAD",
30
+ "ALL"
31
+ ]), L = e.enum([
32
+ "CAMPAIGN",
33
+ "LOCATION",
34
+ "MARKETING MATERIALS",
35
+ "MEMBERSHIP",
36
+ "STORE",
37
+ "TRANSACTION",
38
+ "SETTINGS",
39
+ "SEGMENTATION",
40
+ "USER"
41
+ ]), x = e.object({
42
+ httpMethod: R,
43
+ url: e.string().min(1),
44
+ userAgent: e.string(),
45
+ host: e.string().min(1),
46
+ params: e.object({}).passthrough().nullish(),
47
+ query: e.object({}).passthrough().nullish(),
48
+ body: e.object({}).passthrough().nullish()
49
+ }), D = e.object({
50
+ statusCode: e.number().int().min(100).max(599),
51
+ body: e.object({}).passthrough().nullish()
52
+ });
53
+ e.object({
54
+ _id: a,
55
+ user: e.string().length(28),
56
+ userName: e.string().min(1),
57
+ userPhoneNumber: e.string().refine((n) => P(n)).nullish(),
58
+ moduleType: L,
59
+ business: a.nullish(),
60
+ clientIp: e.string().nullish(),
61
+ timestamp: e.string().datetime(),
62
+ request: x,
63
+ response: D
64
+ }).describe(i.describe(I));
65
+ const we = {
66
+ PROMOTION: {
67
+ name: "Promotion Template",
68
+ description: "Promotion template for campaign creation.",
69
+ steps: [
70
+ {
71
+ name: "connect.template.general_information",
72
+ groups: [
73
+ {
74
+ name: "connect.template.general",
75
+ fields: [
76
+ {
77
+ label: "connect.template.campaign_name",
78
+ property: "campaign.name",
79
+ type: "text"
80
+ },
81
+ {
82
+ label: "connect.template.campaign_description",
83
+ property: "campaign.description",
84
+ type: "textarea"
85
+ },
86
+ {
87
+ label: "connect.template.campaign_period",
88
+ property: "campaign.timeframeOptions",
89
+ type: "timeframe"
90
+ }
91
+ ]
92
+ },
93
+ {
94
+ name: "connect.template.trigger",
95
+ fields: [
96
+ {
97
+ label: void 0,
98
+ property: "campaign.event.type",
99
+ type: "trigger",
100
+ extras: "campaign.type"
101
+ }
102
+ ]
103
+ }
104
+ ]
105
+ },
106
+ {
107
+ name: "connect.template.discount",
108
+ groups: [
109
+ {
110
+ name: "connect.template.discount",
111
+ fields: [
112
+ {
113
+ label: void 0,
114
+ property: "campaign.effect",
115
+ type: "effect"
116
+ },
117
+ {
118
+ label: "connect.template.campaign_image",
119
+ property: "campaign.image",
120
+ type: "image"
121
+ }
122
+ ]
123
+ }
124
+ ]
125
+ },
126
+ {
127
+ name: "connect.template.terms_conditions",
128
+ groups: [
129
+ {
130
+ name: "connect.template.time_limitation",
131
+ fields: [
132
+ {
133
+ label: void 0,
134
+ property: "campaign.event.rule",
135
+ type: "rule_time",
136
+ extras: "campaign.type"
137
+ }
138
+ ]
139
+ },
140
+ {
141
+ name: "connect.template.target_audience",
142
+ fields: [
143
+ {
144
+ label: void 0,
145
+ property: "campaign.event.rule",
146
+ type: "rule_user"
147
+ }
148
+ ]
149
+ },
150
+ {
151
+ name: "connect.template.game_configuration",
152
+ fields: [
153
+ {
154
+ label: void 0,
155
+ property: "campaign.gameConfig",
156
+ type: "promotion_game_type"
157
+ }
158
+ ]
159
+ },
160
+ {
161
+ name: "connect.template.location",
162
+ fields: [
163
+ {
164
+ label: "connect.template.target_location",
165
+ property: "campaign.targetLocation",
166
+ type: "target_location"
167
+ }
168
+ ]
169
+ }
170
+ ]
171
+ }
172
+ ],
173
+ defaultValue: {
174
+ // TODO: templateId use in db
175
+ templateId: "",
176
+ campaign: {
177
+ type: "PROMOTION",
178
+ // TODO: templateId use in db
179
+ templateId: "",
180
+ name: "",
181
+ description: "",
182
+ image: "",
183
+ effect: null,
184
+ event: {
185
+ type: "MAKING_ORDER",
186
+ rule: t.scaffoldGroup()
187
+ },
188
+ group: null,
189
+ targetLocation: null,
190
+ timeframeOptions: {
191
+ type: "timeframe",
192
+ property: "__now"
193
+ },
194
+ gameConfig: null
195
+ }
196
+ }
197
+ },
198
+ VOUCHER: {
199
+ name: "Voucher Template",
200
+ description: "Voucher template for campaign creation.",
201
+ steps: [
202
+ {
203
+ name: "connect.template.general_information",
204
+ groups: [
205
+ {
206
+ name: "connect.template.general",
207
+ fields: [
208
+ {
209
+ label: "connect.template.campaign_name",
210
+ property: "campaign.name",
211
+ type: "text"
212
+ },
213
+ {
214
+ label: "connect.template.campaign_description",
215
+ property: "campaign.description",
216
+ type: "textarea"
217
+ },
218
+ {
219
+ label: "connect.template.campaign_period",
220
+ property: "campaign.timeframeOptions",
221
+ type: "timeframe"
222
+ }
223
+ ]
224
+ },
225
+ {
226
+ name: "connect.template.trigger",
227
+ fields: [
228
+ {
229
+ label: void 0,
230
+ property: "campaign.event.type",
231
+ type: "trigger",
232
+ extras: "campaign.type"
233
+ }
234
+ ]
235
+ },
236
+ {
237
+ name: "",
238
+ fields: [
239
+ {
240
+ label: void 0,
241
+ property: "campaign.event.rule.rules.g_schedule",
242
+ type: "rule_schedule",
243
+ extras: "campaign.timeframeOptions"
244
+ }
245
+ ],
246
+ condition: {
247
+ property: "campaign.event.type",
248
+ value: "SCHEDULE"
249
+ }
250
+ }
251
+ ]
252
+ },
253
+ {
254
+ name: "connect.template.discount",
255
+ groups: [
256
+ {
257
+ name: "connect.template.discount",
258
+ fields: [
259
+ {
260
+ label: void 0,
261
+ property: "configs.extras.effect",
262
+ type: "effect"
263
+ }
264
+ ]
265
+ },
266
+ {
267
+ name: "connect.template.voucher_detail",
268
+ fields: [
269
+ {
270
+ label: "connect.template.voucher_name",
271
+ property: "configs.name",
272
+ type: "text"
273
+ },
274
+ {
275
+ label: "connect.template.voucher_description",
276
+ property: "configs.description",
277
+ type: "textarea"
278
+ },
279
+ {
280
+ label: "connect.template.voucher_image",
281
+ property: "configs.image",
282
+ type: "image"
283
+ }
284
+ ]
285
+ }
286
+ ]
287
+ },
288
+ {
289
+ name: "connect.template.terms_conditions",
290
+ groups: [
291
+ {
292
+ name: "connect.template.time_limitation",
293
+ fields: [
294
+ {
295
+ label: void 0,
296
+ property: "campaign.event.rule",
297
+ type: "rule_time",
298
+ extras: "campaign.type"
299
+ }
300
+ ],
301
+ condition: {
302
+ not: !0,
303
+ property: "campaign.event.type",
304
+ value: "SCHEDULE"
305
+ }
306
+ },
307
+ {
308
+ name: "connect.template.spending_criteria",
309
+ fields: [
310
+ {
311
+ label: void 0,
312
+ property: "campaign.event.rule",
313
+ type: "rule_bill"
314
+ }
315
+ ],
316
+ condition: {
317
+ property: "campaign.event.type",
318
+ value: "BILL_COMPLETED"
319
+ }
320
+ },
321
+ {
322
+ name: "connect.template.feedback_criteria",
323
+ fields: [
324
+ {
325
+ label: void 0,
326
+ property: "campaign.event.rule",
327
+ type: "rule_feedback"
328
+ }
329
+ ],
330
+ condition: {
331
+ property: "campaign.event.type",
332
+ value: "FEEDBACK"
333
+ }
334
+ },
335
+ {
336
+ name: "connect.template.target_audience",
337
+ fields: [
338
+ {
339
+ label: void 0,
340
+ property: "campaign.event.rule",
341
+ type: "rule_user"
342
+ }
343
+ // {
344
+ // label: 'Birthday config',
345
+ // property: 'campaign.event.__rule',
346
+ // type: 'rule_birthday',
347
+ // },
348
+ ]
349
+ },
350
+ {
351
+ name: "connect.template.voucher_usage_configuration",
352
+ fields: [
353
+ {
354
+ label: void 0,
355
+ property: "configs.options",
356
+ type: "collectible_options"
357
+ }
358
+ ]
359
+ }
360
+ ]
361
+ },
362
+ {
363
+ name: "connect.template.configuration",
364
+ groups: [
365
+ {
366
+ name: "connect.template.location",
367
+ fields: [
368
+ {
369
+ label: "connect.template.target_location",
370
+ property: "campaign.targetLocation",
371
+ type: "target_location"
372
+ }
373
+ ]
374
+ },
375
+ // {
376
+ // name: 'Hide in App (FeedVibe)',
377
+ // fields: [
378
+ // {
379
+ // label: 'Hide',
380
+ // property: 'campaign.hideInApp',
381
+ // type: 'switch',
382
+ // },
383
+ // ],
384
+ // condition: {
385
+ // property: 'campaign.event.type',
386
+ // value: 'SIMPLE_CLAIM',
387
+ // },
388
+ // },
389
+ {
390
+ name: "connect.template.redemption",
391
+ fields: [
392
+ {
393
+ label: "connect.template.code",
394
+ property: "campaign.code",
395
+ type: "text"
396
+ }
397
+ ],
398
+ condition: [
399
+ {
400
+ property: "campaign.event.type",
401
+ value: "SIMPLE_CLAIM"
402
+ },
403
+ {
404
+ property: "campaign.hideInApp",
405
+ value: !0
406
+ }
407
+ ]
408
+ },
409
+ {
410
+ name: "connect.template.notify_audience",
411
+ fields: [
412
+ {
413
+ label: "connect.template.send_notification",
414
+ property: "campaign.notify",
415
+ type: "switch"
416
+ }
417
+ ]
418
+ },
419
+ {
420
+ name: "connect.template.notify_message",
421
+ fields: [
422
+ {
423
+ label: "connect.template.notification_message",
424
+ property: "campaign.notifyMessage",
425
+ type: "message",
426
+ extras: "ISSUE_REWARD"
427
+ }
428
+ ],
429
+ condition: {
430
+ property: "campaign.notify",
431
+ value: !0
432
+ }
433
+ }
434
+ ]
435
+ }
436
+ ],
437
+ defaultValue: {
438
+ templateId: "",
439
+ campaign: {
440
+ collectible: "",
441
+ type: "VOUCHER",
442
+ templateId: "",
443
+ name: "",
444
+ description: "",
445
+ image: "",
446
+ code: "",
447
+ event: {
448
+ type: "BILL_COMPLETED",
449
+ rule: t.scaffoldGroup()
450
+ },
451
+ group: null,
452
+ targetLocation: null,
453
+ timeframeOptions: {
454
+ type: "timeframe",
455
+ property: "__now"
456
+ },
457
+ earningOption: {
458
+ type: "FIXED",
459
+ amount: 1
460
+ },
461
+ notify: !1,
462
+ // notifyMessage: {
463
+ // channel: 'SMS',
464
+ // content: 'You received a reward.',
465
+ // language: 'en',
466
+ // variables: ['transaction.amount', 'collectible.name'],
467
+ // imageUrl: '',
468
+ // },
469
+ hideInApp: !0
470
+ },
471
+ configs: o("VOUCHER", {
472
+ name: "",
473
+ business: null,
474
+ noCampaign: !1
475
+ })
476
+ }
477
+ },
478
+ BROADCAST: {
479
+ name: "Broadcast Template",
480
+ description: "Broadcast template for campaign creation.",
481
+ steps: [
482
+ {
483
+ name: "connect.template.general_information",
484
+ groups: [
485
+ {
486
+ name: "connect.template.general",
487
+ fields: [
488
+ {
489
+ label: "connect.template.campaign_name",
490
+ property: "campaign.name",
491
+ type: "text"
492
+ },
493
+ {
494
+ label: "connect.template.campaign_description",
495
+ property: "campaign.description",
496
+ type: "textarea"
497
+ },
498
+ {
499
+ label: "connect.template.campaign_period",
500
+ property: "campaign.timeframeOptions",
501
+ type: "timeframe"
502
+ }
503
+ ]
504
+ },
505
+ {
506
+ name: "connect.template.trigger",
507
+ fields: [
508
+ {
509
+ label: void 0,
510
+ property: "campaign.event.type",
511
+ type: "trigger",
512
+ extras: "campaign.type"
513
+ }
514
+ ]
515
+ },
516
+ {
517
+ name: "connect.template.broadcast_configuration",
518
+ fields: [
519
+ {
520
+ label: void 0,
521
+ property: "campaign.event.rule.rules.g_schedule",
522
+ type: "rule_schedule",
523
+ extras: "campaign.timeframeOptions"
524
+ }
525
+ ],
526
+ condition: {
527
+ property: "campaign.event.type",
528
+ value: "SCHEDULE"
529
+ }
530
+ }
531
+ ]
532
+ },
533
+ {
534
+ name: "connect.template.terms_conditions",
535
+ groups: [
536
+ {
537
+ name: "connect.template.target_audience",
538
+ fields: [
539
+ {
540
+ label: void 0,
541
+ property: "campaign.event.rule",
542
+ type: "rule_user"
543
+ }
544
+ ]
545
+ },
546
+ {
547
+ name: "connect.template.feedback_criteria",
548
+ fields: [
549
+ {
550
+ label: void 0,
551
+ property: "campaign.event.rule",
552
+ type: "rule_feedback"
553
+ }
554
+ ],
555
+ condition: {
556
+ property: "campaign.event.type",
557
+ value: "FEEDBACK"
558
+ }
559
+ }
560
+ ]
561
+ },
562
+ {
563
+ name: "connect.template.configuration",
564
+ groups: [
565
+ {
566
+ name: "connect.template.content",
567
+ fields: [
568
+ {
569
+ label: void 0,
570
+ property: "campaign.message",
571
+ type: "message"
572
+ }
573
+ ]
574
+ },
575
+ {
576
+ name: "connect.template.location",
577
+ fields: [
578
+ {
579
+ label: void 0,
580
+ property: "campaign.targetLocation",
581
+ type: "target_location"
582
+ }
583
+ ]
584
+ }
585
+ ]
586
+ }
587
+ ],
588
+ defaultValue: {
589
+ templateId: "",
590
+ campaign: {
591
+ type: "BROADCAST",
592
+ // TODO: templateId use in db
593
+ templateId: "",
594
+ name: "",
595
+ description: "",
596
+ image: "",
597
+ event: {
598
+ type: "SCHEDULE",
599
+ rule: t.setRuleToGroup(
600
+ t.scaffoldGroup(),
601
+ t.setRuleToGroup(
602
+ t.scaffoldGroup("g_schedule"),
603
+ [
604
+ t.constructEntry(
605
+ "trigger.date",
606
+ "_rrule",
607
+ "RRULE:FREQ=DAILY;INTERVAL=1;BYHOUR=0;BYMINUTE=0;BYSECOND=0;WKST=SU"
608
+ ),
609
+ t.constructEntry(
610
+ "trigger.time",
611
+ "_isOnTime",
612
+ "00:00"
613
+ )
614
+ ],
615
+ "&&"
616
+ )
617
+ )
618
+ },
619
+ group: null,
620
+ targetLocation: null,
621
+ timeframeOptions: {
622
+ type: "timeframe",
623
+ property: "__now"
624
+ },
625
+ message: {
626
+ channel: "SMS",
627
+ content: "",
628
+ language: "en",
629
+ variables: []
630
+ }
631
+ }
632
+ }
633
+ },
634
+ POINT: {
635
+ name: "Experience Template",
636
+ description: "Experience template for campaign creation.",
637
+ steps: [
638
+ {
639
+ name: "connect.template.general_information",
640
+ groups: [
641
+ {
642
+ name: "connect.template.general",
643
+ fields: [
644
+ {
645
+ label: "connect.template.campaign_name",
646
+ property: "campaign.name",
647
+ type: "text"
648
+ },
649
+ {
650
+ label: "connect.template.campaign_description",
651
+ property: "campaign.description",
652
+ type: "textarea"
653
+ },
654
+ {
655
+ label: "connect.template.campaign_period",
656
+ property: "campaign.timeframeOptions",
657
+ type: "timeframe"
658
+ }
659
+ ]
660
+ },
661
+ {
662
+ name: "connect.template.trigger",
663
+ fields: [
664
+ {
665
+ label: void 0,
666
+ property: "campaign.event.type",
667
+ type: "trigger",
668
+ extras: "campaign.type"
669
+ }
670
+ ]
671
+ },
672
+ {
673
+ name: void 0,
674
+ fields: [
675
+ {
676
+ label: void 0,
677
+ property: "campaign.event.rule.rules.g_schedule",
678
+ type: "rule_schedule",
679
+ extras: "campaign.timeframeOptions"
680
+ }
681
+ ],
682
+ condition: {
683
+ property: "campaign.event.type",
684
+ value: "SCHEDULE"
685
+ }
686
+ }
687
+ ]
688
+ },
689
+ {
690
+ name: "connect.template.terms_conditions",
691
+ groups: [
692
+ {
693
+ name: "connect.template.time_limitation",
694
+ fields: [
695
+ {
696
+ label: void 0,
697
+ property: "campaign.event.rule",
698
+ type: "rule_time",
699
+ extras: "campaign.type"
700
+ }
701
+ ],
702
+ condition: {
703
+ not: !0,
704
+ property: "campaign.event.type",
705
+ value: "SCHEDULE"
706
+ }
707
+ },
708
+ {
709
+ name: "connect.template.spending_criteria",
710
+ fields: [
711
+ {
712
+ label: void 0,
713
+ property: "campaign.event.rule",
714
+ type: "rule_bill"
715
+ }
716
+ ],
717
+ condition: {
718
+ property: "campaign.event.type",
719
+ value: "BILL_COMPLETED"
720
+ }
721
+ },
722
+ {
723
+ name: "connect.template.feedback_criteria",
724
+ fields: [
725
+ {
726
+ label: void 0,
727
+ property: "campaign.event.rule",
728
+ type: "rule_feedback"
729
+ }
730
+ ],
731
+ condition: {
732
+ property: "campaign.event.type",
733
+ value: "FEEDBACK"
734
+ }
735
+ },
736
+ {
737
+ name: "connect.template.target_audience",
738
+ fields: [
739
+ {
740
+ label: void 0,
741
+ property: "campaign.event.rule",
742
+ type: "rule_user"
743
+ }
744
+ ]
745
+ }
746
+ ]
747
+ },
748
+ {
749
+ name: "connect.template.configuration",
750
+ groups: [
751
+ {
752
+ name: "connect.template.earning_type",
753
+ fields: [
754
+ {
755
+ label: void 0,
756
+ property: "campaign.earningOption",
757
+ type: "earning_option",
758
+ extras: ""
759
+ },
760
+ {
761
+ label: void 0,
762
+ property: "campaign.config.validityOption",
763
+ type: "validity_option"
764
+ }
765
+ ]
766
+ },
767
+ {
768
+ name: "connect.template.location",
769
+ fields: [
770
+ {
771
+ label: "connect.template.target_location",
772
+ property: "campaign.targetLocation",
773
+ type: "target_location"
774
+ }
775
+ ]
776
+ }
777
+ // {
778
+ // name: 'connect.template.notify_audience',
779
+ // fields: [
780
+ // {
781
+ // label: 'connect.template.send_notification',
782
+ // property: 'campaign.notify',
783
+ // type: 'switch',
784
+ // },
785
+ // ],
786
+ // },
787
+ ]
788
+ }
789
+ ],
790
+ defaultValue: {
791
+ // TODO: templateId use in db
792
+ templateId: "",
793
+ campaign: {
794
+ collectible: "",
795
+ type: "POINT",
796
+ // TODO: templateId use in db
797
+ templateId: "",
798
+ name: "",
799
+ description: "",
800
+ image: "",
801
+ event: {
802
+ type: "BILL_COMPLETED",
803
+ rule: t.scaffoldGroup()
804
+ },
805
+ group: null,
806
+ targetLocation: null,
807
+ timeframeOptions: {
808
+ type: "timeframe",
809
+ property: "__now"
810
+ },
811
+ earningOption: {
812
+ type: "FIXED",
813
+ amount: 1
814
+ },
815
+ config: {
816
+ validityOption: {}
817
+ }
818
+ }
819
+ }
820
+ },
821
+ COIN: {
822
+ name: "Point Template",
823
+ description: "Point template for campaign creation.",
824
+ steps: [
825
+ {
826
+ name: "connect.template.general_information",
827
+ groups: [
828
+ {
829
+ name: "connect.template.general",
830
+ fields: [
831
+ {
832
+ label: "connect.template.campaign_name",
833
+ property: "campaign.name",
834
+ type: "text"
835
+ },
836
+ {
837
+ label: "connect.template.campaign_description",
838
+ property: "campaign.description",
839
+ type: "textarea"
840
+ },
841
+ {
842
+ label: "connect.template.campaign_period",
843
+ property: "campaign.timeframeOptions",
844
+ type: "timeframe"
845
+ }
846
+ ]
847
+ },
848
+ {
849
+ name: "connect.template.trigger",
850
+ fields: [
851
+ {
852
+ label: void 0,
853
+ property: "campaign.event.type",
854
+ type: "trigger",
855
+ extras: "campaign.type"
856
+ }
857
+ ]
858
+ },
859
+ {
860
+ name: void 0,
861
+ fields: [
862
+ {
863
+ label: void 0,
864
+ property: "campaign.event.rule.rules.g_schedule",
865
+ type: "rule_schedule",
866
+ extras: "campaign.timeframeOptions"
867
+ }
868
+ ],
869
+ condition: {
870
+ property: "campaign.event.type",
871
+ value: "SCHEDULE"
872
+ }
873
+ }
874
+ ]
875
+ },
876
+ {
877
+ name: "connect.template.terms_conditions",
878
+ groups: [
879
+ {
880
+ name: "connect.template.time_limitation",
881
+ fields: [
882
+ {
883
+ label: void 0,
884
+ property: "campaign.event.rule",
885
+ type: "rule_time",
886
+ extras: "campaign.type"
887
+ }
888
+ ],
889
+ condition: {
890
+ not: !0,
891
+ property: "campaign.event.type",
892
+ value: "SCHEDULE"
893
+ }
894
+ },
895
+ {
896
+ name: "connect.template.spending_criteria",
897
+ fields: [
898
+ {
899
+ label: void 0,
900
+ property: "campaign.event.rule",
901
+ type: "rule_bill"
902
+ }
903
+ ],
904
+ condition: {
905
+ property: "campaign.event.type",
906
+ value: "BILL_COMPLETED"
907
+ }
908
+ },
909
+ {
910
+ name: "connect.template.feedback_criteria",
911
+ fields: [
912
+ {
913
+ label: void 0,
914
+ property: "campaign.event.rule",
915
+ type: "rule_feedback"
916
+ }
917
+ ],
918
+ condition: {
919
+ property: "campaign.event.type",
920
+ value: "FEEDBACK"
921
+ }
922
+ },
923
+ {
924
+ name: "connect.template.target_audience",
925
+ fields: [
926
+ {
927
+ label: void 0,
928
+ property: "campaign.event.rule",
929
+ type: "rule_user"
930
+ }
931
+ ]
932
+ }
933
+ ]
934
+ },
935
+ {
936
+ name: "connect.template.configuration",
937
+ groups: [
938
+ {
939
+ name: "connect.template.earning_type",
940
+ fields: [
941
+ {
942
+ label: void 0,
943
+ property: "campaign.earningOption",
944
+ type: "earning_option",
945
+ extras: ""
946
+ },
947
+ {
948
+ label: void 0,
949
+ property: "campaign.config.validityOption",
950
+ type: "validity_option"
951
+ }
952
+ ]
953
+ },
954
+ {
955
+ name: "connect.template.location",
956
+ fields: [
957
+ {
958
+ label: "connect.template.target_location",
959
+ property: "campaign.targetLocation",
960
+ type: "target_location"
961
+ }
962
+ ]
963
+ }
964
+ // {
965
+ // name: 'connect.template.notify_audience',
966
+ // fields: [
967
+ // {
968
+ // label: 'connect.template.send_notification',
969
+ // property: 'campaign.notify',
970
+ // type: 'switch',
971
+ // },
972
+ // ],
973
+ // },
974
+ ]
975
+ }
976
+ ],
977
+ defaultValue: {
978
+ // TODO: templateId use in db
979
+ templateId: "",
980
+ campaign: {
981
+ collectible: "",
982
+ type: "COIN",
983
+ // TODO: templateId use in db
984
+ templateId: "",
985
+ name: "",
986
+ description: "",
987
+ image: "",
988
+ event: {
989
+ type: "BILL_COMPLETED",
990
+ rule: t.scaffoldGroup()
991
+ },
992
+ group: null,
993
+ targetLocation: null,
994
+ timeframeOptions: {
995
+ type: "timeframe",
996
+ property: "__now"
997
+ },
998
+ earningOption: {
999
+ type: "FIXED",
1000
+ amount: 1
1001
+ },
1002
+ config: {
1003
+ validityOption: {}
1004
+ }
1005
+ }
1006
+ }
1007
+ },
1008
+ CREDIT: {
1009
+ name: "Credit Template",
1010
+ description: "Credit template for campaign creation.",
1011
+ steps: [
1012
+ {
1013
+ name: "connect.template.general_information",
1014
+ groups: [
1015
+ {
1016
+ name: "connect.template.general",
1017
+ fields: [
1018
+ {
1019
+ label: "connect.template.campaign_name",
1020
+ property: "campaign.name",
1021
+ type: "text"
1022
+ },
1023
+ {
1024
+ label: "connect.template.campaign_description",
1025
+ property: "campaign.description",
1026
+ type: "textarea"
1027
+ },
1028
+ {
1029
+ label: "connect.template.campaign_period",
1030
+ property: "campaign.timeframeOptions",
1031
+ type: "timeframe"
1032
+ }
1033
+ ]
1034
+ },
1035
+ {
1036
+ name: "connect.template.trigger",
1037
+ fields: [
1038
+ {
1039
+ label: void 0,
1040
+ property: "campaign.event.type",
1041
+ type: "trigger",
1042
+ extras: "campaign.type"
1043
+ }
1044
+ ]
1045
+ },
1046
+ {
1047
+ name: void 0,
1048
+ fields: [
1049
+ {
1050
+ label: void 0,
1051
+ property: "campaign.event.rule.rules.g_schedule",
1052
+ type: "rule_schedule",
1053
+ extras: "campaign.timeframeOptions"
1054
+ }
1055
+ ],
1056
+ condition: {
1057
+ property: "campaign.event.type",
1058
+ value: "SCHEDULE"
1059
+ }
1060
+ }
1061
+ ]
1062
+ },
1063
+ {
1064
+ name: "connect.template.terms_conditions",
1065
+ groups: [
1066
+ {
1067
+ name: "connect.template.time_limitation",
1068
+ fields: [
1069
+ {
1070
+ label: void 0,
1071
+ property: "campaign.event.rule",
1072
+ type: "rule_time",
1073
+ extras: "campaign.type"
1074
+ }
1075
+ ],
1076
+ condition: {
1077
+ not: !0,
1078
+ property: "campaign.event.type",
1079
+ value: "SCHEDULE"
1080
+ }
1081
+ },
1082
+ {
1083
+ name: "connect.template.spending_criteria",
1084
+ fields: [
1085
+ {
1086
+ label: void 0,
1087
+ property: "campaign.event.rule",
1088
+ type: "rule_bill"
1089
+ }
1090
+ ],
1091
+ condition: {
1092
+ property: "campaign.event.type",
1093
+ value: "BILL_COMPLETED"
1094
+ }
1095
+ },
1096
+ {
1097
+ name: "connect.template.feedback_criteria",
1098
+ fields: [
1099
+ {
1100
+ label: void 0,
1101
+ property: "campaign.event.rule",
1102
+ type: "rule_feedback"
1103
+ }
1104
+ ],
1105
+ condition: {
1106
+ property: "campaign.event.type",
1107
+ value: "FEEDBACK"
1108
+ }
1109
+ },
1110
+ {
1111
+ name: "connect.template.target_audience",
1112
+ fields: [
1113
+ {
1114
+ label: void 0,
1115
+ property: "campaign.event.rule",
1116
+ type: "rule_user"
1117
+ }
1118
+ ]
1119
+ }
1120
+ ]
1121
+ },
1122
+ {
1123
+ name: "connect.template.configuration",
1124
+ groups: [
1125
+ {
1126
+ name: "connect.template.earning_type",
1127
+ fields: [
1128
+ {
1129
+ label: void 0,
1130
+ property: "campaign.earningOption",
1131
+ type: "earning_option",
1132
+ extras: ""
1133
+ },
1134
+ {
1135
+ label: void 0,
1136
+ property: "campaign.config.validityOption",
1137
+ type: "validity_option"
1138
+ }
1139
+ ]
1140
+ },
1141
+ {
1142
+ name: "connect.template.location",
1143
+ fields: [
1144
+ {
1145
+ label: "connect.template.target_location",
1146
+ property: "campaign.targetLocation",
1147
+ type: "target_location"
1148
+ }
1149
+ ]
1150
+ }
1151
+ // {
1152
+ // name: 'connect.template.notify_audience',
1153
+ // fields: [
1154
+ // {
1155
+ // label: 'connect.template.send_notification',
1156
+ // property: 'campaign.notify',
1157
+ // type: 'switch',
1158
+ // },
1159
+ // ],
1160
+ // },
1161
+ ]
1162
+ }
1163
+ ],
1164
+ defaultValue: {
1165
+ // TODO: templateId use in db
1166
+ templateId: "",
1167
+ campaign: {
1168
+ collectible: "",
1169
+ type: "CREDIT",
1170
+ // TODO: templateId use in db
1171
+ templateId: "",
1172
+ name: "",
1173
+ description: "",
1174
+ image: "",
1175
+ event: {
1176
+ type: "BILL_COMPLETED",
1177
+ rule: t.scaffoldGroup()
1178
+ },
1179
+ group: null,
1180
+ targetLocation: null,
1181
+ timeframeOptions: {
1182
+ type: "timeframe",
1183
+ property: "__now"
1184
+ },
1185
+ earningOption: {
1186
+ type: "FIXED",
1187
+ amount: 1
1188
+ },
1189
+ config: {
1190
+ validityOption: {
1191
+ validForDay: 1
1192
+ }
1193
+ }
1194
+ }
1195
+ }
1196
+ },
1197
+ GAME: {
1198
+ name: "Token Template",
1199
+ description: "Token template for campaign creation.",
1200
+ steps: [
1201
+ {
1202
+ name: "connect.template.general_information",
1203
+ groups: [
1204
+ {
1205
+ name: "connect.template.general",
1206
+ fields: [
1207
+ {
1208
+ label: "connect.template.campaign_name",
1209
+ property: "campaign.name",
1210
+ type: "text"
1211
+ },
1212
+ {
1213
+ label: "connect.template.campaign_description",
1214
+ property: "campaign.description",
1215
+ type: "textarea"
1216
+ },
1217
+ {
1218
+ label: "connect.template.campaign_period",
1219
+ property: "campaign.timeframeOptions",
1220
+ type: "timeframe"
1221
+ }
1222
+ ]
1223
+ },
1224
+ {
1225
+ name: "connect.template.trigger",
1226
+ fields: [
1227
+ {
1228
+ label: void 0,
1229
+ property: "campaign.event.type",
1230
+ type: "trigger",
1231
+ extras: "campaign.type"
1232
+ }
1233
+ ]
1234
+ },
1235
+ {
1236
+ name: void 0,
1237
+ fields: [
1238
+ {
1239
+ label: void 0,
1240
+ property: "campaign.event.rule.rules.g_schedule",
1241
+ type: "rule_schedule",
1242
+ extras: "campaign.timeframeOptions"
1243
+ }
1244
+ ],
1245
+ condition: {
1246
+ property: "campaign.event.type",
1247
+ value: "SCHEDULE"
1248
+ }
1249
+ }
1250
+ ]
1251
+ },
1252
+ {
1253
+ name: "connect.template.terms_conditions",
1254
+ groups: [
1255
+ {
1256
+ name: "connect.template.time_limitation",
1257
+ fields: [
1258
+ {
1259
+ label: void 0,
1260
+ property: "campaign.event.rule",
1261
+ type: "rule_time",
1262
+ extras: "campaign.type"
1263
+ }
1264
+ ],
1265
+ condition: {
1266
+ not: !0,
1267
+ property: "campaign.event.type",
1268
+ value: "SCHEDULE"
1269
+ }
1270
+ },
1271
+ {
1272
+ name: "connect.template.spending_criteria",
1273
+ fields: [
1274
+ {
1275
+ label: void 0,
1276
+ property: "campaign.event.rule",
1277
+ type: "rule_bill"
1278
+ }
1279
+ ],
1280
+ condition: {
1281
+ property: "campaign.event.type",
1282
+ value: "BILL_COMPLETED"
1283
+ }
1284
+ },
1285
+ {
1286
+ name: "connect.template.feedback_criteria",
1287
+ fields: [
1288
+ {
1289
+ label: void 0,
1290
+ property: "campaign.event.rule",
1291
+ type: "rule_feedback"
1292
+ }
1293
+ ],
1294
+ condition: {
1295
+ property: "campaign.event.type",
1296
+ value: "FEEDBACK"
1297
+ }
1298
+ },
1299
+ {
1300
+ name: "connect.template.target_audience",
1301
+ fields: [
1302
+ {
1303
+ label: void 0,
1304
+ property: "campaign.event.rule",
1305
+ type: "rule_user"
1306
+ }
1307
+ ]
1308
+ }
1309
+ ]
1310
+ },
1311
+ {
1312
+ name: "connect.template.configuration",
1313
+ groups: [
1314
+ {
1315
+ name: "connect.template.earning_type",
1316
+ fields: [
1317
+ {
1318
+ label: void 0,
1319
+ property: "campaign.earningOption",
1320
+ type: "earning_option",
1321
+ extras: ""
1322
+ },
1323
+ {
1324
+ label: void 0,
1325
+ property: "campaign.config.validityOption",
1326
+ type: "validity_option"
1327
+ }
1328
+ ]
1329
+ },
1330
+ {
1331
+ name: "connect.template.location",
1332
+ fields: [
1333
+ {
1334
+ label: "connect.template.target_location",
1335
+ property: "campaign.targetLocation",
1336
+ type: "target_location"
1337
+ }
1338
+ ]
1339
+ }
1340
+ ]
1341
+ },
1342
+ {
1343
+ name: "connect.template.game_configuration",
1344
+ groups: [
1345
+ {
1346
+ name: "connect.template.game_type",
1347
+ fields: [
1348
+ {
1349
+ label: "connect.template.select_game",
1350
+ property: "configs.extras.gameType",
1351
+ type: "game_type"
1352
+ }
1353
+ ]
1354
+ }
1355
+ ]
1356
+ },
1357
+ {
1358
+ name: "connect.template.reward_pool",
1359
+ groups: [
1360
+ {
1361
+ name: "connect.template.reward_pool",
1362
+ fields: [
1363
+ {
1364
+ label: "Configure the reward type and weightage given to your customer.",
1365
+ property: "campaign.game.rewards",
1366
+ type: "reward_pool"
1367
+ }
1368
+ ]
1369
+ }
1370
+ ]
1371
+ }
1372
+ ],
1373
+ defaultValue: {
1374
+ // TODO: templateId use in db
1375
+ templateId: "",
1376
+ campaign: {
1377
+ collectible: "",
1378
+ type: "GAME",
1379
+ // TODO: templateId use in db
1380
+ templateId: "",
1381
+ name: "",
1382
+ description: "",
1383
+ image: "",
1384
+ event: {
1385
+ type: "BILL_COMPLETED",
1386
+ rule: t.scaffoldGroup()
1387
+ },
1388
+ group: null,
1389
+ targetLocation: null,
1390
+ timeframeOptions: {
1391
+ type: "timeframe",
1392
+ property: "__now"
1393
+ },
1394
+ earningOption: {
1395
+ type: "FIXED",
1396
+ amount: 1
1397
+ },
1398
+ config: {
1399
+ validityOption: {}
1400
+ },
1401
+ game: {
1402
+ event: {
1403
+ type: "GAME_COMPLETED",
1404
+ rule: t.scaffoldGroup()
1405
+ },
1406
+ name: "rewardpool_",
1407
+ targetLocation: null,
1408
+ timeframeOptions: {
1409
+ type: "timeframe",
1410
+ property: "__now"
1411
+ },
1412
+ type: "REWARD_POOL",
1413
+ rewards: []
1414
+ }
1415
+ },
1416
+ configs: o("GAME", {
1417
+ name: "Token",
1418
+ business: null,
1419
+ noCampaign: !1
1420
+ })
1421
+ }
1422
+ },
1423
+ MISSION: {
1424
+ name: "Mission Template",
1425
+ description: "Mission template for campaign creation.",
1426
+ steps: [
1427
+ {
1428
+ name: "connect.template.general_information",
1429
+ groups: [
1430
+ {
1431
+ name: "connect.template.general",
1432
+ fields: [
1433
+ {
1434
+ label: "connect.template.campaign_name",
1435
+ property: "campaign.name",
1436
+ type: "text"
1437
+ },
1438
+ {
1439
+ label: "connect.template.campaign_description",
1440
+ property: "campaign.description",
1441
+ type: "textarea"
1442
+ },
1443
+ {
1444
+ label: "connect.template.campaign_period",
1445
+ property: "campaign.timeframeOptions",
1446
+ type: "timeframe"
1447
+ }
1448
+ ]
1449
+ },
1450
+ {
1451
+ name: "connect.template.trigger",
1452
+ fields: [
1453
+ {
1454
+ label: void 0,
1455
+ property: "campaign.event.type",
1456
+ type: "trigger",
1457
+ extras: "campaign.type"
1458
+ }
1459
+ ]
1460
+ },
1461
+ {
1462
+ name: void 0,
1463
+ fields: [
1464
+ {
1465
+ label: void 0,
1466
+ property: "campaign.event.rule.rules.g_schedule",
1467
+ type: "rule_schedule",
1468
+ extras: "campaign.timeframeOptions"
1469
+ }
1470
+ ],
1471
+ condition: {
1472
+ property: "campaign.event.type",
1473
+ value: "SCHEDULE"
1474
+ }
1475
+ }
1476
+ ]
1477
+ },
1478
+ {
1479
+ name: "connect.template.terms_conditions",
1480
+ groups: [
1481
+ {
1482
+ name: "connect.template.time_limitation",
1483
+ fields: [
1484
+ {
1485
+ label: void 0,
1486
+ property: "campaign.event.rule",
1487
+ type: "rule_time",
1488
+ extras: "campaign.type"
1489
+ }
1490
+ ],
1491
+ condition: {
1492
+ not: !0,
1493
+ property: "campaign.event.type",
1494
+ value: "SCHEDULE"
1495
+ }
1496
+ },
1497
+ {
1498
+ name: "connect.template.feedback_criteria",
1499
+ fields: [
1500
+ {
1501
+ label: void 0,
1502
+ property: "campaign.event.rule",
1503
+ type: "rule_feedback"
1504
+ }
1505
+ ],
1506
+ condition: {
1507
+ property: "campaign.event.type",
1508
+ value: "FEEDBACK"
1509
+ }
1510
+ },
1511
+ {
1512
+ name: "connect.template.target_audience",
1513
+ fields: [
1514
+ {
1515
+ label: void 0,
1516
+ property: "campaign.event.rule",
1517
+ type: "rule_user"
1518
+ }
1519
+ ]
1520
+ },
1521
+ {
1522
+ name: "connect.template.spending_criteria",
1523
+ fields: [
1524
+ {
1525
+ label: void 0,
1526
+ property: "campaign.event.rule",
1527
+ type: "rule_bill"
1528
+ }
1529
+ ],
1530
+ condition: {
1531
+ property: "campaign.event.type",
1532
+ value: "BILL_COMPLETED"
1533
+ }
1534
+ }
1535
+ ]
1536
+ },
1537
+ {
1538
+ name: "connect.template.configuration",
1539
+ groups: [
1540
+ // {
1541
+ // name: 'Earning type',
1542
+ // fields: [
1543
+ // {
1544
+ // label: undefined,
1545
+ // property: 'campaign.earningOption',
1546
+ // type: 'earning_option',
1547
+ // extras: 'campaign',
1548
+ // },
1549
+ // ],
1550
+ // },
1551
+ {
1552
+ name: "connect.template.location",
1553
+ fields: [
1554
+ {
1555
+ label: "connect.template.target_location",
1556
+ property: "campaign.targetLocation",
1557
+ type: "target_location"
1558
+ }
1559
+ ]
1560
+ }
1561
+ ]
1562
+ },
1563
+ {
1564
+ name: "connect.template.mission_configuration",
1565
+ groups: [
1566
+ {
1567
+ name: void 0,
1568
+ fields: [
1569
+ {
1570
+ label: void 0,
1571
+ property: "campaign.mission",
1572
+ type: "mission"
1573
+ }
1574
+ ]
1575
+ },
1576
+ {
1577
+ name: "connect.template.earning_type",
1578
+ fields: [
1579
+ {
1580
+ label: void 0,
1581
+ property: "campaign.earningOption",
1582
+ type: "earning_option",
1583
+ extras: ""
1584
+ }
1585
+ ]
1586
+ },
1587
+ {
1588
+ name: "connect.template.validity_configuration",
1589
+ fields: [
1590
+ {
1591
+ label: void 0,
1592
+ property: "campaign.config.validityOption",
1593
+ type: "validity_option"
1594
+ }
1595
+ ]
1596
+ },
1597
+ {
1598
+ name: "connect.template.mission_participation",
1599
+ fields: [
1600
+ {
1601
+ label: void 0,
1602
+ property: "configs.options",
1603
+ type: "collectible_options",
1604
+ extras: "campaign.type"
1605
+ }
1606
+ ]
1607
+ }
1608
+ ]
1609
+ },
1610
+ {
1611
+ name: "connect.template.reward_setup",
1612
+ groups: [
1613
+ {
1614
+ name: "connect.template.configure_reward",
1615
+ fields: [
1616
+ {
1617
+ label: "connect.template.configure_reward_customer",
1618
+ property: "campaign.rewards",
1619
+ type: "mission_pool",
1620
+ extras: "campaign"
1621
+ }
1622
+ ]
1623
+ }
1624
+ ]
1625
+ }
1626
+ ],
1627
+ defaultValue: {
1628
+ // TODO: templateId use in db
1629
+ templateId: "",
1630
+ campaign: {
1631
+ type: "MISSION",
1632
+ business: "",
1633
+ collectible: "",
1634
+ name: "",
1635
+ earningOption: {
1636
+ amount: 1,
1637
+ type: "FIXED"
1638
+ },
1639
+ event: {
1640
+ type: "BILL_COMPLETED",
1641
+ rule: t.scaffoldGroup()
1642
+ },
1643
+ mission: {
1644
+ type: "STAMP",
1645
+ end: 10
1646
+ },
1647
+ rewards: [],
1648
+ config: {
1649
+ validityOption: {
1650
+ followFirstReceive: !0
1651
+ }
1652
+ },
1653
+ timeframeOptions: {
1654
+ type: "timeframe"
1655
+ }
1656
+ },
1657
+ configs: o("STAMP", {
1658
+ business: null,
1659
+ noCampaign: !1
1660
+ })
1661
+ }
1662
+ },
1663
+ GRAB: {
1664
+ name: "Grab Campaign Template",
1665
+ description: "Grab campaign template for campaign creation.",
1666
+ steps: [
1667
+ {
1668
+ name: "connect.template.general_information",
1669
+ groups: [
1670
+ {
1671
+ name: "connect.template.general",
1672
+ fields: [
1673
+ {
1674
+ label: "connect.template.campaign_name",
1675
+ property: "campaign.name",
1676
+ type: "text"
1677
+ },
1678
+ {
1679
+ label: "connect.template.campaign_period",
1680
+ property: "campaign.timeframeOptions",
1681
+ type: "timeframe"
1682
+ }
1683
+ ]
1684
+ }
1685
+ ]
1686
+ },
1687
+ {
1688
+ name: "connect.template.discount",
1689
+ groups: [
1690
+ {
1691
+ name: "connect.template.discount",
1692
+ fields: [
1693
+ {
1694
+ label: void 0,
1695
+ property: "campaign.discount",
1696
+ type: "grab_effect"
1697
+ }
1698
+ ]
1699
+ },
1700
+ {
1701
+ name: "connect.template.grab_quota",
1702
+ fields: [
1703
+ {
1704
+ label: void 0,
1705
+ property: "campaign.quotas",
1706
+ type: "grab_quota"
1707
+ }
1708
+ ]
1709
+ },
1710
+ {
1711
+ name: "connect.template.grab_condition",
1712
+ fields: [
1713
+ {
1714
+ label: void 0,
1715
+ property: "campaign.conditions",
1716
+ type: "grab_conditions"
1717
+ }
1718
+ ]
1719
+ }
1720
+ ]
1721
+ },
1722
+ {
1723
+ name: "connect.template.terms_conditions",
1724
+ groups: [
1725
+ {
1726
+ name: "Location",
1727
+ fields: [
1728
+ {
1729
+ label: "Target location",
1730
+ property: "campaign.targetLocation",
1731
+ type: "target_location"
1732
+ }
1733
+ ]
1734
+ }
1735
+ ]
1736
+ }
1737
+ ],
1738
+ defaultValue: {
1739
+ templateId: "",
1740
+ campaign: {
1741
+ type: "GRAB",
1742
+ templateId: "",
1743
+ name: "",
1744
+ description: "",
1745
+ image: "",
1746
+ discount: null,
1747
+ group: null,
1748
+ event: {
1749
+ type: "MAKING_ORDER",
1750
+ rule: t.scaffoldGroup()
1751
+ },
1752
+ quotas: {
1753
+ totalCount: 10,
1754
+ totalCountPerUser: 2
1755
+ },
1756
+ conditions: {
1757
+ startTime: "",
1758
+ endTime: "",
1759
+ eaterType: "all",
1760
+ minBasketAmount: 10,
1761
+ bundleQuantity: 2,
1762
+ workingHour: {
1763
+ sun: {
1764
+ periods: [
1765
+ {
1766
+ startTime: "11:30",
1767
+ endTime: "14:00"
1768
+ }
1769
+ ]
1770
+ },
1771
+ mon: {
1772
+ periods: [
1773
+ {
1774
+ startTime: "11:30",
1775
+ endTime: "14:00"
1776
+ }
1777
+ ]
1778
+ },
1779
+ tue: {
1780
+ periods: [
1781
+ {
1782
+ startTime: "11:30",
1783
+ endTime: "14:00"
1784
+ }
1785
+ ]
1786
+ },
1787
+ wed: {
1788
+ periods: [
1789
+ {
1790
+ startTime: "11:30",
1791
+ endTime: "14:00"
1792
+ }
1793
+ ]
1794
+ },
1795
+ thu: {
1796
+ periods: [
1797
+ {
1798
+ startTime: "11:30",
1799
+ endTime: "14:00"
1800
+ }
1801
+ ]
1802
+ },
1803
+ fri: {
1804
+ periods: [
1805
+ {
1806
+ startTime: "11:30",
1807
+ endTime: "14:00"
1808
+ }
1809
+ ]
1810
+ },
1811
+ sat: {
1812
+ periods: [
1813
+ {
1814
+ startTime: "11:30",
1815
+ endTime: "14:00"
1816
+ }
1817
+ ]
1818
+ }
1819
+ }
1820
+ },
1821
+ targetLocation: null,
1822
+ timeframeOptions: {
1823
+ type: "timeframe",
1824
+ property: "__now"
1825
+ }
1826
+ }
1827
+ }
1828
+ }
1829
+ };
1830
+ t.scaffoldGroup(), o("STAMP", {
1831
+ business: null,
1832
+ noCampaign: !1
1833
+ });
1834
+ ({
1835
+ ...t.scaffoldGroup()
1836
+ }, o("VOUCHER", {
1837
+ name: "",
1838
+ business: null,
1839
+ noCampaign: !1
1840
+ }));
1841
+ ({
1842
+ ...t.scaffoldGroup()
1843
+ }, o("VOUCHER", {
1844
+ name: "",
1845
+ business: null,
1846
+ noCampaign: !1
1847
+ }));
1848
+ ({
1849
+ ...t.scaffoldGroup()
1850
+ });
1851
+ ({
1852
+ ...t.scaffoldGroup()
1853
+ });
1854
+ ({
1855
+ ...t.scaffoldGroup()
1856
+ });
1857
+ t.setRuleToGroup(
1858
+ t.scaffoldGroup(),
1859
+ t.setRuleToGroup(
1860
+ t.scaffoldGroup("g_user"),
1861
+ [t.constructEntry("user.member", "_isIn", [!0])],
1862
+ "&&"
1863
+ )
1864
+ );
1865
+ t.setRuleToGroup(t.scaffoldGroup(), [
1866
+ t.setRuleToGroup(
1867
+ t.scaffoldGroup("g_user"),
1868
+ [
1869
+ t.constructEntry("user.birthday", "_isRange", {
1870
+ op: "this",
1871
+ unit: "month",
1872
+ ignoreYear: !0
1873
+ })
1874
+ ],
1875
+ "&&"
1876
+ )
1877
+ ]);
1878
+ ({
1879
+ ...t.scaffoldGroup()
1880
+ });
1881
+ t.setRuleToGroup(t.scaffoldGroup(), [
1882
+ t.setRuleToGroup(
1883
+ t.scaffoldGroup("g_user"),
1884
+ [
1885
+ t.constructEntry("user.birthday", "_isRange", {
1886
+ op: "this",
1887
+ unit: "month",
1888
+ ignoreYear: !0
1889
+ })
1890
+ ],
1891
+ "&&"
1892
+ )
1893
+ ]);
1894
+ ({
1895
+ ...t.scaffoldGroup()
1896
+ });
1897
+ ({
1898
+ ...t.scaffoldGroup()
1899
+ }, o("VOUCHER", {
1900
+ name: "",
1901
+ business: null,
1902
+ noCampaign: !1
1903
+ }));
1904
+ t.setRuleToGroup(
1905
+ t.scaffoldGroup(),
1906
+ t.setRuleToGroup(
1907
+ t.scaffoldGroup("g_schedule"),
1908
+ [
1909
+ t.constructEntry("trigger.date", "_isOnDate", ""),
1910
+ t.constructEntry("trigger.time", "_isOnTime", "00:00")
1911
+ ],
1912
+ "&&"
1913
+ )
1914
+ );
1915
+ t.setRuleToGroup(t.scaffoldGroup(), [
1916
+ t.setRuleToGroup(
1917
+ t.scaffoldGroup("g_schedule"),
1918
+ [
1919
+ t.constructEntry(
1920
+ "trigger.date",
1921
+ "_rrule",
1922
+ "RRULE:FREQ=MONTHLY;INTERVAL=1;BYHOUR=0;BYMINUTE=0;BYSECOND=0;WKST=SU;BYMONTHDAY=1"
1923
+ ),
1924
+ t.constructEntry("trigger.time", "_isOnTime", "00:00")
1925
+ ],
1926
+ "&&"
1927
+ )
1928
+ ]);
1929
+ ({ ...t.scaffoldGroup() });
1930
+ t.setRuleToGroup(
1931
+ t.scaffoldGroup(),
1932
+ t.setRuleToGroup(
1933
+ t.scaffoldGroup("g_schedule"),
1934
+ [
1935
+ t.constructEntry(
1936
+ "trigger.date",
1937
+ "_rrule",
1938
+ "RRULE:FREQ=WEEKLY;INTERVAL=1;BYHOUR=0;BYMINUTE=0;BYSECOND=0;WKST=SU;BYDAY=MO"
1939
+ ),
1940
+ t.constructEntry("trigger.time", "_isOnTime", "00:00")
1941
+ ],
1942
+ "&&"
1943
+ )
1944
+ );
1945
+ t.scaffoldGroup(), t.scaffoldGroup(), o("GAME", {
1946
+ name: "Token",
1947
+ business: null,
1948
+ noCampaign: !1
1949
+ });
1950
+ ({
1951
+ ...t.scaffoldGroup()
1952
+ }, o("VOUCHER", {
1953
+ name: "",
1954
+ business: null,
1955
+ noCampaign: !1
1956
+ }));
1957
+ t.setRuleToGroup(t.scaffoldGroup(), [
1958
+ t.setRuleToGroup(
1959
+ t.scaffoldGroup("g_schedule"),
1960
+ [
1961
+ t.constructEntry(
1962
+ "trigger.date",
1963
+ "_rrule",
1964
+ "RRULE:FREQ=MONTHLY;INTERVAL=1;BYHOUR=0;BYMINUTE=0;BYSECOND=0;WKST=SU;BYMONTHDAY=1"
1965
+ ),
1966
+ t.constructEntry("trigger.time", "_isOnTime", "00:00")
1967
+ ],
1968
+ "&&"
1969
+ ),
1970
+ t.setRuleToGroup(
1971
+ t.scaffoldGroup("g_user"),
1972
+ [
1973
+ t.constructEntry("user.birthday", "_isRange", {
1974
+ op: "this",
1975
+ unit: "month",
1976
+ ignoreYear: !0
1977
+ })
1978
+ ],
1979
+ "&&"
1980
+ )
1981
+ ]), o("VOUCHER", {
1982
+ name: "",
1983
+ business: null,
1984
+ noCampaign: !1
1985
+ });
1986
+ ({
1987
+ ...t.scaffoldGroup()
1988
+ });
1989
+ ({
1990
+ ...t.scaffoldGroup()
1991
+ });
1992
+ ({
1993
+ ...t.scaffoldGroup()
1994
+ });
1995
+ ({
1996
+ ...t.scaffoldGroup()
1997
+ });
1998
+ ({
1999
+ ...t.scaffoldGroup()
2000
+ });
2001
+ ({
2002
+ ...t.scaffoldGroup()
2003
+ });
2004
+ const w = e.enum([
2005
+ "MEMBER_REWARD",
2006
+ "PAID_LOYALTY",
2007
+ "COLLECT_FEEDBACK",
2008
+ "REVISITING",
2009
+ "SPEND_MORE",
2010
+ "PRODUCT_LAUNCHING",
2011
+ "BROADCAST",
2012
+ "BIRTHDAY",
2013
+ "GAME"
2014
+ ]), A = e.enum([
2015
+ "text",
2016
+ "number",
2017
+ "textarea",
2018
+ "trigger",
2019
+ "timeframe",
2020
+ "image",
2021
+ "switch",
2022
+ "collectible_options",
2023
+ "target_location",
2024
+ "effect",
2025
+ "message",
2026
+ "earning_option",
2027
+ "validity_option",
2028
+ "game_type",
2029
+ "reward_pool",
2030
+ "mission",
2031
+ "mission_type",
2032
+ "mission_end",
2033
+ "mission_pool",
2034
+ "rule_schedule",
2035
+ "rule_user",
2036
+ "rule_time",
2037
+ "rule_bill",
2038
+ "rule_feedback",
2039
+ "rule_birthday",
2040
+ "promotion_game_type",
2041
+ "grab_effect",
2042
+ "grab_quota",
2043
+ "grab_conditions"
2044
+ ]), F = e.object({
2045
+ label: e.string().optional(),
2046
+ label_locale: e.record(e.string()).nullish(),
2047
+ property: e.string().or(e.any()),
2048
+ type: A,
2049
+ extras: e.string().optional(),
2050
+ isRuleChildren: e.boolean().optional()
2051
+ }), u = e.object({
2052
+ not: e.boolean().optional(),
2053
+ property: e.string(),
2054
+ value: e.any()
2055
+ }), G = e.object({
2056
+ name: e.string().optional(),
2057
+ name_locale: e.record(e.string()).nullish(),
2058
+ fields: e.array(F),
2059
+ condition: u.optional().or(
2060
+ e.array(u)
2061
+ )
2062
+ }), M = e.object({
2063
+ name: e.string(),
2064
+ name_locale: e.record(e.string()).nullish(),
2065
+ groups: e.array(G)
2066
+ });
2067
+ e.object({
2068
+ _id: a,
2069
+ name: e.string(),
2070
+ name_locale: e.record(e.string()).nullish(),
2071
+ description: e.string().nullish(),
2072
+ description_locale: e.record(e.string()).nullish(),
2073
+ steps: e.array(M).min(1),
2074
+ intention: e.array(w),
2075
+ defaultValue: e.any()
2076
+ }).describe(JSON.stringify({ collectionName: "MarketingTemplates" }));
2077
+ const k = {
2078
+ collectionName: "Businesses",
2079
+ transform: {
2080
+ _id: "oid"
2081
+ }
2082
+ };
2083
+ e.object({
2084
+ _id: a,
2085
+ ownerId: e.string(),
2086
+ name: e.string(),
2087
+ credit: e.number(),
2088
+ forceSend: e.boolean().optional()
2089
+ }).describe(i.describe(k));
2090
+ const y = e.enum(["PHONE"]), B = e.enum([
2091
+ "MOCEAN",
2092
+ "SLACK",
2093
+ "SMS",
2094
+ "EMAIL",
2095
+ "WHATSAPP"
2096
+ ]), V = e.enum(["PENDING", "COMPLETED", "FAILED"]), Y = e.enum([
2097
+ "General",
2098
+ "Otp",
2099
+ "Marketing",
2100
+ "Ordering",
2101
+ "MemberInvitation",
2102
+ "MarketingPromotion"
2103
+ ]), K = e.object({
2104
+ type: y
2105
+ }), f = K.extend({
2106
+ type: e.literal(y.enum.PHONE),
2107
+ provider: B,
2108
+ usage: Y.optional()
2109
+ }), W = {
2110
+ collectionName: "Notifications",
2111
+ transform: { _id: "oid", business: "oid" }
2112
+ };
2113
+ e.object({
2114
+ _id: a,
2115
+ business: a,
2116
+ target: e.string(),
2117
+ title: e.string().optional(),
2118
+ message: e.string(),
2119
+ option: f,
2120
+ status: V,
2121
+ ref: e.string().optional()
2122
+ }).describe(i.describe(W));
2123
+ const X = e.object({
2124
+ target: e.string(),
2125
+ title: e.string().optional(),
2126
+ message: e.string(),
2127
+ option: f,
2128
+ ref: e.string().optional()
2129
+ });
2130
+ e.object({
2131
+ campaignId: e.string(),
2132
+ notification: X,
2133
+ business: e.string()
2134
+ });
2135
+ e.object({
2136
+ phone: e.string(),
2137
+ message: e.string()
2138
+ });
2139
+ const _ = e.object({
2140
+ name: e.string().optional(),
2141
+ address: e.string()
2142
+ }), q = e.object({
2143
+ filename: e.string(),
2144
+ content: e.instanceof(Uint8Array)
2145
+ });
2146
+ e.object({
2147
+ from: _.optional(),
2148
+ to: e.array(_),
2149
+ subject: e.string(),
2150
+ html: e.string().optional(),
2151
+ attachments: e.array(q).optional()
2152
+ });
2153
+ e.object({
2154
+ subject: e.string(),
2155
+ body: e.string()
2156
+ });
2157
+ e.object({
2158
+ target: e.string(),
2159
+ message: e.string(),
2160
+ mediaUrl: e.string().optional()
2161
+ });
2162
+ e.enum(["send_notification", "TRIGGER_EVENT"]);
2163
+ e.enum([
2164
+ "campaign.general",
2165
+ "campaign.broadcast",
2166
+ "notification.send",
2167
+ "BILL_CREATE"
2168
+ ]);
2169
+ e.object({
2170
+ claimIds: e.array(e.string()),
2171
+ billId: e.string()
2172
+ });
2173
+ e.object({
2174
+ claimIds: e.array(e.string())
2175
+ });
2176
+ e.object({
2177
+ claimIds: e.array(e.string())
2178
+ });
2179
+ e.object({
2180
+ userId: e.string().optional(),
2181
+ ids: e.array(e.string()),
2182
+ type: e.enum(["DINE_IN", "PICKUP", "DELIVERY"]),
2183
+ restaurantId: e.string(),
2184
+ orderId: e.string().optional()
2185
+ });
2186
+ e.object({
2187
+ claimIds: e.array(e.string()),
2188
+ billId: e.string()
2189
+ });
2190
+ e.object({
2191
+ amount: U,
2192
+ member: e.string(),
2193
+ bill: e.string(),
2194
+ otp: e.string().nullish(),
2195
+ businessId: e.string()
2196
+ });
2197
+ e.object({
2198
+ orderId: e.string()
2199
+ });
2200
+ var b = /* @__PURE__ */ ((n) => (n[n.feedMe = 0] = "feedMe", n[n.business = 1] = "business", n[n.restaurant = 2] = "restaurant", n))(b || {});
2201
+ e.nativeEnum(b);
2202
+ e.enum(["manage", "create", "read", "update", "delete"]);
2203
+ e.enum(["all", "restaurant", "business", "delivery", "agent"]);
2204
+ e.enum(["quota"]);
2205
+ var H = /* @__PURE__ */ ((n) => (n.marketing = "business::marketing", n.campaign = "business::campaign", n.counter = "business::counter", n.permission = "business::permission", n.role = "business::role", n))(H || {});
2206
+ e.nativeEnum(H);
2207
+ e.enum(["restaurant"]);
2208
+ const Q = e.object({
2209
+ label: e.string(),
2210
+ subject: e.union([e.string(), e.array(e.string())]),
2211
+ actions: e.union([e.string(), e.array(e.string())]),
2212
+ fields: e.array(e.string()).optional(),
2213
+ conditions: e.any().optional(),
2214
+ inverted: e.boolean().optional(),
2215
+ reason: e.string().optional()
2216
+ });
2217
+ e.object({
2218
+ _id: a,
2219
+ businessId: e.string(),
2220
+ userId: e.string(),
2221
+ email: e.string().nullish(),
2222
+ phoneNo: e.string().nullish(),
2223
+ permissions: e.array(e.lazy(() => Q))
2224
+ }).describe(
2225
+ i.describe({
2226
+ collectionName: "PermissionUsers",
2227
+ transform: {
2228
+ _id: "oid"
2229
+ }
2230
+ })
2231
+ );
2232
+ const z = e.object({
2233
+ userId: e.string(),
2234
+ level: e.number(),
2235
+ role: e.string().optional(),
2236
+ businessId: e.string().optional(),
2237
+ restaurantId: e.string().optional()
2238
+ }), Z = e.function().args(e.any(), z).returns(e.boolean()), $ = e.function().args(z).returns(e.promise(e.array(e.any())));
2239
+ e.object({
2240
+ isAdmin: Z,
2241
+ getRules: $
2242
+ });
2243
+ e.object({
2244
+ transactions: e.array(j),
2245
+ collections: e.array(J)
2246
+ });
2247
+ const C = e.enum([
2248
+ "ROCK_PAPER_SCISSOR"
2249
+ ]);
2250
+ C.enum.ROCK_PAPER_SCISSOR + "";
2251
+ e.object({
2252
+ type: C
2253
+ });
2254
+ e.object({
2255
+ host: e.string().url(),
2256
+ player: e.string().url(),
2257
+ token: e.string(),
2258
+ roomId: e.string()
2259
+ });
2260
+ e.enum(["FACEBOOK", "INSTAGRAM", "TV", "BRAND_APP"]);
2261
+ const ee = {
2262
+ collectionName: "MarketingMaterials",
2263
+ transform: {
2264
+ _id: "oid",
2265
+ business: "oid"
2266
+ }
2267
+ };
2268
+ e.object({
2269
+ _id: a,
2270
+ business: a,
2271
+ imageUrl: e.string().url(),
2272
+ headline: e.string(),
2273
+ caption: e.string(),
2274
+ editedAt: e.coerce.date()
2275
+ }).describe(i.describe(ee));
2276
+ e.object({
2277
+ id: e.number(),
2278
+ name: e.string(),
2279
+ email: e.string(),
2280
+ phone: e.string(),
2281
+ birthday: e.string(),
2282
+ address: e.string().nullable(),
2283
+ avatar: e.string(),
2284
+ tier: e.string(),
2285
+ visitCount: e.number().nullable(),
2286
+ lastVisit: e.string().nullable(),
2287
+ averageSpending: e.number().nullable(),
2288
+ point: e.number()
2289
+ });
2290
+ e.object({
2291
+ businessId: e.string(),
2292
+ phone: e.string().optional(),
2293
+ email: e.string().optional()
2294
+ });
2295
+ const te = e.enum([
2296
+ "PENDING",
2297
+ "SUCCESS",
2298
+ "FAILED",
2299
+ "RETRYING"
2300
+ ]), ae = {
2301
+ collectionName: "WebhookLogs",
2302
+ transform: {
2303
+ _id: "oid",
2304
+ business: "oid"
2305
+ }
2306
+ };
2307
+ e.object({
2308
+ _id: a,
2309
+ business: a,
2310
+ type: e.string(),
2311
+ payload: e.record(e.any()),
2312
+ status: te,
2313
+ response: e.any().optional(),
2314
+ error: e.string().optional()
2315
+ }).describe(i.describe(ae));
2316
+ const ne = e.enum(["AUTO", "MANUAL"]);
2317
+ e.enum(["IN_PROGRESS", "COMPLETED"]);
2318
+ const T = e.object({
2319
+ _id: a,
2320
+ name: e.string().min(1, "Name is required").max(50),
2321
+ type: ne,
2322
+ event: O.optional()
2323
+ }), oe = e.object({
2324
+ from: e.number().int("Must be integer").min(1, "Min referral count need to start from 1"),
2325
+ to: e.number().int("Must be integer").nullish()
2326
+ }).superRefine((n, N) => {
2327
+ n.from && n.to && n.from > n.to && N.addIssue({
2328
+ code: "custom",
2329
+ message: "Max referral count must be more than min referral count"
2330
+ });
2331
+ }), ie = e.object({
2332
+ threshold: oe,
2333
+ rewards: e.array(a),
2334
+ pf_reward: e.array(d).optional()
2335
+ }), h = e.object({
2336
+ id: e.string(),
2337
+ name: e.string().min(1, "Name is required").max(50, "Name must be less than 50 characters"),
2338
+ rule: E.optional(),
2339
+ rewards: e.array(ie)
2340
+ }), le = {
2341
+ collectionName: "ReferralRecords",
2342
+ transform: {
2343
+ _id: "oid",
2344
+ business: "oid",
2345
+ referer: "oid",
2346
+ referee: "oid",
2347
+ refereeReward: "oid"
2348
+ }
2349
+ }, re = e.object({
2350
+ completedAt: e.coerce.date(),
2351
+ criteria: a,
2352
+ ref: e.string()
2353
+ }), ce = e.object({
2354
+ _id: a,
2355
+ business: a,
2356
+ referer: a,
2357
+ referee: a,
2358
+ criteria: e.array(T),
2359
+ reward: e.array(h),
2360
+ refereeReward: e.array(a).optional(),
2361
+ criteria_progress: e.array(re),
2362
+ status: e.string(),
2363
+ pf_referer: r.optional(),
2364
+ pf_referee: r.optional(),
2365
+ pf_refereeReward: e.array(d).optional()
2366
+ }).describe(i.describe(le));
2367
+ ce.pick({
2368
+ _id: !0,
2369
+ business: !0,
2370
+ referer: !0,
2371
+ referee: !0,
2372
+ criteria_progress: !0,
2373
+ criteria: !0
2374
+ }).extend({
2375
+ pf_referee: r.pick({
2376
+ _id: !0,
2377
+ name: !0,
2378
+ phoneNumber: !0,
2379
+ photoUrl: !0
2380
+ })
2381
+ });
2382
+ const pe = {
2383
+ collectionName: "ReferralProgram",
2384
+ transform: {
2385
+ _id: "oid",
2386
+ business: "oid"
2387
+ }
2388
+ }, v = e.object({
2389
+ _id: a,
2390
+ business: a,
2391
+ term_and_condition: e.string().optional(),
2392
+ refereeReward: e.array(a).optional(),
2393
+ reward: e.array(h),
2394
+ criteria: e.array(T)
2395
+ }).describe(i.describe(pe));
2396
+ e.object({
2397
+ referer: a,
2398
+ referee: a,
2399
+ business: a
2400
+ });
2401
+ e.object({
2402
+ program: v.pick({
2403
+ _id: !0,
2404
+ business: !0,
2405
+ term_and_condition: !0
2406
+ }).extend({
2407
+ reward: h.optional(),
2408
+ pf_refereeReward: e.array(d).optional()
2409
+ }),
2410
+ referralCount: e.number(),
2411
+ successReferralCount: e.number(),
2412
+ referredBy: r.pick({
2413
+ _id: !0,
2414
+ name: !0,
2415
+ phoneNumber: !0,
2416
+ photoUrl: !0
2417
+ }).optional()
2418
+ });
2419
+ v.extend({
2420
+ updateReferralRecord: e.boolean().optional()
2421
+ });
2422
+ const me = e.object({
2423
+ facebookPageId: e.string(),
2424
+ pageName: e.string(),
2425
+ pageProfileImageUrl: e.string(),
2426
+ pageAccessToken: e.string().optional(),
2427
+ locationIds: e.array(a)
2428
+ }), se = e.object({
2429
+ locationId: a.nullable(),
2430
+ googleLocationName: e.string(),
2431
+ displayName: e.string().optional()
2432
+ }), ge = e.object({
2433
+ accessToken: e.string().nullable(),
2434
+ refreshToken: e.string().nullable(),
2435
+ accessTokenExpiresAt: e.date().nullable(),
2436
+ locations: e.array(se)
2437
+ }), de = e.object({
2438
+ token: e.string().nullable(),
2439
+ pages: e.array(me)
2440
+ });
2441
+ e.object({
2442
+ _id: a,
2443
+ businessId: a,
2444
+ google: ge.nullable(),
2445
+ facebook: de.nullable()
2446
+ }).describe(
2447
+ i.describe({
2448
+ collectionName: "ReviewSourceConfig",
2449
+ transform: {
2450
+ _id: "oid",
2451
+ businessId: "oid"
2452
+ }
2453
+ })
2454
+ );
2455
+ e.object({
2456
+ code: e.string(),
2457
+ redirectUri: e.string(),
2458
+ state: e.string()
2459
+ });
2460
+ e.object({
2461
+ locations: e.array(
2462
+ e.object({
2463
+ googleLocationName: e.string(),
2464
+ locationId: e.string().nullable(),
2465
+ displayName: e.string().optional()
2466
+ })
2467
+ )
2468
+ });
2469
+ e.object({
2470
+ token: e.string()
2471
+ });
2472
+ e.object({
2473
+ pages: e.array(
2474
+ e.object({
2475
+ facebookPageId: e.string(),
2476
+ locationIds: e.array(e.string())
2477
+ })
2478
+ )
2479
+ });
2480
+ e.object({
2481
+ _id: e.string(),
2482
+ google: e.object({
2483
+ accessToken: e.string().nullable(),
2484
+ accessTokenExpiresAt: e.string().datetime().nullable(),
2485
+ locations: e.array(
2486
+ e.object({
2487
+ googleLocationName: e.string(),
2488
+ displayName: e.string().optional(),
2489
+ locationId: e.string().nullable()
2490
+ })
2491
+ )
2492
+ }).nullable(),
2493
+ facebook: e.object({
2494
+ token: e.string().nullable(),
2495
+ pages: e.array(
2496
+ e.object({
2497
+ facebookPageId: e.string(),
2498
+ pageName: e.string(),
2499
+ pageProfileImageUrl: e.string(),
2500
+ locationIds: e.array(e.string())
2501
+ })
2502
+ )
2503
+ }).nullable()
2504
+ });
2505
+ const c = e.object({
2506
+ name: e.string(),
2507
+ pictureUrl: e.string(),
2508
+ phoneNumber: e.string().optional()
2509
+ }), he = c.extend({
2510
+ isAnonymous: e.boolean().optional()
2511
+ }), ue = c.extend({
2512
+ id: e.string().optional()
2513
+ }), p = e.object({
2514
+ comment: e.string(),
2515
+ updateTime: e.coerce.date()
2516
+ });
2517
+ e.object({
2518
+ comment: e.string().trim().min(1).max(4096)
2519
+ });
2520
+ const l = e.object({
2521
+ externalId: e.string().optional(),
2522
+ thumbnailUrl: e.string(),
2523
+ thumbnailLabel: e.string(),
2524
+ videoUrl: e.string().optional()
2525
+ }), _e = {
2526
+ collectionName: "Reviews",
2527
+ transform: {
2528
+ _id: "oid",
2529
+ businessId: "oid",
2530
+ reviewerId: "oid",
2531
+ restaurantId: "oid"
2532
+ }
2533
+ }, S = e.enum([
2534
+ "google",
2535
+ "facebook",
2536
+ "feedme",
2537
+ "feedvibe"
2538
+ ]);
2539
+ S.options;
2540
+ e.enum(["google", "facebook"]);
2541
+ const ye = e.enum([
2542
+ "createTime_desc",
2543
+ "createTime_asc",
2544
+ "rating_asc",
2545
+ "rating_desc"
2546
+ ]);
2547
+ e.object({
2548
+ source: S.array().optional(),
2549
+ dateFrom: e.string().datetime({ offset: !0 }).optional(),
2550
+ dateTo: e.string().datetime({ offset: !0 }).optional(),
2551
+ locationId: e.string().optional(),
2552
+ excludeDeleted: e.boolean().optional(),
2553
+ sort: ye.optional(),
2554
+ limit: e.coerce.number().int().positive().optional(),
2555
+ skip: e.coerce.number().int().min(0).optional()
2556
+ });
2557
+ const Ae = e.object({
2558
+ averageScore: e.number(),
2559
+ total: e.number().int().nonnegative(),
2560
+ starCounts: e.array(
2561
+ e.object({
2562
+ star: e.number().int().min(1).max(5),
2563
+ count: e.number().int().nonnegative()
2564
+ })
2565
+ )
2566
+ }), m = e.object({
2567
+ name: e.string(),
2568
+ pictureUrl: e.string().optional(),
2569
+ phoneNumber: e.string().optional()
2570
+ }), fe = m.extend({
2571
+ _id: e.string().optional()
2572
+ }), be = m.extend({
2573
+ _id: e.string()
2574
+ }), He = m.extend({
2575
+ isAnonymous: e.boolean().optional()
2576
+ }), ze = m.extend({
2577
+ id: e.string().optional()
2578
+ }), s = e.object({
2579
+ _id: a,
2580
+ comment: e.string(),
2581
+ createTime: e.coerce.date(),
2582
+ updateTime: e.coerce.date().nullish(),
2583
+ restaurantId: a,
2584
+ restaurantName: e.string()
2585
+ }), Ce = s.extend({
2586
+ source: e.literal("google"),
2587
+ externalId: e.string().min(1),
2588
+ translatedComment: e.string().optional(),
2589
+ reviewer: He.optional(),
2590
+ reply: p.optional(),
2591
+ mediaItems: e.array(l),
2592
+ starRating: e.number(),
2593
+ locationName: e.string(),
2594
+ locationDisplayName: e.string(),
2595
+ originalUrl: e.string().optional()
2596
+ }), Te = s.extend({
2597
+ source: e.literal("facebook"),
2598
+ externalId: e.string().min(1),
2599
+ reviewer: ze.optional(),
2600
+ isPositive: e.boolean().optional(),
2601
+ pageId: e.string(),
2602
+ pageName: e.string()
2603
+ }), ve = s.extend({
2604
+ source: e.literal("feedme"),
2605
+ reviewer: fe.optional(),
2606
+ reply: p.optional(),
2607
+ starRating: e.number(),
2608
+ mediaItems: e.array(l),
2609
+ billId: e.string()
2610
+ }), Se = s.extend({
2611
+ source: e.literal("feedvibe"),
2612
+ externalId: e.string().min(1),
2613
+ reviewer: be.optional(),
2614
+ rating: e.object({
2615
+ overall: e.number(),
2616
+ food: e.number(),
2617
+ service: e.number(),
2618
+ atmosphere: e.number()
2619
+ }),
2620
+ verified: e.boolean(),
2621
+ mediaItems: e.array(l).default([])
2622
+ });
2623
+ e.discriminatedUnion("source", [
2624
+ Ce,
2625
+ Te,
2626
+ ve,
2627
+ Se
2628
+ ]);
2629
+ e.object({
2630
+ comment: e.string(),
2631
+ starRating: e.number(),
2632
+ billId: e.string(),
2633
+ isAnonymous: e.boolean(),
2634
+ mediaItems: e.array(l).optional()
2635
+ });
2636
+ e.object({
2637
+ name: e.string().trim().min(1),
2638
+ phoneNumber: e.string().trim().min(1).optional()
2639
+ });
2640
+ const g = e.object({
2641
+ _id: a,
2642
+ businessId: a,
2643
+ comment: e.string(),
2644
+ createTime: e.coerce.date(),
2645
+ updateTime: e.coerce.date().nullish(),
2646
+ restaurantId: a,
2647
+ restaurantName: e.string(),
2648
+ deletedAt: e.coerce.date().optional()
2649
+ }), Ne = g.extend({
2650
+ source: e.literal("google"),
2651
+ externalId: e.string().min(1),
2652
+ translatedComment: e.string().optional(),
2653
+ reviewer: he.optional(),
2654
+ reply: p.optional(),
2655
+ mediaItems: e.array(l),
2656
+ starRating: e.number(),
2657
+ locationName: e.string(),
2658
+ locationDisplayName: e.string(),
2659
+ originalUrl: e.string().optional()
2660
+ }), Ue = g.extend({
2661
+ source: e.literal("facebook"),
2662
+ externalId: e.string().min(1),
2663
+ reviewer: ue.optional(),
2664
+ isPositive: e.boolean().optional(),
2665
+ pageId: e.string(),
2666
+ pageName: e.string()
2667
+ }), Pe = g.extend({
2668
+ source: e.literal("feedme"),
2669
+ isAnonymous: e.boolean(),
2670
+ reviewerId: a.optional(),
2671
+ reviewer: c.optional(),
2672
+ reply: p.optional(),
2673
+ starRating: e.number(),
2674
+ billId: e.string(),
2675
+ mediaItems: e.array(l)
2676
+ }), je = g.extend({
2677
+ source: e.literal("feedvibe"),
2678
+ externalId: e.string().min(1),
2679
+ reviewerId: a,
2680
+ reviewer: c,
2681
+ rating: e.object({
2682
+ overall: e.number(),
2683
+ food: e.number(),
2684
+ service: e.number(),
2685
+ atmosphere: e.number()
2686
+ }),
2687
+ verified: e.boolean(),
2688
+ mediaItems: e.array(l).default([])
2689
+ });
2690
+ e.discriminatedUnion("source", [
2691
+ Ne,
2692
+ Ue,
2693
+ Pe,
2694
+ je
2695
+ ]).describe(i.describe(_e));
2696
+ export {
2697
+ w as F,
2698
+ we as T,
2699
+ ie as a,
2700
+ T as b,
2701
+ h as c,
2702
+ R as d,
2703
+ L as e,
2704
+ Ae as f,
2705
+ p as g
2706
+ };