@feedmepos/mf-connect 0.0.8 → 0.0.9
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-BxRuK2P2.js → Analytic-CwaN0mge.js} +68 -69
- package/dist/{Broadcast-BqGojAWW.js → Broadcast-Cjx5xzUC.js} +27 -28
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B-VzcVMS.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D4mO5aik.js} +34 -34
- package/dist/Card-DbY6YaXk.js +827 -0
- package/dist/{Collections-DvdDRozp.js → Collections-DRN2gzwh.js} +158 -168
- package/dist/{Credit-BeHm7_2S.js → Credit-DOcrzykJ.js} +11 -12
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-BsbgHsah.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-CUxfXaro.js} +359 -333
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-hwXvdiut.js → EffectSheet.vue_vue_type_style_index_0_lang-EF_rHfwT.js} +5 -5
- package/dist/{Experience-CtDY9u4Y.js → Experience-aQj-3H2Y.js} +11 -12
- package/dist/{Game-DjaYuqcb.js → Game-Cnje-m_M.js} +22 -23
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-Bq5-Gl9N.js → ImageInput.vue_vue_type_script_setup_true_lang-CG-GBVMP.js} +8 -8
- package/dist/{MainLayout-B-iAZM2k.js → MainLayout-Cxl9yLPs.js} +1 -1
- package/dist/{Marketing-BJJltAh-.js → Marketing-BYUcbcMU.js} +19 -20
- package/dist/{Member-eJ9Pdi5w.js → Member-D7K9fm_Q.js} +2 -2
- package/dist/MemberList-DbXkxUzF.js +1717 -0
- package/dist/{MemberTransactions-DRET8mSQ.js → MemberTransactions-DED1SYwX.js} +4 -4
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-CLqIp5wR.js +203 -0
- package/dist/{Point-DPTOgJbC.js → Point-CQm8whVQ.js} +11 -12
- package/dist/{Promotion-wzkRuNqO.js → Promotion-DzVXy_C9.js} +42 -44
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-Z06eB5i5.js → RuleGroup.vue_vue_type_script_setup_true_lang-CeS6KlhP.js} +12 -12
- package/dist/Segment-D3o0D3Uv.js +407 -0
- package/dist/{Setting-CXuZu0-m.js → Setting-pCzenLoL.js} +17 -18
- package/dist/{Store-4Um9keEp.js → Store-DEwEIFYD.js} +18 -19
- package/dist/{StoreRewards-B-UFeyQM.js → StoreRewards-D7vnZN4f.js} +86 -87
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-ALzQU3th.js +793 -0
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-I_XFpctY.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-GMIztWCj.js} +1 -1
- package/dist/{Tier-C6KVsxGO.js → Tier-BJbX5CPB.js} +401 -377
- package/dist/{Title-DuN1ahIM.js → Title-C9xV6rBg.js} +274 -248
- package/dist/Transaction-C8OHlhzR.js +36 -0
- package/dist/Voucher-eZwm7N1D.js +481 -0
- package/dist/{app-CxBTTB31.js → app-DgbDbhL-.js} +34 -34
- package/dist/app.js +1 -1
- package/dist/{campaign-B0aXkadj.js → campaign-BkvrUTEJ.js} +2 -2
- package/dist/{dto-BtdVC-Ab.js → dto-YYVhW73A.js} +52 -53
- package/dist/{effect-BUN6rkQM.js → effect-f7DAPYC8.js} +1 -1
- package/dist/export-BXbCXTfd.js +97 -0
- package/dist/{helper-Cpq3x8K5.js → helper-BhvQ9m6d.js} +1 -1
- package/dist/{index-D2Juhkdw.js → index-BhacKx5B.js} +85 -83
- package/dist/{index-DDSLx7vu.js → index-BsEqtUmY.js} +2 -2
- package/dist/{index-0GYrZr4L.js → index-CdtrQ9tR.js} +5 -5
- package/dist/{index-8clzk3uX.js → index-Cfo2A0Se.js} +1 -1
- package/dist/index-Cz5RZlYh.js +73 -0
- package/dist/{index-BTntbYTS.js → index-DQC_1tRF.js} +1 -1
- package/dist/{index-DysVCkrx.js → index-Dd3hrFcQ.js} +3 -3
- package/dist/{index-CK9yJMj7.js → index-FWp9M1yS.js} +5 -5
- package/dist/{index-C6NgUSl2.js → index-VmFlM704.js} +1 -1
- package/dist/{index-BvnZdJBY.js → index-oQLJE4Uw.js} +2 -2
- package/dist/libs/packages/core/src/collectible/collectible.dto.d.ts +6 -0
- package/dist/{plugins-B_d-WFtN.js → loading-DQaawbHE.js} +8204 -8108
- package/dist/{lodash-DsT1nK-T.js → lodash-DzdmTD20.js} +1 -1
- package/dist/{membership-DtD45RXh.js → membership-Dq2-b-S_.js} +3 -3
- package/dist/{money-CFI1TMCS.js → money-vzwOUBrp.js} +1 -1
- package/dist/{number-BBtf4fYz.js → number-CBzs6rfW.js} +1 -1
- package/dist/packages/connect/src/components/campaign/CampaignSummary.vue.d.ts +13 -0
- package/dist/packages/connect/src/composables/export.d.ts +11 -0
- package/dist/packages/connect/src/export/base.export.d.ts +7 -0
- package/dist/packages/connect/src/export/card.export.d.ts +5 -6
- package/dist/packages/connect/src/export/collection-transaction.export.d.ts +14 -0
- package/dist/packages/connect/src/export/index.d.ts +1 -0
- package/dist/packages/connect/src/export/store-transaction.export.d.ts +14 -0
- package/dist/packages/connect/src/helpers/user.d.ts +6 -0
- package/dist/{rule-CB9Qlcx1.js → rule-BR5rrmUV.js} +2 -2
- package/dist/{rule-builder-BIKcA4Bg.js → rule-builder-7GBNrPXt.js} +1 -1
- package/dist/{template-qlb46PGl.js → template-CETJ6lkf.js} +5 -5
- package/dist/{usePagination-CX66ab1Y.js → usePagination-DdZeE4Tt.js} +57 -56
- package/dist/user-Bm4KttFq.js +37 -0
- package/dist/{xlsx-DMaFso0k.js → xlsx-CDAKxZE_.js} +1 -1
- package/package.json +1 -1
- package/dist/Card-Dlj5jQp4.js +0 -792
- package/dist/MemberList-CrhMqUfJ.js +0 -1664
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-D-ttMwn2.js +0 -166
- package/dist/Segment-DnsPrP7Q.js +0 -371
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BAyotuXd.js +0 -660
- package/dist/Transaction-DdfX7Xfe.js +0 -34
- package/dist/Voucher-DarXrxZr.js +0 -454
- package/dist/index-Dg-PMgXV.js +0 -64
- package/dist/loading-Cxp7sI5p.js +0 -100
|
@@ -1,660 +0,0 @@
|
|
|
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
|
-
import { components as w } from "@feedmepos/ui-library";
|
|
3
|
-
import { d as ne } from "./index-DDSLx7vu.js";
|
|
4
|
-
import { c as q } from "./plugins-B_d-WFtN.js";
|
|
5
|
-
import { s as re } from "./index-Dbd4WA4r.js";
|
|
6
|
-
import { h as b } from "./moment-BWErdI6_.js";
|
|
7
|
-
import { s as L } from "./index-CuvNtC_M.js";
|
|
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
|
-
import { o as G } from "./objectId-dwaoBfJX.js";
|
|
12
|
-
function de(o) {
|
|
13
|
-
let l = "";
|
|
14
|
-
switch (o) {
|
|
15
|
-
case "PORTAL":
|
|
16
|
-
l = "ADMIN";
|
|
17
|
-
break;
|
|
18
|
-
case "EXPIRED":
|
|
19
|
-
l = "EXPIRED";
|
|
20
|
-
break;
|
|
21
|
-
case "BENEFIT":
|
|
22
|
-
l = "MEMBERSHIP";
|
|
23
|
-
break;
|
|
24
|
-
case "ORDER":
|
|
25
|
-
l = "ORDER";
|
|
26
|
-
break;
|
|
27
|
-
case "BILL":
|
|
28
|
-
l = "SPENDING";
|
|
29
|
-
break;
|
|
30
|
-
case "CASHBACK":
|
|
31
|
-
l = "CASHBACK";
|
|
32
|
-
break;
|
|
33
|
-
case "CYCLE":
|
|
34
|
-
l = "EXPIRED";
|
|
35
|
-
break;
|
|
36
|
-
case "COUNTER_CONSUME":
|
|
37
|
-
l = "COUNTER REDEEM";
|
|
38
|
-
break;
|
|
39
|
-
default:
|
|
40
|
-
l = o;
|
|
41
|
-
break;
|
|
42
|
-
}
|
|
43
|
-
return l;
|
|
44
|
-
}
|
|
45
|
-
function me(o) {
|
|
46
|
-
var l, r, p, a, i, y;
|
|
47
|
-
switch ((l = o == null ? void 0 : o.pf_collectible) == null ? void 0 : l.type) {
|
|
48
|
-
case "VOUCHER":
|
|
49
|
-
return `${(r = o.pf_collectible) == null ? void 0 : r.type} (${(p = o.pf_collectible) == null ? void 0 : p.name})`;
|
|
50
|
-
case "TITLE":
|
|
51
|
-
return `${(a = o.pf_collectible) == null ? void 0 : a.type} (${(i = o.pf_collectible) == null ? void 0 : i.name})`;
|
|
52
|
-
case "POINT":
|
|
53
|
-
return "Experience";
|
|
54
|
-
case "COIN":
|
|
55
|
-
return "Point";
|
|
56
|
-
default:
|
|
57
|
-
return re((y = o == null ? void 0 : o.pf_collectible) == null ? void 0 : y.type);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
function pe(o) {
|
|
61
|
-
switch (o) {
|
|
62
|
-
case "ONLINE":
|
|
63
|
-
return "Online";
|
|
64
|
-
case "COIN":
|
|
65
|
-
return "Point";
|
|
66
|
-
default:
|
|
67
|
-
return o;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
const E = {
|
|
71
|
-
getReason: de,
|
|
72
|
-
formattedType: me,
|
|
73
|
-
formattedPaymentType: pe
|
|
74
|
-
}, ge = { class: "fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap" }, N = /* @__PURE__ */ O({
|
|
75
|
-
__name: "FilterChip",
|
|
76
|
-
props: {
|
|
77
|
-
modelValue: {
|
|
78
|
-
type: Array,
|
|
79
|
-
required: !1
|
|
80
|
-
},
|
|
81
|
-
label: {
|
|
82
|
-
type: String,
|
|
83
|
-
required: !1,
|
|
84
|
-
default: ""
|
|
85
|
-
},
|
|
86
|
-
showItemLabel: {
|
|
87
|
-
type: Boolean,
|
|
88
|
-
default: !1
|
|
89
|
-
},
|
|
90
|
-
placement: {
|
|
91
|
-
type: String,
|
|
92
|
-
required: !1,
|
|
93
|
-
default: "bottom-end"
|
|
94
|
-
},
|
|
95
|
-
class: {
|
|
96
|
-
type: String,
|
|
97
|
-
required: !1
|
|
98
|
-
},
|
|
99
|
-
disabled: {
|
|
100
|
-
type: Boolean,
|
|
101
|
-
required: !1
|
|
102
|
-
},
|
|
103
|
-
items: {
|
|
104
|
-
type: Array,
|
|
105
|
-
required: !0
|
|
106
|
-
},
|
|
107
|
-
icon: {
|
|
108
|
-
type: String,
|
|
109
|
-
required: !1
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
emits: ["update:model-value"],
|
|
113
|
-
setup(o, { emit: l }) {
|
|
114
|
-
const r = o, p = l, a = I(!1), i = I({}), y = M(() => {
|
|
115
|
-
if (!i.value || Object.keys(i.value).length == r.items.length)
|
|
116
|
-
return "All";
|
|
117
|
-
{
|
|
118
|
-
const t = Object.keys(i.value).length;
|
|
119
|
-
return `${t > 0 ? t : "None"} selected`;
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
function S(t) {
|
|
123
|
-
i.value[t] ? delete i.value[t] : i.value[t] = !0, p("update:model-value", Object.keys(i.value));
|
|
124
|
-
}
|
|
125
|
-
function v() {
|
|
126
|
-
Object.keys(i.value).length > 0 ? i.value = {} : i.value = r.items.reduce((t, s) => (t[s.value] = !0, t), {}), p("update:model-value", Object.keys(i.value));
|
|
127
|
-
}
|
|
128
|
-
return A(() => {
|
|
129
|
-
i.value = r.modelValue.reduce(
|
|
130
|
-
(t, s) => (t[s] = !0, t),
|
|
131
|
-
{}
|
|
132
|
-
), r.modelValue.length == 0;
|
|
133
|
-
}), (t, s) => {
|
|
134
|
-
const h = _("FmIcon"), f = _("FmChip"), n = _("FmMenuItem"), c = _("FmMenu");
|
|
135
|
-
return x(), V(c, {
|
|
136
|
-
placement: o.placement || "bottom-end",
|
|
137
|
-
disabled: o.disabled == !0,
|
|
138
|
-
"model-value": e(a),
|
|
139
|
-
onMenuChanged: s[0] || (s[0] = (m) => a.value = m),
|
|
140
|
-
"close-on-click": !1
|
|
141
|
-
}, {
|
|
142
|
-
"menu-button": k(() => [
|
|
143
|
-
g(f, {
|
|
144
|
-
label: o.label,
|
|
145
|
-
class: T(r.class || "text-fm-color-neutral-gray-400 cursor-pointer")
|
|
146
|
-
}, {
|
|
147
|
-
default: k(() => [
|
|
148
|
-
r.icon ? (x(), V(h, {
|
|
149
|
-
key: 0,
|
|
150
|
-
name: r.icon,
|
|
151
|
-
class: T(r.class),
|
|
152
|
-
outline: "",
|
|
153
|
-
size: "sm"
|
|
154
|
-
}, null, 8, ["name", "class"])) : Z("", !0),
|
|
155
|
-
C("div", ge, z(r.label) + " " + z(o.showItemLabel ? e(y) : ""), 1),
|
|
156
|
-
g(h, {
|
|
157
|
-
name: e(a) ? "keyboard_arrow_up" : "keyboard_arrow_down",
|
|
158
|
-
class: T(r.class),
|
|
159
|
-
outline: "",
|
|
160
|
-
size: "sm"
|
|
161
|
-
}, null, 8, ["name", "class"])
|
|
162
|
-
]),
|
|
163
|
-
_: 1
|
|
164
|
-
}, 8, ["label", "class"])
|
|
165
|
-
]),
|
|
166
|
-
default: k(() => [
|
|
167
|
-
g(n, {
|
|
168
|
-
"model-value": Object.keys(e(i)).length === r.items.length,
|
|
169
|
-
label: "All",
|
|
170
|
-
"has-checkbox": !0,
|
|
171
|
-
indeterminate: !0,
|
|
172
|
-
onClick: v
|
|
173
|
-
}, null, 8, ["model-value"]),
|
|
174
|
-
(x(!0), P(ee, null, ae(r.items ?? [], (m) => (x(), V(n, {
|
|
175
|
-
key: m.value,
|
|
176
|
-
value: m.value,
|
|
177
|
-
label: m.label,
|
|
178
|
-
"has-checkbox": !0,
|
|
179
|
-
"model-value": e(i)[m.value],
|
|
180
|
-
"onUpdate:modelValue": (u) => S(m.value)
|
|
181
|
-
}, null, 8, ["value", "label", "model-value", "onUpdate:modelValue"]))), 128))
|
|
182
|
-
]),
|
|
183
|
-
_: 1
|
|
184
|
-
}, 8, ["placement", "disabled", "model-value"]);
|
|
185
|
-
};
|
|
186
|
-
}
|
|
187
|
-
}), R = "YYYY-MM-DD", X = /* @__PURE__ */ O({
|
|
188
|
-
__name: "DateRangeChip",
|
|
189
|
-
props: /* @__PURE__ */ B({
|
|
190
|
-
modelValue: {
|
|
191
|
-
type: Object,
|
|
192
|
-
required: !0
|
|
193
|
-
}
|
|
194
|
-
}, {
|
|
195
|
-
dateRange: {
|
|
196
|
-
type: Object,
|
|
197
|
-
default: () => ({
|
|
198
|
-
startDate: b().subtract(7, "day").format(R),
|
|
199
|
-
endDate: b().endOf("day").format(R)
|
|
200
|
-
})
|
|
201
|
-
},
|
|
202
|
-
dateRangeModifiers: {}
|
|
203
|
-
}),
|
|
204
|
-
emits: /* @__PURE__ */ B(["update:model-value"], ["update:dateRange"]),
|
|
205
|
-
setup(o, { emit: l }) {
|
|
206
|
-
const r = o, p = l, a = te(o, "dateRange"), i = M(() => a.value ? `${y.value.startDate ?? "Start"} - ${y.value.endDate ?? "End"}` : "No dates selected."), y = M(() => ({
|
|
207
|
-
startDate: a.value.startDate ? b(a.value.startDate).format(R) : void 0,
|
|
208
|
-
endDate: a.value.endDate ? b(a.value.endDate).format(R) : void 0
|
|
209
|
-
}));
|
|
210
|
-
return A(() => {
|
|
211
|
-
a.value = r.modelValue;
|
|
212
|
-
}), U(
|
|
213
|
-
() => a.value,
|
|
214
|
-
() => {
|
|
215
|
-
p("update:model-value", y.value);
|
|
216
|
-
}
|
|
217
|
-
), (S, v) => {
|
|
218
|
-
const t = _("FmChip"), s = _("FmDateRangePicker");
|
|
219
|
-
return x(), V(s, {
|
|
220
|
-
modelValue: a.value,
|
|
221
|
-
"onUpdate:modelValue": v[0] || (v[0] = (h) => a.value = h),
|
|
222
|
-
"show-predefined-range": ""
|
|
223
|
-
}, {
|
|
224
|
-
"trigger-button": k(() => [
|
|
225
|
-
g(t, {
|
|
226
|
-
label: e(i),
|
|
227
|
-
icon: "calendar_month",
|
|
228
|
-
"right-icon": "keyboard_arrow_down",
|
|
229
|
-
class: "text-fm-color-neutral-gray-400 cursor-pointer"
|
|
230
|
-
}, null, 8, ["label"])
|
|
231
|
-
]),
|
|
232
|
-
_: 1
|
|
233
|
-
}, 8, ["modelValue"]);
|
|
234
|
-
};
|
|
235
|
-
}
|
|
236
|
-
}), j = () => {
|
|
237
|
-
const o = ie.getBusinessId();
|
|
238
|
-
if (!o) throw new Error("Invalid business ID");
|
|
239
|
-
return ce(`businesses/${o}/transactions`, {
|
|
240
|
-
noIdRequired: !0
|
|
241
|
-
});
|
|
242
|
-
}, J = {
|
|
243
|
-
async readAll(o, l) {
|
|
244
|
-
const r = Y(
|
|
245
|
-
await j().get("", {
|
|
246
|
-
params: { ...o, ...l }
|
|
247
|
-
})
|
|
248
|
-
);
|
|
249
|
-
return {
|
|
250
|
-
meta: r.meta,
|
|
251
|
-
resources: r.resources
|
|
252
|
-
};
|
|
253
|
-
},
|
|
254
|
-
async readStoreTransactions(o, l) {
|
|
255
|
-
const r = Y(
|
|
256
|
-
await j().get("/store", {
|
|
257
|
-
params: { ...o, ...l }
|
|
258
|
-
})
|
|
259
|
-
);
|
|
260
|
-
return {
|
|
261
|
-
meta: r.meta,
|
|
262
|
-
resources: r.resources
|
|
263
|
-
};
|
|
264
|
-
},
|
|
265
|
-
async readBills(o, l, r) {
|
|
266
|
-
return (await se("").get(`/restaurants/${o}/receipt?start=${l}&end=${r}`)).data;
|
|
267
|
-
}
|
|
268
|
-
}, fe = { class: "flex items-center justify-between" }, be = { class: "flex gap-8 items-center w-full overflow-x-scroll" }, ke = /* @__PURE__ */ O({
|
|
269
|
-
__name: "CollectionTransactions",
|
|
270
|
-
props: {
|
|
271
|
-
user: {
|
|
272
|
-
type: String
|
|
273
|
-
}
|
|
274
|
-
},
|
|
275
|
-
setup(o) {
|
|
276
|
-
const l = ue(), r = o, p = [
|
|
277
|
-
{
|
|
278
|
-
header: "Transaction ID",
|
|
279
|
-
accessorKey: "_id",
|
|
280
|
-
cell(n) {
|
|
281
|
-
return d("div", { class: "flex items-center" }, [
|
|
282
|
-
d(w.FmIcon, {
|
|
283
|
-
name: "content_copy",
|
|
284
|
-
outline: !0,
|
|
285
|
-
size: "sm",
|
|
286
|
-
class: "cursor-pointer mr-4",
|
|
287
|
-
onClick: (c) => {
|
|
288
|
-
c.preventDefault(), c.stopPropagation(), q(n.row.original._id.toString());
|
|
289
|
-
}
|
|
290
|
-
}),
|
|
291
|
-
d("div", { class: "pr-2" }, n.row.original._id.toString())
|
|
292
|
-
]);
|
|
293
|
-
},
|
|
294
|
-
enableSorting: !1
|
|
295
|
-
},
|
|
296
|
-
{
|
|
297
|
-
header: "Created at",
|
|
298
|
-
accessorKey: "_id",
|
|
299
|
-
accessorFn: (n) => b(G(n._id.toString())).format("D MMM YYYY, hh:mmA"),
|
|
300
|
-
enableSorting: !0
|
|
301
|
-
},
|
|
302
|
-
{
|
|
303
|
-
header: "Amount",
|
|
304
|
-
// accessorKey: 'totalAmount',
|
|
305
|
-
enableSorting: !1,
|
|
306
|
-
cell(n) {
|
|
307
|
-
var u, D, F, $;
|
|
308
|
-
const c = le(
|
|
309
|
-
n.row.original.expiryAmount.reduce(
|
|
310
|
-
(Q, W) => Q + W.amount,
|
|
311
|
-
n.row.original.amount ?? 0
|
|
312
|
-
),
|
|
313
|
-
2
|
|
314
|
-
), m = (D = (u = n.row.original.expiryAmount) == null ? void 0 : u[0]) != null && D.expiredAt ? b(($ = (F = n.row.original.expiryAmount) == null ? void 0 : F[0]) == null ? void 0 : $.expiredAt).format(
|
|
315
|
-
"D MMM YYYY"
|
|
316
|
-
) : "";
|
|
317
|
-
return d("div", { class: "flex items-center" }, [
|
|
318
|
-
d(
|
|
319
|
-
"div",
|
|
320
|
-
{
|
|
321
|
-
class: [
|
|
322
|
-
"pr-2",
|
|
323
|
-
+c > 0 ? "text-fm-color-system-success-300" : "text-fm-color-system-error-300"
|
|
324
|
-
]
|
|
325
|
-
},
|
|
326
|
-
c
|
|
327
|
-
),
|
|
328
|
-
d("div", { class: "flex items-center" }, [
|
|
329
|
-
n.row.original.expiryAmount.length > 0 ? d(
|
|
330
|
-
w.FmTooltip,
|
|
331
|
-
{
|
|
332
|
-
content: `Expired on ${m}`
|
|
333
|
-
},
|
|
334
|
-
[
|
|
335
|
-
d(w.FmIcon, {
|
|
336
|
-
name: "info",
|
|
337
|
-
outline: !0,
|
|
338
|
-
size: "sm"
|
|
339
|
-
})
|
|
340
|
-
]
|
|
341
|
-
) : d("div")
|
|
342
|
-
])
|
|
343
|
-
]);
|
|
344
|
-
}
|
|
345
|
-
},
|
|
346
|
-
{
|
|
347
|
-
header: "Type",
|
|
348
|
-
accessorKey: "pf_collectible.type",
|
|
349
|
-
accessorFn: (n) => E.formattedType(n)
|
|
350
|
-
},
|
|
351
|
-
{
|
|
352
|
-
header: "Source",
|
|
353
|
-
accessorKey: "source",
|
|
354
|
-
accessorFn: (n) => L(E.getReason(n.source))
|
|
355
|
-
},
|
|
356
|
-
{
|
|
357
|
-
header: "User",
|
|
358
|
-
accessorKey: "pf_user.name",
|
|
359
|
-
accessorFn: (n) => n.pf_user.name
|
|
360
|
-
},
|
|
361
|
-
{
|
|
362
|
-
header: "Phone No.",
|
|
363
|
-
accessorKey: "pf_user.phoneNumber",
|
|
364
|
-
accessorFn: (n) => n.pf_user.phoneNumber
|
|
365
|
-
},
|
|
366
|
-
{
|
|
367
|
-
accessorFn: (n) => n.ref,
|
|
368
|
-
header: "References",
|
|
369
|
-
accessorKey: "ref",
|
|
370
|
-
cell(n) {
|
|
371
|
-
var c, m;
|
|
372
|
-
return d("div", { class: "flex items-center justify-between gap-4" }, [
|
|
373
|
-
d("div", { class: "flex items-center" }, [
|
|
374
|
-
(c = n.row.original.metadata) != null && c.remark ? d(
|
|
375
|
-
w.FmTooltip,
|
|
376
|
-
{
|
|
377
|
-
content: (m = n.row.original.metadata) == null ? void 0 : m.remark
|
|
378
|
-
},
|
|
379
|
-
[
|
|
380
|
-
d(w.FmIcon, {
|
|
381
|
-
name: "info",
|
|
382
|
-
outline: !0,
|
|
383
|
-
size: "sm"
|
|
384
|
-
})
|
|
385
|
-
]
|
|
386
|
-
) : d("div")
|
|
387
|
-
]),
|
|
388
|
-
d("div", { class: "flex-1" }, n.row.original.ref)
|
|
389
|
-
]);
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
], a = I({
|
|
393
|
-
search: "",
|
|
394
|
-
"pf_collectible.type": [],
|
|
395
|
-
"metadata.location": [],
|
|
396
|
-
dateRange: {
|
|
397
|
-
startDate: b().subtract(7, "day").toISOString(),
|
|
398
|
-
endDate: b().endOf("day").toISOString()
|
|
399
|
-
},
|
|
400
|
-
source: []
|
|
401
|
-
}), { tableMeta: i, rowData: y, onSort: S, debouncedFetchData: v, onSearch: t } = K(async (n) => {
|
|
402
|
-
const c = {
|
|
403
|
-
...a.value,
|
|
404
|
-
user: r.user,
|
|
405
|
-
dateRange: {
|
|
406
|
-
start: new Date(a.value.dateRange.startDate).toISOString(),
|
|
407
|
-
end: new Date(a.value.dateRange.endDate).toISOString()
|
|
408
|
-
}
|
|
409
|
-
}, m = await J.readAll(n, c);
|
|
410
|
-
return {
|
|
411
|
-
resources: m.resources.map((u) => {
|
|
412
|
-
const D = s.value.find((F) => F._id === u.ref);
|
|
413
|
-
return { ...u, ref: (D == null ? void 0 : D.seqNumber) || u.ref };
|
|
414
|
-
}),
|
|
415
|
-
meta: m.meta
|
|
416
|
-
};
|
|
417
|
-
}), s = I([]), h = ne.options.map((n) => ({ label: L(E.getReason(n)), value: n })), f = l.locations.map((n) => ({ label: n.name, value: n._id }));
|
|
418
|
-
return U(
|
|
419
|
-
a,
|
|
420
|
-
() => {
|
|
421
|
-
v();
|
|
422
|
-
},
|
|
423
|
-
{ deep: !0 }
|
|
424
|
-
), oe(async () => {
|
|
425
|
-
await l.readLocations(), await v();
|
|
426
|
-
}), (n, c) => {
|
|
427
|
-
const m = _("FmSearch");
|
|
428
|
-
return x(), P("div", null, [
|
|
429
|
-
g(m, {
|
|
430
|
-
class: "hidden xs:flex border-b border-fm-color-neutral-gray-100",
|
|
431
|
-
modelValue: e(a).search,
|
|
432
|
-
"onUpdate:modelValue": c[0] || (c[0] = (u) => e(a).search = u),
|
|
433
|
-
placeholder: "Search",
|
|
434
|
-
collapsible: ""
|
|
435
|
-
}, null, 8, ["modelValue"]),
|
|
436
|
-
C("div", fe, [
|
|
437
|
-
C("div", be, [
|
|
438
|
-
g(N, {
|
|
439
|
-
class: "cursor-pointer text-fm-color-neutral-gray-400",
|
|
440
|
-
"right-icon": "keyboard_arrow_down",
|
|
441
|
-
modelValue: e(a)["metadata.location"],
|
|
442
|
-
"onUpdate:modelValue": c[1] || (c[1] = (u) => e(a)["metadata.location"] = u),
|
|
443
|
-
icon: "storefront",
|
|
444
|
-
"show-item-label": !0,
|
|
445
|
-
items: e(f)
|
|
446
|
-
}, null, 8, ["modelValue", "items"]),
|
|
447
|
-
g(N, {
|
|
448
|
-
class: "cursor-pointer text-fm-color-neutral-gray-400",
|
|
449
|
-
"right-icon": "keyboard_arrow_down",
|
|
450
|
-
modelValue: e(a)["pf_collectible.type"],
|
|
451
|
-
"onUpdate:modelValue": c[2] || (c[2] = (u) => e(a)["pf_collectible.type"] = u),
|
|
452
|
-
label: "Type: ",
|
|
453
|
-
"show-item-label": !0,
|
|
454
|
-
items: [
|
|
455
|
-
{ label: "Point", value: "COIN" },
|
|
456
|
-
{ label: "Credit", value: "CREDIT" },
|
|
457
|
-
{ label: "Voucher", value: "VOUCHER" },
|
|
458
|
-
{ label: "Experience", value: "POINT" },
|
|
459
|
-
{ label: "Tier", value: "TIER" },
|
|
460
|
-
{ label: "Title", value: "TITLE" },
|
|
461
|
-
{ label: "Game", value: "GAME" }
|
|
462
|
-
]
|
|
463
|
-
}, null, 8, ["modelValue"]),
|
|
464
|
-
g(N, {
|
|
465
|
-
class: "cursor-pointer text-fm-color-neutral-gray-400",
|
|
466
|
-
"right-icon": "keyboard_arrow_down",
|
|
467
|
-
modelValue: e(a).source,
|
|
468
|
-
"onUpdate:modelValue": c[3] || (c[3] = (u) => e(a).source = u),
|
|
469
|
-
label: "Source: ",
|
|
470
|
-
"show-item-label": !0,
|
|
471
|
-
items: e(h)
|
|
472
|
-
}, null, 8, ["modelValue", "items"]),
|
|
473
|
-
g(X, {
|
|
474
|
-
"model-value": {
|
|
475
|
-
startDate: e(a).dateRange.startDate,
|
|
476
|
-
endDate: e(a).dateRange.endDate
|
|
477
|
-
},
|
|
478
|
-
"onUpdate:modelValue": c[4] || (c[4] = (u) => e(a).dateRange = {
|
|
479
|
-
startDate: e(b)(u.startDate).startOf("d").toISOString(),
|
|
480
|
-
endDate: e(b)(u.endDate).endOf("d").toISOString()
|
|
481
|
-
})
|
|
482
|
-
}, null, 8, ["model-value"])
|
|
483
|
-
]),
|
|
484
|
-
g(m, {
|
|
485
|
-
class: "xs:hidden",
|
|
486
|
-
modelValue: e(a).search,
|
|
487
|
-
"onUpdate:modelValue": c[5] || (c[5] = (u) => e(a).search = u),
|
|
488
|
-
placeholder: "Search",
|
|
489
|
-
collapsible: ""
|
|
490
|
-
}, null, 8, ["modelValue"])
|
|
491
|
-
]),
|
|
492
|
-
g(H, {
|
|
493
|
-
loading: e(i).isLoading,
|
|
494
|
-
"row-data": e(y),
|
|
495
|
-
"row-count": e(i).totalRows,
|
|
496
|
-
"column-defs": p.filter(
|
|
497
|
-
(u) => !r.user || u.header !== "User" && u.header !== "Phone No."
|
|
498
|
-
),
|
|
499
|
-
"page-count": e(i).pageCount,
|
|
500
|
-
"page-index": e(i).pageIndex,
|
|
501
|
-
"page-size": e(i).pageSize,
|
|
502
|
-
"shrink-at": !1,
|
|
503
|
-
onSortChange: e(S),
|
|
504
|
-
onPageChange: c[6] || (c[6] = (u) => e(v)({
|
|
505
|
-
pageSize: u.pageSize,
|
|
506
|
-
pageIndex: u.pageIndex
|
|
507
|
-
}))
|
|
508
|
-
}, null, 8, ["loading", "row-data", "row-count", "column-defs", "page-count", "page-index", "page-size", "onSortChange"])
|
|
509
|
-
]);
|
|
510
|
-
};
|
|
511
|
-
}
|
|
512
|
-
}), ye = { class: "flex items-center justify-between" }, he = { class: "flex gap-8 items-center" }, Oe = /* @__PURE__ */ O({
|
|
513
|
-
__name: "StoreTransactions",
|
|
514
|
-
props: {
|
|
515
|
-
user: {
|
|
516
|
-
type: String
|
|
517
|
-
}
|
|
518
|
-
},
|
|
519
|
-
setup(o) {
|
|
520
|
-
const l = o, r = [
|
|
521
|
-
{
|
|
522
|
-
header: "Transaction ID",
|
|
523
|
-
cell(t) {
|
|
524
|
-
return d("div", { class: "flex items-center" }, [
|
|
525
|
-
d(w.FmIcon, {
|
|
526
|
-
name: "content_copy",
|
|
527
|
-
outline: !0,
|
|
528
|
-
size: "sm",
|
|
529
|
-
class: "cursor-pointer mr-4",
|
|
530
|
-
onClick: (s) => {
|
|
531
|
-
s.preventDefault(), s.stopPropagation(), q(t.row.original._id.toString());
|
|
532
|
-
}
|
|
533
|
-
}),
|
|
534
|
-
d("div", { class: "pr-2" }, t.row.original._id.toString())
|
|
535
|
-
]);
|
|
536
|
-
}
|
|
537
|
-
},
|
|
538
|
-
{
|
|
539
|
-
header: "Created at",
|
|
540
|
-
accessorFn: (t) => b(G(t._id.toString())).format("D MMM YYYY, hh:mmA"),
|
|
541
|
-
enableSorting: !0
|
|
542
|
-
},
|
|
543
|
-
{
|
|
544
|
-
header: "Bundle",
|
|
545
|
-
accessorFn: (t) => t.bundle.name
|
|
546
|
-
},
|
|
547
|
-
{
|
|
548
|
-
header: "Location",
|
|
549
|
-
accessorFn: (t) => t.location ? t.pf_location.name : "Online Store"
|
|
550
|
-
},
|
|
551
|
-
{
|
|
552
|
-
header: "Payment Type",
|
|
553
|
-
accessorFn: (t) => {
|
|
554
|
-
var s;
|
|
555
|
-
return ((s = t.paymentType) == null ? void 0 : s.type) ?? "N/A";
|
|
556
|
-
},
|
|
557
|
-
cell(t) {
|
|
558
|
-
var s, h;
|
|
559
|
-
return d("div", { class: "flex items-center gap-4" }, [
|
|
560
|
-
d("div", { class: "flex items-center" }, [
|
|
561
|
-
((s = t.row.original.paymentType) == null ? void 0 : s.type) == "ONLINE" && t.row.original.paymentType.extra ? d(
|
|
562
|
-
w.FmTooltip,
|
|
563
|
-
{
|
|
564
|
-
content: t.row.original.paymentType.extra
|
|
565
|
-
},
|
|
566
|
-
[
|
|
567
|
-
d(w.FmIcon, {
|
|
568
|
-
name: "info",
|
|
569
|
-
outline: !0,
|
|
570
|
-
size: "sm"
|
|
571
|
-
})
|
|
572
|
-
]
|
|
573
|
-
) : d("div")
|
|
574
|
-
]),
|
|
575
|
-
d(
|
|
576
|
-
"div",
|
|
577
|
-
{ class: "flex-1" },
|
|
578
|
-
((h = t.row.original.paymentType) == null ? void 0 : h.type) ?? "N/A"
|
|
579
|
-
)
|
|
580
|
-
]);
|
|
581
|
-
}
|
|
582
|
-
},
|
|
583
|
-
{
|
|
584
|
-
header: "User",
|
|
585
|
-
accessorFn: (t) => t.pf_member.name
|
|
586
|
-
},
|
|
587
|
-
{
|
|
588
|
-
header: "Phone No.",
|
|
589
|
-
accessorFn: (t) => t.pf_member.phoneNumber
|
|
590
|
-
},
|
|
591
|
-
{
|
|
592
|
-
header: "Status",
|
|
593
|
-
accessorFn: (t) => t.status
|
|
594
|
-
}
|
|
595
|
-
], p = I({
|
|
596
|
-
searchValue: "",
|
|
597
|
-
dateRange: {
|
|
598
|
-
startDate: b().subtract(7, "day").toISOString(),
|
|
599
|
-
endDate: b().toISOString()
|
|
600
|
-
}
|
|
601
|
-
}), { tableMeta: a, rowData: i, onSort: y, debouncedFetchData: S, onSearch: v } = K(async (t) => {
|
|
602
|
-
const s = {
|
|
603
|
-
...p.value.dateRange,
|
|
604
|
-
user: l.user
|
|
605
|
-
};
|
|
606
|
-
return await J.readStoreTransactions(t, s);
|
|
607
|
-
});
|
|
608
|
-
return U(
|
|
609
|
-
p,
|
|
610
|
-
() => {
|
|
611
|
-
S();
|
|
612
|
-
},
|
|
613
|
-
{ deep: !0 }
|
|
614
|
-
), A(async () => {
|
|
615
|
-
await S();
|
|
616
|
-
}), (t, s) => {
|
|
617
|
-
const h = _("FmSearch");
|
|
618
|
-
return x(), P("div", null, [
|
|
619
|
-
C("div", ye, [
|
|
620
|
-
C("div", he, [
|
|
621
|
-
g(X, {
|
|
622
|
-
modelValue: e(p).dateRange,
|
|
623
|
-
"onUpdate:modelValue": s[0] || (s[0] = (f) => e(p).dateRange = f)
|
|
624
|
-
}, null, 8, ["modelValue"])
|
|
625
|
-
]),
|
|
626
|
-
g(h, {
|
|
627
|
-
modelValue: e(a).searchValue,
|
|
628
|
-
"onUpdate:modelValue": [
|
|
629
|
-
s[1] || (s[1] = (f) => e(a).searchValue = f),
|
|
630
|
-
e(v)
|
|
631
|
-
],
|
|
632
|
-
placeholder: "Search",
|
|
633
|
-
collapsible: ""
|
|
634
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
635
|
-
]),
|
|
636
|
-
g(H, {
|
|
637
|
-
loading: e(a).isLoading,
|
|
638
|
-
"row-data": e(i),
|
|
639
|
-
"row-count": e(a).totalRows,
|
|
640
|
-
"column-defs": r.filter(
|
|
641
|
-
(f) => !l.user || f.header !== "User" && f.header !== "Phone No."
|
|
642
|
-
),
|
|
643
|
-
"page-count": e(a).pageCount,
|
|
644
|
-
"page-index": e(a).pageIndex,
|
|
645
|
-
"page-size": e(a).pageSize,
|
|
646
|
-
"shrink-at": !1,
|
|
647
|
-
onSortChange: e(y),
|
|
648
|
-
onPageChange: s[2] || (s[2] = (f) => e(S)({
|
|
649
|
-
pageSize: f.pageSize,
|
|
650
|
-
pageIndex: f.pageIndex
|
|
651
|
-
}))
|
|
652
|
-
}, null, 8, ["loading", "row-data", "row-count", "column-defs", "page-count", "page-index", "page-size", "onSortChange"])
|
|
653
|
-
]);
|
|
654
|
-
};
|
|
655
|
-
}
|
|
656
|
-
});
|
|
657
|
-
export {
|
|
658
|
-
ke as _,
|
|
659
|
-
Oe as a
|
|
660
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { defineComponent as p, ref as d, resolveComponent as n, openBlock as t, createElementBlock as f, Fragment as v, createVNode as c, createElementVNode as b, unref as a, createBlock as s, resolveDynamicComponent as m, createCommentVNode as k } from "vue";
|
|
2
|
-
import { _ as x, a as C } from "./StoreTransactions.vue_vue_type_script_setup_true_lang-BAyotuXd.js";
|
|
3
|
-
const F = { class: "px-24 flex flex-col gap-y-32 pb-24" }, B = /* @__PURE__ */ p({
|
|
4
|
-
__name: "Transaction",
|
|
5
|
-
setup(T) {
|
|
6
|
-
const o = [
|
|
7
|
-
{
|
|
8
|
-
label: "Collection",
|
|
9
|
-
value: "collection"
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
label: "Store",
|
|
13
|
-
value: "store"
|
|
14
|
-
}
|
|
15
|
-
], e = d(o[0]);
|
|
16
|
-
return (g, l) => {
|
|
17
|
-
const r = n("FmPageHead"), u = n("FmTabs");
|
|
18
|
-
return t(), f(v, null, [
|
|
19
|
-
c(r, { title: "Transactions" }),
|
|
20
|
-
b("div", F, [
|
|
21
|
-
c(u, {
|
|
22
|
-
"model-value": a(e).value,
|
|
23
|
-
items: o,
|
|
24
|
-
"onUpdate:modelValue": l[0] || (l[0] = (i) => e.value = o.find((_) => _.value === i))
|
|
25
|
-
}, null, 8, ["model-value"]),
|
|
26
|
-
a(e).value == "collection" ? (t(), s(m(x), { key: 0 })) : a(e).value == "store" ? (t(), s(m(C), { key: 1 })) : k("", !0)
|
|
27
|
-
])
|
|
28
|
-
], 64);
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
export {
|
|
33
|
-
B as default
|
|
34
|
-
};
|