@feedmepos/mf-connect 0.1.98-beta.6 → 0.1.98-beta.60
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/{App-CvJ0ASlp.js → App-BUwQLdzG.js} +812 -666
- package/dist/{AuditLogs-Bt9S2LKL.js → AuditLogs-laNQB1ef.js} +14 -13
- package/dist/{Bin-ZSCDSioa.js → Bin-Bfboeea_.js} +8 -8
- package/dist/{Broadcast-BT0R11RB.js → Broadcast-CDz-_eDz.js} +40 -37
- package/dist/CampaignAnalytic-BiA-5XG3.js +1830 -0
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-LweQ57aG.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-VrTN-c_a.js} +6 -5
- package/dist/Card-CKHaW8N7.js +1084 -0
- package/dist/{Collections-H7zhe9zN.js → Collections-DRocQb1D.js} +14 -13
- package/dist/Credit-DWaoVhSP.js +286 -0
- package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-B7ZdULCu.js +53 -0
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-B2sZFWUF.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-3ERieT1j.js} +54 -52
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-qNmiKaJc.js → EffectSheet.vue_vue_type_style_index_0_lang-yDUjXV2O.js} +35 -35
- package/dist/{Experience-CH5tg-tm.js → Experience-C1_LpneJ.js} +112 -86
- package/dist/{FileSaver.min-DNFqiyZb.js → FileSaver.min-CWJ-6CFP.js} +1 -1
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-3bH-tZAm.js +138 -0
- package/dist/Game-DtTYcSZk.js +356 -0
- package/dist/GiftCardSetup-B770Rl1Q.js +662 -0
- package/dist/{Grab-3s_sLewD.js → Grab-CN0gmIxT.js} +33 -32
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-fbmoN1e9.js → ImageInput.vue_vue_type_script_setup_true_lang-BaAhKWhX.js} +1 -1
- package/dist/{Index-zTWZCiEo.js → Index-0F6aq3f9.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-BOxYPkf5.js → LocationPicker.vue_vue_type_script_setup_true_lang-BrKj8W2H.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-wjJ_cwft.js → LottieAnimation.vue_vue_type_script_setup_true_lang-DOuHSVdR.js} +1 -1
- package/dist/LoyaltyDashboard-CtXyDFqa.js +2865 -0
- package/dist/MainLayout-BSWLr3gE.js +143 -0
- package/dist/{Marketing-Bto1OvK1.js → Marketing-Ci2haxRd.js} +7 -6
- package/dist/{MarketingMaterialEdit-D7rIqF5U.js → MarketingMaterialEdit-Cw6R0bNM.js} +15 -14
- package/dist/Member-DEzSTAQy.js +649 -0
- package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-BrhSxbrI.js +1287 -0
- package/dist/MemberImportHistory-BGfNLzma.js +187 -0
- package/dist/MemberList-Cq5Gsv3G.js +336 -0
- package/dist/{MemberTransactions-CjTtGB2y.js → MemberTransactions-BrUVZRtt.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DvKL7BL5.js → MessageInput.vue_vue_type_script_setup_true_lang-DCQ6Fse-.js} +5434 -5279
- package/dist/MetricInfoTooltip.vue_vue_type_script_setup_true_lang-CETwYfZD.js +40 -0
- package/dist/Mission-Do4IonLo.js +360 -0
- package/dist/{Overview-mxGLyFvE.js → Overview-DA90l9Kb.js} +21 -20
- package/dist/Overview-DN-nJxw9.js +1316 -0
- package/dist/Point-DQ4w857n.js +288 -0
- package/dist/Promotion-Rgt9LcYi.js +423 -0
- package/dist/{Queue-DgaFyyyH.js → Queue-SzypUxgD.js} +14 -13
- package/dist/{Record-BRol__6_.js → Record-DYvPPhIW.js} +9 -9
- package/dist/Review-B0TERyHM.js +45 -0
- package/dist/ReviewFacebookCallback-BJ5jQ3Dv.js +238 -0
- package/dist/ReviewGoogleCallback-BKQD39dv.js +213 -0
- package/dist/{Reward-DQI0PvmR.js → Reward-BexlVT_C.js} +35 -35
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-B6bvQNsU.js → RewardGroup.vue_vue_type_script_setup_true_lang-C-ygqNur.js} +14 -13
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-DgAU7jGo.js → RuleGroup.vue_vue_type_script_setup_true_lang-DjxIJcdv.js} +103 -109
- package/dist/{Segment-DFaLx0QZ.js → Segment-CYa4GjtQ.js} +30 -29
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-Cpb2i9iV.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-b-K-VDJC.js} +31 -30
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-MvoepHn9.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-t2mlDDtn.js} +4 -4
- package/dist/{Setting-D2NjFJvq.js → Setting-Dmm5BKdF.js} +14 -14
- package/dist/{SettingAdvertisements-CPWgSMaA.js → SettingAdvertisements-cy4cRBop.js} +12 -12
- package/dist/Settings-DMQuLDM4.js +230 -0
- package/dist/Store-B7KflfSk.js +2612 -0
- package/dist/{StoreRewards-Ccj12pyq.js → StoreRewards-BKae8uZn.js} +15 -15
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-sbIR-k1R.js +1329 -0
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-CfWTn0Xd.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DRT3N9SD.js} +2 -2
- package/dist/{Tier-vaJoohiM.js → Tier-BeTz6LHH.js} +2296 -750
- package/dist/{Title-BqHC7-v9.js → Title-OEVVw5I-.js} +39 -37
- package/dist/Transaction-D-MZjntW.js +45 -0
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-Dporb9KE.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-xIEOUOdo.js} +26 -26
- package/dist/{Voucher-DeN6C6DQ.js → Voucher-BJCf3pSa.js} +156 -133
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-De16fuC4.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BFQ_CYub.js} +115 -121
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DAC-j0Ln.js → ZodTextField.vue_vue_type_script_setup_true_lang-DGDw3Too.js} +2 -2
- package/dist/{app-n4Y2jMee.js → app-J8VIC7-H.js} +29852 -25997
- package/dist/app.js +1 -1
- package/dist/base.export-HYFFI4OS.js +75 -0
- package/dist/{business-jn-_l48y.js → business-BonuheMK.js} +5 -5
- package/dist/{campaign-rgDnocfT.js → campaign-7CI7gfS5.js} +74 -96
- package/dist/campaign-Ct7jhugP.js +100 -0
- package/dist/{campaign.enum-C9HvoKuq.js → campaign.enum-OzJ9IbAW.js} +1 -1
- package/dist/{campaign.fn-D21ettpH.js → campaign.fn-CDjxE9B2.js} +99 -99
- package/dist/{collectible.enum-_HVU4lWn.js → collectible.enum-Dw_tlI9E.js} +1 -1
- package/dist/collection.fn-CER0_NEn.js +26 -0
- package/dist/currency-CTUS4vS8.js +7 -0
- package/dist/{duplicateCampaign-gzVwrnWb.js → duplicateCampaign-CMQ-RMH-.js} +11 -11
- package/dist/{effect-DhpIv1L3.js → effect-DBeGoMNE.js} +1 -1
- package/dist/{email-addresses-DPxYLSoa.js → email-addresses-BH3mQzan.js} +209 -201
- package/dist/google-C3S8u0mT.js +4 -0
- package/dist/{helper-WYHUnHVy.js → helper-DJe_JbKJ.js} +1 -1
- package/dist/{index-BdnHQSDd.js → index-B14H1rLW.js} +5 -4
- package/dist/{index-7HizF3GI.js → index-BOVnM3gL.js} +1588 -1522
- package/dist/{index-Cvfavr2M.js → index-BRCB6yJ6.js} +232 -200
- package/dist/{index-BPsofsGt.js → index-BZKKS7jO.js} +1933 -2560
- package/dist/{index-BuLfxJyC.js → index-BlwAgY_z.js} +105 -123
- package/dist/index-BmN_Qcw7.js +151 -0
- package/dist/index-Bnk3vdb-.js +72 -0
- package/dist/index-BzVTqlVH.js +137 -0
- package/dist/{index--fNMSXUf.js → index-CEDhjZzd.js} +1 -1
- package/dist/{index-BdqRrCt8.js → index-CM9GTQIo.js} +5 -5
- package/dist/index-CN8VyVEB.js +53 -0
- package/dist/{index-Cte6dHHy.js → index-COuceEFz.js} +14 -14
- package/dist/{index-BN-FP9kx.js → index-CWR2s6Nt.js} +1 -1
- package/dist/index-CrMBqkKk.js +897 -0
- package/dist/{index-xao4ggML.js → index-D9f3AIaO.js} +5 -5
- package/dist/index-Do36kJeb.js +51 -0
- package/dist/{index-C-5YgmkC.js → index-bGByr1XM.js} +7 -5
- package/dist/{index-DUTFNEn9.js → index-bJX4zgh0.js} +4 -4
- package/dist/{index.esm2017-CjzFPUCa.js → index.esm2017-BpCPgTjc.js} +128 -128
- package/dist/{loading-CojnK00V.js → loading-D_rPJ-Yc.js} +1 -1
- package/dist/{lodash-CLkg5jTT.js → lodash-BM976Z2I.js} +1 -1
- package/dist/member-import-C5rhD3f8.js +187 -0
- package/dist/membership-CIQCEKiL.js +274 -0
- package/dist/{money-CyaLaEKo.js → money-BrMT193t.js} +1 -1
- package/dist/{number-DEtI4bEX.js → number-DOcD1tqL.js} +1 -1
- package/dist/objectid-CAdRRoFu.js +145 -0
- package/dist/{plugins-MnP1vCcg.js → plugins-696Z9K6A.js} +3 -3
- package/dist/remy-Qz_pNsUS.js +13 -0
- package/dist/{reward-Dk3D26xC.js → reward-lSVIBiE9.js} +1 -1
- package/dist/{rule-B1Agad1n.js → rule-BUGAimk8.js} +335 -275
- package/dist/style.css +1 -1
- package/dist/{template-DpqLCq1p.js → template-01_h2Gac.js} +6 -6
- package/dist/timezone-okTdM2YU.js +20 -0
- package/dist/transaction.fn-Nz0T33ex.js +64 -0
- package/dist/{trigger-cwPN-4Ia.js → trigger-CKj1X6zs.js} +17 -17
- package/dist/useMarketingMaterialActions-yKqKaPpe.js +96 -0
- package/dist/{usePagination-D8zBMxdJ.js → usePagination-D6cYlfni.js} +1 -1
- package/dist/{user-EUGwaL2f.js → user-DX5qCQfz.js} +1 -1
- package/dist/{vue-i18n-BBj45p9N.js → vue-i18n-DowpocqN.js} +204 -204
- package/dist/{xlsx-DiMIlKmu.js → xlsx-Dv4SuJbw.js} +1 -1
- package/dist/{zod-B1cU167C.js → zod-DVw24Ejy.js} +1 -1
- package/package.json +6 -5
- package/dist/Card-Wdh8lyUv.js +0 -910
- package/dist/Credit-BuKLrFtM.js +0 -260
- package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +0 -58
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
- package/dist/Game-C9s4qZz4.js +0 -330
- package/dist/LoyaltyDashboard-tOOk6zvV.js +0 -1082
- package/dist/MainLayout-iWi1DzXS.js +0 -41
- package/dist/Member-BdgdT-sa.js +0 -280
- package/dist/MemberList-DBIE-RWC.js +0 -1601
- package/dist/Mission-CWR6FBvN.js +0 -334
- package/dist/Point-BIt82fJk.js +0 -262
- package/dist/Promotion-Cl1vPi0B.js +0 -397
- package/dist/Review-DmV2YnFd.js +0 -1076
- package/dist/ReviewFacebookCallback-B5XgAWXo.js +0 -243
- package/dist/ReviewGoogleCallback-CYR03Wfd.js +0 -208
- package/dist/SelectItems.vue_vue_type_script_setup_true_lang-CAImd3yc.js +0 -181
- package/dist/Store-DjUe8ady.js +0 -1996
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-B7w69A3j.js +0 -1130
- package/dist/Transaction-BOmDOGnD.js +0 -39
- package/dist/campaign-BnI7-ceP.js +0 -219
- package/dist/export-CWAxYj7W.js +0 -97
- package/dist/index-B6EBgIUx.js +0 -85
- package/dist/index-CxR1baaG.js +0 -52
- package/dist/membership-CeX8E_I9.js +0 -255
- package/dist/objectid-CMau7CW-.js +0 -145
- package/dist/useMarketingMaterialActions-CGzfJ68e.js +0 -107
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { defineComponent as F, ref as I, watch as v, onBeforeMount as D, openBlock as C, createElementBlock as M, createElementVNode as N, createVNode as u, unref as t, h as i } from "vue";
|
|
2
|
+
import { a as R } from "./index-B14H1rLW.js";
|
|
3
|
+
import { u as k, _ as L } from "./usePagination-D6cYlfni.js";
|
|
4
|
+
import { _ as O } from "./FilterChip.vue_vue_type_script_setup_true_lang-3bH-tZAm.js";
|
|
5
|
+
import { c as l } from "./string-Gcy5IM_H.js";
|
|
6
|
+
import "./index-CEDhjZzd.js";
|
|
7
|
+
import { useSnackbar as P, components as c } from "@feedmepos/ui-library";
|
|
8
|
+
import { useCoreStore as T } from "@feedmepos/mf-common";
|
|
9
|
+
import { F as U } from "./member-import-C5rhD3f8.js";
|
|
10
|
+
import { F as g } from "./FileSaver.min-CWJ-6CFP.js";
|
|
11
|
+
import { h as m } from "./moment-D7p2TMB-.js";
|
|
12
|
+
import { useRouter as V } from "vue-router";
|
|
13
|
+
import { m as d } from "./index-BzVTqlVH.js";
|
|
14
|
+
import { R as B } from "./app-J8VIC7-H.js";
|
|
15
|
+
const $ = { class: "flex flex-col gap-16" }, Y = { class: "flex items-center" }, re = /* @__PURE__ */ F({
|
|
16
|
+
__name: "MemberImportHistory",
|
|
17
|
+
setup(z) {
|
|
18
|
+
const w = V(), b = T(), S = P(), n = I({ status: [] });
|
|
19
|
+
function _(e) {
|
|
20
|
+
return e === "COMPLETED" ? "text-fm-color-typo-success bg-fm-color-system-success-100" : ["INVALID", "STOPPED"].includes(e) ? "text-fm-color-typo-error bg-fm-color-system-error-100" : ["UPLOADED", "VALIDATING", "QUEUED", "RUNNING", "CANCELLING"].includes(
|
|
21
|
+
e
|
|
22
|
+
) ? "text-fm-color-typo-warning bg-fm-color-system-warning-100" : "text-fm-color-typo-info bg-fm-color-system-info-100";
|
|
23
|
+
}
|
|
24
|
+
function p(e) {
|
|
25
|
+
return m(e.originalFileExpiresAt).isAfter(m());
|
|
26
|
+
}
|
|
27
|
+
function f(e, o = !1) {
|
|
28
|
+
S.open({
|
|
29
|
+
type: "error",
|
|
30
|
+
message: o && e instanceof R && e.status === 410 ? "Original file has expired or is unavailable." : "Unable to download the import file. Please try again."
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
async function y(e) {
|
|
34
|
+
try {
|
|
35
|
+
g.saveAs(
|
|
36
|
+
await d.downloadOriginalImportFile(e._id.toString()),
|
|
37
|
+
e.file.originalName
|
|
38
|
+
);
|
|
39
|
+
} catch (o) {
|
|
40
|
+
f(o, !0);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
async function h(e) {
|
|
44
|
+
try {
|
|
45
|
+
g.saveAs(
|
|
46
|
+
await d.downloadImportResult(e._id.toString()),
|
|
47
|
+
`member-import-${e._id}.csv`
|
|
48
|
+
);
|
|
49
|
+
} catch (o) {
|
|
50
|
+
f(o);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
const x = [
|
|
54
|
+
{
|
|
55
|
+
header: "File",
|
|
56
|
+
accessorFn: (e) => e.file.originalName,
|
|
57
|
+
enableSorting: !1
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
header: "Import ID",
|
|
61
|
+
accessorFn: (e) => e._id.toString(),
|
|
62
|
+
enableSorting: !1
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
header: "Mode",
|
|
66
|
+
accessorFn: (e) => l.title(e.options.mode),
|
|
67
|
+
enableSorting: !1
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
header: "Status",
|
|
71
|
+
cell(e) {
|
|
72
|
+
const o = e.row.original.status;
|
|
73
|
+
return i(c.FmChip, {
|
|
74
|
+
label: l.title(o),
|
|
75
|
+
compact: !0,
|
|
76
|
+
class: _(o)
|
|
77
|
+
});
|
|
78
|
+
},
|
|
79
|
+
enableSorting: !1
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
header: "Rows",
|
|
83
|
+
accessorFn: (e) => `${e.summary.completed}/${e.summary.total} completed · ${e.summary.failed} failed`,
|
|
84
|
+
enableSorting: !1
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
header: "Created / completed",
|
|
88
|
+
accessorFn: (e) => [e.createdAt, e.completedAt].filter(Boolean).map((o) => m(o).format("D MMM YYYY, hh:mmA")).join(" / "),
|
|
89
|
+
enableSorting: !1
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
header: "Error",
|
|
93
|
+
cell(e) {
|
|
94
|
+
return i(
|
|
95
|
+
"div",
|
|
96
|
+
{
|
|
97
|
+
class: "max-w-[240px] truncate",
|
|
98
|
+
title: e.row.original.error ?? void 0
|
|
99
|
+
},
|
|
100
|
+
e.row.original.error || "-"
|
|
101
|
+
);
|
|
102
|
+
},
|
|
103
|
+
enableSorting: !1
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
header: "Actions",
|
|
107
|
+
cell(e) {
|
|
108
|
+
const o = e.row.original;
|
|
109
|
+
return i("div", { class: "flex gap-4" }, [
|
|
110
|
+
i(c.FmButton, {
|
|
111
|
+
icon: "download",
|
|
112
|
+
variant: "tertiary",
|
|
113
|
+
disabled: !p(o),
|
|
114
|
+
"aria-label": "Download original file",
|
|
115
|
+
title: p(o) ? "Download original file" : "Original file has expired",
|
|
116
|
+
onClick: (a) => {
|
|
117
|
+
a.stopPropagation(), y(o);
|
|
118
|
+
}
|
|
119
|
+
}),
|
|
120
|
+
i(c.FmButton, {
|
|
121
|
+
icon: "description",
|
|
122
|
+
variant: "tertiary",
|
|
123
|
+
disabled: o.summary.total === 0,
|
|
124
|
+
"aria-label": "Download result CSV",
|
|
125
|
+
title: "Download result CSV",
|
|
126
|
+
onClick: (a) => {
|
|
127
|
+
a.stopPropagation(), h(o);
|
|
128
|
+
}
|
|
129
|
+
})
|
|
130
|
+
]);
|
|
131
|
+
},
|
|
132
|
+
enableSorting: !1
|
|
133
|
+
}
|
|
134
|
+
], A = U.options.map((e) => ({
|
|
135
|
+
label: l.title(e),
|
|
136
|
+
value: e
|
|
137
|
+
})), { tableMeta: r, rowData: E, debouncedFetchData: s } = k(
|
|
138
|
+
(e) => d.readImportHistory(e, n.value.status),
|
|
139
|
+
{ key: "createdAt", descending: !0 }
|
|
140
|
+
);
|
|
141
|
+
return v(
|
|
142
|
+
n,
|
|
143
|
+
() => {
|
|
144
|
+
s();
|
|
145
|
+
},
|
|
146
|
+
{ deep: !0 }
|
|
147
|
+
), D(async () => {
|
|
148
|
+
var e, o;
|
|
149
|
+
if (!((o = (e = b.sessionUser.value) == null ? void 0 : e.role) != null && o.isAdmin)) {
|
|
150
|
+
await w.replace({
|
|
151
|
+
name: B["$connect-LOYALTY_MEMBER_LIST"]
|
|
152
|
+
});
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
await s();
|
|
156
|
+
}), (e, o) => (C(), M("div", $, [
|
|
157
|
+
N("div", Y, [
|
|
158
|
+
u(O, {
|
|
159
|
+
modelValue: t(n).status,
|
|
160
|
+
"onUpdate:modelValue": o[0] || (o[0] = (a) => t(n).status = a),
|
|
161
|
+
class: "cursor-pointer text-fm-color-neutral-gray-400",
|
|
162
|
+
"right-icon": "keyboard_arrow_down",
|
|
163
|
+
label: "Status: ",
|
|
164
|
+
"show-item-label": !0,
|
|
165
|
+
items: t(A)
|
|
166
|
+
}, null, 8, ["modelValue", "items"])
|
|
167
|
+
]),
|
|
168
|
+
u(L, {
|
|
169
|
+
loading: t(r).isLoading,
|
|
170
|
+
"row-data": t(E),
|
|
171
|
+
"row-count": t(r).totalRows,
|
|
172
|
+
"column-defs": x,
|
|
173
|
+
"page-count": t(r).pageCount,
|
|
174
|
+
"page-index": t(r).pageIndex,
|
|
175
|
+
"page-size": t(r).pageSize,
|
|
176
|
+
"shrink-at": !1,
|
|
177
|
+
onPageChange: o[1] || (o[1] = (a) => t(s)({
|
|
178
|
+
pageSize: a.pageSize,
|
|
179
|
+
pageIndex: a.pageIndex
|
|
180
|
+
}))
|
|
181
|
+
}, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size"])
|
|
182
|
+
]));
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
export {
|
|
186
|
+
re as default
|
|
187
|
+
};
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
import { defineComponent as xe, ref as E, computed as ve, onMounted as Me, resolveComponent as I, openBlock as ne, createElementBlock as Ne, createElementVNode as Fe, createVNode as y, unref as s, withDirectives as Ee, vShow as Ie, createBlock as De, createCommentVNode as Ve, h as d } from "vue";
|
|
2
|
+
import { h } from "./moment-D7p2TMB-.js";
|
|
3
|
+
import { components as S } from "@feedmepos/ui-library";
|
|
4
|
+
import { e as ke, M as Be } from "./email-addresses-BH3mQzan.js";
|
|
5
|
+
import { w as Pe } from "./xlsx-Dv4SuJbw.js";
|
|
6
|
+
import "./index-CEDhjZzd.js";
|
|
7
|
+
import "./index-D9f3AIaO.js";
|
|
8
|
+
import { u as Re } from "./membership-CIQCEKiL.js";
|
|
9
|
+
import { u as Ye, _ as Ae } from "./MemberDetailSheet.vue_vue_type_script_setup_true_lang-BrhSxbrI.js";
|
|
10
|
+
import { f as x } from "./number-DOcD1tqL.js";
|
|
11
|
+
import { u as Le } from "./loading-D_rPJ-Yc.js";
|
|
12
|
+
import { t as Oe } from "./money-BrMT193t.js";
|
|
13
|
+
import { u as ze } from "./business-BonuheMK.js";
|
|
14
|
+
import { u as Ke, _ as je } from "./usePagination-D6cYlfni.js";
|
|
15
|
+
import { g as Ue, a as $e, b as qe } from "./user-DX5qCQfz.js";
|
|
16
|
+
import { useRouter as Je } from "vue-router";
|
|
17
|
+
import { m as D } from "./index-BzVTqlVH.js";
|
|
18
|
+
import { R as Ge } from "./app-J8VIC7-H.js";
|
|
19
|
+
import { o as se } from "./objectId-dwaoBfJX.js";
|
|
20
|
+
const He = { class: "flex items-center justify-end" }, bt = /* @__PURE__ */ xe({
|
|
21
|
+
__name: "MemberList",
|
|
22
|
+
setup(Qe) {
|
|
23
|
+
const ie = Ye(), u = Re(), v = ze(), { minor: re } = Le, le = Je(), ce = [
|
|
24
|
+
{
|
|
25
|
+
header: "Name",
|
|
26
|
+
enableSorting: !0,
|
|
27
|
+
accessorKey: "name",
|
|
28
|
+
cell(t) {
|
|
29
|
+
return Ue(t.row.original);
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
header: "Phone",
|
|
34
|
+
enableSorting: !0,
|
|
35
|
+
accessorKey: "phoneNumber"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
accessorFn: (t) => h(t.joinAt || se(t._id.toString())).format("D MMM YYYY"),
|
|
39
|
+
header: "Customer Since",
|
|
40
|
+
accessorKey: "_id",
|
|
41
|
+
id: "_id"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
accessorKey: "collection_TIER_0_balance",
|
|
45
|
+
header: "Tier",
|
|
46
|
+
enableSorting: !0,
|
|
47
|
+
cell(t) {
|
|
48
|
+
return $e(
|
|
49
|
+
t.row.original,
|
|
50
|
+
u.sortedTiers
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
header: "Title",
|
|
56
|
+
enableSorting: !1,
|
|
57
|
+
cell(t) {
|
|
58
|
+
return qe(
|
|
59
|
+
t.row.original,
|
|
60
|
+
u.sortedTitles
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
accessorKey: "collection_CREDIT_0_balance",
|
|
66
|
+
accessorFn: (t) => {
|
|
67
|
+
var a, o, n;
|
|
68
|
+
return x(((n = (o = (a = t.collection) == null ? void 0 : a.CREDIT) == null ? void 0 : o[0]) == null ? void 0 : n.balance) ?? 0, 2);
|
|
69
|
+
},
|
|
70
|
+
header: "Credit(s)",
|
|
71
|
+
enableSorting: !0
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
accessorKey: "collection_POINT_0_balance",
|
|
75
|
+
accessorFn: (t) => {
|
|
76
|
+
var a, o, n;
|
|
77
|
+
return x(((n = (o = (a = t.collection) == null ? void 0 : a.POINT) == null ? void 0 : o[0]) == null ? void 0 : n.balance) ?? 0, 2);
|
|
78
|
+
},
|
|
79
|
+
header: "Experience(s)",
|
|
80
|
+
enableSorting: !0
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
accessorKey: "collection_COIN_0_balance",
|
|
84
|
+
accessorFn: (t) => {
|
|
85
|
+
var a, o, n;
|
|
86
|
+
return x(((n = (o = (a = t.collection) == null ? void 0 : a.COIN) == null ? void 0 : o[0]) == null ? void 0 : n.balance) ?? 0, 2);
|
|
87
|
+
},
|
|
88
|
+
header: "Point(s)",
|
|
89
|
+
enableSorting: !0
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
accessorFn: (t) => {
|
|
93
|
+
var a;
|
|
94
|
+
return ((a = t.stats) == null ? void 0 : a.visitCount) ?? 0;
|
|
95
|
+
},
|
|
96
|
+
header: "Total visit",
|
|
97
|
+
accessorKey: "stats.visitCount",
|
|
98
|
+
id: "stats.visitCount"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
accessorFn: (t) => {
|
|
102
|
+
var a;
|
|
103
|
+
return (a = t.stats) == null ? void 0 : a.lastVisit;
|
|
104
|
+
},
|
|
105
|
+
sortingFn: (t, a) => {
|
|
106
|
+
var o, n;
|
|
107
|
+
return new Date((o = t.original.stats) == null ? void 0 : o.lastVisit).getTime() - new Date((n = a.original.stats) == null ? void 0 : n.lastVisit).getTime();
|
|
108
|
+
},
|
|
109
|
+
id: "stats.lastVisit",
|
|
110
|
+
header: "Last visit",
|
|
111
|
+
cell(t) {
|
|
112
|
+
var a, o;
|
|
113
|
+
return d("div", { class: "flex items-center justify-end gap-4" }, [
|
|
114
|
+
d(
|
|
115
|
+
"span",
|
|
116
|
+
(a = t.row.original.stats) != null && a.lastVisit ? h((o = t.row.original.stats) == null ? void 0 : o.lastVisit).fromNow() : "NA"
|
|
117
|
+
),
|
|
118
|
+
d(
|
|
119
|
+
S.FmTooltip,
|
|
120
|
+
{
|
|
121
|
+
content: h(t.row.original.stats.lastVisit).format(
|
|
122
|
+
"D MMM YYYY - hh:mmA"
|
|
123
|
+
)
|
|
124
|
+
},
|
|
125
|
+
[d(S.FmIcon, { name: "info", outline: !0, size: "sm" })]
|
|
126
|
+
)
|
|
127
|
+
]);
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
id: "actions",
|
|
132
|
+
cell(t) {
|
|
133
|
+
return d(
|
|
134
|
+
S.FmMenu,
|
|
135
|
+
{
|
|
136
|
+
placement: "bottom-end",
|
|
137
|
+
onClick: (a) => {
|
|
138
|
+
a.stopPropagation();
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"menu-button": () => d(S.FmButton, { icon: "more_vert", variant: "tertiary" }),
|
|
143
|
+
default: () => [
|
|
144
|
+
d(S.FmMenuItem, {
|
|
145
|
+
label: "Transaction details",
|
|
146
|
+
onClick: async (a) => {
|
|
147
|
+
a.stopPropagation(), await be(t.row.original._id);
|
|
148
|
+
}
|
|
149
|
+
})
|
|
150
|
+
]
|
|
151
|
+
}
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
], { tableMeta: l, rowData: de, onSort: ue, debouncedFetchData: M, onSearch: me } = Ke(D.read), V = E(), _ = E(!1), m = E(), pe = ve(() => v.locations.map((t) => ({
|
|
156
|
+
label: t.name,
|
|
157
|
+
value: t._id
|
|
158
|
+
})));
|
|
159
|
+
async function fe() {
|
|
160
|
+
m.value = await D.readById(
|
|
161
|
+
m.value._id.toString()
|
|
162
|
+
), _.value = !0;
|
|
163
|
+
}
|
|
164
|
+
async function ge() {
|
|
165
|
+
await M(), _.value = !1;
|
|
166
|
+
}
|
|
167
|
+
async function be(t) {
|
|
168
|
+
await le.push({
|
|
169
|
+
name: Ge["$connect-LOYALTY_MEMBER_TRANSACTIONS"],
|
|
170
|
+
params: { id: t }
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
const N = {
|
|
174
|
+
sortBy: "_id",
|
|
175
|
+
descending: !1,
|
|
176
|
+
rowsPerPage: 1e3
|
|
177
|
+
};
|
|
178
|
+
function F(t) {
|
|
179
|
+
const a = h(t);
|
|
180
|
+
return a.isValid() ? a.format("DD/MM/YYYY") : "";
|
|
181
|
+
}
|
|
182
|
+
async function he() {
|
|
183
|
+
const t = new Be(), a = N.rowsPerPage;
|
|
184
|
+
await re(
|
|
185
|
+
async () => {
|
|
186
|
+
var T, r, p, k, B, P, R, Y, A, L, O, z, K, j, U, $, q, J, G, H, Q, W, X, Z, ee;
|
|
187
|
+
let o, n = !0;
|
|
188
|
+
for (; n; ) {
|
|
189
|
+
const C = await D.readCursor({
|
|
190
|
+
limit: a,
|
|
191
|
+
sortBy: N.sortBy,
|
|
192
|
+
descending: N.descending,
|
|
193
|
+
...o ? { cursor: o } : {}
|
|
194
|
+
});
|
|
195
|
+
if (!C.resources.length)
|
|
196
|
+
break;
|
|
197
|
+
for (const e of C.resources) {
|
|
198
|
+
const Se = (T = ke.parseOneAddress(
|
|
199
|
+
e == null ? void 0 : e.email
|
|
200
|
+
)) != null && T.domain.includes("feedmepos.com") ? void 0 : e.email, _e = (p = ((r = e == null ? void 0 : e.collection) == null ? void 0 : r.TITLE) || []) == null ? void 0 : p.reduce(
|
|
201
|
+
(i, c) => {
|
|
202
|
+
var g, b;
|
|
203
|
+
const f = (b = (g = u.sortedTitles) == null ? void 0 : g.find(
|
|
204
|
+
(w) => w._id === c.collectible
|
|
205
|
+
)) == null ? void 0 : b.name;
|
|
206
|
+
return !f || c.balance <= 0 || i.push(f), i;
|
|
207
|
+
},
|
|
208
|
+
[]
|
|
209
|
+
), Te = (u.sortedTitles || []).reduce(
|
|
210
|
+
(i, c) => {
|
|
211
|
+
var g, b, w, oe;
|
|
212
|
+
const f = (oe = (w = (b = (((g = e == null ? void 0 : e.collection) == null ? void 0 : g.TITLE) || []).find(
|
|
213
|
+
(ye) => ye.collectible === c._id
|
|
214
|
+
)) == null ? void 0 : b.expiryBalance) == null ? void 0 : w[0]) == null ? void 0 : oe.expiredAt;
|
|
215
|
+
return i[c.name] = f ? h(f).format("DD/MM/YYYY") : "", i;
|
|
216
|
+
},
|
|
217
|
+
{}
|
|
218
|
+
), Ce = ((P = (B = (k = e.collection) == null ? void 0 : k.CREDIT) == null ? void 0 : B.at(0)) == null ? void 0 : P.balance) || 0, te = ((L = (A = (Y = (R = e.collection) == null ? void 0 : R.CREDIT) == null ? void 0 : Y.at(0)) == null ? void 0 : A.expiryBalance) == null ? void 0 : L.reduce(
|
|
219
|
+
(i, c) => i + c.amount,
|
|
220
|
+
0
|
|
221
|
+
)) || 0, ae = x(Ce, 2), we = {
|
|
222
|
+
ID: e._id.toString(),
|
|
223
|
+
Name: ((O = e.name) == null ? void 0 : O.trim()) || "",
|
|
224
|
+
Phone: ((z = e == null ? void 0 : e.phoneNumber) == null ? void 0 : z.trim()) || "",
|
|
225
|
+
Email: Se || "",
|
|
226
|
+
Gender: e.gender || "",
|
|
227
|
+
CardNo: e.cardNo || "",
|
|
228
|
+
Birthday: e != null && e.birthday ? F(e == null ? void 0 : e.birthday) : "",
|
|
229
|
+
Credit: (Number(ae) - Number(te)).toFixed(2),
|
|
230
|
+
FreeCredit: Number(te.toFixed(2)),
|
|
231
|
+
TotalCredit: Number(ae),
|
|
232
|
+
Exp: e != null && e.collection ? ((U = (j = (K = e.collection) == null ? void 0 : K.POINT) == null ? void 0 : j.at(0)) == null ? void 0 : U.balance) ?? 0 : 0,
|
|
233
|
+
Point: e != null && e.collection ? ((J = (q = ($ = e.collection) == null ? void 0 : $.COIN) == null ? void 0 : q.at(0)) == null ? void 0 : J.balance) ?? 0 : 0,
|
|
234
|
+
Tier: e != null && e.collection ? ((Q = (H = (G = e.collection) == null ? void 0 : G.TIER) == null ? void 0 : H.at(0)) == null ? void 0 : Q.balance) ?? 0 : 0,
|
|
235
|
+
Titles: _e.join(","),
|
|
236
|
+
...Te,
|
|
237
|
+
TotalTransaction: e.stats.visitCount,
|
|
238
|
+
AvgSpent: Oe(Number(e.stats.avgBillSize || 0)).toFormat(
|
|
239
|
+
!1
|
|
240
|
+
),
|
|
241
|
+
TotalSpent: e.stats.avgBillSize * e.stats.visitCount,
|
|
242
|
+
LastVisit: F(e.stats.lastVisit),
|
|
243
|
+
Feedback: ((W = e.stats) == null ? void 0 : W.feedbackCount) || 0,
|
|
244
|
+
LastSeasonTierEarned: ((X = e.stats) == null ? void 0 : X.lastSeasonTierEarned) || 0,
|
|
245
|
+
LastSeasonPointEarned: ((Z = e.stats) == null ? void 0 : Z.lastSeasonPointEarned) || 0,
|
|
246
|
+
JoinedAt: F(e.joinAt || se(e._id)),
|
|
247
|
+
JoinedAtLocation: e.location && ((ee = pe.value.find((i) => i.value == e.location)) == null ? void 0 : ee.label) || "-",
|
|
248
|
+
VisitFrequency: `${Number(
|
|
249
|
+
Math.ceil(e.stats.avgVisitFrequency).toFixed(0)
|
|
250
|
+
)}`
|
|
251
|
+
};
|
|
252
|
+
t.addRecord(we);
|
|
253
|
+
}
|
|
254
|
+
o = C.meta.nextCursor ?? void 0, n = C.meta.hasNext && !!o;
|
|
255
|
+
}
|
|
256
|
+
await Pe(
|
|
257
|
+
t.buildExcel(),
|
|
258
|
+
`members-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
|
|
259
|
+
{
|
|
260
|
+
bookType: "xlsx",
|
|
261
|
+
bookSST: !1,
|
|
262
|
+
type: "array"
|
|
263
|
+
}
|
|
264
|
+
);
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
message: "Exporting member...",
|
|
268
|
+
successMessage: "Member exported successfully"
|
|
269
|
+
}
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
return Me(async () => {
|
|
273
|
+
await u.readMembership(), await v.readLocations(), await ie.read(), await v.readLocations(), await M();
|
|
274
|
+
}), (t, a) => {
|
|
275
|
+
const o = I("FmSearch"), n = I("FmButton"), T = I("FmSnackbar");
|
|
276
|
+
return ne(), Ne("div", null, [
|
|
277
|
+
Fe("div", He, [
|
|
278
|
+
y(o, {
|
|
279
|
+
class: "mt-4",
|
|
280
|
+
modelValue: s(l).searchValue,
|
|
281
|
+
"onUpdate:modelValue": [
|
|
282
|
+
a[0] || (a[0] = (r) => s(l).searchValue = r),
|
|
283
|
+
s(me)
|
|
284
|
+
],
|
|
285
|
+
placeholder: "Search",
|
|
286
|
+
collapsible: ""
|
|
287
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
288
|
+
y(n, {
|
|
289
|
+
icon: "ios_share",
|
|
290
|
+
variant: "tertiary",
|
|
291
|
+
onClick: he
|
|
292
|
+
})
|
|
293
|
+
]),
|
|
294
|
+
Ee(y(T, {
|
|
295
|
+
"z-index": 0,
|
|
296
|
+
class: "!max-w-full my-16",
|
|
297
|
+
title: "Info",
|
|
298
|
+
description: "Current list is not up to date, please refresh table for latest data.",
|
|
299
|
+
variant: "info",
|
|
300
|
+
dismissable: "",
|
|
301
|
+
onOnDismiss: a[1] || (a[1] = (r) => _.value = !1),
|
|
302
|
+
action: "Refresh",
|
|
303
|
+
onOnAction: ge
|
|
304
|
+
}, null, 512), [
|
|
305
|
+
[Ie, s(_)]
|
|
306
|
+
]),
|
|
307
|
+
y(je, {
|
|
308
|
+
loading: s(l).isLoading,
|
|
309
|
+
"row-data": s(de),
|
|
310
|
+
"row-count": s(l).totalRows,
|
|
311
|
+
"column-defs": ce,
|
|
312
|
+
"shrink-at": !1,
|
|
313
|
+
"page-count": s(l).pageCount,
|
|
314
|
+
"page-index": s(l).pageIndex,
|
|
315
|
+
"page-size": s(l).pageSize,
|
|
316
|
+
onSortChange: s(ue),
|
|
317
|
+
onPageChange: a[2] || (a[2] = (r) => s(M)({ pageSize: r.pageSize, pageIndex: r.pageIndex })),
|
|
318
|
+
onRowClick: a[3] || (a[3] = (r) => {
|
|
319
|
+
var p;
|
|
320
|
+
m.value = r.original, (p = s(V)) == null || p.showSheet();
|
|
321
|
+
})
|
|
322
|
+
}, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onSortChange"]),
|
|
323
|
+
s(m) ? (ne(), De(Ae, {
|
|
324
|
+
key: 0,
|
|
325
|
+
ref_key: "sheetRef",
|
|
326
|
+
ref: V,
|
|
327
|
+
member: s(m),
|
|
328
|
+
"onUpdate:member": fe
|
|
329
|
+
}, null, 8, ["member"])) : Ve("", !0)
|
|
330
|
+
]);
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
});
|
|
334
|
+
export {
|
|
335
|
+
bt as default
|
|
336
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as d, ref as p, resolveComponent as _, openBlock as a, createElementBlock as f, createVNode as v, unref as o, createBlock as u, createCommentVNode as b } from "vue";
|
|
2
|
-
import { _ as k, a as x } from "./StoreTransactions.vue_vue_type_script_setup_true_lang-
|
|
2
|
+
import { _ as k, a as x } from "./StoreTransactions.vue_vue_type_script_setup_true_lang-sbIR-k1R.js";
|
|
3
3
|
import { useRouter as y } from "vue-router";
|
|
4
4
|
const C = { class: "flex flex-col gap-y-32 pb-24" }, F = /* @__PURE__ */ d({
|
|
5
5
|
__name: "MemberTransactions",
|