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