@feedmepos/mf-connect 0.1.2-prod → 0.1.4-prod
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-07T9poLx.js +423 -0
- package/dist/{App-CRTD0U-N.js → App-C6MukSCT.js} +276 -275
- package/dist/Broadcast-CzsgeZNO.js +223 -0
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-C5zUv0Zx.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BirunpzI.js} +8 -8
- package/dist/Card-DQnyWZZf.js +824 -0
- package/dist/{Collections-BgbWoLWI.js → Collections-BV7CSqRw.js} +4 -4
- package/dist/Credit-CxsbYGLZ.js +220 -0
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-C137bE1q.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BKSZYxvb.js} +918 -901
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-DpsrI-Z3.js +345 -0
- package/dist/Experience-eMUbhq7h.js +221 -0
- package/dist/Game-CxAG2ViS.js +255 -0
- package/dist/Marketing-CozMj2Y5.js +316 -0
- package/dist/Member-DM1dj3F5.js +69 -0
- package/dist/{MemberList-ISy05wGZ.js → MemberList-DNjK9BbG.js} +14 -14
- package/dist/{MemberTransactions-CXvhJngX.js → MemberTransactions-CsjN3LZA.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-Ca1LO__F.js → MessageInput.vue_vue_type_script_setup_true_lang-DVQE9v2R.js} +2 -2
- package/dist/Mission-BugvTPPH.js +261 -0
- package/dist/Point-D8BjGtqT.js +222 -0
- package/dist/Promotion-mc9KBzoJ.js +253 -0
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-D1eQ3i5D.js → RuleGroup.vue_vue_type_script_setup_true_lang-B2H3D_kZ.js} +15 -15
- package/dist/Segment-DZRFA-Pb.js +565 -0
- package/dist/Setting-DxNhR44e.js +1871 -0
- package/dist/Store-CdkJWpjV.js +1530 -0
- package/dist/StoreRewards-Cdturia8.js +400 -0
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-nhS5Dhhk.js → StoreTransactions.vue_vue_type_script_setup_true_lang-D7GcOiUM.js} +10 -10
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DWlpmE56.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-nuCOrrLE.js} +1 -1
- package/dist/{Tier-DLrOmrnK.js → Tier-I_MMd39Y.js} +470 -445
- package/dist/{Title-MHQuel7h.js → Title-DK5gmUvo.js} +298 -282
- package/dist/Transaction-BXpTIMS_.js +39 -0
- package/dist/Voucher-BQ5h2G0I.js +490 -0
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-eAP99wyg.js +141 -0
- package/dist/app-CL2Wxzv5.js +5639 -0
- package/dist/{app-BjOpRVdv.js → app-DTAyCT-G.js} +1 -1
- package/dist/app.js +4 -3
- package/dist/{business-DveMDDHY.js → business-B9OUlaFZ.js} +1 -1
- package/dist/{campaign-CMb05XLt.js → campaign-CNbUA51l.js} +2 -2
- package/dist/{collection.fn-BjaBPYMU.js → collection.fn-D_i45T4Q.js} +2 -2
- package/dist/dto-B4208_es.js +2770 -0
- package/dist/{effect-CxAdSlyD.js → effect-Ye_yr8et.js} +1 -1
- package/dist/{email-addresses-Dtr5OALQ.js → email-addresses-Gm7Dyaxy.js} +1 -1
- package/dist/{export-DuBekrcg.js → export-Buee5oUV.js} +3 -3
- package/dist/{helper-DL6hnmtJ.js → helper-BBlHhMFc.js} +1 -1
- package/dist/{index-raYm7Ew2.js → index-BxJgFvym.js} +2 -2
- package/dist/{index-gcsOy_cD.js → index-ByaM-yoc.js} +91 -86
- package/dist/{index-DISwCnfH.js → index-C0QHb5SL.js} +2 -2
- package/dist/{index-Cibwzgac.js → index-C363BG5A.js} +3 -3
- package/dist/{index-BZAlqAaJ.js → index-CLL3no-v.js} +1 -1
- package/dist/{index-CAQpU5Rv.js → index-ChSVaFk3.js} +1 -1
- package/dist/{index-BSIUoSG3.js → index-Co9n8I_5.js} +3 -3
- package/dist/index-CoGNKU8v.js +3 -0
- package/dist/{index-Dx4pkNRc.js → index-DHGcUMVN.js} +1 -1
- package/dist/{index-CgPlJqkX.js → index-DWWtZSrm.js} +1 -1
- package/dist/{index-CGHNWhkM.js → index-DdVZgYE4.js} +258 -256
- package/dist/{index-BBBytzpn.js → index-Dx3HwWcb.js} +1 -1
- package/dist/{index.esm2017-Bs9CWbrs.js → index.esm2017-Dd02dg_O.js} +38 -38
- package/dist/{loading-Dj5bx8fg.js → loading-Or1ZDzDS.js} +11 -11
- package/dist/{membership-B2avlZoN.js → membership-B8h5ku-v.js} +3 -3
- package/dist/{money-CNSWtAf-.js → money-CmsKAJBT.js} +1 -1
- package/dist/{number-BA58pjU6.js → number-iEhp7Uai.js} +1 -1
- package/dist/{rule-BWazFYuZ.js → rule-BORkgSMK.js} +3 -3
- package/dist/{rule-builder-RIloDQBn.js → rule-builder-DEfkSr68.js} +1 -1
- package/dist/{template-u01r84LY.js → template-C_Y7bhlI.js} +4 -4
- package/dist/{usePagination--B6Wt7C1.js → usePagination-Ci8-uZvb.js} +1 -1
- package/dist/vue-i18n-BXzrZRP6.js +2365 -0
- package/package.json +7 -4
- package/dist/Analytic-AqWU_lJy.js +0 -620
- package/dist/Broadcast-utWSrzP9.js +0 -216
- package/dist/Card-x6qnEaIt.js +0 -823
- package/dist/Credit-CojzmUnh.js +0 -214
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-8l3Dt_Lo.js +0 -344
- package/dist/Experience-CPjovKWF.js +0 -211
- package/dist/Game-DWcjPfZP.js +0 -250
- package/dist/Marketing-CwoI0pFF.js +0 -309
- package/dist/Member-oRcVGr20.js +0 -92
- package/dist/Mission-Y8s5MQIC.js +0 -248
- package/dist/Point-0Fw3qLIW.js +0 -220
- package/dist/Promotion-vqM23NPX.js +0 -244
- package/dist/Segment-lgzMRCyd.js +0 -564
- package/dist/Setting-CFGB53S0.js +0 -1870
- package/dist/Store-fJlew3HJ.js +0 -1533
- package/dist/StoreRewards-DWq34E4p.js +0 -429
- package/dist/Transaction-CYqMFEzc.js +0 -36
- package/dist/Voucher-B0QCX_nG.js +0 -485
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js +0 -140
- package/dist/app-SOHUUM08.js +0 -2974
- package/dist/dto-CY7JrHkZ.js +0 -1145
- package/dist/index-BMxu_XL-.js +0 -11
|
@@ -1,429 +0,0 @@
|
|
|
1
|
-
import { defineComponent as q, ref as V, computed as N, onMounted as Y, resolveComponent as p, openBlock as u, createBlock as b, unref as e, isRef as W, withCtx as x, createElementVNode as l, createVNode as s, createElementBlock as O, createTextVNode as z, resolveDynamicComponent as H, toDisplayString as G, Fragment as j, createCommentVNode as U, h } from "vue";
|
|
2
|
-
import { _ as J } from "./campaign-CpzFl8Vr.js";
|
|
3
|
-
import { components as $ } from "@feedmepos/ui-library";
|
|
4
|
-
import "./index-BMxu_XL-.js";
|
|
5
|
-
import { u as Q, p as M, f as B } from "./loading-Dj5bx8fg.js";
|
|
6
|
-
import { C, u as X } from "./membership-B2avlZoN.js";
|
|
7
|
-
import { F as ee } from "./index-CAQpU5Rv.js";
|
|
8
|
-
import { c as te } from "./object-qECH92oz.js";
|
|
9
|
-
import { _ as oe } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
|
|
10
|
-
import { u as K } from "./app-wDQR6dpb.js";
|
|
11
|
-
import { u as ae } from "./business-DveMDDHY.js";
|
|
12
|
-
import { useCoreStore as ne } from "@feedmepos/mf-common";
|
|
13
|
-
import { _ as se, Z as g } from "./ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js";
|
|
14
|
-
import { _ as le } from "./ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js";
|
|
15
|
-
import { _ as re } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-DWlpmE56.js";
|
|
16
|
-
import { _ as ie, a as me } from "./EffectSheet.vue_vue_type_style_index_0_lang-8l3Dt_Lo.js";
|
|
17
|
-
import { i as de, t as ce } from "./helper-DL6hnmtJ.js";
|
|
18
|
-
import { useRouter as ue } from "vue-router";
|
|
19
|
-
import { m as D } from "./index-Dx4pkNRc.js";
|
|
20
|
-
import { R as k } from "./app-SOHUUM08.js";
|
|
21
|
-
const pe = {
|
|
22
|
-
key: 0,
|
|
23
|
-
class: "flex flex-col space-y-16 pr-12"
|
|
24
|
-
}, fe = { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, ye = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary flex items-center justify-between" }, ge = /* @__PURE__ */ l("div", { class: "fm-typo-en-title-sm-800" }, "Discount", -1), we = /* @__PURE__ */ l("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, " Usage configuration ", -1), ve = /* @__PURE__ */ l("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, "Availability", -1), _e = { class: "flex items-center gap-8" }, be = /* @__PURE__ */ q({
|
|
25
|
-
__name: "EditRewardSheet",
|
|
26
|
-
emits: ["update"],
|
|
27
|
-
setup(Z, { expose: I, emit: f }) {
|
|
28
|
-
const A = f, S = ae(), R = ne(), r = V(!1), a = V(), y = V(), n = ee, w = N(
|
|
29
|
-
() => {
|
|
30
|
-
var o;
|
|
31
|
-
return C[((o = a.value) == null ? void 0 : o.type) || "VOUCHER"];
|
|
32
|
-
}
|
|
33
|
-
), P = N(() => {
|
|
34
|
-
const o = n.safeParse(a.value);
|
|
35
|
-
return o.success ? [] : o.error.errors;
|
|
36
|
-
});
|
|
37
|
-
function F() {
|
|
38
|
-
const o = n.safeParse(a.value);
|
|
39
|
-
o.success && A("update", o.data);
|
|
40
|
-
}
|
|
41
|
-
function E(o, t, i = {
|
|
42
|
-
isStoreReward: !1,
|
|
43
|
-
type: "VOUCHER"
|
|
44
|
-
}) {
|
|
45
|
-
r.value = o, o && (y.value = void 0, a.value = t || de(i.type, {
|
|
46
|
-
business: R.currentBusiness.value._id,
|
|
47
|
-
noCampaign: i.isStoreReward == !0
|
|
48
|
-
}));
|
|
49
|
-
}
|
|
50
|
-
return Y(async () => {
|
|
51
|
-
await S.readLocations();
|
|
52
|
-
}), I({
|
|
53
|
-
showSheet: E,
|
|
54
|
-
data: a,
|
|
55
|
-
rewardImage: y
|
|
56
|
-
}), (o, t) => {
|
|
57
|
-
const i = p("FmTextarea"), c = p("FmHelperText"), v = p("FmButton"), L = p("FmSideSheet");
|
|
58
|
-
return u(), b(L, {
|
|
59
|
-
"max-width": 560,
|
|
60
|
-
modelValue: e(r),
|
|
61
|
-
"onUpdate:modelValue": t[7] || (t[7] = (_) => W(r) ? r.value = _ : null),
|
|
62
|
-
header: "Store setting"
|
|
63
|
-
}, {
|
|
64
|
-
"side-sheet-footer": x(() => [
|
|
65
|
-
l("div", _e, [
|
|
66
|
-
s(v, {
|
|
67
|
-
label: "Submit",
|
|
68
|
-
onClick: F,
|
|
69
|
-
disabled: e(P).length > 0 || e(K)().isLoading,
|
|
70
|
-
loading: e(K)().isLoading
|
|
71
|
-
}, null, 8, ["disabled", "loading"]),
|
|
72
|
-
s(v, {
|
|
73
|
-
label: "Cancel",
|
|
74
|
-
onClick: t[6] || (t[6] = (_) => E(!1)),
|
|
75
|
-
variant: "tertiary"
|
|
76
|
-
})
|
|
77
|
-
])
|
|
78
|
-
]),
|
|
79
|
-
default: x(() => {
|
|
80
|
-
var _, T, m;
|
|
81
|
-
return [
|
|
82
|
-
e(a) ? (u(), O("div", pe, [
|
|
83
|
-
l("div", fe, [
|
|
84
|
-
z(" Reward information "),
|
|
85
|
-
(u(), b(H(e(w).chip())))
|
|
86
|
-
]),
|
|
87
|
-
s(se, {
|
|
88
|
-
modelValue: e(a).name,
|
|
89
|
-
"onUpdate:modelValue": t[0] || (t[0] = (d) => e(a).name = d),
|
|
90
|
-
label: `${e(w).name} name`,
|
|
91
|
-
schema: e(g).typeAtPath(e(n), "name", [e(a).type])
|
|
92
|
-
}, null, 8, ["modelValue", "label", "schema"]),
|
|
93
|
-
s(i, {
|
|
94
|
-
class: "!mb-[-16px]",
|
|
95
|
-
modelValue: e(a).description,
|
|
96
|
-
"onUpdate:modelValue": t[1] || (t[1] = (d) => e(a).description = d),
|
|
97
|
-
rules: [e(g).ruleAtPath(e(n), "description", [e(a).type])]
|
|
98
|
-
}, {
|
|
99
|
-
label: x(() => [
|
|
100
|
-
(u(), b(H(
|
|
101
|
-
e(g).toInputLabel(
|
|
102
|
-
e(g).typeAtPath(e(n), "description", [e(a).type]),
|
|
103
|
-
`${e(w).name} description`
|
|
104
|
-
)
|
|
105
|
-
)))
|
|
106
|
-
]),
|
|
107
|
-
_: 1
|
|
108
|
-
}, 8, ["modelValue", "rules"]),
|
|
109
|
-
l("div", ye, [
|
|
110
|
-
l("div", null, G(e(w).name) + " description should not exceed 200 characters. ", 1),
|
|
111
|
-
l("div", null, G(((_ = e(a).description) == null ? void 0 : _.length) ?? 0) + "/200", 1)
|
|
112
|
-
]),
|
|
113
|
-
s(le, {
|
|
114
|
-
class: "w-1/2 xs:w-2/3",
|
|
115
|
-
"aspect-ratio": "16/9",
|
|
116
|
-
file: e(y) ?? void 0,
|
|
117
|
-
thumbnail: e(a).image ?? void 0,
|
|
118
|
-
"onUpdate:file": t[2] || (t[2] = async (d) => {
|
|
119
|
-
y.value = d, d || (e(a).image = null);
|
|
120
|
-
})
|
|
121
|
-
}, {
|
|
122
|
-
label: x(() => [
|
|
123
|
-
(u(), b(H(
|
|
124
|
-
e(g).toInputLabel(
|
|
125
|
-
e(g).typeAtPath(e(n), "image", [e(a).type]),
|
|
126
|
-
`${e(w).name} image`
|
|
127
|
-
)
|
|
128
|
-
)))
|
|
129
|
-
]),
|
|
130
|
-
_: 1
|
|
131
|
-
}, 8, ["file", "thumbnail"]),
|
|
132
|
-
e(a).type === "VOUCHER" ? (u(), O(j, { key: 0 }, [
|
|
133
|
-
ge,
|
|
134
|
-
s(ie, {
|
|
135
|
-
"model-value": e(a).extras.effect,
|
|
136
|
-
"onUpdate:modelValue": t[3] || (t[3] = (d) => {
|
|
137
|
-
e(a).extras.effect = d;
|
|
138
|
-
})
|
|
139
|
-
}, null, 8, ["model-value"]),
|
|
140
|
-
e(a).extras.effect == null ? (u(), b(c, {
|
|
141
|
-
key: 0,
|
|
142
|
-
class: "!mt-8",
|
|
143
|
-
text: "Effect is required",
|
|
144
|
-
state: "error"
|
|
145
|
-
})) : U("", !0),
|
|
146
|
-
we,
|
|
147
|
-
s(me, {
|
|
148
|
-
"model-value": e(a).options,
|
|
149
|
-
"no-campaign": e(a).noCampaign,
|
|
150
|
-
"onUpdate:modelValue": t[4] || (t[4] = (d) => e(a).options = d),
|
|
151
|
-
schema: e(g).typeAtPath(e(n), "options", ["VOUCHER"])
|
|
152
|
-
}, null, 8, ["model-value", "no-campaign", "schema"])
|
|
153
|
-
], 64)) : U("", !0),
|
|
154
|
-
ve,
|
|
155
|
-
e(a).type === "VOUCHER" ? (u(), b(re, {
|
|
156
|
-
key: 1,
|
|
157
|
-
"model-value": ((m = (T = e(a).extras) == null ? void 0 : T.targetLocation) == null ? void 0 : m.map(String)) ?? null,
|
|
158
|
-
type: "select",
|
|
159
|
-
"onUpdate:modelValue": t[5] || (t[5] = (d) => {
|
|
160
|
-
e(a).extras.targetLocation = d;
|
|
161
|
-
}),
|
|
162
|
-
rules: [
|
|
163
|
-
e(g).ruleAtPath(e(n), "extras.targetLocation", ["VOUCHER"])
|
|
164
|
-
]
|
|
165
|
-
}, null, 8, ["model-value", "rules"])) : U("", !0)
|
|
166
|
-
])) : U("", !0)
|
|
167
|
-
];
|
|
168
|
-
}),
|
|
169
|
-
_: 1
|
|
170
|
-
}, 8, ["modelValue"]);
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
}), Re = { class: "px-24 flex flex-col gap-y-16" }, he = { class: "flex items-center justify-between w-full" }, Ce = { class: "flex gap-8" }, xe = /* @__PURE__ */ l("img", {
|
|
174
|
-
src: J,
|
|
175
|
-
class: "aspect-square w-[150px]"
|
|
176
|
-
}, null, -1), Fe = /* @__PURE__ */ l("div", { class: "flex flex-col gap-16 text-center" }, [
|
|
177
|
-
/* @__PURE__ */ l("div", { class: "fm-typo-en-title-sm-800" }, "Create rewards"),
|
|
178
|
-
/* @__PURE__ */ l("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Create rewards for your customers to redeem inside their bundle. ")
|
|
179
|
-
], -1), qe = /* @__PURE__ */ q({
|
|
180
|
-
__name: "StoreRewards",
|
|
181
|
-
setup(Z) {
|
|
182
|
-
const I = {
|
|
183
|
-
label: "Create reward",
|
|
184
|
-
value: "create",
|
|
185
|
-
isPrimary: !0,
|
|
186
|
-
prependIcon: "add"
|
|
187
|
-
}, f = X(), { global: A, minor: S } = Q, R = ue(), r = V({
|
|
188
|
-
searchKey: "",
|
|
189
|
-
columnFilters: []
|
|
190
|
-
}), a = [
|
|
191
|
-
{
|
|
192
|
-
header: "Reward title",
|
|
193
|
-
accessorFn: (o) => o.name
|
|
194
|
-
},
|
|
195
|
-
{
|
|
196
|
-
id: "type",
|
|
197
|
-
header: "Reward type",
|
|
198
|
-
accessorFn: (o) => o.type,
|
|
199
|
-
cell(o) {
|
|
200
|
-
return C[o.row.original.type].chip();
|
|
201
|
-
}
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
header: "Validity",
|
|
205
|
-
accessorFn: (o) => ce(
|
|
206
|
-
"validityOption" in o.options ? o.options.validityOption || {} : {}
|
|
207
|
-
)
|
|
208
|
-
},
|
|
209
|
-
{
|
|
210
|
-
header: "Used",
|
|
211
|
-
meta: {
|
|
212
|
-
textAlign: "right"
|
|
213
|
-
},
|
|
214
|
-
accessorFn: (o) => o.currentReceive ?? 0
|
|
215
|
-
},
|
|
216
|
-
{
|
|
217
|
-
header: "Actions",
|
|
218
|
-
cell(o) {
|
|
219
|
-
return h("div", { class: "flex items-center justify-end gap-4" }, [
|
|
220
|
-
h(
|
|
221
|
-
$.FmMenu,
|
|
222
|
-
{
|
|
223
|
-
placement: "bottom-end",
|
|
224
|
-
onClick: (t) => {
|
|
225
|
-
t.stopPropagation();
|
|
226
|
-
}
|
|
227
|
-
},
|
|
228
|
-
{
|
|
229
|
-
"menu-button": () => h($.FmButton, {
|
|
230
|
-
icon: "more_vert",
|
|
231
|
-
iconColor: "neutral-gray-400",
|
|
232
|
-
variant: "tertiary"
|
|
233
|
-
}),
|
|
234
|
-
default: () => [
|
|
235
|
-
h($.FmMenuItem, {
|
|
236
|
-
label: "View collections",
|
|
237
|
-
onClick: async (t) => {
|
|
238
|
-
t.stopPropagation(), w(o.row.original._id);
|
|
239
|
-
}
|
|
240
|
-
}),
|
|
241
|
-
// h(components.FmMenuItem, {
|
|
242
|
-
// label: 'View transactions',
|
|
243
|
-
// onClick: async (event: Event) => {
|
|
244
|
-
// event.stopPropagation();
|
|
245
|
-
// onViewTransactions(props.row.original._id as string);
|
|
246
|
-
// },
|
|
247
|
-
// }),
|
|
248
|
-
h(
|
|
249
|
-
$.FmMenuItem,
|
|
250
|
-
{
|
|
251
|
-
onClick: async (t) => {
|
|
252
|
-
t.stopPropagation(), P(o.row.original);
|
|
253
|
-
}
|
|
254
|
-
},
|
|
255
|
-
{
|
|
256
|
-
label: h(
|
|
257
|
-
"div",
|
|
258
|
-
{
|
|
259
|
-
class: "text-fm-color-typo-error fm-typo-en-body-md-400"
|
|
260
|
-
},
|
|
261
|
-
"Remove"
|
|
262
|
-
)
|
|
263
|
-
}
|
|
264
|
-
)
|
|
265
|
-
]
|
|
266
|
-
}
|
|
267
|
-
)
|
|
268
|
-
]);
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
], y = N(
|
|
272
|
-
() => f.bundleRewards.filter((o) => o.type == "VOUCHER")
|
|
273
|
-
), n = V();
|
|
274
|
-
function w(o) {
|
|
275
|
-
R.push({
|
|
276
|
-
name: k["$connect-STORE_REWARD_COLLECTIONS"],
|
|
277
|
-
params: { id: o }
|
|
278
|
-
});
|
|
279
|
-
}
|
|
280
|
-
async function P(o) {
|
|
281
|
-
if (o.type === "TITLE") {
|
|
282
|
-
await M.confirm(
|
|
283
|
-
"You cannot remove a title here, please remove it at the Program > Title section.",
|
|
284
|
-
"Delete reward",
|
|
285
|
-
"Go to title section"
|
|
286
|
-
) && await R.push({ name: k["$connect-PROGRAM_TITLE"] });
|
|
287
|
-
return;
|
|
288
|
-
}
|
|
289
|
-
await M.remove(
|
|
290
|
-
"Are you sure you want to delete this reward?",
|
|
291
|
-
"Delete reward"
|
|
292
|
-
) && await S(
|
|
293
|
-
async () => {
|
|
294
|
-
await D.deleteReward(o._id), await f.readMembership(), await f.readRewards();
|
|
295
|
-
},
|
|
296
|
-
{ message: "Deleting reward", successMessage: "Reward deleted" }
|
|
297
|
-
);
|
|
298
|
-
}
|
|
299
|
-
async function F(o) {
|
|
300
|
-
var i;
|
|
301
|
-
const t = o ? te(f.bundleRewards.find((c) => c._id === o)) : void 0;
|
|
302
|
-
if ((t == null ? void 0 : t.type) === "TITLE") {
|
|
303
|
-
await M.confirm(
|
|
304
|
-
"You cannot edit a title here, please edit it at the Program > Title section.",
|
|
305
|
-
"Update reward",
|
|
306
|
-
"Go to title section"
|
|
307
|
-
) && await R.push({ name: k["$connect-PROGRAM_TITLE"] });
|
|
308
|
-
return;
|
|
309
|
-
}
|
|
310
|
-
(i = n.value) == null || i.showSheet(!0, t, {
|
|
311
|
-
isStoreReward: !0,
|
|
312
|
-
type: "VOUCHER"
|
|
313
|
-
});
|
|
314
|
-
}
|
|
315
|
-
async function E(o) {
|
|
316
|
-
await S(
|
|
317
|
-
async () => {
|
|
318
|
-
var t, i, c, v;
|
|
319
|
-
(t = n.value) != null && t.rewardImage && o.image ? await B.delete(o.image) : (i = n.value) != null && i.rewardImage && (o.image = await B.update(
|
|
320
|
-
o.image || B.collectibleImagePath(
|
|
321
|
-
void 0,
|
|
322
|
-
n.value.rewardImage
|
|
323
|
-
),
|
|
324
|
-
(c = n.value) == null ? void 0 : c.rewardImage
|
|
325
|
-
)), o._id ? await D.updateReward(o._id, o) : await D.createReward(o), await f.readRewards(), (v = n.value) == null || v.showSheet(!1);
|
|
326
|
-
},
|
|
327
|
-
{
|
|
328
|
-
message: "Updating reward",
|
|
329
|
-
successMessage: "Reward updated successfully"
|
|
330
|
-
}
|
|
331
|
-
);
|
|
332
|
-
}
|
|
333
|
-
return Y(async () => {
|
|
334
|
-
await A(async () => {
|
|
335
|
-
await f.readMembership(), await f.readRewards();
|
|
336
|
-
});
|
|
337
|
-
}), (o, t) => {
|
|
338
|
-
const i = p("FmPageHead"), c = p("FmMenuItem"), v = p("FmSearch"), L = p("FmTable"), _ = p("FmButton"), T = p("FmCard");
|
|
339
|
-
return u(), O(j, null, [
|
|
340
|
-
s(i, {
|
|
341
|
-
title: "Rewards",
|
|
342
|
-
description: "Create and manage rewards for your customers.",
|
|
343
|
-
actions: [I],
|
|
344
|
-
"back-button": !0,
|
|
345
|
-
"onClick:action": t[0] || (t[0] = () => F()),
|
|
346
|
-
"onClick:back": t[1] || (t[1] = () => e(R).push({ name: e(k)["$connect-STORE"] }))
|
|
347
|
-
}, null, 8, ["actions"]),
|
|
348
|
-
l("div", Re, [
|
|
349
|
-
e(y) && e(y).length > 0 ? (u(), O(j, { key: 0 }, [
|
|
350
|
-
l("div", he, [
|
|
351
|
-
l("div", Ce, [
|
|
352
|
-
s(oe, {
|
|
353
|
-
label: `Reward type: ${e(r).columnFilters.length == 0 ? "All" : e(r).columnFilters[0].name}`
|
|
354
|
-
}, {
|
|
355
|
-
default: x(() => [
|
|
356
|
-
s(c, {
|
|
357
|
-
onClick: t[2] || (t[2] = (m) => e(r).columnFilters = []),
|
|
358
|
-
label: "All"
|
|
359
|
-
}),
|
|
360
|
-
s(c, {
|
|
361
|
-
onClick: t[3] || (t[3] = (m) => e(r).columnFilters = [
|
|
362
|
-
{
|
|
363
|
-
id: "type",
|
|
364
|
-
value: "VOUCHER",
|
|
365
|
-
name: e(C).VOUCHER.name
|
|
366
|
-
}
|
|
367
|
-
]),
|
|
368
|
-
label: e(C).VOUCHER.name
|
|
369
|
-
}, null, 8, ["label"]),
|
|
370
|
-
s(c, {
|
|
371
|
-
onClick: t[4] || (t[4] = (m) => e(r).columnFilters = [
|
|
372
|
-
{
|
|
373
|
-
id: "type",
|
|
374
|
-
value: "TITLE",
|
|
375
|
-
name: e(C).TITLE.name
|
|
376
|
-
}
|
|
377
|
-
]),
|
|
378
|
-
label: e(C).TITLE.name
|
|
379
|
-
}, null, 8, ["label"])
|
|
380
|
-
]),
|
|
381
|
-
_: 1
|
|
382
|
-
}, 8, ["label"])
|
|
383
|
-
]),
|
|
384
|
-
s(v, {
|
|
385
|
-
modelValue: e(r).searchKey,
|
|
386
|
-
"onUpdate:modelValue": t[5] || (t[5] = (m) => e(r).searchKey = m),
|
|
387
|
-
class: "",
|
|
388
|
-
placeholder: "search",
|
|
389
|
-
collapsible: ""
|
|
390
|
-
}, null, 8, ["modelValue"])
|
|
391
|
-
]),
|
|
392
|
-
s(L, {
|
|
393
|
-
"row-data": e(y),
|
|
394
|
-
"column-defs": a,
|
|
395
|
-
"search-value": e(r).searchKey,
|
|
396
|
-
"column-filter": e(r).columnFilters,
|
|
397
|
-
onRowClick: t[6] || (t[6] = (m) => F(m.original._id)),
|
|
398
|
-
"hide-footer": e(y).length < 10
|
|
399
|
-
}, null, 8, ["row-data", "search-value", "column-filter", "hide-footer"])
|
|
400
|
-
], 64)) : (u(), b(T, {
|
|
401
|
-
key: 1,
|
|
402
|
-
variant: "outlined",
|
|
403
|
-
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
404
|
-
}, {
|
|
405
|
-
default: x(() => [
|
|
406
|
-
xe,
|
|
407
|
-
Fe,
|
|
408
|
-
s(_, {
|
|
409
|
-
variant: "primary",
|
|
410
|
-
label: "Create reward",
|
|
411
|
-
onClick: t[7] || (t[7] = (m) => F()),
|
|
412
|
-
icon: "add"
|
|
413
|
-
})
|
|
414
|
-
]),
|
|
415
|
-
_: 1
|
|
416
|
-
})),
|
|
417
|
-
s(be, {
|
|
418
|
-
ref_key: "rewardSheetRef",
|
|
419
|
-
ref: n,
|
|
420
|
-
onUpdate: t[8] || (t[8] = (m) => E(m))
|
|
421
|
-
}, null, 512)
|
|
422
|
-
])
|
|
423
|
-
], 64);
|
|
424
|
-
};
|
|
425
|
-
}
|
|
426
|
-
});
|
|
427
|
-
export {
|
|
428
|
-
qe as default
|
|
429
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { defineComponent as _, ref as d, resolveComponent as c, openBlock as o, createElementBlock as v, Fragment as f, createVNode as s, createElementVNode as b, unref as t, createBlock as a, KeepAlive as k, resolveDynamicComponent as m, createCommentVNode as x } from "vue";
|
|
2
|
-
import { _ as C, a as F } from "./StoreTransactions.vue_vue_type_script_setup_true_lang-nhS5Dhhk.js";
|
|
3
|
-
const T = { class: "px-24 flex flex-col gap-y-32 pb-24" }, N = /* @__PURE__ */ _({
|
|
4
|
-
__name: "Transaction",
|
|
5
|
-
setup(g) {
|
|
6
|
-
const l = [
|
|
7
|
-
{
|
|
8
|
-
label: "Collection",
|
|
9
|
-
value: "collection"
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
label: "Store",
|
|
13
|
-
value: "store"
|
|
14
|
-
}
|
|
15
|
-
], e = d(l[0]);
|
|
16
|
-
return (y, n) => {
|
|
17
|
-
const r = c("FmPageHead"), u = c("FmTabs");
|
|
18
|
-
return o(), v(f, null, [
|
|
19
|
-
s(r, { title: "Transactions" }),
|
|
20
|
-
b("div", T, [
|
|
21
|
-
s(u, {
|
|
22
|
-
"model-value": t(e).value,
|
|
23
|
-
items: l,
|
|
24
|
-
"onUpdate:modelValue": n[0] || (n[0] = (i) => e.value = l.find((p) => p.value === i))
|
|
25
|
-
}, null, 8, ["model-value"]),
|
|
26
|
-
(o(), a(k, null, [
|
|
27
|
-
t(e).value == "collection" ? (o(), a(m(C), { key: 0 })) : t(e).value == "store" ? (o(), a(m(F), { key: 1 })) : x("", !0)
|
|
28
|
-
], 1024))
|
|
29
|
-
])
|
|
30
|
-
], 64);
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
export {
|
|
35
|
-
N as default
|
|
36
|
-
};
|