@feedmepos/mf-connect 0.0.6 → 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.
- package/dist/{Analytic-BJYHu6np.js → Analytic-BxRuK2P2.js} +8 -8
- package/dist/{Broadcast-B8FNr597.js → Broadcast-BqGojAWW.js} +8 -8
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BlZ4cdrl.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B-VzcVMS.js} +8 -8
- package/dist/{Card-DLHnQyMF.js → Card-Dlj5jQp4.js} +54 -54
- package/dist/{Collections-d7N7aO1G.js → Collections-DvdDRozp.js} +180 -185
- package/dist/{Credit-DWbl28df.js → Credit-BeHm7_2S.js} +8 -8
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-DBRqd0z4.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BsbgHsah.js} +170 -160
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-DTxJHWjb.js → EffectSheet.vue_vue_type_style_index_0_lang-hwXvdiut.js} +2999 -2978
- package/dist/{Experience-Bzt7yrvt.js → Experience-CtDY9u4Y.js} +8 -8
- package/dist/{Game-IRXuMUL3.js → Game-DjaYuqcb.js} +8 -8
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-C8d0t8nQ.js → ImageInput.vue_vue_type_script_setup_true_lang-Bq5-Gl9N.js} +1 -1
- package/dist/{MainLayout-DDh1WuO8.js → MainLayout-B-iAZM2k.js} +1 -1
- package/dist/{Marketing-C2kkxDFL.js → Marketing-BJJltAh-.js} +6 -6
- package/dist/Member-eJ9Pdi5w.js +91 -0
- package/dist/MemberList-CrhMqUfJ.js +1664 -0
- package/dist/{MemberTransactions-DNIJDHOQ.js → MemberTransactions-DRET8mSQ.js} +4 -4
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DYWmeADi.js → MessageInput.vue_vue_type_script_setup_true_lang-D-ttMwn2.js} +2 -2
- package/dist/{Point-Bgp7ogL-.js → Point-DPTOgJbC.js} +8 -8
- package/dist/{Promotion-Dk6STeBk.js → Promotion-wzkRuNqO.js} +9 -9
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-BXzBoSgP.js → RuleGroup.vue_vue_type_script_setup_true_lang-Z06eB5i5.js} +12 -12
- package/dist/{Segment-BEQJcNkY.js → Segment-DnsPrP7Q.js} +10 -10
- package/dist/{Setting-CZi479L2.js → Setting-CXuZu0-m.js} +9 -9
- package/dist/Store-4Um9keEp.js +1424 -0
- package/dist/StoreRewards-B-UFeyQM.js +434 -0
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-Bdo4vZkG.js → StoreTransactions.vue_vue_type_script_setup_true_lang-BAyotuXd.js} +5 -5
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DQQ-EPvQ.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-I_XFpctY.js} +1 -1
- package/dist/Tier-C6KVsxGO.js +818 -0
- package/dist/{Title-Dc3COZA9.js → Title-DuN1ahIM.js} +236 -236
- package/dist/{Transaction-BCa3ObND.js → Transaction-DdfX7Xfe.js} +1 -1
- package/dist/Voucher-DarXrxZr.js +454 -0
- package/dist/{app-DldkpdyI.js → app-CxBTTB31.js} +2372 -2357
- package/dist/app.js +1 -1
- package/dist/{campaign-COrVPhtR.js → campaign-B0aXkadj.js} +7 -7
- package/dist/dto-BtdVC-Ab.js +1093 -0
- package/dist/{effect-B4_HDofh.js → effect-BUN6rkQM.js} +1 -1
- package/dist/{helper-CwQEM81T.js → helper-Cpq3x8K5.js} +1 -1
- package/dist/{index-DujHgfez.js → index-0GYrZr4L.js} +138 -132
- package/dist/{index-Cd-A6imB.js → index-8clzk3uX.js} +1 -1
- package/dist/{index-ClQze5GX.js → index-BTntbYTS.js} +1 -1
- package/dist/{index-D8ae8TSh.js → index-BvnZdJBY.js} +2 -2
- package/dist/{index-D3Oa_lL4.js → index-C6NgUSl2.js} +1 -1
- package/dist/{index-CDXgQC_P.js → index-CK9yJMj7.js} +34 -34
- package/dist/{index-DApTNNm8.js → index-D2Juhkdw.js} +2 -2
- package/dist/{index-DCIJl8iK.js → index-DDSLx7vu.js} +2 -2
- package/dist/{index-BGEOMkg0.js → index-Dg-PMgXV.js} +1 -1
- package/dist/index-DysVCkrx.js +1735 -0
- package/dist/libs/packages/core/src/campaign/campaign.enum.d.ts +6 -0
- package/dist/libs/packages/core/src/campaign/campaign.fn.d.ts +2 -0
- package/dist/libs/packages/core/src/template/templates.d.ts +7 -0
- package/dist/{loading-CEcLG67g.js → loading-Cxp7sI5p.js} +2 -2
- package/dist/{lodash-CQck_rTn.js → lodash-DsT1nK-T.js} +1 -1
- package/dist/{membership-Bat0mrVs.js → membership-DtD45RXh.js} +4 -4
- package/dist/{money-JE8h3c0z.js → money-CFI1TMCS.js} +1 -1
- package/dist/{number-D5WgTK0X.js → number-BBtf4fYz.js} +1 -1
- package/dist/packages/connect/src/api/index.d.ts +3 -0
- package/dist/packages/connect/src/api/settings/index.d.ts +1 -1
- package/dist/packages/connect/src/main.d.ts +1 -1
- package/dist/{plugins-B53iVLET.js → plugins-B_d-WFtN.js} +4 -4
- package/dist/{rule-lH1B2od5.js → rule-CB9Qlcx1.js} +2 -2
- package/dist/{rule-builder-D6chADAd.js → rule-builder-BIKcA4Bg.js} +1 -1
- package/dist/{template-D4IPNePW.js → template-qlb46PGl.js} +5 -5
- package/dist/{usePagination-MD91K8Ao.js → usePagination-CX66ab1Y.js} +1 -1
- package/dist/{xlsx-zo_mxA6a.js → xlsx-DMaFso0k.js} +1 -1
- package/package.json +2 -2
- 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/Tier-DS1BnVuA.js +0 -818
- package/dist/Voucher-BG51P9yR.js +0 -448
- package/dist/dto-lHIRZTaN.js +0 -353
- package/dist/index-BDLy_dUj.js +0 -1742
|
@@ -0,0 +1,434 @@
|
|
|
1
|
+
import { defineComponent as Y, ref as V, computed as N, onMounted as Z, resolveComponent as p, openBlock as u, createBlock as b, unref as e, isRef as z, withCtx as x, createElementVNode as s, createVNode as n, createElementBlock as I, createTextVNode as J, resolveDynamicComponent as H, toDisplayString as K, Fragment as j, createCommentVNode as U, h as C } from "vue";
|
|
2
|
+
import { _ as Q } from "./campaign-CpzFl8Vr.js";
|
|
3
|
+
import { components as $ } from "@feedmepos/ui-library";
|
|
4
|
+
import { a as X, u as q, R as k } from "./app-CxBTTB31.js";
|
|
5
|
+
import { u as ee } from "./loading-Cxp7sI5p.js";
|
|
6
|
+
import { C as _, u as te } from "./membership-DtD45RXh.js";
|
|
7
|
+
import { p as M, f as B } from "./plugins-B_d-WFtN.js";
|
|
8
|
+
import { F as oe } from "./index-D2Juhkdw.js";
|
|
9
|
+
import { c as ae } from "./object-qECH92oz.js";
|
|
10
|
+
import { _ as ne } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
|
|
11
|
+
import { useCoreStore as le } from "@feedmepos/mf-common";
|
|
12
|
+
import { _ as se, Z as w } from "./ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js";
|
|
13
|
+
import { _ as ie } from "./ImageInput.vue_vue_type_script_setup_true_lang-Bq5-Gl9N.js";
|
|
14
|
+
import { _ as re } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-I_XFpctY.js";
|
|
15
|
+
import { _ as me, a as de } from "./EffectSheet.vue_vue_type_style_index_0_lang-hwXvdiut.js";
|
|
16
|
+
import { i as ce, t as ue } from "./helper-Cpq3x8K5.js";
|
|
17
|
+
import { useRouter as pe } from "vue-router";
|
|
18
|
+
import { m as D } from "./index-C6NgUSl2.js";
|
|
19
|
+
const fe = {
|
|
20
|
+
key: 0,
|
|
21
|
+
class: "flex flex-col space-y-16 pr-12"
|
|
22
|
+
}, ye = { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, we = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary flex items-center justify-between" }, ge = /* @__PURE__ */ s("div", { class: "fm-typo-en-title-sm-800" }, "Discount", -1), ve = /* @__PURE__ */ s("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, " Usage configuration ", -1), be = /* @__PURE__ */ s("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, "Availability", -1), _e = { class: "flex items-center gap-8" }, he = /* @__PURE__ */ Y({
|
|
23
|
+
__name: "EditRewardSheet",
|
|
24
|
+
emits: ["update"],
|
|
25
|
+
setup(W, { expose: O, emit: f }) {
|
|
26
|
+
const A = f, S = X(), h = le(), i = V(!1), a = V(), y = V(), l = oe, g = N(
|
|
27
|
+
() => {
|
|
28
|
+
var o;
|
|
29
|
+
return _[((o = a.value) == null ? void 0 : o.type) || "VOUCHER"];
|
|
30
|
+
}
|
|
31
|
+
), P = N(() => {
|
|
32
|
+
const o = l.safeParse(a.value);
|
|
33
|
+
return o.success ? [] : o.error.errors;
|
|
34
|
+
});
|
|
35
|
+
function F() {
|
|
36
|
+
const o = l.safeParse(a.value);
|
|
37
|
+
o.success && A("update", o.data);
|
|
38
|
+
}
|
|
39
|
+
function E(o, t, m = {
|
|
40
|
+
isStoreReward: !1,
|
|
41
|
+
type: "VOUCHER"
|
|
42
|
+
}) {
|
|
43
|
+
i.value = o, o && (y.value = void 0, a.value = t || ce(m.type, {
|
|
44
|
+
business: h.currentBusiness.value._id,
|
|
45
|
+
noCampaign: m.isStoreReward == !0
|
|
46
|
+
}));
|
|
47
|
+
}
|
|
48
|
+
return Z(async () => {
|
|
49
|
+
await S.readLocations();
|
|
50
|
+
}), O({
|
|
51
|
+
showSheet: E,
|
|
52
|
+
data: a,
|
|
53
|
+
rewardImage: y
|
|
54
|
+
}), (o, t) => {
|
|
55
|
+
const m = p("FmTextarea"), c = p("FmHelperText"), R = p("FmSwitch"), T = p("FmButton"), L = p("FmSideSheet");
|
|
56
|
+
return u(), b(L, {
|
|
57
|
+
"max-width": 560,
|
|
58
|
+
modelValue: e(i),
|
|
59
|
+
"onUpdate:modelValue": t[8] || (t[8] = (v) => z(i) ? i.value = v : null),
|
|
60
|
+
header: "Store setting"
|
|
61
|
+
}, {
|
|
62
|
+
"side-sheet-footer": x(() => [
|
|
63
|
+
s("div", _e, [
|
|
64
|
+
n(T, {
|
|
65
|
+
label: "Submit",
|
|
66
|
+
onClick: F,
|
|
67
|
+
disabled: e(P).length > 0 || e(q)().isLoading,
|
|
68
|
+
loading: e(q)().isLoading
|
|
69
|
+
}, null, 8, ["disabled", "loading"]),
|
|
70
|
+
n(T, {
|
|
71
|
+
label: "Cancel",
|
|
72
|
+
onClick: t[7] || (t[7] = (v) => E(!1)),
|
|
73
|
+
variant: "tertiary"
|
|
74
|
+
})
|
|
75
|
+
])
|
|
76
|
+
]),
|
|
77
|
+
default: x(() => {
|
|
78
|
+
var v, d, G;
|
|
79
|
+
return [
|
|
80
|
+
e(a) ? (u(), I("div", fe, [
|
|
81
|
+
s("div", ye, [
|
|
82
|
+
J(" Reward information "),
|
|
83
|
+
(u(), b(H(e(g).chip())))
|
|
84
|
+
]),
|
|
85
|
+
n(se, {
|
|
86
|
+
modelValue: e(a).name,
|
|
87
|
+
"onUpdate:modelValue": t[0] || (t[0] = (r) => e(a).name = r),
|
|
88
|
+
label: `${e(g).name} name`,
|
|
89
|
+
schema: e(w).typeAtPath(e(l), "name", [e(a).type])
|
|
90
|
+
}, null, 8, ["modelValue", "label", "schema"]),
|
|
91
|
+
n(m, {
|
|
92
|
+
class: "!mb-[-16px]",
|
|
93
|
+
modelValue: e(a).description,
|
|
94
|
+
"onUpdate:modelValue": t[1] || (t[1] = (r) => e(a).description = r),
|
|
95
|
+
rules: [e(w).ruleAtPath(e(l), "description", [e(a).type])]
|
|
96
|
+
}, {
|
|
97
|
+
label: x(() => [
|
|
98
|
+
(u(), b(H(
|
|
99
|
+
e(w).toInputLabel(
|
|
100
|
+
e(w).typeAtPath(e(l), "description", [e(a).type]),
|
|
101
|
+
`${e(g).name} description`
|
|
102
|
+
)
|
|
103
|
+
)))
|
|
104
|
+
]),
|
|
105
|
+
_: 1
|
|
106
|
+
}, 8, ["modelValue", "rules"]),
|
|
107
|
+
s("div", we, [
|
|
108
|
+
s("div", null, K(e(g).name) + " description should not exceed 200 characters. ", 1),
|
|
109
|
+
s("div", null, K(((v = e(a).description) == null ? void 0 : v.length) ?? 0) + "/200", 1)
|
|
110
|
+
]),
|
|
111
|
+
n(ie, {
|
|
112
|
+
class: "w-1/2 xs:w-2/3",
|
|
113
|
+
"aspect-ratio": "16/9",
|
|
114
|
+
file: e(y) ?? void 0,
|
|
115
|
+
thumbnail: e(a).image ?? void 0,
|
|
116
|
+
"onUpdate:file": t[2] || (t[2] = async (r) => {
|
|
117
|
+
y.value = r, r || (e(a).image = null);
|
|
118
|
+
})
|
|
119
|
+
}, {
|
|
120
|
+
label: x(() => [
|
|
121
|
+
(u(), b(H(
|
|
122
|
+
e(w).toInputLabel(
|
|
123
|
+
e(w).typeAtPath(e(l), "image", [e(a).type]),
|
|
124
|
+
`${e(g).name} image`
|
|
125
|
+
)
|
|
126
|
+
)))
|
|
127
|
+
]),
|
|
128
|
+
_: 1
|
|
129
|
+
}, 8, ["file", "thumbnail"]),
|
|
130
|
+
e(a).type === "VOUCHER" ? (u(), I(j, { key: 0 }, [
|
|
131
|
+
ge,
|
|
132
|
+
n(me, {
|
|
133
|
+
"model-value": e(a).extras.effect,
|
|
134
|
+
"onUpdate:modelValue": t[3] || (t[3] = (r) => {
|
|
135
|
+
e(a).extras.effect = r;
|
|
136
|
+
})
|
|
137
|
+
}, null, 8, ["model-value"]),
|
|
138
|
+
e(a).extras.effect == null ? (u(), b(c, {
|
|
139
|
+
key: 0,
|
|
140
|
+
class: "!mt-8",
|
|
141
|
+
text: "Effect is required",
|
|
142
|
+
state: "error"
|
|
143
|
+
})) : U("", !0),
|
|
144
|
+
ve,
|
|
145
|
+
n(de, {
|
|
146
|
+
"model-value": e(a).options,
|
|
147
|
+
"no-campaign": e(a).noCampaign,
|
|
148
|
+
"onUpdate:modelValue": t[4] || (t[4] = (r) => e(a).options = r),
|
|
149
|
+
schema: e(w).typeAtPath(e(l), "options", ["VOUCHER"])
|
|
150
|
+
}, null, 8, ["model-value", "no-campaign", "schema"])
|
|
151
|
+
], 64)) : U("", !0),
|
|
152
|
+
be,
|
|
153
|
+
e(a).type === "VOUCHER" ? (u(), b(re, {
|
|
154
|
+
key: 1,
|
|
155
|
+
"model-value": ((G = (d = e(a).extras) == null ? void 0 : d.targetLocation) == null ? void 0 : G.map(String)) ?? null,
|
|
156
|
+
type: "select",
|
|
157
|
+
"onUpdate:modelValue": t[5] || (t[5] = (r) => {
|
|
158
|
+
e(a).extras.targetLocation = r;
|
|
159
|
+
}),
|
|
160
|
+
rules: [
|
|
161
|
+
e(w).ruleAtPath(e(l), "extras.targetLocation", ["VOUCHER"])
|
|
162
|
+
]
|
|
163
|
+
}, null, 8, ["model-value", "rules"])) : U("", !0),
|
|
164
|
+
n(R, {
|
|
165
|
+
modelValue: e(a).internal,
|
|
166
|
+
"onUpdate:modelValue": t[6] || (t[6] = (r) => e(a).internal = r),
|
|
167
|
+
"label-placement": "right",
|
|
168
|
+
label: "Internal only",
|
|
169
|
+
sublabel: `${e(_)[e(a).type].name} will not be shown to customer`
|
|
170
|
+
}, null, 8, ["modelValue", "sublabel"])
|
|
171
|
+
])) : U("", !0)
|
|
172
|
+
];
|
|
173
|
+
}),
|
|
174
|
+
_: 1
|
|
175
|
+
}, 8, ["modelValue"]);
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
}), Re = { class: "px-24 flex flex-col gap-y-16" }, Ce = { class: "flex items-center justify-between w-full" }, xe = { class: "flex gap-8" }, Fe = /* @__PURE__ */ s("img", {
|
|
179
|
+
src: Q,
|
|
180
|
+
class: "aspect-square w-[150px]"
|
|
181
|
+
}, null, -1), Ve = /* @__PURE__ */ s("div", { class: "flex flex-col gap-16 text-center" }, [
|
|
182
|
+
/* @__PURE__ */ s("div", { class: "fm-typo-en-title-sm-800" }, "Create rewards"),
|
|
183
|
+
/* @__PURE__ */ s("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Create rewards for your customers to redeem inside their bundle. ")
|
|
184
|
+
], -1), Ke = /* @__PURE__ */ Y({
|
|
185
|
+
__name: "StoreRewards",
|
|
186
|
+
setup(W) {
|
|
187
|
+
const O = {
|
|
188
|
+
label: "Create reward",
|
|
189
|
+
value: "create",
|
|
190
|
+
isPrimary: !0,
|
|
191
|
+
prependIcon: "add"
|
|
192
|
+
}, f = te(), { global: A, minor: S } = ee, h = pe(), i = V({
|
|
193
|
+
searchKey: "",
|
|
194
|
+
columnFilters: []
|
|
195
|
+
}), a = [
|
|
196
|
+
{
|
|
197
|
+
header: "Reward title",
|
|
198
|
+
accessorFn: (o) => o.name
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
id: "type",
|
|
202
|
+
header: "Reward type",
|
|
203
|
+
accessorFn: (o) => o.type,
|
|
204
|
+
cell(o) {
|
|
205
|
+
return _[o.row.original.type].chip();
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
header: "Validity",
|
|
210
|
+
accessorFn: (o) => ue(
|
|
211
|
+
"validityOption" in o.options ? o.options.validityOption || {} : {}
|
|
212
|
+
)
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
header: "Used",
|
|
216
|
+
meta: {
|
|
217
|
+
textAlign: "right"
|
|
218
|
+
},
|
|
219
|
+
accessorFn: (o) => o.currentReceive ?? 0
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
header: "Actions",
|
|
223
|
+
cell(o) {
|
|
224
|
+
return C("div", { class: "flex items-center justify-end gap-4" }, [
|
|
225
|
+
C(
|
|
226
|
+
$.FmMenu,
|
|
227
|
+
{
|
|
228
|
+
placement: "bottom-end",
|
|
229
|
+
onClick: (t) => {
|
|
230
|
+
t.stopPropagation();
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"menu-button": () => C($.FmButton, {
|
|
235
|
+
icon: "more_vert",
|
|
236
|
+
iconColor: "neutral-gray-400",
|
|
237
|
+
variant: "tertiary"
|
|
238
|
+
}),
|
|
239
|
+
default: () => [
|
|
240
|
+
C($.FmMenuItem, {
|
|
241
|
+
label: "View collections",
|
|
242
|
+
onClick: async (t) => {
|
|
243
|
+
t.stopPropagation(), g(o.row.original._id);
|
|
244
|
+
}
|
|
245
|
+
}),
|
|
246
|
+
// h(components.FmMenuItem, {
|
|
247
|
+
// label: 'View transactions',
|
|
248
|
+
// onClick: async (event: Event) => {
|
|
249
|
+
// event.stopPropagation();
|
|
250
|
+
// onViewTransactions(props.row.original._id as string);
|
|
251
|
+
// },
|
|
252
|
+
// }),
|
|
253
|
+
C(
|
|
254
|
+
$.FmMenuItem,
|
|
255
|
+
{
|
|
256
|
+
onClick: async (t) => {
|
|
257
|
+
t.stopPropagation(), P(o.row.original);
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
label: C(
|
|
262
|
+
"div",
|
|
263
|
+
{
|
|
264
|
+
class: "text-fm-color-typo-error fm-typo-en-body-md-400"
|
|
265
|
+
},
|
|
266
|
+
"Remove"
|
|
267
|
+
)
|
|
268
|
+
}
|
|
269
|
+
)
|
|
270
|
+
]
|
|
271
|
+
}
|
|
272
|
+
)
|
|
273
|
+
]);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
], y = N(
|
|
277
|
+
() => f.bundleRewards.filter((o) => o.type == "VOUCHER")
|
|
278
|
+
), l = V();
|
|
279
|
+
function g(o) {
|
|
280
|
+
h.push({
|
|
281
|
+
name: k["$connect-STORE_REWARD_COLLECTIONS"],
|
|
282
|
+
params: { id: o }
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
async function P(o) {
|
|
286
|
+
if (o.type === "TITLE") {
|
|
287
|
+
await M.confirm(
|
|
288
|
+
"You cannot remove a title here, please remove it at the Program > Title section.",
|
|
289
|
+
"Delete reward",
|
|
290
|
+
"Go to title section"
|
|
291
|
+
) && await h.push({ name: k["$connect-PROGRAM_TITLE"] });
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
await M.remove(
|
|
295
|
+
"Are you sure you want to delete this reward?",
|
|
296
|
+
"Delete reward"
|
|
297
|
+
) && await S(
|
|
298
|
+
async () => {
|
|
299
|
+
await D.deleteReward(o._id), await f.readMembership(), await f.readRewards();
|
|
300
|
+
},
|
|
301
|
+
{ message: "Deleting reward", successMessage: "Reward deleted" }
|
|
302
|
+
);
|
|
303
|
+
}
|
|
304
|
+
async function F(o) {
|
|
305
|
+
var m;
|
|
306
|
+
const t = o ? ae(f.bundleRewards.find((c) => c._id === o)) : void 0;
|
|
307
|
+
if ((t == null ? void 0 : t.type) === "TITLE") {
|
|
308
|
+
await M.confirm(
|
|
309
|
+
"You cannot edit a title here, please edit it at the Program > Title section.",
|
|
310
|
+
"Update reward",
|
|
311
|
+
"Go to title section"
|
|
312
|
+
) && await h.push({ name: k["$connect-PROGRAM_TITLE"] });
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
(m = l.value) == null || m.showSheet(!0, t, {
|
|
316
|
+
isStoreReward: !0,
|
|
317
|
+
type: "VOUCHER"
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
async function E(o) {
|
|
321
|
+
await S(
|
|
322
|
+
async () => {
|
|
323
|
+
var t, m, c, R;
|
|
324
|
+
(t = l.value) != null && t.rewardImage && o.image ? await B.delete(o.image) : (m = l.value) != null && m.rewardImage && (o.image = await B.update(
|
|
325
|
+
o.image || B.collectibleImagePath(
|
|
326
|
+
void 0,
|
|
327
|
+
l.value.rewardImage
|
|
328
|
+
),
|
|
329
|
+
(c = l.value) == null ? void 0 : c.rewardImage
|
|
330
|
+
)), o._id ? await D.updateReward(o._id, o) : await D.createReward(o), await f.readRewards(), (R = l.value) == null || R.showSheet(!1);
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
message: "Updating reward",
|
|
334
|
+
successMessage: "Reward updated successfully"
|
|
335
|
+
}
|
|
336
|
+
);
|
|
337
|
+
}
|
|
338
|
+
return Z(async () => {
|
|
339
|
+
await A(async () => {
|
|
340
|
+
await f.readMembership(), await f.readRewards();
|
|
341
|
+
});
|
|
342
|
+
}), (o, t) => {
|
|
343
|
+
const m = p("FmPageHead"), c = p("FmMenuItem"), R = p("FmSearch"), T = p("FmTable"), L = p("FmButton"), v = p("FmCard");
|
|
344
|
+
return u(), I(j, null, [
|
|
345
|
+
n(m, {
|
|
346
|
+
title: "Rewards",
|
|
347
|
+
description: "Create and manage rewards for your customers.",
|
|
348
|
+
actions: [O],
|
|
349
|
+
"back-button": !0,
|
|
350
|
+
"onClick:action": t[0] || (t[0] = () => F()),
|
|
351
|
+
"onClick:back": t[1] || (t[1] = () => e(h).push({ name: e(k)["$connect-STORE"] }))
|
|
352
|
+
}, null, 8, ["actions"]),
|
|
353
|
+
s("div", Re, [
|
|
354
|
+
e(y) && e(y).length > 0 ? (u(), I(j, { key: 0 }, [
|
|
355
|
+
s("div", Ce, [
|
|
356
|
+
s("div", xe, [
|
|
357
|
+
n(ne, {
|
|
358
|
+
label: `Reward type: ${e(i).columnFilters.length == 0 ? "All" : e(i).columnFilters[0].name}`
|
|
359
|
+
}, {
|
|
360
|
+
default: x(() => [
|
|
361
|
+
n(c, {
|
|
362
|
+
onClick: t[2] || (t[2] = (d) => e(i).columnFilters = []),
|
|
363
|
+
label: "All"
|
|
364
|
+
}),
|
|
365
|
+
n(c, {
|
|
366
|
+
onClick: t[3] || (t[3] = (d) => e(i).columnFilters = [
|
|
367
|
+
{
|
|
368
|
+
id: "type",
|
|
369
|
+
value: "VOUCHER",
|
|
370
|
+
name: e(_).VOUCHER.name
|
|
371
|
+
}
|
|
372
|
+
]),
|
|
373
|
+
label: e(_).VOUCHER.name
|
|
374
|
+
}, null, 8, ["label"]),
|
|
375
|
+
n(c, {
|
|
376
|
+
onClick: t[4] || (t[4] = (d) => e(i).columnFilters = [
|
|
377
|
+
{
|
|
378
|
+
id: "type",
|
|
379
|
+
value: "TITLE",
|
|
380
|
+
name: e(_).TITLE.name
|
|
381
|
+
}
|
|
382
|
+
]),
|
|
383
|
+
label: e(_).TITLE.name
|
|
384
|
+
}, null, 8, ["label"])
|
|
385
|
+
]),
|
|
386
|
+
_: 1
|
|
387
|
+
}, 8, ["label"])
|
|
388
|
+
]),
|
|
389
|
+
n(R, {
|
|
390
|
+
modelValue: e(i).searchKey,
|
|
391
|
+
"onUpdate:modelValue": t[5] || (t[5] = (d) => e(i).searchKey = d),
|
|
392
|
+
class: "",
|
|
393
|
+
placeholder: "search",
|
|
394
|
+
collapsible: ""
|
|
395
|
+
}, null, 8, ["modelValue"])
|
|
396
|
+
]),
|
|
397
|
+
n(T, {
|
|
398
|
+
"row-data": e(y),
|
|
399
|
+
"column-defs": a,
|
|
400
|
+
"search-value": e(i).searchKey,
|
|
401
|
+
"column-filter": e(i).columnFilters,
|
|
402
|
+
onRowClick: t[6] || (t[6] = (d) => F(d.original._id)),
|
|
403
|
+
"hide-footer": e(y).length < 10
|
|
404
|
+
}, null, 8, ["row-data", "search-value", "column-filter", "hide-footer"])
|
|
405
|
+
], 64)) : (u(), b(v, {
|
|
406
|
+
key: 1,
|
|
407
|
+
variant: "outlined",
|
|
408
|
+
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
409
|
+
}, {
|
|
410
|
+
default: x(() => [
|
|
411
|
+
Fe,
|
|
412
|
+
Ve,
|
|
413
|
+
n(L, {
|
|
414
|
+
variant: "primary",
|
|
415
|
+
label: "Create reward",
|
|
416
|
+
onClick: t[7] || (t[7] = (d) => F()),
|
|
417
|
+
icon: "add"
|
|
418
|
+
})
|
|
419
|
+
]),
|
|
420
|
+
_: 1
|
|
421
|
+
})),
|
|
422
|
+
n(he, {
|
|
423
|
+
ref_key: "rewardSheetRef",
|
|
424
|
+
ref: l,
|
|
425
|
+
onUpdate: t[8] || (t[8] = (d) => E(d))
|
|
426
|
+
}, null, 512)
|
|
427
|
+
])
|
|
428
|
+
], 64);
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
});
|
|
432
|
+
export {
|
|
433
|
+
Ke as default
|
|
434
|
+
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { defineComponent as O, ref as I, computed as M, onMounted as A, resolveComponent as _, openBlock as x, createBlock as V, unref as e, withCtx as k, createVNode as g, normalizeClass as T, createCommentVNode as Z, createElementVNode as C, toDisplayString as z, createElementBlock as P, Fragment as ee, renderList as ae, mergeModels as B, useModel as te, watch as U, onBeforeMount as oe, h as d } from "vue";
|
|
2
2
|
import { components as w } from "@feedmepos/ui-library";
|
|
3
|
-
import { d as ne } from "./index-
|
|
4
|
-
import { c as q } from "./plugins-
|
|
3
|
+
import { d as ne } from "./index-DDSLx7vu.js";
|
|
4
|
+
import { c as q } from "./plugins-B_d-WFtN.js";
|
|
5
5
|
import { s as re } from "./index-Dbd4WA4r.js";
|
|
6
6
|
import { h as b } from "./moment-BWErdI6_.js";
|
|
7
7
|
import { s as L } from "./index-CuvNtC_M.js";
|
|
8
|
-
import { f as le } from "./number-
|
|
9
|
-
import { e as Y, j as se, S as ie, h as ce, a as ue } from "./app-
|
|
10
|
-
import { u as K, _ as H } from "./usePagination-
|
|
8
|
+
import { f as le } from "./number-BBtf4fYz.js";
|
|
9
|
+
import { e as Y, j as se, S as ie, h as ce, a as ue } from "./app-CxBTTB31.js";
|
|
10
|
+
import { u as K, _ as H } from "./usePagination-CX66ab1Y.js";
|
|
11
11
|
import { o as G } from "./objectId-dwaoBfJX.js";
|
|
12
12
|
function de(o) {
|
|
13
13
|
let l = "";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as C, ref as U, computed as B, resolveComponent as g, openBlock as o, createElementBlock as u, Fragment as v, toDisplayString as L, createCommentVNode as N, createElementVNode as E, createVNode as h, unref as d, renderList as x, createBlock as S, isRef as I, withCtx as p } from "vue";
|
|
2
|
-
import { a as A } from "./app-
|
|
2
|
+
import { a as A } from "./app-CxBTTB31.js";
|
|
3
3
|
function M(e, m, t) {
|
|
4
4
|
return e.some(
|
|
5
5
|
t instanceof Function ? t : (a) => a === m
|