@feedmepos/mf-connect 0.0.6 → 0.0.7
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-BJYHu6np.js → Analytic-D-E67IbN.js} +8 -8
- package/dist/{Broadcast-B8FNr597.js → Broadcast-NjpOa4PK.js} +8 -8
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BlZ4cdrl.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-7KnDJ-sV.js} +8 -8
- package/dist/{Card-DLHnQyMF.js → Card-BOEkf7wo.js} +16 -16
- package/dist/{Collections-d7N7aO1G.js → Collections-sLYCpBxu.js} +16 -16
- package/dist/{Credit-DWbl28df.js → Credit-DU2_9ex7.js} +8 -8
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-DBRqd0z4.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-CBO6OHrM.js} +21 -21
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-DTxJHWjb.js → EffectSheet.vue_vue_type_style_index_0_lang-CTvGOX7T.js} +5 -5
- package/dist/{Experience-Bzt7yrvt.js → Experience-DGNdVxuU.js} +8 -8
- package/dist/{Game-IRXuMUL3.js → Game-B1i79HLc.js} +8 -8
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-C8d0t8nQ.js → ImageInput.vue_vue_type_script_setup_true_lang-DzdMpEl_.js} +1 -1
- package/dist/{MainLayout-DDh1WuO8.js → MainLayout-CfgDdm6k.js} +1 -1
- package/dist/{Marketing-C2kkxDFL.js → Marketing-CBre7DEM.js} +5 -5
- package/dist/Member-BfvuL8GL.js +91 -0
- package/dist/MemberList-CQ17Q4V7.js +1664 -0
- package/dist/{MemberTransactions-DNIJDHOQ.js → MemberTransactions-Cviim4GX.js} +4 -4
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DYWmeADi.js → MessageInput.vue_vue_type_script_setup_true_lang-j31pc2Wx.js} +2 -2
- package/dist/{Point-Bgp7ogL-.js → Point-9ta-6dJv.js} +8 -8
- package/dist/{Promotion-Dk6STeBk.js → Promotion-CBmH5FNG.js} +9 -9
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-BXzBoSgP.js → RuleGroup.vue_vue_type_script_setup_true_lang-r9Q-pOrs.js} +12 -12
- package/dist/{Segment-BEQJcNkY.js → Segment-ZUtFZM5W.js} +10 -10
- package/dist/{Setting-CZi479L2.js → Setting-TQdqaKPQ.js} +9 -9
- package/dist/Store-DX1ALcTQ.js +1424 -0
- package/dist/StoreRewards-Bd1ZFUQM.js +434 -0
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-Bdo4vZkG.js → StoreTransactions.vue_vue_type_script_setup_true_lang-D0L-LkOm.js} +5 -5
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DQQ-EPvQ.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-C0xL6Ua_.js} +1 -1
- package/dist/{Tier-DS1BnVuA.js → Tier-DAUABM7F.js} +17 -17
- package/dist/{Title-Dc3COZA9.js → Title-YJtGygMA.js} +15 -15
- package/dist/{Transaction-BCa3ObND.js → Transaction-DmvmaPk6.js} +1 -1
- package/dist/Voucher-D88gJYa3.js +449 -0
- package/dist/{app-DldkpdyI.js → app-g6ra_l_x.js} +1455 -1455
- package/dist/app.js +1 -1
- package/dist/{campaign-COrVPhtR.js → campaign-DdY0vnwY.js} +2 -2
- package/dist/{dto-lHIRZTaN.js → dto-BQHDb7XC.js} +8 -8
- package/dist/{effect-B4_HDofh.js → effect-CghM-w8z.js} +1 -1
- package/dist/{helper-CwQEM81T.js → helper-xWsMhdHl.js} +1 -1
- package/dist/{index-D8ae8TSh.js → index-B4ootZIL.js} +2 -2
- package/dist/{index-DApTNNm8.js → index-BSF_A6Bx.js} +2 -2
- package/dist/{index-CDXgQC_P.js → index-Bp8rb1uM.js} +5 -5
- package/dist/{index-DCIJl8iK.js → index-C5UTq5_2.js} +2 -2
- package/dist/{index-BDLy_dUj.js → index-CPU_mtDw.js} +3 -3
- package/dist/{index-DujHgfez.js → index-CVSXd2FW.js} +5 -5
- package/dist/{index-D3Oa_lL4.js → index-Cl-b6jYW.js} +1 -1
- package/dist/{index-ClQze5GX.js → index-D71HFulf.js} +1 -1
- package/dist/{index-Cd-A6imB.js → index-Dz8i7yJ_.js} +1 -1
- package/dist/{index-BGEOMkg0.js → index-gLwPyXKM.js} +1 -1
- package/dist/{loading-CEcLG67g.js → loading-DClM7b3o.js} +2 -2
- package/dist/{lodash-CQck_rTn.js → lodash-wTDGx83S.js} +1 -1
- package/dist/{membership-Bat0mrVs.js → membership-BEDm55VI.js} +3 -3
- package/dist/{money-JE8h3c0z.js → money-CPy2C0LJ.js} +1 -1
- package/dist/{number-D5WgTK0X.js → number-ROACK3bi.js} +1 -1
- package/dist/{plugins-B53iVLET.js → plugins-CJou3ejy.js} +4 -4
- package/dist/{rule-lH1B2od5.js → rule-Cp7qN96m.js} +2 -2
- package/dist/{rule-builder-D6chADAd.js → rule-builder-OR4oX_mq.js} +1 -1
- package/dist/{template-D4IPNePW.js → template-Dk2sky27.js} +5 -5
- package/dist/{usePagination-MD91K8Ao.js → usePagination-DRHXkOF-.js} +1 -1
- package/dist/{xlsx-zo_mxA6a.js → xlsx-C5St1Lch.js} +1 -1
- package/package.json +1 -1
- package/dist/Member-CNfC-lCV.js +0 -90
- package/dist/MemberList-B_lQ2EIK.js +0 -1663
- package/dist/Store-BeH0Gm7T.js +0 -1423
- package/dist/StoreRewards-BgYxgC_0.js +0 -433
- package/dist/Voucher-BG51P9yR.js +0 -448
package/dist/Voucher-BG51P9yR.js
DELETED
|
@@ -1,448 +0,0 @@
|
|
|
1
|
-
import { defineComponent as N, ref as h, watch as H, onMounted as D, resolveComponent as m, openBlock as b, createBlock as U, unref as t, isRef as O, withCtx as x, createElementVNode as i, createVNode as c, toDisplayString as I, computed as J, createElementBlock as B, Fragment as A, renderList as Q, resolveDynamicComponent as W, h as y } from "vue";
|
|
2
|
-
import { _ as Z } from "./campaign-CpzFl8Vr.js";
|
|
3
|
-
import { useDialog as Y, components as C } from "@feedmepos/ui-library";
|
|
4
|
-
import { p as z, c as ee } from "./plugins-B53iVLET.js";
|
|
5
|
-
import { useCoreStore as ae } from "@feedmepos/mf-common";
|
|
6
|
-
import { u as q } from "./loading-CEcLG67g.js";
|
|
7
|
-
import { u as oe, J as te, a as ne, R as se, b as le } from "./app-DldkpdyI.js";
|
|
8
|
-
import { u as ie } from "./campaign-COrVPhtR.js";
|
|
9
|
-
import { g as K, b as j } from "./dto-lHIRZTaN.js";
|
|
10
|
-
import { u as re } from "./template-D4IPNePW.js";
|
|
11
|
-
import { _ as ce } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-DBRqd0z4.js";
|
|
12
|
-
import { _ as ue } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
|
|
13
|
-
import { l as me } from "./lodash-CQck_rTn.js";
|
|
14
|
-
import { m as de } from "./index-BGEOMkg0.js";
|
|
15
|
-
import { c as S } from "./index-ClQze5GX.js";
|
|
16
|
-
const pe = { class: "space-y-16" }, fe = { class: "fm-typo-en-body-md-600" }, he = { class: "flex items-center justify-end" }, ge = { class: "flex items-center gap-8" }, ye = /* @__PURE__ */ N({
|
|
17
|
-
__name: "SendVoucherSheet",
|
|
18
|
-
emits: ["success"],
|
|
19
|
-
setup(X, { expose: L, emit: V }) {
|
|
20
|
-
const { minor: M } = q, F = h(""), u = h({}), P = V, d = h(!1), n = h([]);
|
|
21
|
-
function w(e) {
|
|
22
|
-
d.value = !0, F.value = e.campaignId;
|
|
23
|
-
}
|
|
24
|
-
function k() {
|
|
25
|
-
d.value = !1;
|
|
26
|
-
}
|
|
27
|
-
const R = [
|
|
28
|
-
{
|
|
29
|
-
header: "Name",
|
|
30
|
-
accessorFn: (e) => e.name || "No Profile"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
header: "Phone",
|
|
34
|
-
accessorFn: (e) => e.phoneNumber || "-"
|
|
35
|
-
}
|
|
36
|
-
], l = h({
|
|
37
|
-
searchValue: "",
|
|
38
|
-
pageSize: 10,
|
|
39
|
-
pageCount: 0,
|
|
40
|
-
pageIndex: 0,
|
|
41
|
-
totalRows: 0,
|
|
42
|
-
isLoading: !1
|
|
43
|
-
}), p = h([]), g = async (e) => {
|
|
44
|
-
l.value.isLoading = !0, p.value = [];
|
|
45
|
-
const o = await de.read({
|
|
46
|
-
limit: e.pageSize,
|
|
47
|
-
skip: e.pageIndex * e.pageSize,
|
|
48
|
-
sortBy: "_id",
|
|
49
|
-
search: l.value.searchValue,
|
|
50
|
-
descending: !1
|
|
51
|
-
});
|
|
52
|
-
p.value = o.resources, l.value.totalRows = o.meta.totalResources ?? 0, l.value.pageCount = o.meta.totalPages ?? 0, l.value.isLoading = !1, u.value = {}, n.value.forEach((r) => {
|
|
53
|
-
const v = p.value.findIndex((_) => _._id == r);
|
|
54
|
-
v > -1 && (console.log(v, "fetch member index"), u.value[v] = !0);
|
|
55
|
-
});
|
|
56
|
-
};
|
|
57
|
-
function $() {
|
|
58
|
-
p.value.length > 0 && (n.value = n.value.filter(
|
|
59
|
-
(e) => p.value.some((o) => o._id != e)
|
|
60
|
-
));
|
|
61
|
-
for (const [e, o] of Object.entries(u.value)) {
|
|
62
|
-
const r = p.value[e]._id;
|
|
63
|
-
n.value.includes(r) || n.value.push(r);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
async function a(e) {
|
|
67
|
-
n.value.length < 1 || await M(
|
|
68
|
-
async () => {
|
|
69
|
-
await S.sendCollection(F.value, {
|
|
70
|
-
memberId: n.value
|
|
71
|
-
}), await P("success"), k();
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
message: "Sending claim(s)",
|
|
75
|
-
successMessage: "Claim(s) created"
|
|
76
|
-
}
|
|
77
|
-
);
|
|
78
|
-
}
|
|
79
|
-
return H(u, $, { deep: !0 }), H(
|
|
80
|
-
() => l.value.searchValue,
|
|
81
|
-
me.debounce(async () => {
|
|
82
|
-
await g({ pageSize: 10, pageIndex: 0 });
|
|
83
|
-
}, 500)
|
|
84
|
-
), L({
|
|
85
|
-
showSheet: w,
|
|
86
|
-
hideSheet: k
|
|
87
|
-
}), D(async () => {
|
|
88
|
-
await g(l.value);
|
|
89
|
-
}), (e, o) => {
|
|
90
|
-
const r = m("FmSearch"), v = m("FmTable"), _ = m("FmButton"), E = m("FmSideSheet");
|
|
91
|
-
return b(), U(E, {
|
|
92
|
-
"max-width": 560,
|
|
93
|
-
"dismiss-away": !0,
|
|
94
|
-
header: "Send voucher to",
|
|
95
|
-
modelValue: t(d),
|
|
96
|
-
"onUpdate:modelValue": [
|
|
97
|
-
o[3] || (o[3] = (f) => O(d) ? d.value = f : null),
|
|
98
|
-
o[4] || (o[4] = (f) => d.value = f)
|
|
99
|
-
]
|
|
100
|
-
}, {
|
|
101
|
-
"side-sheet-footer": x(() => [
|
|
102
|
-
i("div", ge, [
|
|
103
|
-
c(_, {
|
|
104
|
-
label: "Send",
|
|
105
|
-
loading: t(oe)().isLoading,
|
|
106
|
-
onClick: a
|
|
107
|
-
}, null, 8, ["loading"]),
|
|
108
|
-
c(_, {
|
|
109
|
-
label: "Cancel",
|
|
110
|
-
type: "button",
|
|
111
|
-
variant: "tertiary",
|
|
112
|
-
onClick: o[2] || (o[2] = (f) => d.value = !1)
|
|
113
|
-
})
|
|
114
|
-
])
|
|
115
|
-
]),
|
|
116
|
-
default: x(() => [
|
|
117
|
-
c(te, { json: t(n) }, null, 8, ["json"]),
|
|
118
|
-
i("div", pe, [
|
|
119
|
-
i("div", fe, I(t(n).length) + " members selected ", 1),
|
|
120
|
-
i("div", he, [
|
|
121
|
-
c(r, {
|
|
122
|
-
class: "mt-4",
|
|
123
|
-
modelValue: t(l).searchValue,
|
|
124
|
-
"onUpdate:modelValue": o[0] || (o[0] = (f) => t(l).searchValue = f),
|
|
125
|
-
placeholder: "Search Member",
|
|
126
|
-
collapsible: ""
|
|
127
|
-
}, null, 8, ["modelValue"])
|
|
128
|
-
]),
|
|
129
|
-
c(v, {
|
|
130
|
-
modelValue: t(u),
|
|
131
|
-
"onUpdate:modelValue": o[1] || (o[1] = (f) => O(u) ? u.value = f : null),
|
|
132
|
-
class: "xs:hidden",
|
|
133
|
-
selection: "multiple",
|
|
134
|
-
loading: t(l).isLoading,
|
|
135
|
-
"row-data": t(p),
|
|
136
|
-
"column-defs": R,
|
|
137
|
-
"page-size": t(l).pageSize,
|
|
138
|
-
"page-count": t(l).pageCount,
|
|
139
|
-
"hide-footer": t(l).totalRows <= t(l).pageSize,
|
|
140
|
-
"fetch-fn": g
|
|
141
|
-
}, null, 8, ["modelValue", "loading", "row-data", "page-size", "page-count", "hide-footer"])
|
|
142
|
-
])
|
|
143
|
-
]),
|
|
144
|
-
_: 1
|
|
145
|
-
}, 8, ["modelValue"]);
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
var ve = { authUrl: "https://portal-v2-dev.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "member.feedmedev.cc", crmUrl: "crm.feedmedev.cc", marketingV1Portal: "https://marketing-v1.feedmedev.cc" };
|
|
150
|
-
const _e = { class: "px-24 flex flex-col gap-y-16" }, be = { class: "flex items-center justify-between w-full" }, we = { class: "flex gap-8 overflow-x-auto" }, Ce = { class: "space-y-8" }, Se = { class: "flex w-full gap-4 items-center" }, xe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ve = { class: "space-y-4" }, Fe = { class: "fm-typo-en-body-lg-600" }, ke = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Re = /* @__PURE__ */ i("img", {
|
|
151
|
-
src: Z,
|
|
152
|
-
class: "aspect-square w-[150px]"
|
|
153
|
-
}, null, -1), Ue = /* @__PURE__ */ i("div", { class: "flex flex-col gap-16 text-center" }, [
|
|
154
|
-
/* @__PURE__ */ i("div", { class: "fm-typo-en-title-sm-800" }, "Create voucher campaign"),
|
|
155
|
-
/* @__PURE__ */ i("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " A digital coupon that users can redeem for discounts on future purchases. Users usually need to claim and apply the voucher to benefit from the discount. ")
|
|
156
|
-
], -1), De = /* @__PURE__ */ N({
|
|
157
|
-
__name: "Voucher",
|
|
158
|
-
setup(X) {
|
|
159
|
-
const L = {
|
|
160
|
-
label: "Create campaign",
|
|
161
|
-
value: "create",
|
|
162
|
-
isPrimary: !0,
|
|
163
|
-
prependIcon: "add"
|
|
164
|
-
}, V = Y(), M = re("VOUCHER", V), F = ne(), u = ie(), { global: P, minor: d } = q, n = h({
|
|
165
|
-
searchKey: "",
|
|
166
|
-
location: null
|
|
167
|
-
}), w = J(
|
|
168
|
-
() => u.campaigns.voucher.filter(
|
|
169
|
-
(a) => !n.value.location || !a.targetLocation || a.targetLocation.includes(n.value.location)
|
|
170
|
-
)
|
|
171
|
-
), k = [
|
|
172
|
-
{
|
|
173
|
-
header: "Voucher title",
|
|
174
|
-
accessorFn: (a) => a.name
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
header: "Status",
|
|
178
|
-
cell(a) {
|
|
179
|
-
return K(a.row.original);
|
|
180
|
-
}
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
header: "Summary",
|
|
184
|
-
accessorFn: (a) => j(a)
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
header: "Quota",
|
|
188
|
-
accessorFn: (a) => {
|
|
189
|
-
var e;
|
|
190
|
-
return ((e = a.pf_collectible) == null ? void 0 : e.options.maxReceive) ?? "Unlimited";
|
|
191
|
-
}
|
|
192
|
-
},
|
|
193
|
-
{
|
|
194
|
-
header: "Claimed",
|
|
195
|
-
accessorFn: (a) => {
|
|
196
|
-
var e;
|
|
197
|
-
return ((e = a == null ? void 0 : a.pf_collectible) == null ? void 0 : e.currentReceive) ?? 0;
|
|
198
|
-
}
|
|
199
|
-
},
|
|
200
|
-
{
|
|
201
|
-
header: "Actions",
|
|
202
|
-
cell(a) {
|
|
203
|
-
return y("div", { class: "flex items-center justify-end" }, [
|
|
204
|
-
y(C.FmButton, {
|
|
205
|
-
icon: "visibility",
|
|
206
|
-
variant: "tertiary",
|
|
207
|
-
iconColor: "neutral-gray-400",
|
|
208
|
-
onClick: async (e) => {
|
|
209
|
-
e.stopPropagation(), await se.push({
|
|
210
|
-
name: le["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
|
|
211
|
-
params: { id: a.row.original._id }
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
}),
|
|
215
|
-
y(
|
|
216
|
-
C.FmMenu,
|
|
217
|
-
{
|
|
218
|
-
placement: "bottom-end",
|
|
219
|
-
onClick: (e) => {
|
|
220
|
-
e.stopPropagation();
|
|
221
|
-
}
|
|
222
|
-
},
|
|
223
|
-
{
|
|
224
|
-
"menu-button": () => y(C.FmButton, {
|
|
225
|
-
icon: "more_vert",
|
|
226
|
-
iconColor: "neutral-gray-400",
|
|
227
|
-
variant: "tertiary"
|
|
228
|
-
}),
|
|
229
|
-
default: () => {
|
|
230
|
-
const e = [
|
|
231
|
-
y(
|
|
232
|
-
C.FmMenuItem,
|
|
233
|
-
{
|
|
234
|
-
onClick: async (o) => {
|
|
235
|
-
o.stopPropagation(), p(a.row.original);
|
|
236
|
-
}
|
|
237
|
-
},
|
|
238
|
-
{
|
|
239
|
-
label: y(
|
|
240
|
-
"div",
|
|
241
|
-
{
|
|
242
|
-
class: "text-fm-color-typo-error fm-typo-en-body-md-400"
|
|
243
|
-
},
|
|
244
|
-
"Remove"
|
|
245
|
-
)
|
|
246
|
-
}
|
|
247
|
-
)
|
|
248
|
-
];
|
|
249
|
-
return a.row.original.event.type === "SIMPLE_CLAIM" && (e.unshift(
|
|
250
|
-
y(C.FmMenuItem, {
|
|
251
|
-
label: "Send",
|
|
252
|
-
onClick: async (o) => {
|
|
253
|
-
var r;
|
|
254
|
-
o.stopPropagation(), (r = l.value) == null || r.showSheet({
|
|
255
|
-
campaignId: a.row.original._id
|
|
256
|
-
});
|
|
257
|
-
}
|
|
258
|
-
})
|
|
259
|
-
), e.unshift(
|
|
260
|
-
y(C.FmMenuItem, {
|
|
261
|
-
label: "Share",
|
|
262
|
-
onClick: async (o) => {
|
|
263
|
-
if (o.stopPropagation(), a.row.original.event.type !== "SIMPLE_CLAIM")
|
|
264
|
-
return await z.confirm(
|
|
265
|
-
"Cannot share a voucher that is not a simple claim.",
|
|
266
|
-
"Share Voucher",
|
|
267
|
-
"OK"
|
|
268
|
-
);
|
|
269
|
-
await ee(
|
|
270
|
-
`https://${ae().currentBusiness.value._id}.${ve.appUrl}/vouchers/${a.row.original._id}`,
|
|
271
|
-
{
|
|
272
|
-
successMessage: "Voucher link copied to clipboard"
|
|
273
|
-
}
|
|
274
|
-
);
|
|
275
|
-
}
|
|
276
|
-
})
|
|
277
|
-
)), e;
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
)
|
|
281
|
-
]);
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
], R = h(), l = h();
|
|
285
|
-
async function p(a) {
|
|
286
|
-
await z.remove(`Are you sure you want to remove ${a.name}?`) && await d(
|
|
287
|
-
async () => {
|
|
288
|
-
await S.delete(a._id), await u.read("VOUCHER");
|
|
289
|
-
},
|
|
290
|
-
{
|
|
291
|
-
message: `Removing ${a.name}`,
|
|
292
|
-
successMessage: `Removed ${a.name} successfully`
|
|
293
|
-
}
|
|
294
|
-
);
|
|
295
|
-
}
|
|
296
|
-
async function g(a) {
|
|
297
|
-
a ? await e() : M.open(async (o) => {
|
|
298
|
-
await e(o);
|
|
299
|
-
});
|
|
300
|
-
async function e(o) {
|
|
301
|
-
var r;
|
|
302
|
-
(r = R.value) == null || r.showSheet(
|
|
303
|
-
!0,
|
|
304
|
-
"VOUCHER",
|
|
305
|
-
a ? await S.readById(a._id) : void 0,
|
|
306
|
-
o
|
|
307
|
-
);
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
async function $(a) {
|
|
311
|
-
a.campaign._id && await new Promise((e) => {
|
|
312
|
-
V.open({
|
|
313
|
-
title: "Confirmation",
|
|
314
|
-
message: "This will change all future vouchers? Would you like to update previous claimed vouchers expiry date and discount?",
|
|
315
|
-
primaryActions: { text: "Update all", close: !0 },
|
|
316
|
-
secondaryActions: { text: "Update future only", close: !0 }
|
|
317
|
-
}).onPrimary(async () => {
|
|
318
|
-
var o;
|
|
319
|
-
a.updateCollections = !0, (o = window.top) == null || o.postMessage("updateAllVoucher", "*"), e();
|
|
320
|
-
}).onSecondary(async () => {
|
|
321
|
-
e();
|
|
322
|
-
});
|
|
323
|
-
}), await d(
|
|
324
|
-
async () => {
|
|
325
|
-
a.campaign._id ? await S.update(a.campaign._id, a) : await S.create(a), await u.read("VOUCHER");
|
|
326
|
-
},
|
|
327
|
-
{
|
|
328
|
-
message: `${a.campaign._id ? "Updating" : "Creating"} voucher`,
|
|
329
|
-
successMessage: `Voucher ${a.campaign._id ? "updated" : "created"} successfully`
|
|
330
|
-
}
|
|
331
|
-
);
|
|
332
|
-
}
|
|
333
|
-
return D(async () => {
|
|
334
|
-
await P(async () => {
|
|
335
|
-
await u.read("VOUCHER");
|
|
336
|
-
});
|
|
337
|
-
}), (a, e) => {
|
|
338
|
-
const o = m("FmPageHead"), r = m("FmSearch"), v = m("FmTable"), _ = m("FmButton"), E = m("FmListItem"), f = m("FmList"), G = m("FmCard");
|
|
339
|
-
return b(), B(A, null, [
|
|
340
|
-
c(o, {
|
|
341
|
-
title: "Voucher",
|
|
342
|
-
actions: t(w).length > 0 ? [L] : [],
|
|
343
|
-
"onClick:action": e[0] || (e[0] = () => g())
|
|
344
|
-
}, null, 8, ["actions"]),
|
|
345
|
-
i("div", _e, [
|
|
346
|
-
c(r, {
|
|
347
|
-
modelValue: t(n).searchKey,
|
|
348
|
-
"onUpdate:modelValue": e[1] || (e[1] = (s) => t(n).searchKey = s),
|
|
349
|
-
class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
|
|
350
|
-
placeholder: "search",
|
|
351
|
-
collapsible: ""
|
|
352
|
-
}, null, 8, ["modelValue"]),
|
|
353
|
-
t(u).campaigns.voucher && t(u).campaigns.voucher.length > 0 ? (b(), B(A, { key: 0 }, [
|
|
354
|
-
i("div", be, [
|
|
355
|
-
i("div", we, [
|
|
356
|
-
c(ue, {
|
|
357
|
-
modelValue: t(n).location,
|
|
358
|
-
"onUpdate:modelValue": e[2] || (e[2] = (s) => t(n).location = s),
|
|
359
|
-
label: "Location: ",
|
|
360
|
-
"show-item-label": !0,
|
|
361
|
-
icon: "storefront",
|
|
362
|
-
placement: "bottom-start",
|
|
363
|
-
items: t(F).locationItems
|
|
364
|
-
}, null, 8, ["modelValue", "items"])
|
|
365
|
-
]),
|
|
366
|
-
c(r, {
|
|
367
|
-
modelValue: t(n).searchKey,
|
|
368
|
-
"onUpdate:modelValue": e[3] || (e[3] = (s) => t(n).searchKey = s),
|
|
369
|
-
class: "xs:hidden",
|
|
370
|
-
placeholder: "search",
|
|
371
|
-
collapsible: ""
|
|
372
|
-
}, null, 8, ["modelValue"])
|
|
373
|
-
]),
|
|
374
|
-
c(v, {
|
|
375
|
-
class: "xs:hidden",
|
|
376
|
-
"row-data": t(w),
|
|
377
|
-
"column-defs": k,
|
|
378
|
-
"search-value": t(n).searchKey,
|
|
379
|
-
"column-filter": [],
|
|
380
|
-
onRowClick: e[4] || (e[4] = (s) => g(s.original)),
|
|
381
|
-
"hide-footer": t(w).length < 10
|
|
382
|
-
}, null, 8, ["row-data", "search-value", "hide-footer"]),
|
|
383
|
-
c(f, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
|
|
384
|
-
default: x(() => [
|
|
385
|
-
(b(!0), B(A, null, Q(t(w).filter(
|
|
386
|
-
(s) => s.name.toLowerCase().includes(t(n).searchKey.toLowerCase())
|
|
387
|
-
), (s) => (b(), U(E, {
|
|
388
|
-
key: s._id.toString(),
|
|
389
|
-
onClick: (T) => g(s),
|
|
390
|
-
class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
|
|
391
|
-
}, {
|
|
392
|
-
default: x(() => [
|
|
393
|
-
i("div", Ce, [
|
|
394
|
-
i("div", Se, [
|
|
395
|
-
(b(), U(W(t(K)(s)))),
|
|
396
|
-
i("div", xe, I(s.currentReceive ?? 0) + " used ", 1)
|
|
397
|
-
]),
|
|
398
|
-
i("div", Ve, [
|
|
399
|
-
i("div", Fe, I(s.name), 1),
|
|
400
|
-
i("div", ke, I(t(j)(s)), 1)
|
|
401
|
-
])
|
|
402
|
-
]),
|
|
403
|
-
c(_, {
|
|
404
|
-
icon: "delete",
|
|
405
|
-
"icon-color": "neutral-gray-400",
|
|
406
|
-
variant: "tertiary",
|
|
407
|
-
onClick: (T) => (T.stopPropagation(), p(s))
|
|
408
|
-
}, null, 8, ["onClick"])
|
|
409
|
-
]),
|
|
410
|
-
_: 2
|
|
411
|
-
}, 1032, ["onClick"]))), 128))
|
|
412
|
-
]),
|
|
413
|
-
_: 1
|
|
414
|
-
})
|
|
415
|
-
], 64)) : (b(), U(G, {
|
|
416
|
-
key: 1,
|
|
417
|
-
variant: "outlined",
|
|
418
|
-
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
419
|
-
}, {
|
|
420
|
-
default: x(() => [
|
|
421
|
-
Re,
|
|
422
|
-
Ue,
|
|
423
|
-
c(_, {
|
|
424
|
-
variant: "primary",
|
|
425
|
-
label: "Create voucher campaign",
|
|
426
|
-
icon: "add",
|
|
427
|
-
onClick: e[5] || (e[5] = (s) => g())
|
|
428
|
-
})
|
|
429
|
-
]),
|
|
430
|
-
_: 1
|
|
431
|
-
})),
|
|
432
|
-
c(ce, {
|
|
433
|
-
ref_key: "sheetRef",
|
|
434
|
-
ref: R,
|
|
435
|
-
"onSubmit:modelValue": $
|
|
436
|
-
}, null, 512),
|
|
437
|
-
c(ye, {
|
|
438
|
-
ref_key: "sendVoucherSheetRef",
|
|
439
|
-
ref: l
|
|
440
|
-
}, null, 512)
|
|
441
|
-
])
|
|
442
|
-
], 64);
|
|
443
|
-
};
|
|
444
|
-
}
|
|
445
|
-
});
|
|
446
|
-
export {
|
|
447
|
-
De as default
|
|
448
|
-
};
|