@feedmepos/mf-connect 0.1.23-prod → 0.1.25-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-DfTQmuSa.js → Analytic-DmQ3d3sr.js} +18 -17
- package/dist/{App-C5AMrBM2.js → App-BK6DtUuH.js} +6 -6
- package/dist/{Bin-nZv2ZrAD.js → Bin-B7F2tXkP.js} +19 -18
- package/dist/{Broadcast-1ViZILw6.js → Broadcast-6n2TGBgu.js} +13 -12
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Nuj7G5E1.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-_hoK2zXW.js} +14 -8
- package/dist/{Card-CUAfRl0P.js → Card-D6AU_9dV.js} +57 -55
- package/dist/{Collections-DNlV8CiV.js → Collections-CMbKkYFL.js} +13 -11
- package/dist/{Credit-C8WVgeKO.js → Credit-CqLwf2JA.js} +35 -34
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-CZmd7K3H.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-CRK5WI7g.js} +28 -27
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-Crakwwgo.js → EffectSheet.vue_vue_type_style_index_0_lang-CaSqYPQ2.js} +6 -6
- package/dist/{Experience-C0ZrJ-rU.js → Experience-OoJ1ODiZ.js} +13 -12
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-BrPLkFX8.js +118 -0
- package/dist/Game-IAfjkExX.js +278 -0
- package/dist/{Index-C_mvHa_E.js → Index-DqHXbokQ.js} +14 -13
- package/dist/{Marketing-7lvR6gR_.js → Marketing-DIVehK5x.js} +8 -7
- package/dist/Member-BMT7m7s9.js +348 -0
- package/dist/{MemberList-BDsVY1bB.js → MemberList-C3JMhLW6.js} +270 -269
- package/dist/{MemberTransactions-DXgJ8Tua.js → MemberTransactions-lQLljdGi.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-BbiWEoQQ.js → MessageInput.vue_vue_type_script_setup_true_lang-DFPEfDUk.js} +15 -18
- package/dist/{Mission-CJnySjh4.js → Mission-BJsuCVHj.js} +118 -96
- package/dist/{Overview-ZENHKQhC.js → Overview-D1AMq951.js} +63 -62
- package/dist/{Point-DvYLQNmg.js → Point-DGffwTWG.js} +11 -10
- package/dist/{Promotion-CE6Mqev4.js → Promotion-Cdu7wiGv.js} +12 -11
- package/dist/Queue-Cm4ekHlP.js +249 -0
- package/dist/{Record-Cl4o08E4.js → Record-B0JjTQ3K.js} +21 -19
- package/dist/{Reward-C1hZ9c6y.js → Reward-U0gEl1no.js} +19 -18
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-Co1mzeQA.js → RewardGroup.vue_vue_type_script_setup_true_lang-CiQHPhkN.js} +13 -12
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CDEiSeqW.js → RuleGroup.vue_vue_type_script_setup_true_lang-BgKlwCAG.js} +12 -12
- package/dist/{Segment-1RH6jUyt.js → Segment-BsXsG6Ga.js} +19 -17
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-CJTZZ4EH.js → SelectItems.vue_vue_type_script_setup_true_lang-hPQP_srV.js} +2 -2
- package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-BLPLYvOq.js +188 -0
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-DL2A84oN.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-rL9NYAk0.js} +3 -3
- package/dist/{Setting-DK9lsogh.js → Setting-DJxzwVSf.js} +20 -19
- package/dist/{Store-DSeXriUy.js → Store-sTvnMjPJ.js} +24 -23
- package/dist/{StoreRewards-DFUg0n5g.js → StoreRewards-CffMLGzL.js} +15 -14
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CUPPeZj5.js +994 -0
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-hR4OBTrC.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DwhQONu8.js} +1 -1
- package/dist/{Tier-Yq3BNKGq.js → Tier-BbfX13Ns.js} +25 -24
- package/dist/{Title-CwWan9gL.js → Title-Bf4fC78d.js} +28 -27
- package/dist/{Transaction-BgO5EYZB.js → Transaction-Ef6ee3WD.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CyUXbl30.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-w66fAQPQ.js} +6 -6
- package/dist/{Voucher-C2w8z86e.js → Voucher-CCH10Wrp.js} +38 -37
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-dEgiWiLL.js → VoucherEditor.vue_vue_type_script_setup_true_lang-C31OGqSE.js} +10 -10
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BME260O1.js → ZodTextField.vue_vue_type_script_setup_true_lang-BqzMSTXs.js} +1 -1
- package/dist/{app-BVIgk6aa.js → app-D2t3_10I.js} +1 -1
- package/dist/{app-BVsQcG_m.js → app-F5UOtzJ-.js} +235 -166
- package/dist/app.js +1 -1
- package/dist/{business-CdvE-WIp.js → business-NXwwmhbL.js} +1 -1
- package/dist/{campaign-WGLWFuCK.js → campaign-BWkn-fFd.js} +9 -9
- package/dist/{campaign-gunNEZhU.js → campaign-Iww5PvJV.js} +2 -2
- package/dist/{campaign.enum-O82qvpU2.js → campaign.enum--kHpbveJ.js} +1 -1
- package/dist/{campaign.fn-Bzr9Jc5X.js → campaign.fn-D0wKIDQf.js} +123 -123
- package/dist/{collectible.enum-CzUCHExj.js → collectible.enum-BpsFdy57.js} +1 -1
- package/dist/{collection.fn-Czs8Mpdz.js → collection.fn-B-_j1A52.js} +2 -2
- package/dist/{dto-Czd638gm.js → dto-CjOlAnWp.js} +4 -4
- package/dist/{effect-D8Km5OHX.js → effect-BMe9xjgR.js} +1 -1
- package/dist/{email-addresses-2-RgQal8.js → email-addresses-BwGoUD7O.js} +1 -1
- package/dist/{export--jJWZuJy.js → export-Bsk4-mYp.js} +3 -3
- package/dist/{helper-BOwvTpT_.js → helper-CiybWTiD.js} +1 -1
- package/dist/{index-Bg8Lqk3s.js → index-7QyaWVGn.js} +1 -1
- package/dist/{index-DGi6aLjD.js → index-BAW03Ygy.js} +24 -21
- package/dist/{index-C6j2uVRJ.js → index-BG_-ksol.js} +1 -1
- package/dist/{index-FBWWEOV0.js → index-COTHSMx7.js} +1 -1
- package/dist/{index-DExfBo0i.js → index-CRa7QWQZ.js} +3 -3
- package/dist/{index-DllRE4Xv.js → index-Cs0QJDgH.js} +1 -1
- package/dist/{index-BMPlc7it.js → index-Cu28MWwC.js} +1162 -1129
- package/dist/{index-CpsX7fKq.js → index-CvKxhzaQ.js} +1 -1
- package/dist/{index-7SYnV8B2.js → index-D7AjQ5_0.js} +1273 -1273
- package/dist/{index-CKSGfZ62.js → index-OLChRkvG.js} +2 -2
- package/dist/{index-DRVIuG-G.js → index-WxOdPYZc.js} +1 -1
- package/dist/{index-CFxA9VYh.js → index-eJ4ofwfd.js} +10 -10
- package/dist/{index.esm2017-CkIJgInI.js → index.esm2017-DMXNt25X.js} +137 -137
- package/dist/loading-CScT_lmc.js +71 -0
- package/dist/{membership-ByveC1Cs.js → membership-DenkPJ5U.js} +3 -3
- package/dist/{money-C_wAhRJ4.js → money-B5hybQjS.js} +1 -1
- package/dist/{number-B1OxEx_j.js → number-anjTvmBi.js} +1 -1
- package/dist/objectid-BHmtsFsO.js +145 -0
- package/dist/{loading-C-HOw2p9.js → plugins-VONaCeWn.js} +1535 -1601
- package/dist/{reward-BOA1fyrM.js → reward-FwctH8OP.js} +1 -1
- package/dist/{rule-CfePtJap.js → rule-BqLIsoB6.js} +3 -3
- package/dist/{rule-builder-B7wNFPfi.js → rule-builder-EwN0tKLd.js} +1 -1
- package/dist/{template-CvIL9Pex.js → template-bVlMDuHk.js} +4 -4
- package/dist/{trigger-D7uzmrxE.js → trigger-Bh7yq_a0.js} +11 -11
- package/dist/usePagination-JoYaROkV.js +223 -0
- package/dist/{user-NlenrMEw.js → user-z65INcT0.js} +1 -1
- package/dist/vue-i18n-59FFzX8P.js +2365 -0
- package/dist/{usePagination-BFzJ3YC7.js → xlsx-D9VDeVL9.js} +2979 -3200
- package/package.json +3 -1
- package/dist/Game-KiwAxjQX.js +0 -256
- package/dist/Member-DR406GTr.js +0 -69
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-D_F7zaEl.js +0 -1105
- package/dist/objectid-CtnWn6lG.js +0 -145
- package/dist/vue-i18n-BjInRP6b.js +0 -2365
|
@@ -1,1105 +0,0 @@
|
|
|
1
|
-
import { defineComponent as z, ref as A, computed as Y, onMounted as ee, resolveComponent as k, openBlock as I, createBlock as U, unref as n, withCtx as $, createVNode as w, normalizeClass as X, createCommentVNode as ge, createElementVNode as D, toDisplayString as P, createElementBlock as N, Fragment as H, renderList as Q, mergeModels as oe, useModel as ve, watch as te, h as s, isRef as ye, createTextVNode as he, resolveDynamicComponent as be, onBeforeMount as _e } from "vue";
|
|
2
|
-
import { components as C, useDialog as Se } from "@feedmepos/ui-library";
|
|
3
|
-
import { p as ne } from "./index-BMPlc7it.js";
|
|
4
|
-
import { a as ae, c as xe, p as we, u as De } from "./loading-C-HOw2p9.js";
|
|
5
|
-
import { s as Re } from "./index-Dbd4WA4r.js";
|
|
6
|
-
import { h as _ } from "./moment-BWErdI6_.js";
|
|
7
|
-
import { s as G } from "./index-CuvNtC_M.js";
|
|
8
|
-
import { f as Z } from "./number-B1OxEx_j.js";
|
|
9
|
-
import { u as re } from "./business-CdvE-WIp.js";
|
|
10
|
-
import { a as le, _ as se } from "./usePagination-BFzJ3YC7.js";
|
|
11
|
-
import { g as ie } from "./user-NlenrMEw.js";
|
|
12
|
-
import { B as ce, e as ue } from "./export--jJWZuJy.js";
|
|
13
|
-
import { u as de } from "./campaign-gunNEZhU.js";
|
|
14
|
-
import "./index-C6j2uVRJ.js";
|
|
15
|
-
import "./index-CKSGfZ62.js";
|
|
16
|
-
import "./index-CFxA9VYh.js";
|
|
17
|
-
import "./index-Bg8Lqk3s.js";
|
|
18
|
-
import "./index-DExfBo0i.js";
|
|
19
|
-
import { u as Ce } from "./vue-i18n-BjInRP6b.js";
|
|
20
|
-
import { o as B } from "./objectId-dwaoBfJX.js";
|
|
21
|
-
import { useRouter as Te } from "vue-router";
|
|
22
|
-
import { t as W } from "./index-DRVIuG-G.js";
|
|
23
|
-
import { R as K } from "./app-BVsQcG_m.js";
|
|
24
|
-
import { useCoreStore as Fe } from "@feedmepos/mf-common";
|
|
25
|
-
import { m as Ie } from "./index-FBWWEOV0.js";
|
|
26
|
-
function ke(c) {
|
|
27
|
-
let v = "";
|
|
28
|
-
switch (c) {
|
|
29
|
-
case "PORTAL":
|
|
30
|
-
v = "ADMIN";
|
|
31
|
-
break;
|
|
32
|
-
case "BENEFIT":
|
|
33
|
-
v = "MEMBERSHIP";
|
|
34
|
-
break;
|
|
35
|
-
case "ORDER":
|
|
36
|
-
v = "ORDER";
|
|
37
|
-
break;
|
|
38
|
-
case "BILL":
|
|
39
|
-
v = "SPENDING";
|
|
40
|
-
break;
|
|
41
|
-
case "CASHBACK":
|
|
42
|
-
v = "CASHBACK";
|
|
43
|
-
break;
|
|
44
|
-
case "CYCLE":
|
|
45
|
-
v = "EXPIRED";
|
|
46
|
-
break;
|
|
47
|
-
case "COUNTER_CONSUME":
|
|
48
|
-
v = "COUNTER REDEEM";
|
|
49
|
-
break;
|
|
50
|
-
default:
|
|
51
|
-
v = c;
|
|
52
|
-
break;
|
|
53
|
-
}
|
|
54
|
-
return v;
|
|
55
|
-
}
|
|
56
|
-
function Oe(c) {
|
|
57
|
-
var v, d, m, f, u, T;
|
|
58
|
-
switch ((v = c == null ? void 0 : c.pf_collectible) == null ? void 0 : v.type) {
|
|
59
|
-
case "VOUCHER":
|
|
60
|
-
return `${(d = c.pf_collectible) == null ? void 0 : d.type} (${(m = c.pf_collectible) == null ? void 0 : m.name})`;
|
|
61
|
-
case "TITLE":
|
|
62
|
-
return `${(f = c.pf_collectible) == null ? void 0 : f.type} (${(u = c.pf_collectible) == null ? void 0 : u.name})`;
|
|
63
|
-
case "POINT":
|
|
64
|
-
return "Experience";
|
|
65
|
-
case "COIN":
|
|
66
|
-
return "Point";
|
|
67
|
-
default:
|
|
68
|
-
return Re((T = c == null ? void 0 : c.pf_collectible) == null ? void 0 : T.type);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
function Ae(c) {
|
|
72
|
-
switch (c) {
|
|
73
|
-
case "ONLINE":
|
|
74
|
-
return "Online";
|
|
75
|
-
case "COIN":
|
|
76
|
-
return "Point";
|
|
77
|
-
default:
|
|
78
|
-
return c;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
const M = {
|
|
82
|
-
getReason: ke,
|
|
83
|
-
formattedType: Oe,
|
|
84
|
-
formattedPaymentType: Ae
|
|
85
|
-
}, Me = { class: "fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap" }, J = /* @__PURE__ */ z({
|
|
86
|
-
__name: "FilterChip",
|
|
87
|
-
props: {
|
|
88
|
-
modelValue: {
|
|
89
|
-
type: Array,
|
|
90
|
-
required: !1
|
|
91
|
-
},
|
|
92
|
-
label: {
|
|
93
|
-
type: String,
|
|
94
|
-
required: !1,
|
|
95
|
-
default: ""
|
|
96
|
-
},
|
|
97
|
-
showItemLabel: {
|
|
98
|
-
type: Boolean,
|
|
99
|
-
default: !1
|
|
100
|
-
},
|
|
101
|
-
placement: {
|
|
102
|
-
type: String,
|
|
103
|
-
required: !1,
|
|
104
|
-
default: "bottom-end"
|
|
105
|
-
},
|
|
106
|
-
class: {
|
|
107
|
-
type: String,
|
|
108
|
-
required: !1
|
|
109
|
-
},
|
|
110
|
-
disabled: {
|
|
111
|
-
type: Boolean,
|
|
112
|
-
required: !1
|
|
113
|
-
},
|
|
114
|
-
items: {
|
|
115
|
-
type: Array,
|
|
116
|
-
required: !0
|
|
117
|
-
},
|
|
118
|
-
icon: {
|
|
119
|
-
type: String,
|
|
120
|
-
required: !1
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
emits: ["update:model-value"],
|
|
124
|
-
setup(c, { emit: v }) {
|
|
125
|
-
const d = c, m = v, f = A(!1), u = A({}), T = Y(() => {
|
|
126
|
-
if (!u.value || Object.keys(u.value).length == d.items.length)
|
|
127
|
-
return "All";
|
|
128
|
-
{
|
|
129
|
-
const b = Object.keys(u.value).length;
|
|
130
|
-
return `${b > 0 ? b : "None"} selected`;
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
function g(b) {
|
|
134
|
-
u.value[b] ? delete u.value[b] : u.value[b] = !0, m("update:model-value", Object.keys(u.value));
|
|
135
|
-
}
|
|
136
|
-
function R() {
|
|
137
|
-
Object.keys(u.value).length > 0 ? u.value = {} : u.value = d.items.reduce((b, p) => (b[p.value] = !0, b), {}), m("update:model-value", Object.keys(u.value));
|
|
138
|
-
}
|
|
139
|
-
return ee(() => {
|
|
140
|
-
u.value = d.modelValue.reduce(
|
|
141
|
-
(b, p) => (b[p] = !0, b),
|
|
142
|
-
{}
|
|
143
|
-
), d.modelValue.length == 0;
|
|
144
|
-
}), (b, p) => {
|
|
145
|
-
const o = k("FmIcon"), e = k("FmChip"), r = k("FmMenuItem"), l = k("FmMenu");
|
|
146
|
-
return I(), U(l, {
|
|
147
|
-
placement: c.placement || "bottom-end",
|
|
148
|
-
disabled: c.disabled == !0,
|
|
149
|
-
"model-value": n(f),
|
|
150
|
-
onMenuChanged: p[0] || (p[0] = (y) => f.value = y),
|
|
151
|
-
"close-on-click": !1
|
|
152
|
-
}, {
|
|
153
|
-
"menu-button": $(() => [
|
|
154
|
-
w(e, {
|
|
155
|
-
label: c.label,
|
|
156
|
-
class: X(d.class || "text-fm-color-neutral-gray-400 cursor-pointer")
|
|
157
|
-
}, {
|
|
158
|
-
default: $(() => [
|
|
159
|
-
d.icon ? (I(), U(o, {
|
|
160
|
-
key: 0,
|
|
161
|
-
name: d.icon,
|
|
162
|
-
class: X(d.class),
|
|
163
|
-
outline: "",
|
|
164
|
-
size: "sm"
|
|
165
|
-
}, null, 8, ["name", "class"])) : ge("", !0),
|
|
166
|
-
D("div", Me, P(d.label) + " " + P(c.showItemLabel ? n(T) : ""), 1),
|
|
167
|
-
w(o, {
|
|
168
|
-
name: n(f) ? "keyboard_arrow_up" : "keyboard_arrow_down",
|
|
169
|
-
class: X(d.class),
|
|
170
|
-
outline: "",
|
|
171
|
-
size: "sm"
|
|
172
|
-
}, null, 8, ["name", "class"])
|
|
173
|
-
]),
|
|
174
|
-
_: 1
|
|
175
|
-
}, 8, ["label", "class"])
|
|
176
|
-
]),
|
|
177
|
-
default: $(() => [
|
|
178
|
-
w(r, {
|
|
179
|
-
"model-value": Object.keys(n(u)).length === d.items.length,
|
|
180
|
-
label: "All",
|
|
181
|
-
"has-checkbox": !0,
|
|
182
|
-
indeterminate: !0,
|
|
183
|
-
onClick: R
|
|
184
|
-
}, null, 8, ["model-value"]),
|
|
185
|
-
(I(!0), N(H, null, Q(d.items ?? [], (y) => (I(), U(r, {
|
|
186
|
-
key: y.value,
|
|
187
|
-
value: y.value,
|
|
188
|
-
label: y.label,
|
|
189
|
-
"has-checkbox": !0,
|
|
190
|
-
"model-value": n(u)[y.value],
|
|
191
|
-
"onUpdate:modelValue": (h) => g(y.value)
|
|
192
|
-
}, null, 8, ["value", "label", "model-value", "onUpdate:modelValue"]))), 128))
|
|
193
|
-
]),
|
|
194
|
-
_: 1
|
|
195
|
-
}, 8, ["placement", "disabled", "model-value"]);
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
}), V = "YYYY-MM-DD", me = /* @__PURE__ */ z({
|
|
199
|
-
__name: "DateRangeChip",
|
|
200
|
-
props: /* @__PURE__ */ oe({
|
|
201
|
-
modelValue: {
|
|
202
|
-
type: Object,
|
|
203
|
-
required: !0
|
|
204
|
-
}
|
|
205
|
-
}, {
|
|
206
|
-
dateRange: {
|
|
207
|
-
type: Object,
|
|
208
|
-
default: () => ({
|
|
209
|
-
startDate: _().subtract(7, "day").format(V),
|
|
210
|
-
endDate: _().endOf("day").format(V)
|
|
211
|
-
})
|
|
212
|
-
},
|
|
213
|
-
dateRangeModifiers: {}
|
|
214
|
-
}),
|
|
215
|
-
emits: /* @__PURE__ */ oe(["update:model-value"], ["update:dateRange"]),
|
|
216
|
-
setup(c, { emit: v }) {
|
|
217
|
-
const d = c, m = v, f = ve(c, "dateRange"), u = Y(() => f.value ? `${T.value.startDate ?? "Start"} - ${T.value.endDate ?? "End"}` : "No dates selected."), T = Y(() => ({
|
|
218
|
-
startDate: f.value.startDate ? _(f.value.startDate).format(V) : void 0,
|
|
219
|
-
endDate: f.value.endDate ? _(f.value.endDate).format(V) : void 0
|
|
220
|
-
}));
|
|
221
|
-
return ee(() => {
|
|
222
|
-
f.value = {
|
|
223
|
-
startDate: d.modelValue.startDate ? _(d.modelValue.startDate).format(V) : void 0,
|
|
224
|
-
endDate: d.modelValue.endDate ? _(d.modelValue.endDate).format(V) : void 0
|
|
225
|
-
};
|
|
226
|
-
}), te(
|
|
227
|
-
() => f.value,
|
|
228
|
-
() => {
|
|
229
|
-
m("update:model-value", T.value);
|
|
230
|
-
}
|
|
231
|
-
), (g, R) => {
|
|
232
|
-
const b = k("FmChip"), p = k("FmDateRangePicker");
|
|
233
|
-
return I(), U(p, {
|
|
234
|
-
modelValue: f.value,
|
|
235
|
-
"onUpdate:modelValue": R[0] || (R[0] = (o) => f.value = o),
|
|
236
|
-
"show-predefined-range": ""
|
|
237
|
-
}, {
|
|
238
|
-
"trigger-button": $(() => [
|
|
239
|
-
w(b, {
|
|
240
|
-
label: n(u),
|
|
241
|
-
icon: "calendar_month",
|
|
242
|
-
"right-icon": "keyboard_arrow_down",
|
|
243
|
-
class: "text-fm-color-neutral-gray-400 cursor-pointer"
|
|
244
|
-
}, null, 8, ["label"])
|
|
245
|
-
]),
|
|
246
|
-
_: 1
|
|
247
|
-
}, 8, ["modelValue"]);
|
|
248
|
-
};
|
|
249
|
-
}
|
|
250
|
-
});
|
|
251
|
-
class Ne extends ce {
|
|
252
|
-
}
|
|
253
|
-
const Ee = { class: "space-y-24 pr-12" }, Ve = { class: "w-full space-y-16" }, Pe = { class: "fm-typo-en-body-lg-600" }, Ye = ["onClick"], Ue = /* @__PURE__ */ D("hr", { class: "mt-3" }, null, -1), $e = { class: "fm-typo-en-body-lg-600" }, Be = ["onClick"], Le = /* @__PURE__ */ D("hr", { class: "mt-3" }, null, -1), ze = { class: "flex items-center gap-8" }, je = /* @__PURE__ */ z({
|
|
254
|
-
__name: "TransactionDetailSheet",
|
|
255
|
-
setup(c, { expose: v }) {
|
|
256
|
-
Ce();
|
|
257
|
-
const d = A(!1), m = A(), f = de(), u = re();
|
|
258
|
-
function T(p, o) {
|
|
259
|
-
d.value = p, m.value = o ?? null;
|
|
260
|
-
}
|
|
261
|
-
const g = Y(() => {
|
|
262
|
-
var p, o;
|
|
263
|
-
return Z(
|
|
264
|
-
((o = m.value) == null ? void 0 : o.expiryAmount.reduce(
|
|
265
|
-
(e, r) => e + r.amount,
|
|
266
|
-
((p = m.value) == null ? void 0 : p.amount) ?? 0
|
|
267
|
-
)) ?? 0,
|
|
268
|
-
2
|
|
269
|
-
);
|
|
270
|
-
}), R = Y(() => {
|
|
271
|
-
var p, o, e, r, l;
|
|
272
|
-
return m.value ? [
|
|
273
|
-
{
|
|
274
|
-
label: "Transaction ID",
|
|
275
|
-
value: (p = m.value) == null ? void 0 : p._id
|
|
276
|
-
},
|
|
277
|
-
{
|
|
278
|
-
label: "Date/Time",
|
|
279
|
-
value: _(B(m.value._id.toString())).format(
|
|
280
|
-
"D MMM YYYY, hh:mmA"
|
|
281
|
-
)
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
label: "Amount",
|
|
285
|
-
component: () => s(
|
|
286
|
-
"span",
|
|
287
|
-
{
|
|
288
|
-
class: [
|
|
289
|
-
"pr-2",
|
|
290
|
-
+g.value > 0 ? "text-fm-color-system-success-300" : "text-fm-color-system-error-300"
|
|
291
|
-
]
|
|
292
|
-
},
|
|
293
|
-
g.value
|
|
294
|
-
)
|
|
295
|
-
},
|
|
296
|
-
{
|
|
297
|
-
label: "Type",
|
|
298
|
-
value: M.formattedType(m.value)
|
|
299
|
-
},
|
|
300
|
-
{
|
|
301
|
-
label: "Source",
|
|
302
|
-
value: G(M.getReason(m.value.source))
|
|
303
|
-
},
|
|
304
|
-
{
|
|
305
|
-
label: "User",
|
|
306
|
-
value: (e = (o = m.value) == null ? void 0 : o.pf_user) == null ? void 0 : e.name
|
|
307
|
-
},
|
|
308
|
-
{
|
|
309
|
-
label: "Phone Number",
|
|
310
|
-
value: (l = (r = m.value) == null ? void 0 : r.pf_user) == null ? void 0 : l.phoneNumber
|
|
311
|
-
}
|
|
312
|
-
] : [];
|
|
313
|
-
}), b = Y(() => {
|
|
314
|
-
var r, l, y, h;
|
|
315
|
-
if (!m.value) return [];
|
|
316
|
-
const p = [], o = (r = m.value) == null ? void 0 : r.metadata, e = m.value;
|
|
317
|
-
if (o != null && o.campaign) {
|
|
318
|
-
const F = f.campaigns.all.find(
|
|
319
|
-
(E) => E._id === (o == null ? void 0 : o.campaign)
|
|
320
|
-
);
|
|
321
|
-
if (!F) return;
|
|
322
|
-
p.push({
|
|
323
|
-
label: "Campaign",
|
|
324
|
-
value: F.name
|
|
325
|
-
});
|
|
326
|
-
}
|
|
327
|
-
return o != null && o.remark && p.push({
|
|
328
|
-
label: "Remark",
|
|
329
|
-
value: o.remark
|
|
330
|
-
}), (l = m.value) != null && l.ref.startsWith("bill_") && p.push({
|
|
331
|
-
label: "Bill Number",
|
|
332
|
-
value: (y = m.value) == null ? void 0 : y.ref,
|
|
333
|
-
copy: () => {
|
|
334
|
-
var F;
|
|
335
|
-
return ae((F = m.value) == null ? void 0 : F.ref);
|
|
336
|
-
}
|
|
337
|
-
}), o != null && o.location && p.push({
|
|
338
|
-
label: "Location",
|
|
339
|
-
value: (h = u.locations.find(
|
|
340
|
-
(F) => F._id.toString() === (o == null ? void 0 : o.location)
|
|
341
|
-
)) == null ? void 0 : h.name
|
|
342
|
-
}), e.source === ne.enum.STORE && p.push({
|
|
343
|
-
label: "Store Transaction",
|
|
344
|
-
value: e.ref
|
|
345
|
-
}), o != null && o.originTransaction && p.push({
|
|
346
|
-
label: "Parent Transaction",
|
|
347
|
-
value: o.originTransaction
|
|
348
|
-
}), o != null && o.referral_count && p.push({
|
|
349
|
-
label: "Referral Count",
|
|
350
|
-
value: o.referral_count
|
|
351
|
-
}), e.refunded && p.push({
|
|
352
|
-
label: "Refunded From",
|
|
353
|
-
value: e.refundedFrom
|
|
354
|
-
}), p;
|
|
355
|
-
});
|
|
356
|
-
return v({
|
|
357
|
-
showSheet: T
|
|
358
|
-
}), (p, o) => {
|
|
359
|
-
const e = k("FmButton"), r = k("FmSideSheet");
|
|
360
|
-
return I(), U(r, {
|
|
361
|
-
"max-width": 560,
|
|
362
|
-
modelValue: n(d),
|
|
363
|
-
"onUpdate:modelValue": o[1] || (o[1] = (l) => ye(d) ? d.value = l : null),
|
|
364
|
-
header: "Transaction Details"
|
|
365
|
-
}, {
|
|
366
|
-
"side-sheet-footer": $(() => [
|
|
367
|
-
D("div", ze, [
|
|
368
|
-
w(e, {
|
|
369
|
-
label: "Close",
|
|
370
|
-
onClick: o[0] || (o[0] = (l) => T(!1)),
|
|
371
|
-
variant: "tertiary"
|
|
372
|
-
})
|
|
373
|
-
])
|
|
374
|
-
]),
|
|
375
|
-
default: $(() => [
|
|
376
|
-
D("div", Ee, [
|
|
377
|
-
D("div", Ve, [
|
|
378
|
-
(I(!0), N(H, null, Q(n(R), (l) => (I(), N("div", {
|
|
379
|
-
key: l.label,
|
|
380
|
-
class: "flex flex-col gap-4"
|
|
381
|
-
}, [
|
|
382
|
-
D("div", Pe, P(l.label), 1),
|
|
383
|
-
D("div", {
|
|
384
|
-
class: "text-fm-color-typo-secondary fm-typo-en-body-md-400 hover:underline",
|
|
385
|
-
onClick: l.copy
|
|
386
|
-
}, [
|
|
387
|
-
he(P(l.accessorFn ? l.accessorFn() : l.value) + " ", 1),
|
|
388
|
-
(I(), U(be(l.component)))
|
|
389
|
-
], 8, Ye),
|
|
390
|
-
Ue
|
|
391
|
-
]))), 128)),
|
|
392
|
-
(I(!0), N(H, null, Q(n(b), (l) => (I(), N("div", {
|
|
393
|
-
key: l.label,
|
|
394
|
-
class: "flex flex-col gap-4"
|
|
395
|
-
}, [
|
|
396
|
-
D("div", $e, P(l.label), 1),
|
|
397
|
-
D("div", {
|
|
398
|
-
class: "text-fm-color-typo-secondary fm-typo-en-body-md-400 hover:underline",
|
|
399
|
-
onClick: l.copy
|
|
400
|
-
}, P(l.accessorFn ? l.accessorFn() : l.value), 9, Be),
|
|
401
|
-
Le
|
|
402
|
-
]))), 128))
|
|
403
|
-
])
|
|
404
|
-
])
|
|
405
|
-
]),
|
|
406
|
-
_: 1
|
|
407
|
-
}, 8, ["modelValue"]);
|
|
408
|
-
};
|
|
409
|
-
}
|
|
410
|
-
}), qe = { class: "hidden xs:flex items-center justify-end" }, Ke = { class: "flex items-center justify-between" }, Ge = { class: "flex gap-8 items-center w-full overflow-x-scroll" }, He = { class: "xs:hidden" }, Dt = /* @__PURE__ */ z({
|
|
411
|
-
__name: "CollectionTransactions",
|
|
412
|
-
props: {
|
|
413
|
-
user: {
|
|
414
|
-
type: String
|
|
415
|
-
}
|
|
416
|
-
},
|
|
417
|
-
setup(c) {
|
|
418
|
-
const v = re(), d = de(), m = Te(), f = c, u = A(!1), T = [
|
|
419
|
-
{
|
|
420
|
-
header: "Transaction ID",
|
|
421
|
-
accessorKey: "_id",
|
|
422
|
-
meta: {
|
|
423
|
-
maxWidth: "100px"
|
|
424
|
-
},
|
|
425
|
-
cell(a) {
|
|
426
|
-
return s("div", { class: "flex items-center" }, [
|
|
427
|
-
s(C.FmIcon, {
|
|
428
|
-
name: "content_copy",
|
|
429
|
-
outline: !0,
|
|
430
|
-
size: "sm",
|
|
431
|
-
class: "cursor-pointer mr-4",
|
|
432
|
-
onClick: (t) => {
|
|
433
|
-
t.preventDefault(), t.stopPropagation(), ae(a.row.original._id.toString());
|
|
434
|
-
}
|
|
435
|
-
}),
|
|
436
|
-
s(
|
|
437
|
-
"div",
|
|
438
|
-
{ class: "pr-2 text-ellipsis overflow-hidden" },
|
|
439
|
-
a.row.original._id.toString()
|
|
440
|
-
)
|
|
441
|
-
]);
|
|
442
|
-
},
|
|
443
|
-
enableSorting: !1
|
|
444
|
-
},
|
|
445
|
-
{
|
|
446
|
-
header: "Created at",
|
|
447
|
-
accessorKey: "_id",
|
|
448
|
-
accessorFn: (a) => _(B(a._id.toString())),
|
|
449
|
-
cell: (a) => _(B(a.row.original._id.toString())).format(
|
|
450
|
-
"D MMM YYYY, hh:mmA"
|
|
451
|
-
),
|
|
452
|
-
enableSorting: !0
|
|
453
|
-
},
|
|
454
|
-
{
|
|
455
|
-
header: "Amount",
|
|
456
|
-
// accessorKey: 'totalAmount',
|
|
457
|
-
enableSorting: !1,
|
|
458
|
-
cell(a) {
|
|
459
|
-
var x, i, O, L;
|
|
460
|
-
const t = Z(
|
|
461
|
-
a.row.original.expiryAmount.reduce(
|
|
462
|
-
(j, q) => j + q.amount,
|
|
463
|
-
a.row.original.amount ?? 0
|
|
464
|
-
),
|
|
465
|
-
2
|
|
466
|
-
), S = (i = (x = a.row.original.expiryAmount) == null ? void 0 : x[0]) != null && i.expiredAt ? _((L = (O = a.row.original.expiryAmount) == null ? void 0 : O[0]) == null ? void 0 : L.expiredAt).format(
|
|
467
|
-
"D MMM YYYY"
|
|
468
|
-
) : "";
|
|
469
|
-
return s("div", { class: "flex items-center" }, [
|
|
470
|
-
s(
|
|
471
|
-
"div",
|
|
472
|
-
{
|
|
473
|
-
class: [
|
|
474
|
-
"pr-2",
|
|
475
|
-
+t > 0 ? "text-fm-color-system-success-300" : "text-fm-color-system-error-300"
|
|
476
|
-
]
|
|
477
|
-
},
|
|
478
|
-
t
|
|
479
|
-
),
|
|
480
|
-
s("div", { class: "flex items-center" }, [
|
|
481
|
-
a.row.original.expiryAmount.length > 0 ? s(
|
|
482
|
-
C.FmTooltip,
|
|
483
|
-
{
|
|
484
|
-
content: `Expired on ${S}`
|
|
485
|
-
},
|
|
486
|
-
[
|
|
487
|
-
s(C.FmIcon, {
|
|
488
|
-
name: "info",
|
|
489
|
-
outline: !0,
|
|
490
|
-
size: "sm"
|
|
491
|
-
})
|
|
492
|
-
]
|
|
493
|
-
) : s("div")
|
|
494
|
-
])
|
|
495
|
-
]);
|
|
496
|
-
}
|
|
497
|
-
},
|
|
498
|
-
{
|
|
499
|
-
header: "Type",
|
|
500
|
-
accessorKey: "pf_collectible.type",
|
|
501
|
-
accessorFn: (a) => M.formattedType(a),
|
|
502
|
-
meta: {
|
|
503
|
-
maxWidth: "200px"
|
|
504
|
-
},
|
|
505
|
-
cell(a) {
|
|
506
|
-
const t = M.formattedType(a.row.original);
|
|
507
|
-
return s("div", { class: "flex items-center" }, [
|
|
508
|
-
s("div", { class: "truncate text-ellipsis" }, t),
|
|
509
|
-
t.length > 20 ? s(
|
|
510
|
-
C.FmTooltip,
|
|
511
|
-
{
|
|
512
|
-
content: t
|
|
513
|
-
},
|
|
514
|
-
[
|
|
515
|
-
s(C.FmIcon, {
|
|
516
|
-
name: "info",
|
|
517
|
-
color: "primary",
|
|
518
|
-
outline: !0,
|
|
519
|
-
size: "sm"
|
|
520
|
-
})
|
|
521
|
-
]
|
|
522
|
-
) : null
|
|
523
|
-
]);
|
|
524
|
-
}
|
|
525
|
-
},
|
|
526
|
-
{
|
|
527
|
-
header: "Source",
|
|
528
|
-
accessorKey: "source",
|
|
529
|
-
cell(a) {
|
|
530
|
-
var t;
|
|
531
|
-
return s("div", { class: "flex items-center gap-4" }, [
|
|
532
|
-
s(
|
|
533
|
-
"div",
|
|
534
|
-
{ class: "truncate text-ellipsis" },
|
|
535
|
-
G(M.getReason(a.row.original.source))
|
|
536
|
-
),
|
|
537
|
-
...(t = a.row.original.metadata) != null && t.campaign ? [
|
|
538
|
-
s(
|
|
539
|
-
C.FmTooltip,
|
|
540
|
-
{
|
|
541
|
-
get content() {
|
|
542
|
-
var S;
|
|
543
|
-
return (S = d.campaigns.all.find(
|
|
544
|
-
(x) => {
|
|
545
|
-
var i;
|
|
546
|
-
return x._id === ((i = a.row.original.metadata) == null ? void 0 : i.campaign);
|
|
547
|
-
}
|
|
548
|
-
)) == null ? void 0 : S.name;
|
|
549
|
-
}
|
|
550
|
-
},
|
|
551
|
-
[
|
|
552
|
-
s(C.FmIcon, {
|
|
553
|
-
name: "info",
|
|
554
|
-
color: "primary",
|
|
555
|
-
size: "sm",
|
|
556
|
-
onClick: async (S) => {
|
|
557
|
-
S.preventDefault(), S.stopPropagation();
|
|
558
|
-
const x = d.campaigns.all.find(
|
|
559
|
-
(i) => {
|
|
560
|
-
var O;
|
|
561
|
-
return i._id === ((O = a.row.original.metadata) == null ? void 0 : O.campaign);
|
|
562
|
-
}
|
|
563
|
-
);
|
|
564
|
-
if (x)
|
|
565
|
-
switch (x.type) {
|
|
566
|
-
case "VOUCHER":
|
|
567
|
-
case "PROMOTION":
|
|
568
|
-
case "BROADCAST":
|
|
569
|
-
await m.push({
|
|
570
|
-
name: K[`$connect-CAMPAIGN_${x.type}`]
|
|
571
|
-
});
|
|
572
|
-
break;
|
|
573
|
-
case "GAME":
|
|
574
|
-
case "CREDIT":
|
|
575
|
-
case "MISSION":
|
|
576
|
-
await m.push({
|
|
577
|
-
name: K[`$connect-PROGRAM_${x.type}`]
|
|
578
|
-
});
|
|
579
|
-
break;
|
|
580
|
-
case "POINT":
|
|
581
|
-
await m.push({
|
|
582
|
-
name: K["$connect-PROGRAM_EXPERIENCE"]
|
|
583
|
-
});
|
|
584
|
-
break;
|
|
585
|
-
case "COIN":
|
|
586
|
-
await m.push({
|
|
587
|
-
name: K["$connect-PROGRAM_POINT"]
|
|
588
|
-
});
|
|
589
|
-
break;
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
})
|
|
593
|
-
]
|
|
594
|
-
)
|
|
595
|
-
] : []
|
|
596
|
-
]);
|
|
597
|
-
}
|
|
598
|
-
},
|
|
599
|
-
{
|
|
600
|
-
header: "User",
|
|
601
|
-
accessorKey: "pf_user.name",
|
|
602
|
-
cell(a) {
|
|
603
|
-
return ie(a.row.original.pf_user);
|
|
604
|
-
}
|
|
605
|
-
},
|
|
606
|
-
{
|
|
607
|
-
header: "Phone No.",
|
|
608
|
-
accessorKey: "pf_user.phoneNumber",
|
|
609
|
-
accessorFn: (a) => {
|
|
610
|
-
var t;
|
|
611
|
-
return ((t = a == null ? void 0 : a.pf_user) == null ? void 0 : t.phoneNumber) || "";
|
|
612
|
-
}
|
|
613
|
-
},
|
|
614
|
-
{
|
|
615
|
-
accessorFn: (a) => a.ref,
|
|
616
|
-
header: "References",
|
|
617
|
-
accessorKey: "ref",
|
|
618
|
-
cell(a) {
|
|
619
|
-
var t, S;
|
|
620
|
-
return s("div", { class: "flex items-center justify-between gap-4" }, [
|
|
621
|
-
s("div", { class: "flex items-center" }, [
|
|
622
|
-
(t = a.row.original.metadata) != null && t.remark ? s(
|
|
623
|
-
C.FmTooltip,
|
|
624
|
-
{
|
|
625
|
-
content: (S = a.row.original.metadata) == null ? void 0 : S.remark
|
|
626
|
-
},
|
|
627
|
-
[
|
|
628
|
-
s(C.FmIcon, {
|
|
629
|
-
name: "info",
|
|
630
|
-
class: "pl-2",
|
|
631
|
-
outline: !0,
|
|
632
|
-
size: "sm"
|
|
633
|
-
})
|
|
634
|
-
]
|
|
635
|
-
) : s("div")
|
|
636
|
-
]),
|
|
637
|
-
s("div", { class: "flex-1" }, a.row.original.ref)
|
|
638
|
-
]);
|
|
639
|
-
}
|
|
640
|
-
}
|
|
641
|
-
], g = A({
|
|
642
|
-
search: "",
|
|
643
|
-
"pf_collectible.type": [],
|
|
644
|
-
"metadata.location": [],
|
|
645
|
-
dateRange: {
|
|
646
|
-
startDate: _().subtract(7, "day").toISOString(),
|
|
647
|
-
endDate: _().endOf("day").toISOString()
|
|
648
|
-
},
|
|
649
|
-
source: []
|
|
650
|
-
}), { tableMeta: R, rowData: b, onSort: p, debouncedFetchData: o, onSearch: e } = le(async (a) => {
|
|
651
|
-
const t = {
|
|
652
|
-
...g.value,
|
|
653
|
-
user: f.user,
|
|
654
|
-
dateRange: {
|
|
655
|
-
start: new Date(g.value.dateRange.startDate).toISOString(),
|
|
656
|
-
end: new Date(g.value.dateRange.endDate).toISOString()
|
|
657
|
-
}
|
|
658
|
-
}, S = await W.readAll(a, t);
|
|
659
|
-
return {
|
|
660
|
-
resources: S.resources.map((x) => {
|
|
661
|
-
const i = r.value.find((O) => O._id === x.ref);
|
|
662
|
-
return { ...x, ref: (i == null ? void 0 : i.seqNumber) || x.ref };
|
|
663
|
-
}),
|
|
664
|
-
meta: S.meta
|
|
665
|
-
};
|
|
666
|
-
}), r = A([]), l = ne.options.map((a) => ({ label: G(M.getReason(a)), value: a })), y = v.locations.map((a) => ({ label: a.name, value: a._id }));
|
|
667
|
-
te(
|
|
668
|
-
g,
|
|
669
|
-
() => {
|
|
670
|
-
o();
|
|
671
|
-
},
|
|
672
|
-
{ deep: !0 }
|
|
673
|
-
);
|
|
674
|
-
async function h() {
|
|
675
|
-
try {
|
|
676
|
-
u.value = !0;
|
|
677
|
-
const a = {
|
|
678
|
-
...g.value,
|
|
679
|
-
user: f.user,
|
|
680
|
-
dateRange: {
|
|
681
|
-
start: new Date(g.value.dateRange.startDate).toISOString(),
|
|
682
|
-
end: new Date(g.value.dateRange.endDate).toISOString()
|
|
683
|
-
}
|
|
684
|
-
};
|
|
685
|
-
await ue({
|
|
686
|
-
exporter: new Ne(),
|
|
687
|
-
readFunction: (t) => W.readAll(t, a),
|
|
688
|
-
transformRecord: (t) => {
|
|
689
|
-
var S, x, i, O, L, j, q;
|
|
690
|
-
return {
|
|
691
|
-
TransactionID: t._id,
|
|
692
|
-
CreatedAt: _(B(t._id.toString())).format(
|
|
693
|
-
"D MMM YYYY, hh:mmA"
|
|
694
|
-
),
|
|
695
|
-
Amount: Z(
|
|
696
|
-
t.expiryAmount.reduce(
|
|
697
|
-
(pe, fe) => pe + fe.amount,
|
|
698
|
-
t.amount ?? 0
|
|
699
|
-
),
|
|
700
|
-
2
|
|
701
|
-
),
|
|
702
|
-
ExpiredAt: (x = (S = t.expiryAmount) == null ? void 0 : S[0]) != null && x.expiredAt ? _((O = (i = t.expiryAmount) == null ? void 0 : i[0]) == null ? void 0 : O.expiredAt).format("D MMM YYYY") : "",
|
|
703
|
-
Type: M.formattedType(t),
|
|
704
|
-
Source: G(M.getReason(t.source)),
|
|
705
|
-
User: ((L = t.pf_user) == null ? void 0 : L.name) || "",
|
|
706
|
-
"Phone No.": ((j = t.pf_user) == null ? void 0 : j.phoneNumber) || "",
|
|
707
|
-
References: t.ref,
|
|
708
|
-
Remark: ((q = t.metadata) == null ? void 0 : q.remark) || ""
|
|
709
|
-
};
|
|
710
|
-
},
|
|
711
|
-
filename: "transactions"
|
|
712
|
-
});
|
|
713
|
-
} catch (a) {
|
|
714
|
-
console.error(a);
|
|
715
|
-
} finally {
|
|
716
|
-
u.value = !1;
|
|
717
|
-
}
|
|
718
|
-
}
|
|
719
|
-
const F = A(null);
|
|
720
|
-
function E(a) {
|
|
721
|
-
var t;
|
|
722
|
-
console.log(a), (t = F.value) == null || t.showSheet(!0, a.original);
|
|
723
|
-
}
|
|
724
|
-
return _e(async () => {
|
|
725
|
-
await v.readLocations(), await d.read(), await o();
|
|
726
|
-
}), (a, t) => {
|
|
727
|
-
const S = k("FmSearch"), x = k("FmButton");
|
|
728
|
-
return I(), N(H, null, [
|
|
729
|
-
D("div", null, [
|
|
730
|
-
D("div", qe, [
|
|
731
|
-
w(S, {
|
|
732
|
-
class: "hidden xs:flex border-b border-fm-color-neutral-gray-100",
|
|
733
|
-
modelValue: n(g).search,
|
|
734
|
-
"onUpdate:modelValue": t[0] || (t[0] = (i) => n(g).search = i),
|
|
735
|
-
placeholder: "Search",
|
|
736
|
-
collapsible: ""
|
|
737
|
-
}, null, 8, ["modelValue"]),
|
|
738
|
-
w(x, {
|
|
739
|
-
icon: "ios_share",
|
|
740
|
-
variant: "tertiary",
|
|
741
|
-
onClick: h
|
|
742
|
-
})
|
|
743
|
-
]),
|
|
744
|
-
D("div", Ke, [
|
|
745
|
-
D("div", Ge, [
|
|
746
|
-
w(J, {
|
|
747
|
-
class: "cursor-pointer text-fm-color-neutral-gray-400",
|
|
748
|
-
"right-icon": "keyboard_arrow_down",
|
|
749
|
-
modelValue: n(g)["metadata.location"],
|
|
750
|
-
"onUpdate:modelValue": t[1] || (t[1] = (i) => n(g)["metadata.location"] = i),
|
|
751
|
-
icon: "storefront",
|
|
752
|
-
"show-item-label": !0,
|
|
753
|
-
items: n(y)
|
|
754
|
-
}, null, 8, ["modelValue", "items"]),
|
|
755
|
-
w(J, {
|
|
756
|
-
class: "cursor-pointer text-fm-color-neutral-gray-400",
|
|
757
|
-
"right-icon": "keyboard_arrow_down",
|
|
758
|
-
modelValue: n(g)["pf_collectible.type"],
|
|
759
|
-
"onUpdate:modelValue": t[2] || (t[2] = (i) => n(g)["pf_collectible.type"] = i),
|
|
760
|
-
label: "Type: ",
|
|
761
|
-
"show-item-label": !0,
|
|
762
|
-
items: [
|
|
763
|
-
{ label: "Point", value: "COIN" },
|
|
764
|
-
{ label: "Credit", value: "CREDIT" },
|
|
765
|
-
{ label: "Voucher", value: "VOUCHER" },
|
|
766
|
-
{ label: "Experience", value: "POINT" },
|
|
767
|
-
{ label: "Tier", value: "TIER" },
|
|
768
|
-
{ label: "Title", value: "TITLE" },
|
|
769
|
-
{ label: "Game", value: "GAME" },
|
|
770
|
-
{ label: "Stamp", value: "STAMP" }
|
|
771
|
-
]
|
|
772
|
-
}, null, 8, ["modelValue"]),
|
|
773
|
-
w(J, {
|
|
774
|
-
class: "cursor-pointer text-fm-color-neutral-gray-400",
|
|
775
|
-
"right-icon": "keyboard_arrow_down",
|
|
776
|
-
modelValue: n(g).source,
|
|
777
|
-
"onUpdate:modelValue": t[3] || (t[3] = (i) => n(g).source = i),
|
|
778
|
-
label: "Source: ",
|
|
779
|
-
"show-item-label": !0,
|
|
780
|
-
items: n(l)
|
|
781
|
-
}, null, 8, ["modelValue", "items"]),
|
|
782
|
-
w(me, {
|
|
783
|
-
"model-value": {
|
|
784
|
-
startDate: n(g).dateRange.startDate,
|
|
785
|
-
endDate: n(g).dateRange.endDate
|
|
786
|
-
},
|
|
787
|
-
"onUpdate:modelValue": t[4] || (t[4] = (i) => n(g).dateRange = {
|
|
788
|
-
startDate: n(_)(i.startDate).startOf("d").toISOString(),
|
|
789
|
-
endDate: n(_)(i.endDate).endOf("d").toISOString()
|
|
790
|
-
})
|
|
791
|
-
}, null, 8, ["model-value"])
|
|
792
|
-
]),
|
|
793
|
-
w(S, {
|
|
794
|
-
class: "xs:hidden",
|
|
795
|
-
modelValue: n(g).search,
|
|
796
|
-
"onUpdate:modelValue": t[5] || (t[5] = (i) => n(g).search = i),
|
|
797
|
-
placeholder: "Search",
|
|
798
|
-
collapsible: ""
|
|
799
|
-
}, null, 8, ["modelValue"]),
|
|
800
|
-
D("div", He, [
|
|
801
|
-
w(x, {
|
|
802
|
-
icon: "ios_share",
|
|
803
|
-
variant: "tertiary",
|
|
804
|
-
onClick: h
|
|
805
|
-
})
|
|
806
|
-
])
|
|
807
|
-
]),
|
|
808
|
-
w(se, {
|
|
809
|
-
loading: n(R).isLoading,
|
|
810
|
-
"row-data": n(b),
|
|
811
|
-
"row-count": n(R).totalRows,
|
|
812
|
-
"column-defs": T.filter(
|
|
813
|
-
(i) => !f.user || i.header !== "User" && i.header !== "Phone No."
|
|
814
|
-
),
|
|
815
|
-
"page-count": n(R).pageCount,
|
|
816
|
-
"page-index": n(R).pageIndex,
|
|
817
|
-
"page-size": n(R).pageSize,
|
|
818
|
-
"shrink-at": !1,
|
|
819
|
-
onSortChange: n(p),
|
|
820
|
-
onPageChange: t[6] || (t[6] = (i) => n(o)({
|
|
821
|
-
pageSize: i.pageSize,
|
|
822
|
-
pageIndex: i.pageIndex
|
|
823
|
-
})),
|
|
824
|
-
onRowClick: E
|
|
825
|
-
}, null, 8, ["loading", "row-data", "row-count", "column-defs", "page-count", "page-index", "page-size", "onSortChange"])
|
|
826
|
-
]),
|
|
827
|
-
w(je, {
|
|
828
|
-
ref_key: "transactionDetailSheet",
|
|
829
|
-
ref: F
|
|
830
|
-
}, null, 512)
|
|
831
|
-
], 64);
|
|
832
|
-
};
|
|
833
|
-
}
|
|
834
|
-
});
|
|
835
|
-
class We extends ce {
|
|
836
|
-
}
|
|
837
|
-
const Xe = { class: "flex items-center justify-between" }, Je = { class: "flex gap-8 items-center" }, Qe = { class: "flex gap-8 items-center xs:hidden" }, Rt = /* @__PURE__ */ z({
|
|
838
|
-
__name: "StoreTransactions",
|
|
839
|
-
props: {
|
|
840
|
-
user: {
|
|
841
|
-
type: String
|
|
842
|
-
}
|
|
843
|
-
},
|
|
844
|
-
setup(c) {
|
|
845
|
-
const v = c, { minor: d } = De;
|
|
846
|
-
Se();
|
|
847
|
-
const m = [
|
|
848
|
-
{
|
|
849
|
-
header: "Transaction ID",
|
|
850
|
-
meta: {
|
|
851
|
-
maxWidth: "150px"
|
|
852
|
-
},
|
|
853
|
-
cell(e) {
|
|
854
|
-
return s("div", { class: "flex items-center" }, [
|
|
855
|
-
s(C.FmIcon, {
|
|
856
|
-
name: "content_copy",
|
|
857
|
-
outline: !0,
|
|
858
|
-
size: "sm",
|
|
859
|
-
class: "cursor-pointer mr-4 shrink-0",
|
|
860
|
-
onClick: (r) => {
|
|
861
|
-
r.preventDefault(), r.stopPropagation(), ae(e.row.original._id.toString());
|
|
862
|
-
}
|
|
863
|
-
}),
|
|
864
|
-
s("div", { class: "truncate" }, e.row.original._id.toString())
|
|
865
|
-
]);
|
|
866
|
-
}
|
|
867
|
-
},
|
|
868
|
-
{
|
|
869
|
-
header: "Created at",
|
|
870
|
-
accessorFn: (e) => _(B(e._id.toString())).format("D MMM YYYY, hh:mmA"),
|
|
871
|
-
enableSorting: !0
|
|
872
|
-
},
|
|
873
|
-
{
|
|
874
|
-
header: "Bundle",
|
|
875
|
-
accessorFn: (e) => e.bundle.name
|
|
876
|
-
},
|
|
877
|
-
{
|
|
878
|
-
header: "Location",
|
|
879
|
-
accessorFn: (e) => e.location ? e.pf_location.name : "Online Store"
|
|
880
|
-
},
|
|
881
|
-
{
|
|
882
|
-
header: "Payment Type",
|
|
883
|
-
accessorFn: (e) => {
|
|
884
|
-
var r;
|
|
885
|
-
return ((r = e.paymentType) == null ? void 0 : r.type) ?? "N/A";
|
|
886
|
-
},
|
|
887
|
-
cell(e) {
|
|
888
|
-
var r, l;
|
|
889
|
-
return s("div", { class: "flex items-center gap-4" }, [
|
|
890
|
-
s("div", { class: "flex items-center" }, [
|
|
891
|
-
((r = e.row.original.paymentType) == null ? void 0 : r.type) == "ONLINE" && e.row.original.paymentType.extra ? s(
|
|
892
|
-
C.FmTooltip,
|
|
893
|
-
{
|
|
894
|
-
content: e.row.original.paymentType.extra
|
|
895
|
-
},
|
|
896
|
-
[
|
|
897
|
-
s(C.FmIcon, {
|
|
898
|
-
name: "info",
|
|
899
|
-
outline: !0,
|
|
900
|
-
size: "sm"
|
|
901
|
-
})
|
|
902
|
-
]
|
|
903
|
-
) : s("div")
|
|
904
|
-
]),
|
|
905
|
-
s(
|
|
906
|
-
"div",
|
|
907
|
-
{ class: "flex-1" },
|
|
908
|
-
((l = e.row.original.paymentType) == null ? void 0 : l.type) ?? "N/A"
|
|
909
|
-
)
|
|
910
|
-
]);
|
|
911
|
-
}
|
|
912
|
-
},
|
|
913
|
-
{
|
|
914
|
-
header: "User",
|
|
915
|
-
cell: (e) => ie(e.row.original.pf_member)
|
|
916
|
-
},
|
|
917
|
-
{
|
|
918
|
-
header: "Phone No.",
|
|
919
|
-
accessorFn: (e) => e.pf_member.phoneNumber
|
|
920
|
-
},
|
|
921
|
-
{
|
|
922
|
-
header: "Status",
|
|
923
|
-
// accessorFn: (u) => u.status,
|
|
924
|
-
cell(e) {
|
|
925
|
-
var r, l, y, h;
|
|
926
|
-
return s("div", { class: "flex items-center" }, [
|
|
927
|
-
s("div", xe.title(e.row.original.status)),
|
|
928
|
-
s("div", { class: "flex items-center" }, [
|
|
929
|
-
(l = (r = e.row.original) == null ? void 0 : r.refund) != null && l.reason ? s(
|
|
930
|
-
C.FmTooltip,
|
|
931
|
-
{
|
|
932
|
-
content: (h = (y = e.row.original) == null ? void 0 : y.refund) == null ? void 0 : h.reason
|
|
933
|
-
},
|
|
934
|
-
[
|
|
935
|
-
s(C.FmIcon, {
|
|
936
|
-
name: "info",
|
|
937
|
-
color: "primary",
|
|
938
|
-
outline: !0,
|
|
939
|
-
size: "sm",
|
|
940
|
-
class: "pl-2"
|
|
941
|
-
})
|
|
942
|
-
]
|
|
943
|
-
) : s("div")
|
|
944
|
-
])
|
|
945
|
-
]);
|
|
946
|
-
}
|
|
947
|
-
},
|
|
948
|
-
{
|
|
949
|
-
header: "Source",
|
|
950
|
-
accessorFn: (e) => e.source
|
|
951
|
-
},
|
|
952
|
-
{
|
|
953
|
-
header: "Ref",
|
|
954
|
-
accessorFn: (e) => e.ref
|
|
955
|
-
},
|
|
956
|
-
{
|
|
957
|
-
id: "action",
|
|
958
|
-
cell(e) {
|
|
959
|
-
const r = e.row.original, l = r.status === "COMPLETED" && !r.refund && r.source == "ADMIN";
|
|
960
|
-
return l ? s(
|
|
961
|
-
C.FmMenu,
|
|
962
|
-
{
|
|
963
|
-
placement: "bottom-end",
|
|
964
|
-
onClick: (y) => {
|
|
965
|
-
y.stopPropagation();
|
|
966
|
-
}
|
|
967
|
-
},
|
|
968
|
-
{
|
|
969
|
-
"menu-button": () => s(C.FmButton, {
|
|
970
|
-
icon: "settings",
|
|
971
|
-
variant: "tertiary",
|
|
972
|
-
if: l
|
|
973
|
-
}),
|
|
974
|
-
default: () => [
|
|
975
|
-
s(C.FmMenuItem, {
|
|
976
|
-
label: "Refund",
|
|
977
|
-
sublabel: "Refund this transaction",
|
|
978
|
-
onClick: async (y) => {
|
|
979
|
-
y.stopPropagation(), await p(r);
|
|
980
|
-
}
|
|
981
|
-
})
|
|
982
|
-
]
|
|
983
|
-
}
|
|
984
|
-
) : s("div");
|
|
985
|
-
}
|
|
986
|
-
}
|
|
987
|
-
], f = A({
|
|
988
|
-
searchValue: "",
|
|
989
|
-
dateRange: {
|
|
990
|
-
startDate: _().subtract(7, "day").toISOString(),
|
|
991
|
-
endDate: _().toISOString()
|
|
992
|
-
}
|
|
993
|
-
}), { tableMeta: u, rowData: T, onSort: g, debouncedFetchData: R, onSearch: b } = le(async (e) => {
|
|
994
|
-
const r = {
|
|
995
|
-
...f.value.dateRange,
|
|
996
|
-
user: v.user
|
|
997
|
-
};
|
|
998
|
-
return await W.readStoreTransactions(e, r);
|
|
999
|
-
});
|
|
1000
|
-
async function p(e) {
|
|
1001
|
-
await we.confirm(
|
|
1002
|
-
"Are you sure you want to refund this transaction?",
|
|
1003
|
-
"Refund Store Transaction",
|
|
1004
|
-
"Confirm",
|
|
1005
|
-
"Cancel"
|
|
1006
|
-
) && await d(
|
|
1007
|
-
async () => {
|
|
1008
|
-
var l;
|
|
1009
|
-
await Ie.refundStoreTransaction({
|
|
1010
|
-
id: e._id,
|
|
1011
|
-
reason: `ADMIN:${(l = Fe().sessionUser) == null ? void 0 : l.name}`
|
|
1012
|
-
}), await R();
|
|
1013
|
-
},
|
|
1014
|
-
{
|
|
1015
|
-
message: "Refunding transaction...",
|
|
1016
|
-
successMessage: "Transaction refunded successfully"
|
|
1017
|
-
}
|
|
1018
|
-
);
|
|
1019
|
-
}
|
|
1020
|
-
te(
|
|
1021
|
-
f,
|
|
1022
|
-
() => {
|
|
1023
|
-
R();
|
|
1024
|
-
},
|
|
1025
|
-
{ deep: !0 }
|
|
1026
|
-
), ee(async () => {
|
|
1027
|
-
await R();
|
|
1028
|
-
});
|
|
1029
|
-
const o = async () => ue({
|
|
1030
|
-
exporter: new We(),
|
|
1031
|
-
readFunction: (e) => W.readStoreTransactions(e, {
|
|
1032
|
-
...f.value.dateRange,
|
|
1033
|
-
user: v.user
|
|
1034
|
-
}),
|
|
1035
|
-
transformRecord: (e) => {
|
|
1036
|
-
var r, l, y, h, F, E;
|
|
1037
|
-
return {
|
|
1038
|
-
TransactionId: ((r = e._id) == null ? void 0 : r.toString()) || "",
|
|
1039
|
-
CreatedAt: _(B(e._id.toString())).format(
|
|
1040
|
-
"DD/MM/YYYY HH:mm:ss"
|
|
1041
|
-
),
|
|
1042
|
-
Bundle: e.bundle.name || "",
|
|
1043
|
-
Location: e.location ? e.pf_location.name : "Online Store",
|
|
1044
|
-
PaymentType: ((l = e.paymentType) == null ? void 0 : l.type) || "N/A",
|
|
1045
|
-
PaymentExtra: ((y = e.paymentType) == null ? void 0 : y.extra) || "",
|
|
1046
|
-
User: ((h = e.pf_member) == null ? void 0 : h.name) || "",
|
|
1047
|
-
PhoneNumber: ((F = e.pf_member) == null ? void 0 : F.phoneNumber) || "",
|
|
1048
|
-
Status: e.status || "",
|
|
1049
|
-
RefundReason: ((E = e == null ? void 0 : e.refund) == null ? void 0 : E.reason) || ""
|
|
1050
|
-
};
|
|
1051
|
-
},
|
|
1052
|
-
filename: "store-transactions"
|
|
1053
|
-
});
|
|
1054
|
-
return (e, r) => {
|
|
1055
|
-
const l = k("FmSearch"), y = k("FmButton");
|
|
1056
|
-
return I(), N("div", null, [
|
|
1057
|
-
D("div", Xe, [
|
|
1058
|
-
D("div", Je, [
|
|
1059
|
-
w(me, {
|
|
1060
|
-
modelValue: n(f).dateRange,
|
|
1061
|
-
"onUpdate:modelValue": r[0] || (r[0] = (h) => n(f).dateRange = h)
|
|
1062
|
-
}, null, 8, ["modelValue"])
|
|
1063
|
-
]),
|
|
1064
|
-
D("div", Qe, [
|
|
1065
|
-
w(l, {
|
|
1066
|
-
modelValue: n(u).searchValue,
|
|
1067
|
-
"onUpdate:modelValue": [
|
|
1068
|
-
r[1] || (r[1] = (h) => n(u).searchValue = h),
|
|
1069
|
-
n(b)
|
|
1070
|
-
],
|
|
1071
|
-
placeholder: "Search",
|
|
1072
|
-
collapsible: ""
|
|
1073
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
1074
|
-
w(y, {
|
|
1075
|
-
icon: "ios_share",
|
|
1076
|
-
variant: "tertiary",
|
|
1077
|
-
onClick: o
|
|
1078
|
-
})
|
|
1079
|
-
])
|
|
1080
|
-
]),
|
|
1081
|
-
w(se, {
|
|
1082
|
-
loading: n(u).isLoading,
|
|
1083
|
-
"row-data": n(T),
|
|
1084
|
-
"row-count": n(u).totalRows,
|
|
1085
|
-
"column-defs": m.filter(
|
|
1086
|
-
(h) => !v.user || h.header !== "User" && h.header !== "Phone No."
|
|
1087
|
-
),
|
|
1088
|
-
"page-count": n(u).pageCount,
|
|
1089
|
-
"page-index": n(u).pageIndex,
|
|
1090
|
-
"page-size": n(u).pageSize,
|
|
1091
|
-
"shrink-at": !1,
|
|
1092
|
-
onSortChange: n(g),
|
|
1093
|
-
onPageChange: r[2] || (r[2] = (h) => n(R)({
|
|
1094
|
-
pageSize: h.pageSize,
|
|
1095
|
-
pageIndex: h.pageIndex
|
|
1096
|
-
}))
|
|
1097
|
-
}, null, 8, ["loading", "row-data", "row-count", "column-defs", "page-count", "page-index", "page-size", "onSortChange"])
|
|
1098
|
-
]);
|
|
1099
|
-
};
|
|
1100
|
-
}
|
|
1101
|
-
});
|
|
1102
|
-
export {
|
|
1103
|
-
Dt as _,
|
|
1104
|
-
Rt as a
|
|
1105
|
-
};
|