@feedmepos/mf-connect 0.1.98-beta.13 → 0.1.98-beta.15

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