@feedmepos/mf-connect 0.1.0-beta.9 → 0.1.0-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-D1vIDmhJ.js +620 -0
- package/dist/{App-DQUbRsdA.js → App-DHrfWG8l.js} +249 -250
- package/dist/Broadcast-B2rxZAZi.js +216 -0
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D-BFllvG.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D2a9rcXK.js} +20 -20
- package/dist/Card-Dr6pTTM0.js +824 -0
- package/dist/Collections-0tbg0MFt.js +441 -0
- package/dist/Credit-KbB_7Jq-.js +214 -0
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-C_ZKNWzb.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-we7ADwFk.js} +999 -1018
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-VBNyvZCJ.js +344 -0
- package/dist/Experience-C_Q9Iml8.js +211 -0
- package/dist/Game-BwODw7M6.js +250 -0
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js +144 -0
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js → MainLayout-DpZC6o3R.js} +53 -19
- package/dist/Marketing-QOKTAS_T.js +309 -0
- package/dist/Member-d7RIGRm1.js +92 -0
- package/dist/MemberList-CK9629ew.js +1737 -0
- package/dist/MemberOverview-C2n9oJZh.js +58 -0
- package/dist/{MemberTransactions-zSxSnUkK.js → MemberTransactions-D-pnlXiP.js} +1 -1
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-3VS7JnK6.js +203 -0
- package/dist/Mission-BAKDm4VZ.js +248 -0
- package/dist/Point-Puu0jKz0.js +220 -0
- package/dist/Promotion-DRIaUvJi.js +244 -0
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CTKKhH-r.js → RuleGroup.vue_vue_type_script_setup_true_lang-DTdfYGya.js} +557 -557
- package/dist/Segment-DpBxGuuu.js +435 -0
- package/dist/Setting-DLB2ywCp.js +1870 -0
- package/dist/Store-8DO6ITWc.js +1513 -0
- package/dist/StoreRewards-DZfqUeYR.js +429 -0
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-2Jqj_rKv.js → StoreTransactions.vue_vue_type_script_setup_true_lang-RTfozD01.js} +10 -10
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BkdSj0cX.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BGI78ycg.js} +1 -1
- package/dist/{Tier-Cpl0FV8L.js → Tier-BnQRujpX.js} +453 -481
- package/dist/{Title-CbMDd1Et.js → Title-BPf1tUFx.js} +295 -314
- package/dist/Transaction-ese0oNrz.js +36 -0
- package/dist/Voucher--gtOZQx1.js +485 -0
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js +140 -0
- package/dist/app-Bt59niI-.js +2974 -0
- package/dist/{app-VxaUCtgl.js → app-DHE61XdR.js} +1 -1
- package/dist/app.js +3 -5
- package/dist/{business-DR7jpnLz.js → business-BSo7EPan.js} +1 -1
- package/dist/{campaign-MqcTb329.js → campaign-CsOje3Ap.js} +3 -5
- package/dist/{collection.fn-CvEoe61K.js → collection.fn-BYQfFJOr.js} +2 -2
- package/dist/dto-CfEXSCq6.js +1145 -0
- package/dist/{effect-BjjQeiQg.js → effect-Bn_ofYS3.js} +9 -9
- package/dist/{export-B8cvWh5n.js → export-CMR243CF.js} +3 -3
- package/dist/{helper-DfgVNY7B.js → helper-BqOQRtvW.js} +1 -1
- package/dist/index-BLDYTxnc.js +28058 -0
- package/dist/{index-C2JNcGc-.js → index-BWnFs-Cb.js} +281 -299
- package/dist/{index-B5NufbUt.js → index-BaBNmzUb.js} +1 -1
- package/dist/{index-CWR3qYjb.js → index-Boo5np6l.js} +1 -1
- package/dist/{index-BsfWRB8R.js → index-CC1GV8OW.js} +1 -1
- package/dist/{index-0UYoh1-7.js → index-CHO4_zsT.js} +1 -1
- package/dist/{index-2P9w5u3m.js → index-DEZsrQ2f.js} +3 -3
- package/dist/{index-C7zMfUgy.js → index-D_f2lmK2.js} +1 -1
- package/dist/{index-Dap5R3vr.js → index-Da142OER.js} +66 -78
- package/dist/index-DbP04yeg.js +11 -0
- package/dist/{index-DBy30v8N.js → index-DtPe-TEm.js} +3 -3
- package/dist/{index-CJ8Uh2Ja.js → index-FvlaxwGB.js} +3 -3
- package/dist/{index.esm2017-D1X3PgpO.js → index.esm2017-ePm--Atp.js} +55 -55
- package/dist/{loading-CJ3nOovJ.js → loading-KNmEMBUB.js} +460 -469
- package/dist/{membership-B1cmSRyk.js → membership-DKoVIS1a.js} +3 -3
- package/dist/money-CkD3zl5C.js +15 -0
- package/dist/number-BDsGpOXm.js +12 -0
- package/dist/{rule-ChWyR-0j.js → rule-CzamI50_.js} +2 -2
- package/dist/{rule-builder-CSmOONdb.js → rule-builder-DHf6wfaQ.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{template-Cug7aRK0.js → template-CFAIPoD7.js} +63 -63
- package/dist/{usePagination-BeF5K3M7.js → usePagination-JoYaROkV.js} +85 -85
- package/dist/{xlsx-CfgPFFvp.js → xlsx-BDJMaozs.js} +517 -517
- package/package.json +4 -7
- package/dist/Analytic-CMXUjK_F.js +0 -622
- package/dist/Broadcast-DowFtHv6.js +0 -223
- package/dist/Card-C7rhL0pV.js +0 -825
- package/dist/Collections-B-1wlk3r.js +0 -453
- package/dist/Credit-DDjozmoF.js +0 -220
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-pwMuIgs5.js +0 -345
- package/dist/Experience-BbE-c1Op.js +0 -221
- package/dist/Game-DQdRpaN-.js +0 -255
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +0 -144
- package/dist/MainLayout-B1aJoR95.js +0 -41
- package/dist/Marketing-Dgmxzg4h.js +0 -316
- package/dist/Member-w23oRVwN.js +0 -69
- package/dist/MemberList-BLIdjznQ.js +0 -1735
- package/dist/MemberOverview-wL_ailso.js +0 -58
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-Dy_lMdZA.js +0 -432
- package/dist/Mission-Cjt0E083.js +0 -261
- package/dist/Point-CQJL3Ewu.js +0 -222
- package/dist/Promotion-BYViH3bu.js +0 -247
- package/dist/Segment-B9Jj1ak0.js +0 -437
- package/dist/Setting-DXWbgRxs.js +0 -1901
- package/dist/Store-Dswk2e_z.js +0 -1511
- package/dist/StoreRewards-CNUhG_Ue.js +0 -401
- package/dist/Transaction-BB-kk-84.js +0 -39
- package/dist/Voucher-b1_Jlm6X.js +0 -490
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-pG-SrXp9.js +0 -56
- package/dist/app-DCHKJoql.js +0 -5639
- package/dist/dto-jcK3TGB7.js +0 -2770
- package/dist/index-Cv7pLAYq.js +0 -3
- package/dist/index-LrSSauN2.js +0 -29193
- package/dist/money-BEATdGS6.js +0 -15
- package/dist/number-CeAYAKCp.js +0 -12
- package/dist/vue-i18n-BRhKDHdF.js +0 -2365
- package/dist/zod-Bg2FbC-D.js +0 -90
|
@@ -0,0 +1,429 @@
|
|
|
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-DbP04yeg.js";
|
|
5
|
+
import { u as Q, p as M, f as B } from "./loading-KNmEMBUB.js";
|
|
6
|
+
import { C, u as X } from "./membership-DKoVIS1a.js";
|
|
7
|
+
import { F as ee } from "./index-D_f2lmK2.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-BSo7EPan.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-BGI78ycg.js";
|
|
16
|
+
import { _ as ie, a as me } from "./EffectSheet.vue_vue_type_style_index_0_lang-VBNyvZCJ.js";
|
|
17
|
+
import { i as de, t as ce } from "./helper-BqOQRtvW.js";
|
|
18
|
+
import { useRouter as ue } from "vue-router";
|
|
19
|
+
import { m as D } from "./index-CC1GV8OW.js";
|
|
20
|
+
import { R as k } from "./app-Bt59niI-.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,21 +1,21 @@
|
|
|
1
1
|
import { defineComponent as z, ref as A, computed as K, onMounted as G, resolveComponent as D, openBlock as O, createBlock as Y, unref as n, withCtx as U, createVNode as h, normalizeClass as L, createCommentVNode as ue, createElementVNode as T, toDisplayString as X, createElementBlock as H, Fragment as de, renderList as me, mergeModels as J, useModel as pe, watch as W, onBeforeMount as fe, h as o } from "vue";
|
|
2
2
|
import { components as _ } from "@feedmepos/ui-library";
|
|
3
|
-
import { f as ge } from "./index-
|
|
4
|
-
import { a as te } from "./loading-
|
|
3
|
+
import { f as ge } from "./index-FvlaxwGB.js";
|
|
4
|
+
import { a as te } from "./loading-KNmEMBUB.js";
|
|
5
5
|
import { s as ye } from "./index-Dbd4WA4r.js";
|
|
6
6
|
import { h as v } from "./moment-BWErdI6_.js";
|
|
7
7
|
import { s as j } from "./index-CuvNtC_M.js";
|
|
8
|
-
import { f as Q } from "./number-
|
|
9
|
-
import { u as be } from "./business-
|
|
10
|
-
import { u as ae, _ as ne } from "./usePagination-
|
|
8
|
+
import { f as Q } from "./number-BDsGpOXm.js";
|
|
9
|
+
import { u as be } from "./business-BSo7EPan.js";
|
|
10
|
+
import { u as ae, _ as ne } from "./usePagination-JoYaROkV.js";
|
|
11
11
|
import { g as re } from "./user-Bm4KttFq.js";
|
|
12
|
-
import { B as oe, a as le } from "./export-
|
|
13
|
-
import { u as he } from "./campaign-
|
|
14
|
-
import "./index-
|
|
12
|
+
import { B as oe, a as le } from "./export-CMR243CF.js";
|
|
13
|
+
import { u as he } from "./campaign-CsOje3Ap.js";
|
|
14
|
+
import "./index-DbP04yeg.js";
|
|
15
15
|
import { useRouter as ve } from "vue-router";
|
|
16
|
-
import { R as V } from "./app-
|
|
16
|
+
import { R as V } from "./app-Bt59niI-.js";
|
|
17
17
|
import { o as $ } from "./objectId-dwaoBfJX.js";
|
|
18
|
-
import { g as Z, a as _e, S as xe, b as Se } from "./index-
|
|
18
|
+
import { g as Z, a as _e, S as xe, b as Se } from "./index-BLDYTxnc.js";
|
|
19
19
|
function we(r) {
|
|
20
20
|
let c = "";
|
|
21
21
|
switch (r) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as N, ref as C, computed as L, watch as E, resolveComponent as g, openBlock as o, createElementBlock as i, Fragment as y, toDisplayString as I, createCommentVNode as A, createElementVNode as M, createVNode as v, unref as u, renderList as S, createBlock as b, isRef as U, withCtx as F } from "vue";
|
|
2
|
-
import { u as T } from "./business-
|
|
2
|
+
import { u as T } from "./business-BSo7EPan.js";
|
|
3
3
|
function j(l, s, n) {
|
|
4
4
|
return l.some(
|
|
5
5
|
n instanceof Function ? n : (a) => a === s
|