@feedmepos/mf-connect 0.1.0-beta.6 → 0.1.0-beta.60
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.
- package/dist/Analytic-CXegtSEd.js +427 -0
- package/dist/{App-C2616cfr.js → App-m9A9s3wd.js} +445 -420
- package/dist/AuditLogs-CpUOkyXq.js +1886 -0
- package/dist/Bin-m6mPl3FE.js +166 -0
- package/dist/{Broadcast-CqSwLTAq.js → Broadcast-DNjHnlPp.js} +56 -54
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DrR9Pmtb.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-cjdNZLkE.js} +6 -8
- package/dist/Card-CAvS5aaN.js +896 -0
- package/dist/Collections-3C9I2byH.js +459 -0
- package/dist/{Credit-CPcLgnsq.js → Credit-DcAmLeMb.js} +36 -34
- package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +108 -0
- package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js +58 -0
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-wGFMCV-y.js +2181 -0
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-D2buK6Dj.js → EffectSheet.vue_vue_type_style_index_0_lang-CIEn1N24.js} +6 -6
- package/dist/{Experience-BoBikt-x.js → Experience-GF9yOrlE.js} +32 -30
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-BrPLkFX8.js +118 -0
- package/dist/{Game-DR8PyYZa.js → Game-CzBn_Li3.js} +39 -37
- package/dist/Index-Bhmkdb4n.js +259 -0
- package/dist/Marketing-DlbcOoiN.js +20071 -0
- package/dist/Member-CdXG5uEN.js +317 -0
- package/dist/MemberList-xIOXAHJf.js +1598 -0
- package/dist/MemberTransactions-CsW9vso0.js +45 -0
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DhtIZCjT.js → MessageInput.vue_vue_type_script_setup_true_lang-jtjk9NjI.js} +83 -71
- package/dist/{Mission-CMpvz9zN.js → Mission-2UjKrmGe.js} +101 -87
- package/dist/Overview-ClittdS6.js +1078 -0
- package/dist/{Point-DkZn6p9s.js → Point-BON4g7zE.js} +55 -53
- package/dist/{Promotion-B7YzwPc_.js → Promotion-qUEZmmm8.js} +65 -57
- package/dist/Queue-DA4glGdE.js +244 -0
- package/dist/Record-EUAnp1--.js +340 -0
- package/dist/Reward-ChbsdQuW.js +442 -0
- package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-CUFw56sf.js +150 -0
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BKesht7Y.js +1637 -0
- package/dist/Segment-DbwFx6vD.js +568 -0
- package/dist/SelectItems.vue_vue_type_script_setup_true_lang-lwpYOWMR.js +181 -0
- package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-BbuOPEGY.js +147 -0
- package/dist/Setting-FMTftvlU.js +1931 -0
- package/dist/Store-BkUwiBUq.js +1751 -0
- package/dist/{StoreRewards-6BzVwZqr.js → StoreRewards-Z8uhK0v1.js} +33 -32
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-DwFYJ1Iz.js +943 -0
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-B6cAveco.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-D6mrJp05.js} +1 -1
- package/dist/{Tier-CW-46oJS.js → Tier-COCmcJJF.js} +327 -318
- package/dist/{Title-CE9rWVdi.js → Title-7qCjbur9.js} +199 -184
- package/dist/{Transaction-B21RrC4M.js → Transaction-9FS_K2hv.js} +2 -2
- package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-Fx-J2gcK.js +130 -0
- package/dist/Voucher-Dx70JAgw.js +354 -0
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-CECJsKRJ.js +419 -0
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BiVZwBuG.js → ZodTextField.vue_vue_type_script_setup_true_lang-Bne_nxYS.js} +1 -1
- package/dist/{app-CjhXHUQv.js → app-CWKpKW78.js} +1 -1
- package/dist/app-q6W6-faT.js +7059 -0
- package/dist/app.js +1 -1
- package/dist/{business-aHhRUXc0.js → business-D5AQBRGS.js} +1 -1
- package/dist/campaign-BGiM8ccX.js +1810 -0
- package/dist/{campaign-DH9NUNf_.js → campaign-v8MAkDo-.js} +2 -2
- package/dist/campaign.enum-Dro6UEcE.js +20 -0
- package/dist/campaign.fn-DsJUr-gE.js +758 -0
- package/dist/collectible.enum-BH9pX7PE.js +19 -0
- package/dist/{collection.fn-CYlsA-kW.js → collection.fn-CHiRShK_.js} +2 -2
- package/dist/dto-CeX9egUp.js +214 -0
- package/dist/{effect-LSc9YanX.js → effect-DtJQE1cD.js} +9 -9
- package/dist/email-addresses-DKOsgzML.js +705 -0
- package/dist/{export-Cf0-C5Ly.js → export-Daiv_zH9.js} +5 -5
- package/dist/{helper-CiZpeMCM.js → helper-B5Emawnj.js} +1 -1
- package/dist/index-9WBy0L7U.js +54 -0
- package/dist/{index-D6cEOHP4.js → index-BSHuLDD0.js} +1501 -1480
- package/dist/{index-BVb5-Ht8.js → index-CUl_8M_c.js} +259 -173
- package/dist/{index-gxwjKu3-.js → index-CgCcvX_L.js} +2212 -871
- package/dist/index-CsaQJMAR.js +66 -0
- package/dist/{index-D_83JP2i.js → index-DrWrGAHJ.js} +48 -4
- package/dist/index-DteeKoFo.js +115 -0
- package/dist/{index-DW3PRjPL.js → index-Dw2RtHKR.js} +1 -1
- package/dist/{index-kPhrD63q.js → index-ICbXrXiP.js} +1 -1
- package/dist/index-Xwc07I54.js +29000 -0
- package/dist/{index-DtsDOuDx.js → index-ZBSI6ViG.js} +24 -21
- package/dist/index-g9NNHS8s.js +32 -0
- package/dist/index-p6F08hhh.js +44 -0
- package/dist/index-vh86FiIQ.js +10 -0
- package/dist/{index.esm2017-B7oVYIbY.js → index.esm2017-B-SDA6Y2.js} +121 -121
- package/dist/loading-CDbkBsRr.js +71 -0
- package/dist/{membership-Dw1ylJ9Y.js → membership-B8uwuntJ.js} +54 -46
- package/dist/money-DRKB3Rpe.js +15 -0
- package/dist/number-DtyC1DJU.js +12 -0
- package/dist/objectid-wGrq9P1h.js +145 -0
- package/dist/{loading-7yq1tinq.js → plugins-DKNh-lBz.js} +3871 -3943
- package/dist/remy-vue-client-Cpppk9h-.js +1693 -0
- package/dist/reward-C2jv5dmJ.js +36 -0
- package/dist/{rule-C0Q_SHow.js → rule-C5AMTchR.js} +180 -177
- package/dist/{rule-builder-iu17XIof.js → rule-builder-DLOGHT1l.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{template-CyOanTMu.js → template-C-fz1DXI.js} +5 -5
- package/dist/trigger-DTErX60D.js +144 -0
- package/dist/user-CVRoQGCF.js +54 -0
- package/dist/{vue-i18n-B0fLJH7a.js → vue-i18n-CxMxiW_u.js} +366 -366
- package/dist/{xlsx-BYO_bB9J.js → xlsx-CARvMJN_.js} +1 -1
- package/package.json +10 -6
- package/dist/Analytic-muDf0oMG.js +0 -622
- package/dist/Card-bhLoK0ZV.js +0 -825
- package/dist/Collections-DjtsAiol.js +0 -453
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-U_QZneS6.js +0 -2813
- package/dist/Marketing-Dny2nMUl.js +0 -316
- package/dist/Member-CP_smyk8.js +0 -69
- package/dist/MemberList-CR3eYI9p.js +0 -1733
- package/dist/MemberTransactions-RTx_lKFb.js +0 -38
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Cs67_GLE.js +0 -1753
- package/dist/Segment-Bb4gHt5V.js +0 -437
- package/dist/Setting-Xj0AVzh3.js +0 -1901
- package/dist/Store-BWRHQ6Ie.js +0 -1511
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BsFnT8BS.js +0 -890
- package/dist/Voucher-KK9fBI0u.js +0 -490
- package/dist/app-Dvf_JNMf.js +0 -5764
- package/dist/dto-DArfyZAI.js +0 -2770
- package/dist/index-Bi_LGEtY.js +0 -99
- package/dist/index-CiQDG7Cm.js +0 -762
- package/dist/index-CuvNtC_M.js +0 -61
- package/dist/index-DQfjSSMF.js +0 -206
- package/dist/index-DcxssxPi.js +0 -29193
- package/dist/index-DqJVH2kv.js +0 -298
- package/dist/money-CPd0XTNv.js +0 -15
- package/dist/number-BgXY4un8.js +0 -12
- package/dist/user-Bm4KttFq.js +0 -37
|
@@ -0,0 +1,459 @@
|
|
|
1
|
+
var te = Object.defineProperty;
|
|
2
|
+
var ae = (g, u, c) => u in g ? te(g, u, { enumerable: !0, configurable: !0, writable: !0, value: c }) : g[u] = c;
|
|
3
|
+
var O = (g, u, c) => ae(g, typeof u != "symbol" ? u + "" : u, c);
|
|
4
|
+
import { defineComponent as J, ref as f, computed as Q, watch as K, resolveComponent as d, openBlock as x, createBlock as z, unref as o, isRef as j, withCtx as I, createElementVNode as C, createVNode as r, createElementBlock as P, Fragment as N, renderList as le, createCommentVNode as R, onMounted as ne, h as S } from "vue";
|
|
5
|
+
import { h as G } from "./moment-BWErdI6_.js";
|
|
6
|
+
import { components as H } from "@feedmepos/ui-library";
|
|
7
|
+
import { a as se } from "./plugins-DKNh-lBz.js";
|
|
8
|
+
import { J as re } from "./JsonViewer-v8_C7l5N.js";
|
|
9
|
+
import { u as W } from "./loading-CDbkBsRr.js";
|
|
10
|
+
import { u as ie } from "./app-wDQR6dpb.js";
|
|
11
|
+
import { useRoute as X, useRouter as ue } from "vue-router";
|
|
12
|
+
import { c as q } from "./index-DteeKoFo.js";
|
|
13
|
+
import { e as p } from "./index-vh86FiIQ.js";
|
|
14
|
+
import { u as Y, w as de } from "./xlsx-CARvMJN_.js";
|
|
15
|
+
import { u as ce, _ as me } from "./usePagination-BeF5K3M7.js";
|
|
16
|
+
import { m as pe } from "./index-DrWrGAHJ.js";
|
|
17
|
+
import { o as fe } from "./objectId-dwaoBfJX.js";
|
|
18
|
+
const ge = { class: "space-y-16" }, be = { class: "gap-16 grid grid-cols-2" }, Ce = { class: "flex items-center gap-8" }, ve = /* @__PURE__ */ J({
|
|
19
|
+
__name: "CreateCollectionSheet",
|
|
20
|
+
emits: ["success"],
|
|
21
|
+
setup(g, { expose: u, emit: c }) {
|
|
22
|
+
const { minor: w } = W, F = X(), k = f(), _ = f(!1), A = c, b = f(!1);
|
|
23
|
+
function D(s) {
|
|
24
|
+
b.value = s, s && (a.value = {
|
|
25
|
+
quantity: 1,
|
|
26
|
+
code: "",
|
|
27
|
+
codeConfig: {
|
|
28
|
+
length: 8,
|
|
29
|
+
charset: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
|
|
30
|
+
prefix: "",
|
|
31
|
+
suffix: "",
|
|
32
|
+
pattern: "########"
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
const a = f({
|
|
37
|
+
quantity: 1,
|
|
38
|
+
code: "",
|
|
39
|
+
codeConfig: {
|
|
40
|
+
length: 8,
|
|
41
|
+
charset: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
|
|
42
|
+
prefix: "",
|
|
43
|
+
suffix: "",
|
|
44
|
+
pattern: "########"
|
|
45
|
+
}
|
|
46
|
+
}), E = [
|
|
47
|
+
{
|
|
48
|
+
label: "Bulk codes",
|
|
49
|
+
value: "bulk",
|
|
50
|
+
sublabel: "Bulk generate unique codes"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
label: "Custom code",
|
|
54
|
+
value: "single",
|
|
55
|
+
sublabel: "Enter your own custom codes"
|
|
56
|
+
}
|
|
57
|
+
], U = [
|
|
58
|
+
{
|
|
59
|
+
label: "Alphanumeric",
|
|
60
|
+
value: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
label: "Alphabetic",
|
|
64
|
+
value: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
|
65
|
+
},
|
|
66
|
+
{ label: "Alphabetic Lowercase", value: "abcdefghijklmnopqrstuvwxyz" },
|
|
67
|
+
{ label: "Alphabetic Uppercase", value: "ABCDEFGHIJKLMNOPQRSTUVWXYZ" },
|
|
68
|
+
{ label: "Numbers", value: "0123456789" },
|
|
69
|
+
{ label: "Custom", value: "" }
|
|
70
|
+
], v = f(U[0].value), m = f("bulk"), h = f(!1), M = Q(() => F.params.id);
|
|
71
|
+
async function n(s) {
|
|
72
|
+
var e;
|
|
73
|
+
await ((e = k.value) == null ? void 0 : e.validateInputs()), _.value && await w(
|
|
74
|
+
async () => {
|
|
75
|
+
await q.createCollectionByCampaignId(M.value, s), await A("success");
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
message: "Creating claim(s)",
|
|
79
|
+
successMessage: "Claim(s) created"
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
u({
|
|
84
|
+
showSheet: D
|
|
85
|
+
}), K(
|
|
86
|
+
() => m.value,
|
|
87
|
+
(s, e) => {
|
|
88
|
+
e != s && (a.value.code = "", a.value.codeConfig.length = 8, a.value.codeConfig.charset = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", a.value.codeConfig.prefix = "", a.value.codeConfig.suffix = "", a.value.codeConfig.pattern = "########");
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
function l(s) {
|
|
92
|
+
if (m.value !== "single") return !1;
|
|
93
|
+
const e = s.split(`
|
|
94
|
+
`).map((i) => i.trim()).filter(Boolean);
|
|
95
|
+
return new Set(e).size !== e.length;
|
|
96
|
+
}
|
|
97
|
+
return K(
|
|
98
|
+
() => a.value.codeConfig.length,
|
|
99
|
+
(s, e) => {
|
|
100
|
+
s != e && (a.value.codeConfig.pattern = "#".repeat(Math.min(16, Number(s))));
|
|
101
|
+
}
|
|
102
|
+
), (s, e) => {
|
|
103
|
+
const i = d("FmRadio"), y = d("FmRadioGroup"), L = d("FmSwitch"), V = d("FmStepperField"), T = d("FmSelect"), B = d("FmTextField"), Z = d("FmTextarea"), ee = d("FmForm"), $ = d("FmButton"), oe = d("FmSideSheet");
|
|
104
|
+
return x(), z(oe, {
|
|
105
|
+
"max-width": 560,
|
|
106
|
+
"dismiss-away": !0,
|
|
107
|
+
header: "Create collection",
|
|
108
|
+
modelValue: o(b),
|
|
109
|
+
"onUpdate:modelValue": [
|
|
110
|
+
e[14] || (e[14] = (t) => j(b) ? b.value = t : null),
|
|
111
|
+
e[15] || (e[15] = (t) => b.value = t)
|
|
112
|
+
]
|
|
113
|
+
}, {
|
|
114
|
+
"side-sheet-footer": I(() => [
|
|
115
|
+
C("div", Ce, [
|
|
116
|
+
r($, {
|
|
117
|
+
label: "Save",
|
|
118
|
+
onClick: e[12] || (e[12] = (t) => n(o(a))),
|
|
119
|
+
loading: o(ie)().isLoading
|
|
120
|
+
}, null, 8, ["loading"]),
|
|
121
|
+
r($, {
|
|
122
|
+
label: "Cancel",
|
|
123
|
+
type: "button",
|
|
124
|
+
variant: "tertiary",
|
|
125
|
+
onClick: e[13] || (e[13] = (t) => b.value = !1)
|
|
126
|
+
})
|
|
127
|
+
])
|
|
128
|
+
]),
|
|
129
|
+
default: I(() => [
|
|
130
|
+
r(re, { json: o(a) }, null, 8, ["json"]),
|
|
131
|
+
r(ee, {
|
|
132
|
+
ref_key: "form",
|
|
133
|
+
ref: k,
|
|
134
|
+
class: "space-y-40",
|
|
135
|
+
onValidationSuccess: e[10] || (e[10] = (t) => _.value = !0),
|
|
136
|
+
onValidationFailed: e[11] || (e[11] = (t) => _.value = !1)
|
|
137
|
+
}, {
|
|
138
|
+
default: I(() => [
|
|
139
|
+
C("div", null, [
|
|
140
|
+
e[16] || (e[16] = C("div", { class: "fm-typo-en-body-lg-600" }, "Code type", -1)),
|
|
141
|
+
r(y, {
|
|
142
|
+
modelValue: o(m),
|
|
143
|
+
"onUpdate:modelValue": e[0] || (e[0] = (t) => j(m) ? m.value = t : null),
|
|
144
|
+
inline: !1
|
|
145
|
+
}, {
|
|
146
|
+
default: I(() => [
|
|
147
|
+
(x(), P(N, null, le(E, (t) => r(i, {
|
|
148
|
+
key: t.value,
|
|
149
|
+
value: t.value,
|
|
150
|
+
label: t.label,
|
|
151
|
+
sublabel: t.sublabel
|
|
152
|
+
}, null, 8, ["value", "label", "sublabel"])), 64))
|
|
153
|
+
]),
|
|
154
|
+
_: 1
|
|
155
|
+
}, 8, ["modelValue"])
|
|
156
|
+
]),
|
|
157
|
+
C("div", ge, [
|
|
158
|
+
e[17] || (e[17] = C("div", { class: "fm-typo-en-body-lg-600" }, "Settings", -1)),
|
|
159
|
+
o(m) === "bulk" ? (x(), P(N, { key: 0 }, [
|
|
160
|
+
r(L, {
|
|
161
|
+
"model-value": o(h),
|
|
162
|
+
"label-placement": "right",
|
|
163
|
+
value: "true",
|
|
164
|
+
label: "Advance code setting",
|
|
165
|
+
required: !0,
|
|
166
|
+
"onUpdate:modelValue": e[1] || (e[1] = () => h.value = !o(h))
|
|
167
|
+
}, null, 8, ["model-value"]),
|
|
168
|
+
o(h) ? (x(), P(N, { key: 0 }, [
|
|
169
|
+
r(V, {
|
|
170
|
+
modelValue: o(a).codeConfig.length,
|
|
171
|
+
"onUpdate:modelValue": e[2] || (e[2] = (t) => o(a).codeConfig.length = t),
|
|
172
|
+
label: "Code length",
|
|
173
|
+
max: 16,
|
|
174
|
+
min: 1,
|
|
175
|
+
rules: [
|
|
176
|
+
(t) => Number(t) >= 1 || "Code length must at least 1",
|
|
177
|
+
(t) => Number(t) <= 16 || "Code length must less than 16"
|
|
178
|
+
],
|
|
179
|
+
required: !0
|
|
180
|
+
}, null, 8, ["modelValue", "rules"]),
|
|
181
|
+
r(T, {
|
|
182
|
+
label: "Charset",
|
|
183
|
+
"model-value": o(v),
|
|
184
|
+
items: U,
|
|
185
|
+
"helper-text": o(a).codeConfig.charset.length > 62 ? `${o(a).codeConfig.charset.substring(0, 62)}...` : o(a).codeConfig.charset,
|
|
186
|
+
"onUpdate:modelValue": e[3] || (e[3] = (t) => {
|
|
187
|
+
v.value = t, o(a).codeConfig.charset = t;
|
|
188
|
+
})
|
|
189
|
+
}, null, 8, ["model-value", "helper-text"]),
|
|
190
|
+
o(v) === "" ? (x(), z(B, {
|
|
191
|
+
key: 0,
|
|
192
|
+
modelValue: o(a).codeConfig.charset,
|
|
193
|
+
"onUpdate:modelValue": e[4] || (e[4] = (t) => o(a).codeConfig.charset = t),
|
|
194
|
+
label: "Custom Charset",
|
|
195
|
+
required: ""
|
|
196
|
+
}, null, 8, ["modelValue"])) : R("", !0),
|
|
197
|
+
C("div", be, [
|
|
198
|
+
r(B, {
|
|
199
|
+
modelValue: o(a).codeConfig.prefix,
|
|
200
|
+
"onUpdate:modelValue": e[5] || (e[5] = (t) => o(a).codeConfig.prefix = t),
|
|
201
|
+
label: "Prefix (Optional)"
|
|
202
|
+
}, null, 8, ["modelValue"]),
|
|
203
|
+
r(B, {
|
|
204
|
+
modelValue: o(a).codeConfig.suffix,
|
|
205
|
+
"onUpdate:modelValue": e[6] || (e[6] = (t) => o(a).codeConfig.suffix = t),
|
|
206
|
+
label: "Suffix (Optional)"
|
|
207
|
+
}, null, 8, ["modelValue"])
|
|
208
|
+
]),
|
|
209
|
+
r(B, {
|
|
210
|
+
modelValue: o(a).codeConfig.pattern,
|
|
211
|
+
"onUpdate:modelValue": e[7] || (e[7] = (t) => o(a).codeConfig.pattern = t),
|
|
212
|
+
label: "Pattern",
|
|
213
|
+
required: !0
|
|
214
|
+
}, null, 8, ["modelValue"])
|
|
215
|
+
], 64)) : R("", !0),
|
|
216
|
+
r(B, {
|
|
217
|
+
modelValue: o(a).quantity,
|
|
218
|
+
"onUpdate:modelValue": e[8] || (e[8] = (t) => o(a).quantity = t),
|
|
219
|
+
label: "Number of code",
|
|
220
|
+
rules: [
|
|
221
|
+
(t) => t >= 1 || "Quantity cannot be less than 1",
|
|
222
|
+
(t) => t <= 1e4 || "Quantity cannot more than 10,000"
|
|
223
|
+
],
|
|
224
|
+
required: !0,
|
|
225
|
+
"helper-text": `${o(a).quantity} claim will be created`
|
|
226
|
+
}, null, 8, ["modelValue", "rules", "helper-text"])
|
|
227
|
+
], 64)) : R("", !0),
|
|
228
|
+
o(m) !== "bulk" ? (x(), z(Z, {
|
|
229
|
+
key: 1,
|
|
230
|
+
modelValue: o(a).code,
|
|
231
|
+
"onUpdate:modelValue": e[9] || (e[9] = (t) => o(a).code = t),
|
|
232
|
+
label: "Custom Code",
|
|
233
|
+
rules: [
|
|
234
|
+
(t) => o(m) != "single" || !!t || "Custom code is required",
|
|
235
|
+
(t) => !l(t) || "Custom code must be unique"
|
|
236
|
+
],
|
|
237
|
+
placeholder: "(For multiple codes, please enter in the new row.)"
|
|
238
|
+
}, null, 8, ["modelValue", "rules"])) : R("", !0)
|
|
239
|
+
])
|
|
240
|
+
]),
|
|
241
|
+
_: 1
|
|
242
|
+
}, 512)
|
|
243
|
+
]),
|
|
244
|
+
_: 1
|
|
245
|
+
}, 8, ["modelValue"]);
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
class xe {
|
|
250
|
+
constructor() {
|
|
251
|
+
O(this, "data", []);
|
|
252
|
+
}
|
|
253
|
+
addRecord(u) {
|
|
254
|
+
this.data.push(u);
|
|
255
|
+
}
|
|
256
|
+
buildExcel() {
|
|
257
|
+
const u = Y.book_new(), c = Y.json_to_sheet(this.data);
|
|
258
|
+
return Y.book_append_sheet(u, c, "Collection"), u;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
const he = { class: "px-24 flex flex-col gap-y-32 pb-24" }, ye = { class: "flex items-center justify-end py-4 xs:hidden" }, Ee = /* @__PURE__ */ J({
|
|
262
|
+
__name: "Collections",
|
|
263
|
+
setup(g) {
|
|
264
|
+
const u = ue(), c = X(), w = f(), F = Q(() => c.params.id), k = f(!1), { custom: _ } = W, A = [
|
|
265
|
+
{
|
|
266
|
+
header: "ID/Code",
|
|
267
|
+
accessorKey: "_id",
|
|
268
|
+
cell(n) {
|
|
269
|
+
return S("div", { class: "flex items-center" }, [
|
|
270
|
+
S(H.FmIcon, {
|
|
271
|
+
name: "content_copy",
|
|
272
|
+
outline: !0,
|
|
273
|
+
size: "sm",
|
|
274
|
+
class: "cursor-pointer mr-4",
|
|
275
|
+
onClick: (l) => {
|
|
276
|
+
l.preventDefault(), l.stopPropagation(), se(
|
|
277
|
+
n.row.original.code || n.row.original._id.toString()
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
}),
|
|
281
|
+
S(
|
|
282
|
+
"div",
|
|
283
|
+
{ class: "pr-2 text-ellipsis overflow-hidden" },
|
|
284
|
+
n.row.original.code || n.row.original._id.toString()
|
|
285
|
+
)
|
|
286
|
+
]);
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
header: "User",
|
|
291
|
+
accessorKey: "user",
|
|
292
|
+
enableSorting: !1,
|
|
293
|
+
cell(n) {
|
|
294
|
+
const l = n.row.original.pf_user;
|
|
295
|
+
return S(
|
|
296
|
+
"div",
|
|
297
|
+
{
|
|
298
|
+
class: "flex items-center gap-x-8"
|
|
299
|
+
},
|
|
300
|
+
[
|
|
301
|
+
S(H.FmAvatar, {
|
|
302
|
+
name: l != null && l.photoUrl || l == null ? void 0 : l.name,
|
|
303
|
+
src: (l == null ? void 0 : l.photoUrl) ?? void 0,
|
|
304
|
+
size: "sm"
|
|
305
|
+
}),
|
|
306
|
+
S("span", l == null ? void 0 : l.name)
|
|
307
|
+
]
|
|
308
|
+
);
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
header: "Phone",
|
|
313
|
+
accessorFn: (n) => {
|
|
314
|
+
var l;
|
|
315
|
+
return ((l = n.pf_user) == null ? void 0 : l.phoneNumber) || "-";
|
|
316
|
+
},
|
|
317
|
+
accessorKey: "pf_user.phoneNumber"
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
header: "Balance",
|
|
321
|
+
accessorKey: "balance"
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
header: "Created at",
|
|
325
|
+
accessorKey: "_id",
|
|
326
|
+
accessorFn: (n) => G(fe(n._id.toString())).format("DD MMM YYYY")
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
header: "Nearest expired at",
|
|
330
|
+
accessorKey: "expiryBalance",
|
|
331
|
+
accessorFn: (n) => {
|
|
332
|
+
var l;
|
|
333
|
+
return n.expiryBalance && n.expiryBalance.length ? G((l = n.expiryBalance) == null ? void 0 : l[0].expiredAt).format("DD MMM YYYY") : "Never expires";
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
], b = {
|
|
337
|
+
"$connect-STORE_REWARD_COLLECTIONS": pe.readCollectionsByRewardId,
|
|
338
|
+
"$connect-CAMPAIGN_VOUCHER_COLLECTIONS": q.readCollectionsByCampaignId
|
|
339
|
+
}, D = (n) => {
|
|
340
|
+
const l = b[c.name];
|
|
341
|
+
return (s) => l(n, s);
|
|
342
|
+
}, { tableMeta: a, rowData: E, onSort: U, debouncedFetchData: v, onSearch: m } = ce(D(F.value));
|
|
343
|
+
async function h() {
|
|
344
|
+
var n;
|
|
345
|
+
await v(), (n = w.value) == null || n.showSheet(!1);
|
|
346
|
+
}
|
|
347
|
+
async function M() {
|
|
348
|
+
k.value || _(
|
|
349
|
+
async () => {
|
|
350
|
+
var e;
|
|
351
|
+
const n = new xe(), l = (await q.readCollectionsByCampaignId(F.value, {
|
|
352
|
+
limit: 1,
|
|
353
|
+
skip: 0,
|
|
354
|
+
sortBy: p.sortBy,
|
|
355
|
+
descending: p.descending
|
|
356
|
+
})).meta.totalResources ?? 0, s = p.rowsPerPage;
|
|
357
|
+
for (let i = 0; i < l; i += s) {
|
|
358
|
+
const y = {
|
|
359
|
+
...p,
|
|
360
|
+
limit: s,
|
|
361
|
+
skip: (p.page - 1) * p.rowsPerPage,
|
|
362
|
+
sortBy: p.sortBy,
|
|
363
|
+
descending: p.descending
|
|
364
|
+
}, L = await q.readCollectionsByCampaignId(
|
|
365
|
+
F.value,
|
|
366
|
+
y
|
|
367
|
+
);
|
|
368
|
+
for await (const V of L.resources) {
|
|
369
|
+
const T = {
|
|
370
|
+
Id: (V == null ? void 0 : V.code) || ((e = V._id) == null ? void 0 : e.toString()) || ""
|
|
371
|
+
};
|
|
372
|
+
n.addRecord(T);
|
|
373
|
+
}
|
|
374
|
+
p.page++;
|
|
375
|
+
}
|
|
376
|
+
await de(
|
|
377
|
+
n.buildExcel(),
|
|
378
|
+
`members-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
|
|
379
|
+
{
|
|
380
|
+
bookType: "xlsx",
|
|
381
|
+
bookSST: !1,
|
|
382
|
+
type: "array"
|
|
383
|
+
}
|
|
384
|
+
), p.page = 1;
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
isLoading: k
|
|
388
|
+
}
|
|
389
|
+
);
|
|
390
|
+
}
|
|
391
|
+
return ne(async () => {
|
|
392
|
+
await v();
|
|
393
|
+
}), (n, l) => {
|
|
394
|
+
const s = d("FmPageHead"), e = d("FmSearch");
|
|
395
|
+
return x(), P(N, null, [
|
|
396
|
+
r(s, {
|
|
397
|
+
title: "Collections",
|
|
398
|
+
"back-button": !0,
|
|
399
|
+
actions: [
|
|
400
|
+
{ label: "Export", value: "export", isPrimary: !1 },
|
|
401
|
+
{
|
|
402
|
+
label: "Create collection",
|
|
403
|
+
value: "create",
|
|
404
|
+
isPrimary: !0
|
|
405
|
+
}
|
|
406
|
+
],
|
|
407
|
+
"onClick:back": l[0] || (l[0] = (i) => o(u).back()),
|
|
408
|
+
"onClick:action": l[1] || (l[1] = (i) => {
|
|
409
|
+
var y;
|
|
410
|
+
i === "create" && ((y = o(w)) == null || y.showSheet(!0)), i === "export" && M();
|
|
411
|
+
})
|
|
412
|
+
}),
|
|
413
|
+
C("div", he, [
|
|
414
|
+
r(e, {
|
|
415
|
+
class: "hidden xs:flex border-b border-fm-color-neutral-gray-100",
|
|
416
|
+
modelValue: o(a).searchValue,
|
|
417
|
+
"onUpdate:modelValue": [
|
|
418
|
+
l[2] || (l[2] = (i) => o(a).searchValue = i),
|
|
419
|
+
o(m)
|
|
420
|
+
],
|
|
421
|
+
placeholder: "Search",
|
|
422
|
+
collapsible: ""
|
|
423
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
424
|
+
C("div", ye, [
|
|
425
|
+
r(e, {
|
|
426
|
+
modelValue: o(a).searchValue,
|
|
427
|
+
"onUpdate:modelValue": [
|
|
428
|
+
l[3] || (l[3] = (i) => o(a).searchValue = i),
|
|
429
|
+
o(m)
|
|
430
|
+
],
|
|
431
|
+
placeholder: "Search",
|
|
432
|
+
collapsible: ""
|
|
433
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
434
|
+
]),
|
|
435
|
+
r(me, {
|
|
436
|
+
loading: o(a).isLoading,
|
|
437
|
+
"row-data": o(E),
|
|
438
|
+
"column-defs": A,
|
|
439
|
+
"row-count": o(a).totalRows,
|
|
440
|
+
"page-count": o(a).pageCount,
|
|
441
|
+
"page-index": o(a).pageIndex,
|
|
442
|
+
"page-size": o(a).pageSize,
|
|
443
|
+
"shrink-at": !1,
|
|
444
|
+
onSortChange: o(U),
|
|
445
|
+
onPageChange: l[4] || (l[4] = (i) => o(v)({ pageSize: i.pageSize, pageIndex: i.pageIndex }))
|
|
446
|
+
}, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onSortChange"]),
|
|
447
|
+
r(ve, {
|
|
448
|
+
ref_key: "sheetRef",
|
|
449
|
+
ref: w,
|
|
450
|
+
onSuccess: h
|
|
451
|
+
}, null, 512)
|
|
452
|
+
])
|
|
453
|
+
], 64);
|
|
454
|
+
};
|
|
455
|
+
}
|
|
456
|
+
});
|
|
457
|
+
export {
|
|
458
|
+
Ee as default
|
|
459
|
+
};
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import { defineComponent as N, ref as S, computed as j, h as M, onMounted as A, resolveComponent as l, openBlock as c, createElementBlock as y, Fragment as
|
|
1
|
+
import { defineComponent as N, ref as S, computed as j, h as M, onMounted as A, resolveComponent as l, openBlock as c, createElementBlock as y, Fragment as C, createVNode as i, unref as a, createElementVNode as n, withCtx as h, renderList as H, createBlock as v, resolveDynamicComponent as q, toDisplayString as g, createCommentVNode as z } from "vue";
|
|
2
2
|
import { _ as G } from "./campaign-CpzFl8Vr.js";
|
|
3
3
|
import { useDialog as J, components as O } from "@feedmepos/ui-library";
|
|
4
|
-
import { p as Q
|
|
5
|
-
import { u as
|
|
6
|
-
import { u as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { _ as oe } from "./
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
4
|
+
import { p as Q } from "./plugins-DKNh-lBz.js";
|
|
5
|
+
import { u as W } from "./loading-CDbkBsRr.js";
|
|
6
|
+
import { u as X } from "./business-D5AQBRGS.js";
|
|
7
|
+
import { u as Y } from "./campaign-v8MAkDo-.js";
|
|
8
|
+
import { g as Z, a as V, b as L } from "./campaign-BGiM8ccX.js";
|
|
9
|
+
import { u as ee } from "./vue-i18n-CxMxiW_u.js";
|
|
10
|
+
import { _ as oe } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
|
|
11
|
+
import { _ as te } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-wGFMCV-y.js";
|
|
12
|
+
import { u as ae } from "./template-C-fz1DXI.js";
|
|
13
|
+
import { c as _ } from "./index-DteeKoFo.js";
|
|
14
|
+
const ne = { class: "px-24 flex flex-col gap-y-16" }, re = { class: "flex items-center justify-between w-full" }, se = { class: "flex gap-8 overflow-x-auto" }, ie = { class: "space-y-8" }, le = { class: "flex w-full gap-4 items-center" }, ce = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, me = { class: "space-y-4" }, de = { class: "fm-typo-en-body-lg-600" }, pe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ue = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, fe = { key: 0 }, Ie = /* @__PURE__ */ N({
|
|
14
15
|
__name: "Credit",
|
|
15
|
-
setup(
|
|
16
|
-
const { t: r } =
|
|
16
|
+
setup(ye) {
|
|
17
|
+
const { t: r } = ee(), I = {
|
|
17
18
|
label: r("connect.program.common.actions.create", {
|
|
18
19
|
type: r("connect.program.credit.title").toLowerCase()
|
|
19
20
|
}),
|
|
20
21
|
value: "create",
|
|
21
22
|
isPrimary: !0,
|
|
22
23
|
prependIcon: "add"
|
|
23
|
-
}, R =
|
|
24
|
+
}, R = ae("CREDIT", J()), B = X(), m = Y(), { global: D, minor: w } = W, s = S({
|
|
24
25
|
searchKey: "",
|
|
25
26
|
location: null
|
|
26
27
|
}), d = j(
|
|
@@ -34,6 +35,7 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, ne = { class: "flex items-
|
|
|
34
35
|
},
|
|
35
36
|
{
|
|
36
37
|
header: r("connect.program.common.table.status"),
|
|
38
|
+
accessorFn: (e) => Z(e),
|
|
37
39
|
cell(e) {
|
|
38
40
|
return V(e.row.original);
|
|
39
41
|
}
|
|
@@ -102,13 +104,13 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, ne = { class: "flex items-
|
|
|
102
104
|
});
|
|
103
105
|
}), (e, o) => {
|
|
104
106
|
const p = l("FmPageHead"), u = l("FmSearch"), K = l("FmTable"), F = l("FmButton"), $ = l("FmListItem"), P = l("FmList"), U = l("FmCard");
|
|
105
|
-
return c(), y(
|
|
107
|
+
return c(), y(C, null, [
|
|
106
108
|
i(p, {
|
|
107
109
|
title: a(r)("connect.program.credit.title"),
|
|
108
110
|
actions: a(d).length > 0 ? [I] : [],
|
|
109
111
|
"onClick:action": o[0] || (o[0] = () => f())
|
|
110
112
|
}, null, 8, ["title", "actions"]),
|
|
111
|
-
n("div",
|
|
113
|
+
n("div", ne, [
|
|
112
114
|
i(u, {
|
|
113
115
|
modelValue: a(s).searchKey,
|
|
114
116
|
"onUpdate:modelValue": o[1] || (o[1] = (t) => a(s).searchKey = t),
|
|
@@ -116,10 +118,10 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, ne = { class: "flex items-
|
|
|
116
118
|
placeholder: "search",
|
|
117
119
|
collapsible: ""
|
|
118
120
|
}, null, 8, ["modelValue"]),
|
|
119
|
-
a(m).campaigns.credit && a(m).campaigns.credit.length > 0 ? (c(), y(
|
|
120
|
-
n("div",
|
|
121
|
-
n("div",
|
|
122
|
-
i(
|
|
121
|
+
a(m).campaigns.credit && a(m).campaigns.credit.length > 0 ? (c(), y(C, { key: 0 }, [
|
|
122
|
+
n("div", re, [
|
|
123
|
+
n("div", se, [
|
|
124
|
+
i(oe, {
|
|
123
125
|
modelValue: a(s).location,
|
|
124
126
|
"onUpdate:modelValue": o[2] || (o[2] = (t) => a(s).location = t),
|
|
125
127
|
label: "Location: ",
|
|
@@ -147,25 +149,25 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, ne = { class: "flex items-
|
|
|
147
149
|
"hide-footer": a(d).length < 10
|
|
148
150
|
}, null, 8, ["row-data", "search-value", "hide-footer"]),
|
|
149
151
|
i(P, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
|
|
150
|
-
default:
|
|
151
|
-
(c(!0), y(
|
|
152
|
+
default: h(() => [
|
|
153
|
+
(c(!0), y(C, null, H(a(d).filter(
|
|
152
154
|
(t) => t.name.toLowerCase().includes(a(s).searchKey.toLowerCase())
|
|
153
155
|
), (t) => (c(), v($, {
|
|
154
156
|
key: t._id.toString(),
|
|
155
157
|
onClick: (k) => f(t),
|
|
156
158
|
class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
|
|
157
159
|
}, {
|
|
158
|
-
default:
|
|
159
|
-
n("div",
|
|
160
|
-
n("div",
|
|
160
|
+
default: h(() => [
|
|
161
|
+
n("div", ie, [
|
|
162
|
+
n("div", le, [
|
|
161
163
|
(c(), v(q(a(V)(t)))),
|
|
162
|
-
n("div",
|
|
164
|
+
n("div", ce, g(t.currentReceive ?? 0) + " used ", 1)
|
|
163
165
|
]),
|
|
164
|
-
n("div",
|
|
165
|
-
n("div",
|
|
166
|
-
n("div",
|
|
166
|
+
n("div", me, [
|
|
167
|
+
n("div", de, g(t.name), 1),
|
|
168
|
+
n("div", pe, g(a(L)(t)), 1)
|
|
167
169
|
]),
|
|
168
|
-
n("div",
|
|
170
|
+
n("div", ue, " Credit received: " + g(t.currentReceive ?? 0), 1)
|
|
169
171
|
]),
|
|
170
172
|
i(F, {
|
|
171
173
|
icon: "delete",
|
|
@@ -179,7 +181,7 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, ne = { class: "flex items-
|
|
|
179
181
|
]),
|
|
180
182
|
_: 1
|
|
181
183
|
}),
|
|
182
|
-
a(d).length == 0 ? (c(), y("div",
|
|
184
|
+
a(d).length == 0 ? (c(), y("div", fe, o[6] || (o[6] = [
|
|
183
185
|
n("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-600" }, " No results found ", -1)
|
|
184
186
|
]))) : z("", !0)
|
|
185
187
|
], 64)) : (c(), v(U, {
|
|
@@ -187,7 +189,7 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, ne = { class: "flex items-
|
|
|
187
189
|
variant: "outlined",
|
|
188
190
|
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
189
191
|
}, {
|
|
190
|
-
default:
|
|
192
|
+
default: h(() => [
|
|
191
193
|
o[7] || (o[7] = n("img", {
|
|
192
194
|
src: G,
|
|
193
195
|
class: "aspect-square w-[150px]"
|
|
@@ -205,7 +207,7 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, ne = { class: "flex items-
|
|
|
205
207
|
]),
|
|
206
208
|
_: 1
|
|
207
209
|
})),
|
|
208
|
-
i(
|
|
210
|
+
i(te, {
|
|
209
211
|
ref_key: "sheetRef",
|
|
210
212
|
ref: b,
|
|
211
213
|
"onSubmit:modelValue": E
|
|
@@ -216,5 +218,5 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, ne = { class: "flex items-
|
|
|
216
218
|
}
|
|
217
219
|
});
|
|
218
220
|
export {
|
|
219
|
-
|
|
221
|
+
Ie as default
|
|
220
222
|
};
|