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