@feedmepos/mf-connect 0.0.7 → 0.0.8

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 (67) hide show
  1. package/dist/{Analytic-D-E67IbN.js → Analytic-BxRuK2P2.js} +8 -8
  2. package/dist/{Broadcast-NjpOa4PK.js → Broadcast-BqGojAWW.js} +8 -8
  3. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-7KnDJ-sV.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B-VzcVMS.js} +8 -8
  4. package/dist/{Card-BOEkf7wo.js → Card-Dlj5jQp4.js} +54 -54
  5. package/dist/{Collections-sLYCpBxu.js → Collections-DvdDRozp.js} +181 -186
  6. package/dist/{Credit-DU2_9ex7.js → Credit-BeHm7_2S.js} +8 -8
  7. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-CBO6OHrM.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BsbgHsah.js} +170 -160
  8. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-CTvGOX7T.js → EffectSheet.vue_vue_type_style_index_0_lang-hwXvdiut.js} +2999 -2978
  9. package/dist/{Experience-DGNdVxuU.js → Experience-CtDY9u4Y.js} +8 -8
  10. package/dist/{Game-B1i79HLc.js → Game-DjaYuqcb.js} +8 -8
  11. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-DzdMpEl_.js → ImageInput.vue_vue_type_script_setup_true_lang-Bq5-Gl9N.js} +1 -1
  12. package/dist/{MainLayout-CfgDdm6k.js → MainLayout-B-iAZM2k.js} +1 -1
  13. package/dist/{Marketing-CBre7DEM.js → Marketing-BJJltAh-.js} +6 -6
  14. package/dist/{Member-BfvuL8GL.js → Member-eJ9Pdi5w.js} +2 -2
  15. package/dist/{MemberList-CQ17Q4V7.js → MemberList-CrhMqUfJ.js} +12 -12
  16. package/dist/{MemberTransactions-Cviim4GX.js → MemberTransactions-DRET8mSQ.js} +2 -2
  17. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-j31pc2Wx.js → MessageInput.vue_vue_type_script_setup_true_lang-D-ttMwn2.js} +2 -2
  18. package/dist/{Point-9ta-6dJv.js → Point-DPTOgJbC.js} +8 -8
  19. package/dist/{Promotion-CBmH5FNG.js → Promotion-wzkRuNqO.js} +9 -9
  20. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-r9Q-pOrs.js → RuleGroup.vue_vue_type_script_setup_true_lang-Z06eB5i5.js} +12 -12
  21. package/dist/{Segment-ZUtFZM5W.js → Segment-DnsPrP7Q.js} +10 -10
  22. package/dist/{Setting-TQdqaKPQ.js → Setting-CXuZu0-m.js} +9 -9
  23. package/dist/{Store-DX1ALcTQ.js → Store-4Um9keEp.js} +12 -12
  24. package/dist/{StoreRewards-Bd1ZFUQM.js → StoreRewards-B-UFeyQM.js} +10 -10
  25. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-D0L-LkOm.js → StoreTransactions.vue_vue_type_script_setup_true_lang-BAyotuXd.js} +5 -5
  26. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-C0xL6Ua_.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-I_XFpctY.js} +1 -1
  27. package/dist/Tier-C6KVsxGO.js +818 -0
  28. package/dist/{Title-YJtGygMA.js → Title-DuN1ahIM.js} +236 -236
  29. package/dist/{Transaction-DmvmaPk6.js → Transaction-DdfX7Xfe.js} +1 -1
  30. package/dist/{Voucher-D88gJYa3.js → Voucher-DarXrxZr.js} +99 -94
  31. package/dist/{app-g6ra_l_x.js → app-CxBTTB31.js} +1266 -1251
  32. package/dist/app.js +1 -1
  33. package/dist/{campaign-DdY0vnwY.js → campaign-B0aXkadj.js} +7 -7
  34. package/dist/dto-BtdVC-Ab.js +1093 -0
  35. package/dist/{effect-CghM-w8z.js → effect-BUN6rkQM.js} +1 -1
  36. package/dist/{helper-xWsMhdHl.js → helper-Cpq3x8K5.js} +1 -1
  37. package/dist/{index-CVSXd2FW.js → index-0GYrZr4L.js} +138 -132
  38. package/dist/{index-Dz8i7yJ_.js → index-8clzk3uX.js} +1 -1
  39. package/dist/{index-D71HFulf.js → index-BTntbYTS.js} +1 -1
  40. package/dist/{index-B4ootZIL.js → index-BvnZdJBY.js} +2 -2
  41. package/dist/{index-Cl-b6jYW.js → index-C6NgUSl2.js} +1 -1
  42. package/dist/{index-Bp8rb1uM.js → index-CK9yJMj7.js} +34 -34
  43. package/dist/{index-BSF_A6Bx.js → index-D2Juhkdw.js} +2 -2
  44. package/dist/{index-C5UTq5_2.js → index-DDSLx7vu.js} +2 -2
  45. package/dist/{index-gLwPyXKM.js → index-Dg-PMgXV.js} +1 -1
  46. package/dist/index-DysVCkrx.js +1735 -0
  47. package/dist/libs/packages/core/src/campaign/campaign.enum.d.ts +6 -0
  48. package/dist/libs/packages/core/src/campaign/campaign.fn.d.ts +2 -0
  49. package/dist/libs/packages/core/src/template/templates.d.ts +7 -0
  50. package/dist/{loading-DClM7b3o.js → loading-Cxp7sI5p.js} +2 -2
  51. package/dist/{lodash-wTDGx83S.js → lodash-DsT1nK-T.js} +1 -1
  52. package/dist/{membership-BEDm55VI.js → membership-DtD45RXh.js} +4 -4
  53. package/dist/{money-CPy2C0LJ.js → money-CFI1TMCS.js} +1 -1
  54. package/dist/{number-ROACK3bi.js → number-BBtf4fYz.js} +1 -1
  55. package/dist/packages/connect/src/api/index.d.ts +3 -0
  56. package/dist/packages/connect/src/api/settings/index.d.ts +1 -1
  57. package/dist/packages/connect/src/main.d.ts +1 -1
  58. package/dist/{plugins-CJou3ejy.js → plugins-B_d-WFtN.js} +4 -4
  59. package/dist/{rule-Cp7qN96m.js → rule-CB9Qlcx1.js} +2 -2
  60. package/dist/{rule-builder-OR4oX_mq.js → rule-builder-BIKcA4Bg.js} +1 -1
  61. package/dist/{template-Dk2sky27.js → template-qlb46PGl.js} +5 -5
  62. package/dist/{usePagination-DRHXkOF-.js → usePagination-CX66ab1Y.js} +1 -1
  63. package/dist/{xlsx-C5St1Lch.js → xlsx-DMaFso0k.js} +1 -1
  64. package/package.json +2 -2
  65. package/dist/Tier-DAUABM7F.js +0 -818
  66. package/dist/dto-BQHDb7XC.js +0 -353
  67. package/dist/index-CPU_mtDw.js +0 -1742
@@ -1,25 +1,25 @@
1
- var ee = Object.defineProperty;
2
- var oe = (v, r, p) => r in v ? ee(v, r, { enumerable: !0, configurable: !0, writable: !0, value: p }) : v[r] = p;
3
- var D = (v, r, p) => oe(v, typeof r != "symbol" ? r + "" : r, p);
4
- import { defineComponent as z, ref as g, computed as Y, watch as O, resolveComponent as m, openBlock as C, createBlock as L, unref as e, isRef as M, withCtx as I, createElementVNode as h, createVNode as i, createElementBlock as S, Fragment as U, renderList as te, createCommentVNode as _, h as A } from "vue";
5
- import { h as $ } from "./moment-BWErdI6_.js";
6
- import { u as ae, b as le } from "./app-g6ra_l_x.js";
7
- import { components as ne } from "@feedmepos/ui-library";
8
- import "./plugins-CJou3ejy.js";
9
- import { u as j } from "./loading-DClM7b3o.js";
10
- import { useRoute as G } from "vue-router";
11
- import { c as N } from "./index-D71HFulf.js";
12
- import { l as se } from "./lodash-wTDGx83S.js";
13
- import { u as q, w as re } from "./xlsx-C5St1Lch.js";
14
- import { m as ie } from "./index-Cl-b6jYW.js";
15
- import { o as de } from "./objectId-dwaoBfJX.js";
16
- const ue = /* @__PURE__ */ h("div", { class: "fm-typo-en-body-lg-600" }, "Code type", -1), ce = { class: "space-y-16" }, me = /* @__PURE__ */ h("div", { class: "fm-typo-en-body-lg-600" }, "Settings", -1), pe = { class: "gap-16 grid grid-cols-2" }, fe = { class: "flex items-center gap-8" }, ge = /* @__PURE__ */ z({
1
+ var Z = Object.defineProperty;
2
+ var ee = (b, s, u) => s in b ? Z(b, s, { enumerable: !0, configurable: !0, writable: !0, value: u }) : b[s] = u;
3
+ var z = (b, s, u) => ee(b, typeof s != "symbol" ? s + "" : s, u);
4
+ import { defineComponent as j, ref as g, computed as G, watch as oe, resolveComponent as m, openBlock as h, createBlock as L, unref as e, isRef as O, withCtx as N, createElementVNode as f, createVNode as r, createElementBlock as U, Fragment as P, renderList as te, createCommentVNode as B, onMounted as ae, h as M } from "vue";
5
+ import { h as K } from "./moment-BWErdI6_.js";
6
+ import { u as le, b as ne } from "./app-CxBTTB31.js";
7
+ import { components as se } from "@feedmepos/ui-library";
8
+ import "./plugins-B_d-WFtN.js";
9
+ import { u as H } from "./loading-Cxp7sI5p.js";
10
+ import { useRoute as Q } from "vue-router";
11
+ import { c as A } from "./index-BTntbYTS.js";
12
+ import { u as T, w as re } from "./xlsx-DMaFso0k.js";
13
+ import { u as ie, _ as de } from "./usePagination-CX66ab1Y.js";
14
+ import { m as ue } from "./index-C6NgUSl2.js";
15
+ import { o as ce } from "./objectId-dwaoBfJX.js";
16
+ const me = /* @__PURE__ */ f("div", { class: "fm-typo-en-body-lg-600" }, "Code type", -1), pe = { class: "space-y-16" }, fe = /* @__PURE__ */ f("div", { class: "fm-typo-en-body-lg-600" }, "Settings", -1), ge = { class: "gap-16 grid grid-cols-2" }, be = { class: "flex items-center gap-8" }, Ce = /* @__PURE__ */ j({
17
17
  __name: "CreateCollectionSheet",
18
18
  emits: ["success"],
19
- setup(v, { expose: r, emit: p }) {
20
- const { minor: V } = j, k = G(), B = g(), w = g(!1), R = p, s = g(!1);
21
- function y(c) {
22
- s.value = c, c && (l.value = {
19
+ setup(b, { expose: s, emit: u }) {
20
+ const { minor: F } = H, I = Q(), R = g(), _ = g(!1), E = u, C = g(!1);
21
+ function c(i) {
22
+ C.value = i, i && (l.value = {
23
23
  quantity: 1,
24
24
  code: "",
25
25
  codeConfig: {
@@ -41,7 +41,7 @@ const ue = /* @__PURE__ */ h("div", { class: "fm-typo-en-body-lg-600" }, "Code t
41
41
  suffix: "",
42
42
  pattern: "########"
43
43
  }
44
- }), P = [
44
+ }), q = [
45
45
  {
46
46
  label: "Bulk codes",
47
47
  value: "bulk",
@@ -52,7 +52,7 @@ const ue = /* @__PURE__ */ h("div", { class: "fm-typo-en-body-lg-600" }, "Code t
52
52
  value: "single",
53
53
  sublabel: "Enter your own custom codes"
54
54
  }
55
- ], n = [
55
+ ], v = [
56
56
  {
57
57
  label: "Alphanumeric",
58
58
  value: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
@@ -65,12 +65,12 @@ const ue = /* @__PURE__ */ h("div", { class: "fm-typo-en-body-lg-600" }, "Code t
65
65
  { label: "Alphabetic Uppercase", value: "ABCDEFGHIJKLMNOPQRSTUVWXYZ" },
66
66
  { label: "Numbers", value: "0123456789" },
67
67
  { label: "Custom", value: "" }
68
- ], a = g(n[0].value), u = g("bulk"), d = g(!1), x = Y(() => k.params.id);
69
- async function f(c) {
68
+ ], x = g(v[0].value), y = g("bulk"), V = g(!1), n = G(() => I.params.id);
69
+ async function a(i) {
70
70
  var o;
71
- await ((o = B.value) == null ? void 0 : o.validateInputs()), w.value && await V(
71
+ await ((o = R.value) == null ? void 0 : o.validateInputs()), _.value && await F(
72
72
  async () => {
73
- await N.createCollectionByCampaignId(x.value, c), await R("success");
73
+ await A.createCollectionByCampaignId(n.value, i), await E("success");
74
74
  },
75
75
  {
76
76
  message: "Creating claim(s)",
@@ -78,58 +78,58 @@ const ue = /* @__PURE__ */ h("div", { class: "fm-typo-en-body-lg-600" }, "Code t
78
78
  }
79
79
  );
80
80
  }
81
- return r({
82
- showSheet: y
83
- }), O(
81
+ return s({
82
+ showSheet: c
83
+ }), oe(
84
84
  () => l.value.codeConfig.length,
85
- (c, o) => {
86
- c != o && (l.value.codeConfig.pattern = "#".repeat(Number(c)));
85
+ (i, o) => {
86
+ i != o && (l.value.codeConfig.pattern = "#".repeat(Number(i)));
87
87
  }
88
- ), (c, o) => {
89
- const E = m("FmRadio"), H = m("FmRadioGroup"), K = m("FmSwitch"), Q = m("FmStepperField"), W = m("FmSelect"), F = m("FmTextField"), J = m("FmTextarea"), X = m("FmForm"), T = m("FmButton"), Z = m("FmSideSheet");
90
- return C(), L(Z, {
88
+ ), (i, o) => {
89
+ const d = m("FmRadio"), S = m("FmRadioGroup"), $ = m("FmSwitch"), w = m("FmStepperField"), D = m("FmSelect"), k = m("FmTextField"), W = m("FmTextarea"), J = m("FmForm"), Y = m("FmButton"), X = m("FmSideSheet");
90
+ return h(), L(X, {
91
91
  "max-width": 560,
92
92
  "dismiss-away": !0,
93
93
  header: "Create collection",
94
- modelValue: e(s),
94
+ modelValue: e(C),
95
95
  "onUpdate:modelValue": [
96
- o[14] || (o[14] = (t) => M(s) ? s.value = t : null),
97
- o[15] || (o[15] = (t) => s.value = t)
96
+ o[14] || (o[14] = (t) => O(C) ? C.value = t : null),
97
+ o[15] || (o[15] = (t) => C.value = t)
98
98
  ]
99
99
  }, {
100
- "side-sheet-footer": I(() => [
101
- h("div", fe, [
102
- i(T, {
100
+ "side-sheet-footer": N(() => [
101
+ f("div", be, [
102
+ r(Y, {
103
103
  label: "Save",
104
- onClick: o[12] || (o[12] = (t) => f(e(l))),
105
- loading: e(ae)().isLoading
104
+ onClick: o[12] || (o[12] = (t) => a(e(l))),
105
+ loading: e(le)().isLoading
106
106
  }, null, 8, ["loading"]),
107
- i(T, {
107
+ r(Y, {
108
108
  label: "Cancel",
109
109
  type: "button",
110
110
  variant: "tertiary",
111
- onClick: o[13] || (o[13] = (t) => s.value = !1)
111
+ onClick: o[13] || (o[13] = (t) => C.value = !1)
112
112
  })
113
113
  ])
114
114
  ]),
115
- default: I(() => [
116
- i(X, {
115
+ default: N(() => [
116
+ r(J, {
117
117
  ref_key: "form",
118
- ref: B,
118
+ ref: R,
119
119
  class: "space-y-40",
120
- onValidationSuccess: o[10] || (o[10] = (t) => w.value = !0),
121
- onValidationFailed: o[11] || (o[11] = (t) => w.value = !1)
120
+ onValidationSuccess: o[10] || (o[10] = (t) => _.value = !0),
121
+ onValidationFailed: o[11] || (o[11] = (t) => _.value = !1)
122
122
  }, {
123
- default: I(() => [
124
- h("div", null, [
125
- ue,
126
- i(H, {
127
- modelValue: e(u),
128
- "onUpdate:modelValue": o[0] || (o[0] = (t) => M(u) ? u.value = t : null),
123
+ default: N(() => [
124
+ f("div", null, [
125
+ me,
126
+ r(S, {
127
+ modelValue: e(y),
128
+ "onUpdate:modelValue": o[0] || (o[0] = (t) => O(y) ? y.value = t : null),
129
129
  inline: !1
130
130
  }, {
131
- default: I(() => [
132
- (C(), S(U, null, te(P, (t) => i(E, {
131
+ default: N(() => [
132
+ (h(), U(P, null, te(q, (t) => r(d, {
133
133
  key: t.value,
134
134
  value: t.value,
135
135
  label: t.label,
@@ -139,61 +139,61 @@ const ue = /* @__PURE__ */ h("div", { class: "fm-typo-en-body-lg-600" }, "Code t
139
139
  _: 1
140
140
  }, 8, ["modelValue"])
141
141
  ]),
142
- h("div", ce, [
143
- me,
144
- e(u) === "bulk" ? (C(), S(U, { key: 0 }, [
145
- i(K, {
146
- "model-value": e(d),
142
+ f("div", pe, [
143
+ fe,
144
+ e(y) === "bulk" ? (h(), U(P, { key: 0 }, [
145
+ r($, {
146
+ "model-value": e(V),
147
147
  "label-placement": "right",
148
148
  value: "true",
149
149
  label: "Advance code setting",
150
150
  required: !0,
151
- "onUpdate:modelValue": o[1] || (o[1] = () => d.value = !e(d))
151
+ "onUpdate:modelValue": o[1] || (o[1] = () => V.value = !e(V))
152
152
  }, null, 8, ["model-value"]),
153
- e(d) ? (C(), S(U, { key: 0 }, [
154
- i(Q, {
153
+ e(V) ? (h(), U(P, { key: 0 }, [
154
+ r(w, {
155
155
  modelValue: e(l).codeConfig.length,
156
156
  "onUpdate:modelValue": o[2] || (o[2] = (t) => e(l).codeConfig.length = t),
157
157
  label: "Code length",
158
158
  rules: [(t) => Number(t) >= 1 || "Code length must at least 1"],
159
159
  required: !0
160
160
  }, null, 8, ["modelValue", "rules"]),
161
- i(W, {
161
+ r(D, {
162
162
  label: "Charset",
163
- "model-value": e(a),
164
- items: n,
163
+ "model-value": e(x),
164
+ items: v,
165
165
  "helper-text": e(l).codeConfig.charset.length > 62 ? `${e(l).codeConfig.charset.substring(0, 62)}...` : e(l).codeConfig.charset,
166
166
  "onUpdate:modelValue": o[3] || (o[3] = (t) => {
167
- a.value = t, e(l).codeConfig.charset = t;
167
+ x.value = t, e(l).codeConfig.charset = t;
168
168
  })
169
169
  }, null, 8, ["model-value", "helper-text"]),
170
- e(a) === "" ? (C(), L(F, {
170
+ e(x) === "" ? (h(), L(k, {
171
171
  key: 0,
172
172
  modelValue: e(l).codeConfig.charset,
173
173
  "onUpdate:modelValue": o[4] || (o[4] = (t) => e(l).codeConfig.charset = t),
174
174
  label: "Custom Charset",
175
175
  required: ""
176
- }, null, 8, ["modelValue"])) : _("", !0),
177
- h("div", pe, [
178
- i(F, {
176
+ }, null, 8, ["modelValue"])) : B("", !0),
177
+ f("div", ge, [
178
+ r(k, {
179
179
  modelValue: e(l).codeConfig.prefix,
180
180
  "onUpdate:modelValue": o[5] || (o[5] = (t) => e(l).codeConfig.prefix = t),
181
181
  label: "Prefix (Optional)"
182
182
  }, null, 8, ["modelValue"]),
183
- i(F, {
183
+ r(k, {
184
184
  modelValue: e(l).codeConfig.suffix,
185
185
  "onUpdate:modelValue": o[6] || (o[6] = (t) => e(l).codeConfig.suffix = t),
186
186
  label: "Suffix (Optional)"
187
187
  }, null, 8, ["modelValue"])
188
188
  ]),
189
- i(F, {
189
+ r(k, {
190
190
  modelValue: e(l).codeConfig.pattern,
191
191
  "onUpdate:modelValue": o[7] || (o[7] = (t) => e(l).codeConfig.pattern = t),
192
192
  label: "Pattern",
193
193
  required: !0
194
194
  }, null, 8, ["modelValue"])
195
- ], 64)) : _("", !0),
196
- i(F, {
195
+ ], 64)) : B("", !0),
196
+ r(k, {
197
197
  modelValue: e(l).quantity,
198
198
  "onUpdate:modelValue": o[8] || (o[8] = (t) => e(l).quantity = t),
199
199
  label: "Number of code",
@@ -204,15 +204,15 @@ const ue = /* @__PURE__ */ h("div", { class: "fm-typo-en-body-lg-600" }, "Code t
204
204
  required: !0,
205
205
  "helper-text": `${e(l).quantity} claim will be created`
206
206
  }, null, 8, ["modelValue", "rules", "helper-text"])
207
- ], 64)) : _("", !0),
208
- e(u) !== "bulk" ? (C(), L(J, {
207
+ ], 64)) : B("", !0),
208
+ e(y) !== "bulk" ? (h(), L(W, {
209
209
  key: 1,
210
210
  modelValue: e(l).code,
211
211
  "onUpdate:modelValue": o[9] || (o[9] = (t) => e(l).code = t),
212
212
  label: "Custom Code",
213
- rules: [(t) => e(u) != "single" || !!t || "Custom code is required"],
213
+ rules: [(t) => e(y) != "single" || !!t || "Custom code is required"],
214
214
  placeholder: "(For multiple codes, please enter in the new row.)"
215
- }, null, 8, ["modelValue", "rules"])) : _("", !0)
215
+ }, null, 8, ["modelValue", "rules"])) : B("", !0)
216
216
  ])
217
217
  ]),
218
218
  _: 1
@@ -223,34 +223,34 @@ const ue = /* @__PURE__ */ h("div", { class: "fm-typo-en-body-lg-600" }, "Code t
223
223
  };
224
224
  }
225
225
  });
226
- class be {
226
+ class ye {
227
227
  constructor() {
228
- D(this, "data", []);
228
+ z(this, "data", []);
229
229
  }
230
- addRecord(r) {
231
- this.data.push(r);
230
+ addRecord(s) {
231
+ this.data.push(s);
232
232
  }
233
233
  buildExcel() {
234
- const r = q.book_new(), p = q.json_to_sheet(this.data);
235
- return q.book_append_sheet(r, p, "Collection"), r;
234
+ const s = T.book_new(), u = T.json_to_sheet(this.data);
235
+ return T.book_append_sheet(s, u, "Collection"), s;
236
236
  }
237
237
  }
238
- const b = {
238
+ const p = {
239
239
  sortBy: "_id",
240
240
  descending: !1,
241
241
  rowsPerPage: 1e3,
242
242
  page: 1,
243
243
  rowsNumber: 0
244
- }, he = { class: "px-24 flex flex-col gap-y-32 pb-24" }, ve = { class: "flex items-center justify-end py-4 xs:hidden" }, Ce = {
244
+ }, he = { class: "px-24 flex flex-col gap-y-32 pb-24" }, ve = { class: "flex items-center justify-end py-4 xs:hidden" }, xe = {
245
245
  key: 0,
246
246
  class: "w-full flex flex-col gap-16 items-center pt-16"
247
- }, ye = /* @__PURE__ */ h("div", { class: "fm-typo-en-body-lg-600" }, "No data found", -1), xe = /* @__PURE__ */ h("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " No data to show at the current moment. ", -1), Ve = [
248
- ye,
249
- xe
250
- ], Ae = /* @__PURE__ */ z({
247
+ }, Ve = /* @__PURE__ */ f("div", { class: "fm-typo-en-body-lg-600" }, "No data found", -1), Se = /* @__PURE__ */ f("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " No data to show at the current moment. ", -1), we = [
248
+ Ve,
249
+ Se
250
+ ], De = /* @__PURE__ */ j({
251
251
  __name: "Collections",
252
- setup(v) {
253
- const r = G(), p = g(), V = Y(() => r.params.id), k = g(!1), { custom: B } = j, w = [
252
+ setup(b) {
253
+ const s = Q(), u = g(), F = G(() => s.params.id), I = g(!1), { custom: R } = H, _ = [
254
254
  {
255
255
  header: "ID/Code",
256
256
  accessorFn: (n) => n.code || n._id
@@ -261,18 +261,18 @@ const b = {
261
261
  enableSorting: !1,
262
262
  cell(n) {
263
263
  const a = n.row.original.pf_user;
264
- return A(
264
+ return M(
265
265
  "div",
266
266
  {
267
267
  class: "flex items-center gap-x-8"
268
268
  },
269
269
  [
270
- A(ne.FmAvatar, {
270
+ M(se.FmAvatar, {
271
271
  name: a != null && a.photoUrl || a == null ? void 0 : a.name,
272
272
  src: (a == null ? void 0 : a.photoUrl) ?? void 0,
273
273
  size: "sm"
274
274
  }),
275
- A("span", a == null ? void 0 : a.name)
275
+ M("span", a == null ? void 0 : a.name)
276
276
  ]
277
277
  );
278
278
  }
@@ -282,7 +282,8 @@ const b = {
282
282
  accessorFn: (n) => {
283
283
  var a;
284
284
  return ((a = n.pf_user) == null ? void 0 : a.phoneNumber) || "-";
285
- }
285
+ },
286
+ accessorKey: "pf_user.phoneNumber"
286
287
  },
287
288
  {
288
289
  header: "Balance",
@@ -291,68 +292,58 @@ const b = {
291
292
  {
292
293
  header: "Created at",
293
294
  accessorKey: "_id",
294
- accessorFn: (n) => $(de(n._id.toString())).format("DD MMM YYYY")
295
+ accessorFn: (n) => K(ce(n._id.toString())).format("DD MMM YYYY")
295
296
  },
296
297
  {
297
298
  header: "Nearest expired at",
299
+ accessorKey: "expiryBalance",
298
300
  accessorFn: (n) => {
299
301
  var a;
300
- return n.expiryBalance && n.expiryBalance.length ? $((a = n.expiryBalance) == null ? void 0 : a[0].expiredAt).format("DD MMM YYYY") : "Never expires";
302
+ return n.expiryBalance && n.expiryBalance.length ? K((a = n.expiryBalance) == null ? void 0 : a[0].expiredAt).format("DD MMM YYYY") : "Never expires";
301
303
  }
302
304
  }
303
- ], R = async (n) => {
304
- y.value = [], s.value.isLoading = !0;
305
- const u = {
306
- "$connect-STORE_REWARD_COLLECTIONS": ie.readCollectionsByRewardId,
307
- "$connect-CAMPAIGN_VOUCHER_COLLECTIONS": N.readCollectionsByCampaignId
308
- }[r.name], d = await u(V.value, {
309
- limit: n.pageSize,
310
- skip: n.pageIndex ?? 0,
311
- sortBy: "_id",
312
- search: s.value.searchValue,
313
- descending: !0
314
- });
315
- y.value = d.resources, s.value.totalRows = d.meta.totalResources ?? 0, s.value.pageCount = d.meta.totalPages ?? 0, s.value.isLoading = !1;
316
- }, s = g({
317
- searchValue: "",
318
- pageSize: 10,
319
- pageCount: 0,
320
- pageIndex: 0,
321
- totalRows: 0,
322
- isLoading: !1
323
- }), y = g([]);
324
- async function l() {
305
+ ], E = {
306
+ "$connect-STORE_REWARD_COLLECTIONS": ue.readCollectionsByRewardId,
307
+ "$connect-CAMPAIGN_VOUCHER_COLLECTIONS": A.readCollectionsByCampaignId
308
+ }, C = (n) => {
309
+ const a = E[s.name];
310
+ return (i) => a(n, i);
311
+ }, { tableMeta: c, rowData: l, onSort: q, debouncedFetchData: v, onSearch: x } = ie(C(F.value), {
312
+ key: "_id",
313
+ descending: !1
314
+ });
315
+ async function y() {
325
316
  var n;
326
- await R({ pageSize: 10, pageIndex: 0 }), (n = p.value) == null || n.showSheet(!1);
317
+ await v(), (n = u.value) == null || n.showSheet(!1);
327
318
  }
328
- async function P() {
329
- k.value || B(
319
+ async function V() {
320
+ I.value || R(
330
321
  async () => {
331
- var d;
332
- const n = new be(), a = (await N.readCollectionsByCampaignId(V.value, {
322
+ var o;
323
+ const n = new ye(), a = (await A.readCollectionsByCampaignId(F.value, {
333
324
  limit: 1,
334
325
  skip: 0,
335
- sortBy: b.sortBy,
336
- descending: b.descending
337
- })).meta.totalResources ?? 0, u = b.rowsPerPage;
338
- for (let x = 0; x < a; x += u) {
339
- const f = {
340
- ...b,
341
- limit: u,
342
- skip: (b.page - 1) * b.rowsPerPage,
343
- sortBy: b.sortBy,
344
- descending: b.descending
345
- }, c = await N.readCollectionsByCampaignId(
346
- V.value,
347
- f
326
+ sortBy: p.sortBy,
327
+ descending: p.descending
328
+ })).meta.totalResources ?? 0, i = p.rowsPerPage;
329
+ for (let d = 0; d < a; d += i) {
330
+ const S = {
331
+ ...p,
332
+ limit: i,
333
+ skip: (p.page - 1) * p.rowsPerPage,
334
+ sortBy: p.sortBy,
335
+ descending: p.descending
336
+ }, $ = await A.readCollectionsByCampaignId(
337
+ F.value,
338
+ S
348
339
  );
349
- for await (const o of c.resources) {
350
- const E = {
351
- Id: (o == null ? void 0 : o.code) || ((d = o._id) == null ? void 0 : d.toString()) || ""
340
+ for await (const w of $.resources) {
341
+ const D = {
342
+ Id: (w == null ? void 0 : w.code) || ((o = w._id) == null ? void 0 : o.toString()) || ""
352
343
  };
353
- n.addRecord(E);
344
+ n.addRecord(D);
354
345
  }
355
- b.page++;
346
+ p.page++;
356
347
  }
357
348
  await re(
358
349
  n.buildExcel(),
@@ -362,22 +353,19 @@ const b = {
362
353
  bookSST: !1,
363
354
  type: "array"
364
355
  }
365
- ), b.page = 1;
356
+ ), p.page = 1;
366
357
  },
367
358
  {
368
- isLoading: k
359
+ isLoading: I
369
360
  }
370
361
  );
371
362
  }
372
- return O(
373
- () => s.value.searchValue,
374
- se.debounce(async () => {
375
- await l();
376
- }, 500)
377
- ), (n, a) => {
378
- const u = m("FmPageHead"), d = m("FmSearch"), x = m("FmTable");
379
- return C(), S(U, null, [
380
- i(u, {
363
+ return ae(async () => {
364
+ await v();
365
+ }), (n, a) => {
366
+ const i = m("FmPageHead"), o = m("FmSearch");
367
+ return h(), U(P, null, [
368
+ r(i, {
381
369
  title: "Collections",
382
370
  "back-button": !0,
383
371
  actions: [
@@ -388,44 +376,51 @@ const b = {
388
376
  isPrimary: !0
389
377
  }
390
378
  ],
391
- "onClick:back": a[0] || (a[0] = (f) => e(le).back()),
392
- "onClick:action": a[1] || (a[1] = (f) => {
393
- var c;
394
- f === "create" && ((c = e(p)) == null || c.showSheet(!0)), f === "export" && P();
379
+ "onClick:back": a[0] || (a[0] = (d) => e(ne).back()),
380
+ "onClick:action": a[1] || (a[1] = (d) => {
381
+ var S;
382
+ d === "create" && ((S = e(u)) == null || S.showSheet(!0)), d === "export" && V();
395
383
  })
396
384
  }),
397
- h("div", he, [
398
- i(d, {
385
+ f("div", he, [
386
+ r(o, {
399
387
  class: "hidden xs:flex border-b border-fm-color-neutral-gray-100",
400
- modelValue: e(s).searchValue,
401
- "onUpdate:modelValue": a[2] || (a[2] = (f) => e(s).searchValue = f),
388
+ modelValue: e(c).searchValue,
389
+ "onUpdate:modelValue": [
390
+ a[2] || (a[2] = (d) => e(c).searchValue = d),
391
+ e(x)
392
+ ],
402
393
  placeholder: "Search",
403
394
  collapsible: ""
404
- }, null, 8, ["modelValue"]),
405
- h("div", ve, [
406
- i(d, {
407
- modelValue: e(s).searchValue,
408
- "onUpdate:modelValue": a[3] || (a[3] = (f) => e(s).searchValue = f),
395
+ }, null, 8, ["modelValue", "onUpdate:modelValue"]),
396
+ f("div", ve, [
397
+ r(o, {
398
+ modelValue: e(c).searchValue,
399
+ "onUpdate:modelValue": [
400
+ a[3] || (a[3] = (d) => e(c).searchValue = d),
401
+ e(x)
402
+ ],
409
403
  placeholder: "Search",
410
404
  collapsible: ""
411
- }, null, 8, ["modelValue"])
405
+ }, null, 8, ["modelValue", "onUpdate:modelValue"])
412
406
  ]),
413
- i(x, {
414
- loading: e(s).isLoading,
415
- "row-data": e(y),
416
- "column-defs": w,
417
- "row-count": e(s).totalRows,
418
- "page-count": e(s).pageCount,
419
- "hide-footer": e(s).totalRows < 10,
420
- "fetch-fn": R,
407
+ r(de, {
408
+ loading: e(c).isLoading,
409
+ "row-data": e(l),
410
+ "column-defs": _,
411
+ "row-count": e(c).totalRows,
412
+ "page-count": e(c).pageCount,
413
+ "page-index": e(c).pageIndex,
414
+ "page-size": e(c).pageSize,
421
415
  "shrink-at": !1,
422
- "page-size": e(s).pageSize
423
- }, null, 8, ["loading", "row-data", "row-count", "page-count", "hide-footer", "page-size"]),
424
- e(y).length == 0 && e(s).isLoading == !1 ? (C(), S("div", Ce, Ve)) : _("", !0),
425
- i(ge, {
416
+ onSortChange: e(q),
417
+ onPageChange: a[4] || (a[4] = (d) => e(v)({ pageSize: d.pageSize, pageIndex: d.pageIndex }))
418
+ }, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onSortChange"]),
419
+ e(l).length == 0 && !e(c).isLoading ? (h(), U("div", xe, we)) : B("", !0),
420
+ r(Ce, {
426
421
  ref_key: "sheetRef",
427
- ref: p,
428
- onSuccess: l
422
+ ref: u,
423
+ onSuccess: y
429
424
  }, null, 512)
430
425
  ])
431
426
  ], 64);
@@ -433,5 +428,5 @@ const b = {
433
428
  }
434
429
  });
435
430
  export {
436
- Ae as default
431
+ De as default
437
432
  };
@@ -1,15 +1,15 @@
1
1
  import { defineComponent as U, ref as k, computed as A, onMounted as N, resolveComponent as i, openBlock as l, createElementBlock as f, Fragment as g, createVNode as r, unref as o, createElementVNode as s, withCtx as h, renderList as j, createBlock as C, resolveDynamicComponent as M, toDisplayString as y, createCommentVNode as H, h as q } from "vue";
2
2
  import { _ as z } from "./campaign-CpzFl8Vr.js";
3
3
  import { useDialog as G, components as J } from "@feedmepos/ui-library";
4
- import { p as O } from "./plugins-CJou3ejy.js";
5
- import { u as Q } from "./loading-DClM7b3o.js";
6
- import { a as W } from "./app-g6ra_l_x.js";
7
- import { u as X } from "./campaign-DdY0vnwY.js";
8
- import { g as S, b as V } from "./dto-BQHDb7XC.js";
4
+ import { p as O } from "./plugins-B_d-WFtN.js";
5
+ import { u as Q } from "./loading-Cxp7sI5p.js";
6
+ import { a as W } from "./app-CxBTTB31.js";
7
+ import { u as X } from "./campaign-B0aXkadj.js";
8
+ import { g as S, b as V } from "./dto-BtdVC-Ab.js";
9
9
  import { _ as Y } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
10
- import { _ as Z } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-CBO6OHrM.js";
11
- import { u as ee } from "./template-Dk2sky27.js";
12
- import { c as _ } from "./index-D71HFulf.js";
10
+ import { _ as Z } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-BsbgHsah.js";
11
+ import { u as ee } from "./template-qlb46PGl.js";
12
+ import { c as _ } from "./index-BTntbYTS.js";
13
13
  const te = { class: "px-24 flex flex-col gap-y-16" }, oe = { class: "flex items-center justify-between w-full" }, ae = { class: "flex gap-8 overflow-x-auto" }, se = { class: "space-y-8" }, ne = { class: "flex w-full gap-4 items-center" }, re = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ie = { class: "space-y-4" }, le = { class: "fm-typo-en-body-lg-600" }, ce = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, me = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, de = { key: 0 }, ue = /* @__PURE__ */ s("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-600" }, " No results found ", -1), pe = [
14
14
  ue
15
15
  ], fe = /* @__PURE__ */ s("img", {