order-management 0.0.74 → 0.0.76
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/.medusa/server/src/admin/index.js +641 -641
- package/.medusa/server/src/admin/index.mjs +642 -642
- package/.medusa/server/src/api/admin/orders/[order_id]/cancel-reason-mapping/route.js +2 -2
- package/.medusa/server/src/api/store/guest-orders/[id]/cancel/route.js +7 -7
- package/.medusa/server/src/api/store/guest-orders/[id]/cancel-reason-mapping/route.js +3 -2
- package/.medusa/server/src/api/store/orders/[order_id]/cancel-reason-mapping/route.js +2 -2
- package/.medusa/server/src/api/store/orders/cancel/[order_id]/route.js +3 -2
- package/.medusa/server/src/api/store/orders/reorder/[order_id]/route.js +72 -13
- package/.medusa/server/src/modules/cancel-order-reason/service.js +5 -12
- package/.medusa/server/src/workflows/reorder-workflow.js +3 -2
- package/.medusa/server/src/workflows/steps/retrieve-order-step.js +4 -131
- package/.medusa/server/src/workflows/steps/transform-order-to-cart-step.js +193 -4
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
|
2
2
|
import { defineWidgetConfig, defineRouteConfig } from "@medusajs/admin-sdk";
|
|
3
3
|
import { useState, useEffect, useRef, useCallback, useMemo } from "react";
|
|
4
4
|
import { Container, Text, Heading, Badge, Button, Label, Select, Textarea, Input } from "@medusajs/ui";
|
|
5
|
-
import { CashSolid, PencilSquareSolid, Trash, CreditCard, ArrowPath,
|
|
5
|
+
import { CashSolid, PencilSquareSolid, Trash, Receipt, CreditCard, ArrowPath, CheckCircle, ArrowLeft } from "@medusajs/icons";
|
|
6
6
|
import { useNavigate, useParams } from "react-router-dom";
|
|
7
7
|
function roundRectPath(ctx, x, y, w, h, r) {
|
|
8
8
|
ctx.beginPath();
|
|
@@ -872,19 +872,27 @@ const getStatusBadgeClass$7 = (status) => {
|
|
|
872
872
|
if (s2 === "pending" || s2 === "requires_more") return "bg-ui-tag-orange-bg text-ui-tag-orange-text";
|
|
873
873
|
return "bg-ui-tag-purple-bg text-ui-tag-purple-text";
|
|
874
874
|
};
|
|
875
|
-
const
|
|
875
|
+
const RefundsPage = () => {
|
|
876
876
|
const navigate = useNavigate();
|
|
877
877
|
const [items, setItems] = useState([]);
|
|
878
|
-
const [statusFilter, setStatusFilter] = useState("all");
|
|
879
878
|
const [orderIdSearch, setOrderIdSearch] = useState("");
|
|
880
879
|
const debouncedOrderId = useDebounce$3(orderIdSearch, 300);
|
|
880
|
+
const [paymentStatusFilter, setPaymentStatusFilter] = useState("all");
|
|
881
|
+
const [providerSearch, setProviderSearch] = useState("");
|
|
882
|
+
const debouncedProvider = useDebounce$3(providerSearch, 300);
|
|
883
|
+
const [currencySearch, setCurrencySearch] = useState("");
|
|
884
|
+
const debouncedCurrency = useDebounce$3(currencySearch, 300);
|
|
885
|
+
const [dateFrom, setDateFrom] = useState("");
|
|
886
|
+
const [dateTo, setDateTo] = useState("");
|
|
887
|
+
const [amountMin, setAmountMin] = useState("");
|
|
888
|
+
const [amountMax, setAmountMax] = useState("");
|
|
881
889
|
const [isLoading, setIsLoading] = useState(true);
|
|
882
890
|
const [isFetchingMore, setIsFetchingMore] = useState(false);
|
|
883
891
|
const [error, setError] = useState(null);
|
|
884
892
|
const [offset, setOffset] = useState(0);
|
|
885
893
|
const [count, setCount] = useState(0);
|
|
886
894
|
const limit = 50;
|
|
887
|
-
const
|
|
895
|
+
const loadRefunds = useCallback(
|
|
888
896
|
async (nextOffset, replace) => {
|
|
889
897
|
try {
|
|
890
898
|
if (replace) setIsLoading(true);
|
|
@@ -893,18 +901,25 @@ const PaymentsPage = () => {
|
|
|
893
901
|
const params = new URLSearchParams();
|
|
894
902
|
params.set("limit", String(limit));
|
|
895
903
|
params.set("offset", String(nextOffset));
|
|
896
|
-
if (statusFilter !== "all") params.set("status", statusFilter);
|
|
897
904
|
if (debouncedOrderId.trim()) params.set("order_id", debouncedOrderId.trim());
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
);
|
|
905
|
+
if (paymentStatusFilter !== "all") params.set("payment_status", paymentStatusFilter);
|
|
906
|
+
if (debouncedProvider.trim()) params.set("provider_id", debouncedProvider.trim());
|
|
907
|
+
if (debouncedCurrency.trim()) params.set("currency_code", debouncedCurrency.trim());
|
|
908
|
+
if (dateFrom.trim()) params.set("date_from", dateFrom.trim());
|
|
909
|
+
if (dateTo.trim()) params.set("date_to", dateTo.trim());
|
|
910
|
+
const min = amountMin.trim() ? Number(amountMin) : void 0;
|
|
911
|
+
const max = amountMax.trim() ? Number(amountMax) : void 0;
|
|
912
|
+
if (min != null && !Number.isNaN(min)) params.set("amount_min", String(min));
|
|
913
|
+
if (max != null && !Number.isNaN(max)) params.set("amount_max", String(max));
|
|
914
|
+
const response = await fetch(`/admin/refunds?${params.toString()}`, {
|
|
915
|
+
credentials: "include"
|
|
916
|
+
});
|
|
902
917
|
if (!response.ok) {
|
|
903
918
|
const text = await response.text();
|
|
904
|
-
throw new Error(text || "Failed to load
|
|
919
|
+
throw new Error(text || "Failed to load refunds");
|
|
905
920
|
}
|
|
906
921
|
const payload = await response.json();
|
|
907
|
-
const list = payload.
|
|
922
|
+
const list = payload.refunds ?? [];
|
|
908
923
|
setCount(payload.count ?? 0);
|
|
909
924
|
setOffset(nextOffset + list.length);
|
|
910
925
|
setItems((prev) => replace ? list : [...prev, ...list]);
|
|
@@ -915,46 +930,75 @@ const PaymentsPage = () => {
|
|
|
915
930
|
setIsFetchingMore(false);
|
|
916
931
|
}
|
|
917
932
|
},
|
|
918
|
-
[
|
|
933
|
+
[
|
|
934
|
+
debouncedOrderId,
|
|
935
|
+
paymentStatusFilter,
|
|
936
|
+
debouncedProvider,
|
|
937
|
+
debouncedCurrency,
|
|
938
|
+
dateFrom,
|
|
939
|
+
dateTo,
|
|
940
|
+
amountMin,
|
|
941
|
+
amountMax
|
|
942
|
+
]
|
|
919
943
|
);
|
|
920
944
|
useEffect(() => {
|
|
921
|
-
void
|
|
922
|
-
}, [
|
|
945
|
+
void loadRefunds(0, true);
|
|
946
|
+
}, [loadRefunds]);
|
|
923
947
|
const hasMore = useMemo(() => offset < count, [offset, count]);
|
|
924
|
-
const
|
|
925
|
-
const
|
|
926
|
-
return
|
|
948
|
+
const displayAmount = (r) => {
|
|
949
|
+
const code = (r.currency_code ?? "USD").toUpperCase();
|
|
950
|
+
return `${code} ${Number(r.amount)}`;
|
|
927
951
|
};
|
|
928
|
-
const
|
|
929
|
-
const
|
|
930
|
-
return
|
|
952
|
+
const displayStatus = (r) => {
|
|
953
|
+
const s2 = r.payment_status ?? "";
|
|
954
|
+
return s2 !== "" ? s2 : "—";
|
|
931
955
|
};
|
|
932
956
|
return /* @__PURE__ */ jsx("div", { className: "w-full p-6", children: /* @__PURE__ */ jsxs(Container, { className: "mx-auto flex w-full max-w-7xl flex-col gap-6 p-6", children: [
|
|
933
957
|
/* @__PURE__ */ jsxs("header", { className: "flex flex-col gap-3 md:flex-row md:items-center md:justify-between", children: [
|
|
934
958
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
935
|
-
/* @__PURE__ */ jsx(Heading, { level: "h1", children: "
|
|
936
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "
|
|
959
|
+
/* @__PURE__ */ jsx(Heading, { level: "h1", children: "Refunds" }),
|
|
960
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "Refund records — amount, order, payment status" })
|
|
937
961
|
] }),
|
|
938
|
-
/* @__PURE__ */ jsx(Button, { variant: "primary", onClick: () =>
|
|
962
|
+
/* @__PURE__ */ jsx(Button, { variant: "primary", onClick: () => loadRefunds(0, true), children: "Refresh" })
|
|
939
963
|
] }),
|
|
940
|
-
/* @__PURE__ */
|
|
964
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-col gap-4", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-3", children: [
|
|
941
965
|
/* @__PURE__ */ jsx(
|
|
942
966
|
Input,
|
|
943
967
|
{
|
|
944
|
-
placeholder: "
|
|
968
|
+
placeholder: "Order ID",
|
|
945
969
|
value: orderIdSearch,
|
|
946
970
|
onChange: (e) => setOrderIdSearch(e.target.value),
|
|
947
|
-
className: "md:max-w-
|
|
948
|
-
"aria-label": "
|
|
971
|
+
className: "md:max-w-[180px]",
|
|
972
|
+
"aria-label": "Filter by order ID"
|
|
949
973
|
}
|
|
950
974
|
),
|
|
951
|
-
/* @__PURE__ */ jsx(
|
|
975
|
+
/* @__PURE__ */ jsx(
|
|
976
|
+
Input,
|
|
977
|
+
{
|
|
978
|
+
placeholder: "Provider",
|
|
979
|
+
value: providerSearch,
|
|
980
|
+
onChange: (e) => setProviderSearch(e.target.value),
|
|
981
|
+
className: "md:max-w-[140px]",
|
|
982
|
+
"aria-label": "Filter by provider"
|
|
983
|
+
}
|
|
984
|
+
),
|
|
985
|
+
/* @__PURE__ */ jsx(
|
|
986
|
+
Input,
|
|
987
|
+
{
|
|
988
|
+
placeholder: "Currency",
|
|
989
|
+
value: currencySearch,
|
|
990
|
+
onChange: (e) => setCurrencySearch(e.target.value),
|
|
991
|
+
className: "md:max-w-[100px]",
|
|
992
|
+
"aria-label": "Filter by currency"
|
|
993
|
+
}
|
|
994
|
+
),
|
|
995
|
+
/* @__PURE__ */ jsxs(
|
|
952
996
|
"select",
|
|
953
997
|
{
|
|
954
|
-
value:
|
|
955
|
-
onChange: (e) =>
|
|
956
|
-
className: "h-9 rounded-md border border-ui-border-base bg-transparent px-3 text-sm text-ui-fg-base outline-none transition focus:ring-2 focus:ring-ui-fg-interactive md:max-w-
|
|
957
|
-
"aria-label": "Filter by status",
|
|
998
|
+
value: paymentStatusFilter,
|
|
999
|
+
onChange: (e) => setPaymentStatusFilter(e.target.value),
|
|
1000
|
+
className: "h-9 rounded-md border border-ui-border-base bg-transparent px-3 text-sm text-ui-fg-base outline-none transition focus:ring-2 focus:ring-ui-fg-interactive md:max-w-[160px]",
|
|
1001
|
+
"aria-label": "Filter by payment status",
|
|
958
1002
|
children: [
|
|
959
1003
|
/* @__PURE__ */ jsx("option", { value: "all", children: "All statuses" }),
|
|
960
1004
|
/* @__PURE__ */ jsx("option", { value: "pending", children: "Pending" }),
|
|
@@ -965,52 +1009,103 @@ const PaymentsPage = () => {
|
|
|
965
1009
|
/* @__PURE__ */ jsx("option", { value: "captured", children: "Captured" })
|
|
966
1010
|
]
|
|
967
1011
|
}
|
|
968
|
-
)
|
|
969
|
-
|
|
1012
|
+
),
|
|
1013
|
+
/* @__PURE__ */ jsx(
|
|
1014
|
+
Input,
|
|
1015
|
+
{
|
|
1016
|
+
type: "date",
|
|
1017
|
+
placeholder: "From",
|
|
1018
|
+
value: dateFrom,
|
|
1019
|
+
onChange: (e) => setDateFrom(e.target.value),
|
|
1020
|
+
className: "md:max-w-[140px]",
|
|
1021
|
+
"aria-label": "Date from"
|
|
1022
|
+
}
|
|
1023
|
+
),
|
|
1024
|
+
/* @__PURE__ */ jsx(
|
|
1025
|
+
Input,
|
|
1026
|
+
{
|
|
1027
|
+
type: "date",
|
|
1028
|
+
placeholder: "To",
|
|
1029
|
+
value: dateTo,
|
|
1030
|
+
onChange: (e) => setDateTo(e.target.value),
|
|
1031
|
+
className: "md:max-w-[140px]",
|
|
1032
|
+
"aria-label": "Date to"
|
|
1033
|
+
}
|
|
1034
|
+
),
|
|
1035
|
+
/* @__PURE__ */ jsx(
|
|
1036
|
+
Input,
|
|
1037
|
+
{
|
|
1038
|
+
placeholder: "Amount min",
|
|
1039
|
+
value: amountMin,
|
|
1040
|
+
onChange: (e) => setAmountMin(e.target.value),
|
|
1041
|
+
type: "number",
|
|
1042
|
+
min: 0,
|
|
1043
|
+
className: "md:max-w-[100px]",
|
|
1044
|
+
"aria-label": "Refund amount minimum"
|
|
1045
|
+
}
|
|
1046
|
+
),
|
|
1047
|
+
/* @__PURE__ */ jsx(
|
|
1048
|
+
Input,
|
|
1049
|
+
{
|
|
1050
|
+
placeholder: "Amount max",
|
|
1051
|
+
value: amountMax,
|
|
1052
|
+
onChange: (e) => setAmountMax(e.target.value),
|
|
1053
|
+
type: "number",
|
|
1054
|
+
min: 0,
|
|
1055
|
+
className: "md:max-w-[100px]",
|
|
1056
|
+
"aria-label": "Refund amount maximum"
|
|
1057
|
+
}
|
|
1058
|
+
)
|
|
1059
|
+
] }) }),
|
|
970
1060
|
error ? /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-ui-border-strong p-6 text-center", children: [
|
|
971
1061
|
/* @__PURE__ */ jsx(Text, { weight: "plus", className: "text-ui-fg-error", children: error }),
|
|
972
|
-
/* @__PURE__ */ jsx("div", { className: "mt-4 flex justify-center", children: /* @__PURE__ */ jsx(Button, { variant: "secondary", onClick: () =>
|
|
1062
|
+
/* @__PURE__ */ jsx("div", { className: "mt-4 flex justify-center", children: /* @__PURE__ */ jsx(Button, { variant: "secondary", onClick: () => loadRefunds(0, true), children: "Try again" }) })
|
|
973
1063
|
] }) : null,
|
|
974
|
-
isLoading ? /* @__PURE__ */ jsx("div", { className: "flex justify-center py-16", children: /* @__PURE__ */ jsx(Text, { children: "Loading
|
|
975
|
-
/* @__PURE__ */ jsx(Heading, { level: "h3", className: "text-xl", children: "No
|
|
976
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "mt-2 text-ui-fg-subtle", children: "
|
|
977
|
-
] }) : /* @__PURE__ */ jsx("div", { className: "overflow-
|
|
1064
|
+
isLoading ? /* @__PURE__ */ jsx("div", { className: "flex justify-center py-16", children: /* @__PURE__ */ jsx(Text, { children: "Loading refunds…" }) }) : items.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-dashed border-ui-border-strong p-10 text-center", children: [
|
|
1065
|
+
/* @__PURE__ */ jsx(Heading, { level: "h3", className: "text-xl", children: "No refunds yet" }),
|
|
1066
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "mt-2 text-ui-fg-subtle", children: "Refund records will appear here." })
|
|
1067
|
+
] }) : /* @__PURE__ */ jsx("div", { className: "w-full overflow-x-auto rounded-xl border border-ui-border-base", children: /* @__PURE__ */ jsxs("table", { className: "w-full table-fixed divide-y divide-ui-border-base", style: { minWidth: 0 }, children: [
|
|
978
1068
|
/* @__PURE__ */ jsx("thead", { className: "bg-ui-bg-subtle", children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
979
|
-
/* @__PURE__ */ jsx("th", { className: "px-
|
|
980
|
-
/* @__PURE__ */ jsx("th", { className: "px-
|
|
981
|
-
/* @__PURE__ */ jsx("th", { className: "px-
|
|
982
|
-
/* @__PURE__ */ jsx("th", { className: "px-
|
|
983
|
-
/* @__PURE__ */ jsx("th", { className: "px-
|
|
984
|
-
/* @__PURE__ */ jsx("th", { className: "px-
|
|
985
|
-
/* @__PURE__ */ jsx("th", { className: "px-
|
|
1069
|
+
/* @__PURE__ */ jsx("th", { className: "w-[11%] min-w-0 px-3 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Refund ID" }),
|
|
1070
|
+
/* @__PURE__ */ jsx("th", { className: "w-[11%] min-w-0 px-3 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Order ID" }),
|
|
1071
|
+
/* @__PURE__ */ jsx("th", { className: "w-[11%] min-w-0 px-3 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Payment ID" }),
|
|
1072
|
+
/* @__PURE__ */ jsx("th", { className: "w-[8%] min-w-0 px-3 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Amount" }),
|
|
1073
|
+
/* @__PURE__ */ jsx("th", { className: "w-[6%] min-w-0 px-3 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Currency" }),
|
|
1074
|
+
/* @__PURE__ */ jsx("th", { className: "w-[10%] min-w-0 px-3 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Provider" }),
|
|
1075
|
+
/* @__PURE__ */ jsx("th", { className: "w-[10%] min-w-0 px-3 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Payment Status" }),
|
|
1076
|
+
/* @__PURE__ */ jsx("th", { className: "w-[14%] min-w-0 px-3 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Note" }),
|
|
1077
|
+
/* @__PURE__ */ jsx("th", { className: "w-[11%] min-w-0 px-3 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Created" }),
|
|
1078
|
+
/* @__PURE__ */ jsx("th", { className: "w-[8%] min-w-0 px-3 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Actions" })
|
|
986
1079
|
] }) }),
|
|
987
|
-
/* @__PURE__ */ jsx("tbody", { className: "divide-y divide-ui-border-subtle", children: items.map((
|
|
1080
|
+
/* @__PURE__ */ jsx("tbody", { className: "divide-y divide-ui-border-subtle", children: items.map((r) => /* @__PURE__ */ jsxs(
|
|
988
1081
|
"tr",
|
|
989
1082
|
{
|
|
990
|
-
className: "hover:bg-ui-bg-subtle/60
|
|
991
|
-
onClick: () => navigate(`/
|
|
1083
|
+
className: "cursor-pointer hover:bg-ui-bg-subtle/60",
|
|
1084
|
+
onClick: () => navigate(`/refunds/${r.refund_id}`),
|
|
992
1085
|
children: [
|
|
993
|
-
/* @__PURE__ */ jsx("td", { className: "px-
|
|
994
|
-
/* @__PURE__ */ jsx("td", { className: "px-
|
|
995
|
-
/* @__PURE__ */ jsx("td", { className: "px-
|
|
996
|
-
/* @__PURE__ */ jsx("td", { className: "px-
|
|
1086
|
+
/* @__PURE__ */ jsx("td", { className: "min-w-0 truncate px-3 py-3 font-mono text-sm text-ui-fg-base", title: r.refund_id, children: r.refund_id }),
|
|
1087
|
+
/* @__PURE__ */ jsx("td", { className: "min-w-0 truncate px-3 py-3 font-medium text-ui-fg-base", title: r.order_id ?? void 0, children: r.order_id ?? "—" }),
|
|
1088
|
+
/* @__PURE__ */ jsx("td", { className: "min-w-0 truncate px-3 py-3 font-mono text-sm text-ui-fg-subtle", title: r.payment_id, children: r.payment_id }),
|
|
1089
|
+
/* @__PURE__ */ jsx("td", { className: "min-w-0 truncate px-3 py-3 text-ui-fg-subtle", children: displayAmount(r) }),
|
|
1090
|
+
/* @__PURE__ */ jsx("td", { className: "min-w-0 truncate px-3 py-3 text-ui-fg-subtle uppercase", children: r.currency_code || "—" }),
|
|
1091
|
+
/* @__PURE__ */ jsx("td", { className: "min-w-0 truncate px-3 py-3 text-ui-fg-subtle", title: r.provider_id || void 0, children: r.provider_id || "—" }),
|
|
1092
|
+
/* @__PURE__ */ jsx("td", { className: "min-w-0 px-3 py-3", children: /* @__PURE__ */ jsx(
|
|
997
1093
|
Badge,
|
|
998
1094
|
{
|
|
999
1095
|
size: "2xsmall",
|
|
1000
|
-
className: `uppercase ${getStatusBadgeClass$7(displayStatus(
|
|
1001
|
-
children: displayStatus(
|
|
1096
|
+
className: `uppercase ${getStatusBadgeClass$7(displayStatus(r))}`,
|
|
1097
|
+
children: displayStatus(r) !== "—" ? displayStatus(r).replace(/_/g, " ") : "—"
|
|
1002
1098
|
}
|
|
1003
1099
|
) }),
|
|
1004
|
-
/* @__PURE__ */ jsx("td", { className: "px-
|
|
1005
|
-
/* @__PURE__ */ jsx("td", { className: "px-
|
|
1006
|
-
year: "numeric",
|
|
1100
|
+
/* @__PURE__ */ jsx("td", { className: "min-w-0 truncate px-3 py-3 text-ui-fg-subtle", title: r.note ?? void 0, children: r.note ?? "—" }),
|
|
1101
|
+
/* @__PURE__ */ jsx("td", { className: "min-w-0 truncate px-3 py-3 text-ui-fg-subtle text-xs", children: new Date(r.created_at).toLocaleDateString("en-US", {
|
|
1007
1102
|
month: "short",
|
|
1008
1103
|
day: "numeric",
|
|
1009
1104
|
hour: "numeric",
|
|
1010
1105
|
minute: "2-digit",
|
|
1011
1106
|
hour12: true
|
|
1012
1107
|
}) }),
|
|
1013
|
-
/* @__PURE__ */
|
|
1108
|
+
/* @__PURE__ */ jsx("td", { className: "min-w-0 px-3 py-3", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-1", children: [
|
|
1014
1109
|
/* @__PURE__ */ jsx(
|
|
1015
1110
|
Button,
|
|
1016
1111
|
{
|
|
@@ -1018,27 +1113,27 @@ const PaymentsPage = () => {
|
|
|
1018
1113
|
size: "small",
|
|
1019
1114
|
onClick: (e) => {
|
|
1020
1115
|
e.stopPropagation();
|
|
1021
|
-
navigate(`/
|
|
1116
|
+
navigate(`/refunds/${r.refund_id}`);
|
|
1022
1117
|
},
|
|
1023
|
-
children: "
|
|
1118
|
+
children: "Details"
|
|
1024
1119
|
}
|
|
1025
1120
|
),
|
|
1026
|
-
|
|
1121
|
+
r.order_id ? /* @__PURE__ */ jsx(
|
|
1027
1122
|
Button,
|
|
1028
1123
|
{
|
|
1029
1124
|
variant: "transparent",
|
|
1030
1125
|
size: "small",
|
|
1031
1126
|
onClick: (e) => {
|
|
1032
1127
|
e.stopPropagation();
|
|
1033
|
-
navigate(`/orders/${
|
|
1128
|
+
navigate(`/orders/${r.order_id}`);
|
|
1034
1129
|
},
|
|
1035
1130
|
children: "Order"
|
|
1036
1131
|
}
|
|
1037
1132
|
) : null
|
|
1038
|
-
] })
|
|
1133
|
+
] }) })
|
|
1039
1134
|
]
|
|
1040
1135
|
},
|
|
1041
|
-
|
|
1136
|
+
r.refund_id
|
|
1042
1137
|
)) })
|
|
1043
1138
|
] }) }),
|
|
1044
1139
|
hasMore ? /* @__PURE__ */ jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ jsx(
|
|
@@ -1046,15 +1141,15 @@ const PaymentsPage = () => {
|
|
|
1046
1141
|
{
|
|
1047
1142
|
variant: "secondary",
|
|
1048
1143
|
isLoading: isFetchingMore,
|
|
1049
|
-
onClick: () =>
|
|
1144
|
+
onClick: () => loadRefunds(offset, false),
|
|
1050
1145
|
children: "Load more"
|
|
1051
1146
|
}
|
|
1052
1147
|
) }) : null
|
|
1053
1148
|
] }) });
|
|
1054
1149
|
};
|
|
1055
1150
|
const config$7 = defineRouteConfig({
|
|
1056
|
-
label: "
|
|
1057
|
-
icon:
|
|
1151
|
+
label: "Refunds",
|
|
1152
|
+
icon: Receipt
|
|
1058
1153
|
});
|
|
1059
1154
|
const useDebounce$2 = (value, delay) => {
|
|
1060
1155
|
const [debouncedValue, setDebouncedValue] = useState(value);
|
|
@@ -1065,190 +1160,144 @@ const useDebounce$2 = (value, delay) => {
|
|
|
1065
1160
|
return debouncedValue;
|
|
1066
1161
|
};
|
|
1067
1162
|
const getStatusBadgeClass$6 = (status) => {
|
|
1068
|
-
const
|
|
1069
|
-
if (
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
if (
|
|
1073
|
-
return "bg-ui-tag-blue-bg text-ui-tag-blue-text";
|
|
1074
|
-
}
|
|
1075
|
-
if (statusLower === "requires_action") {
|
|
1076
|
-
return "bg-ui-tag-red-bg text-ui-tag-red-text";
|
|
1077
|
-
}
|
|
1078
|
-
if (statusLower === "completed") {
|
|
1079
|
-
return "bg-ui-tag-green-bg text-ui-tag-green-text";
|
|
1080
|
-
}
|
|
1081
|
-
if (statusLower === "canceled") {
|
|
1082
|
-
return "bg-ui-tag-grey-bg text-ui-tag-grey-text";
|
|
1083
|
-
}
|
|
1163
|
+
const s2 = status.toLowerCase();
|
|
1164
|
+
if (s2 === "captured" || s2 === "completed") return "bg-ui-tag-green-bg text-ui-tag-green-text";
|
|
1165
|
+
if (s2 === "authorized") return "bg-ui-tag-blue-bg text-ui-tag-blue-text";
|
|
1166
|
+
if (s2 === "error" || s2 === "canceled" || s2 === "cancelled") return "bg-ui-tag-red-bg text-ui-tag-red-text";
|
|
1167
|
+
if (s2 === "pending" || s2 === "requires_more") return "bg-ui-tag-orange-bg text-ui-tag-orange-text";
|
|
1084
1168
|
return "bg-ui-tag-purple-bg text-ui-tag-purple-text";
|
|
1085
1169
|
};
|
|
1086
|
-
const
|
|
1170
|
+
const PaymentsPage = () => {
|
|
1087
1171
|
const navigate = useNavigate();
|
|
1088
1172
|
const [items, setItems] = useState([]);
|
|
1089
1173
|
const [statusFilter, setStatusFilter] = useState("all");
|
|
1090
|
-
const [
|
|
1091
|
-
const
|
|
1092
|
-
const debouncedSearchQuery = useDebounce$2(searchQuery, 300);
|
|
1174
|
+
const [orderIdSearch, setOrderIdSearch] = useState("");
|
|
1175
|
+
const debouncedOrderId = useDebounce$2(orderIdSearch, 300);
|
|
1093
1176
|
const [isLoading, setIsLoading] = useState(true);
|
|
1094
1177
|
const [isFetchingMore, setIsFetchingMore] = useState(false);
|
|
1095
1178
|
const [error, setError] = useState(null);
|
|
1096
1179
|
const [offset, setOffset] = useState(0);
|
|
1097
1180
|
const [count, setCount] = useState(0);
|
|
1098
1181
|
const limit = 50;
|
|
1099
|
-
const
|
|
1100
|
-
async (nextOffset, replace
|
|
1101
|
-
var _a;
|
|
1182
|
+
const loadTransactions = useCallback(
|
|
1183
|
+
async (nextOffset, replace) => {
|
|
1102
1184
|
try {
|
|
1103
|
-
if (replace)
|
|
1104
|
-
|
|
1105
|
-
} else {
|
|
1106
|
-
setIsFetchingMore(true);
|
|
1107
|
-
}
|
|
1185
|
+
if (replace) setIsLoading(true);
|
|
1186
|
+
else setIsFetchingMore(true);
|
|
1108
1187
|
setError(null);
|
|
1109
1188
|
const params = new URLSearchParams();
|
|
1110
1189
|
params.set("limit", String(limit));
|
|
1111
1190
|
params.set("offset", String(nextOffset));
|
|
1112
|
-
if (statusFilter !== "all")
|
|
1113
|
-
|
|
1114
|
-
}
|
|
1115
|
-
if (debouncedSearchQuery.trim()) {
|
|
1116
|
-
params.set("q", debouncedSearchQuery.trim());
|
|
1117
|
-
}
|
|
1118
|
-
if (createdByFilter !== "all") {
|
|
1119
|
-
params.set("created_by", createdByFilter);
|
|
1120
|
-
}
|
|
1121
|
-
params.set("order", "created_at");
|
|
1191
|
+
if (statusFilter !== "all") params.set("status", statusFilter);
|
|
1192
|
+
if (debouncedOrderId.trim()) params.set("order_id", debouncedOrderId.trim());
|
|
1122
1193
|
const response = await fetch(
|
|
1123
|
-
`/admin/
|
|
1194
|
+
`/admin/payment-transactions?${params.toString()}`,
|
|
1124
1195
|
{ credentials: "include" }
|
|
1125
1196
|
);
|
|
1126
1197
|
if (!response.ok) {
|
|
1127
|
-
const
|
|
1128
|
-
throw new Error(
|
|
1198
|
+
const text = await response.text();
|
|
1199
|
+
throw new Error(text || "Failed to load payment transactions");
|
|
1129
1200
|
}
|
|
1130
1201
|
const payload = await response.json();
|
|
1202
|
+
const list = payload.transactions ?? [];
|
|
1131
1203
|
setCount(payload.count ?? 0);
|
|
1132
|
-
setOffset(nextOffset +
|
|
1133
|
-
setItems(
|
|
1134
|
-
|
|
1135
|
-
);
|
|
1136
|
-
} catch (loadError) {
|
|
1137
|
-
const message = loadError instanceof Error ? loadError.message : "Unable to load return orders";
|
|
1138
|
-
setError(message);
|
|
1204
|
+
setOffset(nextOffset + list.length);
|
|
1205
|
+
setItems((prev) => replace ? list : [...prev, ...list]);
|
|
1206
|
+
} catch (e) {
|
|
1207
|
+
setError(e instanceof Error ? e.message : "Failed to load");
|
|
1139
1208
|
} finally {
|
|
1140
1209
|
setIsLoading(false);
|
|
1141
1210
|
setIsFetchingMore(false);
|
|
1142
1211
|
}
|
|
1143
1212
|
},
|
|
1144
|
-
[statusFilter,
|
|
1213
|
+
[statusFilter, debouncedOrderId]
|
|
1145
1214
|
);
|
|
1146
1215
|
useEffect(() => {
|
|
1147
|
-
void
|
|
1148
|
-
}, [
|
|
1216
|
+
void loadTransactions(0, true);
|
|
1217
|
+
}, [loadTransactions]);
|
|
1149
1218
|
const hasMore = useMemo(() => offset < count, [offset, count]);
|
|
1150
|
-
const
|
|
1151
|
-
const
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1219
|
+
const displayStatus = (t) => {
|
|
1220
|
+
const s2 = t.payment_id != null && t.payment_status != null && t.payment_status !== "" ? t.payment_status : t.session_status ?? "";
|
|
1221
|
+
return s2 !== "" ? s2 : "—";
|
|
1222
|
+
};
|
|
1223
|
+
const displayAmount = (t) => {
|
|
1224
|
+
const code = (t.currency_code ?? "USD").toUpperCase();
|
|
1225
|
+
return `${code} ${Number(t.amount)}`;
|
|
1226
|
+
};
|
|
1155
1227
|
return /* @__PURE__ */ jsx("div", { className: "w-full p-6", children: /* @__PURE__ */ jsxs(Container, { className: "mx-auto flex w-full max-w-7xl flex-col gap-6 p-6", children: [
|
|
1156
1228
|
/* @__PURE__ */ jsxs("header", { className: "flex flex-col gap-3 md:flex-row md:items-center md:justify-between", children: [
|
|
1157
1229
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
1158
|
-
/* @__PURE__ */ jsx(Heading, { level: "h1", children: "
|
|
1159
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "
|
|
1230
|
+
/* @__PURE__ */ jsx(Heading, { level: "h1", children: "Payments" }),
|
|
1231
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "All payment attempts — completed, pending, failed, requires action" })
|
|
1160
1232
|
] }),
|
|
1161
|
-
/* @__PURE__ */ jsx(Button, { variant: "primary", onClick: () =>
|
|
1233
|
+
/* @__PURE__ */ jsx(Button, { variant: "primary", onClick: () => loadTransactions(0, true), children: "Refresh" })
|
|
1162
1234
|
] }),
|
|
1163
1235
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3 md:flex-row md:items-center md:justify-between", children: [
|
|
1164
1236
|
/* @__PURE__ */ jsx(
|
|
1165
1237
|
Input,
|
|
1166
1238
|
{
|
|
1167
|
-
placeholder: "Search by
|
|
1168
|
-
value:
|
|
1169
|
-
onChange: (
|
|
1170
|
-
className: "md:max-w-sm"
|
|
1239
|
+
placeholder: "Search by Order ID",
|
|
1240
|
+
value: orderIdSearch,
|
|
1241
|
+
onChange: (e) => setOrderIdSearch(e.target.value),
|
|
1242
|
+
className: "md:max-w-sm",
|
|
1243
|
+
"aria-label": "Search by order ID"
|
|
1171
1244
|
}
|
|
1172
1245
|
),
|
|
1173
|
-
/* @__PURE__ */
|
|
1174
|
-
|
|
1175
|
-
"select",
|
|
1176
|
-
{
|
|
1177
|
-
value: createdByFilter,
|
|
1178
|
-
onChange: (event) => setCreatedByFilter(event.target.value),
|
|
1179
|
-
className: "h-9 rounded-md border border-ui-border-base bg-transparent px-3 text-sm text-ui-fg-base outline-none transition focus:ring-2 focus:ring-ui-fg-interactive md:max-w-xs",
|
|
1180
|
-
children: [
|
|
1181
|
-
/* @__PURE__ */ jsx("option", { value: "all", children: "All (Created by)" }),
|
|
1182
|
-
/* @__PURE__ */ jsx("option", { value: "customer", children: "Customer" }),
|
|
1183
|
-
/* @__PURE__ */ jsx("option", { value: "admin", children: "Admin" })
|
|
1184
|
-
]
|
|
1185
|
-
}
|
|
1186
|
-
),
|
|
1187
|
-
/* @__PURE__ */ jsxs(
|
|
1188
|
-
"select",
|
|
1189
|
-
{
|
|
1190
|
-
value: statusFilter,
|
|
1191
|
-
onChange: (event) => setStatusFilter(event.target.value),
|
|
1192
|
-
className: "h-9 rounded-md border border-ui-border-base bg-transparent px-3 text-sm text-ui-fg-base outline-none transition focus:ring-2 focus:ring-ui-fg-interactive md:max-w-xs",
|
|
1193
|
-
children: [
|
|
1194
|
-
/* @__PURE__ */ jsx("option", { value: "all", children: "All Statuses" }),
|
|
1195
|
-
availableStatuses.map((status) => /* @__PURE__ */ jsx("option", { value: status, children: status.replace(/_/g, " ").toUpperCase() }, status))
|
|
1196
|
-
]
|
|
1197
|
-
}
|
|
1198
|
-
)
|
|
1199
|
-
] })
|
|
1200
|
-
] }),
|
|
1201
|
-
error ? /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-ui-border-strong p-6 text-center", children: [
|
|
1202
|
-
/* @__PURE__ */ jsx(Text, { weight: "plus", className: "text-ui-fg-error", children: error }),
|
|
1203
|
-
/* @__PURE__ */ jsx("div", { className: "mt-4 flex justify-center", children: /* @__PURE__ */ jsx(
|
|
1204
|
-
Button,
|
|
1246
|
+
/* @__PURE__ */ jsx("div", { className: "flex gap-3", children: /* @__PURE__ */ jsxs(
|
|
1247
|
+
"select",
|
|
1205
1248
|
{
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1249
|
+
value: statusFilter,
|
|
1250
|
+
onChange: (e) => setStatusFilter(e.target.value),
|
|
1251
|
+
className: "h-9 rounded-md border border-ui-border-base bg-transparent px-3 text-sm text-ui-fg-base outline-none transition focus:ring-2 focus:ring-ui-fg-interactive md:max-w-xs",
|
|
1252
|
+
"aria-label": "Filter by status",
|
|
1253
|
+
children: [
|
|
1254
|
+
/* @__PURE__ */ jsx("option", { value: "all", children: "All statuses" }),
|
|
1255
|
+
/* @__PURE__ */ jsx("option", { value: "pending", children: "Pending" }),
|
|
1256
|
+
/* @__PURE__ */ jsx("option", { value: "requires_more", children: "Requires more" }),
|
|
1257
|
+
/* @__PURE__ */ jsx("option", { value: "error", children: "Error" }),
|
|
1258
|
+
/* @__PURE__ */ jsx("option", { value: "canceled", children: "Canceled" }),
|
|
1259
|
+
/* @__PURE__ */ jsx("option", { value: "authorized", children: "Authorized" }),
|
|
1260
|
+
/* @__PURE__ */ jsx("option", { value: "captured", children: "Captured" })
|
|
1261
|
+
]
|
|
1209
1262
|
}
|
|
1210
1263
|
) })
|
|
1264
|
+
] }),
|
|
1265
|
+
error ? /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-ui-border-strong p-6 text-center", children: [
|
|
1266
|
+
/* @__PURE__ */ jsx(Text, { weight: "plus", className: "text-ui-fg-error", children: error }),
|
|
1267
|
+
/* @__PURE__ */ jsx("div", { className: "mt-4 flex justify-center", children: /* @__PURE__ */ jsx(Button, { variant: "secondary", onClick: () => loadTransactions(0, true), children: "Try again" }) })
|
|
1211
1268
|
] }) : null,
|
|
1212
|
-
isLoading ? /* @__PURE__ */ jsx("div", { className: "flex justify-center py-16", children: /* @__PURE__ */ jsx(Text, { children: "Loading
|
|
1213
|
-
/* @__PURE__ */ jsx(Heading, { level: "h3", className: "text-xl", children: "No
|
|
1214
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "mt-2 text-ui-fg-subtle", children: "
|
|
1269
|
+
isLoading ? /* @__PURE__ */ jsx("div", { className: "flex justify-center py-16", children: /* @__PURE__ */ jsx(Text, { children: "Loading payments…" }) }) : items.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-dashed border-ui-border-strong p-10 text-center", children: [
|
|
1270
|
+
/* @__PURE__ */ jsx(Heading, { level: "h3", className: "text-xl", children: "No payment transactions yet" }),
|
|
1271
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "mt-2 text-ui-fg-subtle", children: "Payment attempts will appear here." })
|
|
1215
1272
|
] }) : /* @__PURE__ */ jsx("div", { className: "overflow-hidden rounded-xl border border-ui-border-base", children: /* @__PURE__ */ jsxs("table", { className: "min-w-full divide-y divide-ui-border-base", children: [
|
|
1216
1273
|
/* @__PURE__ */ jsx("thead", { className: "bg-ui-bg-subtle", children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
1217
|
-
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Return ID" }),
|
|
1218
1274
|
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Order ID" }),
|
|
1219
|
-
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "
|
|
1275
|
+
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Amount" }),
|
|
1276
|
+
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Provider" }),
|
|
1220
1277
|
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Status" }),
|
|
1221
|
-
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "
|
|
1278
|
+
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Finalized" }),
|
|
1222
1279
|
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Created" }),
|
|
1223
1280
|
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Actions" })
|
|
1224
1281
|
] }) }),
|
|
1225
|
-
/* @__PURE__ */ jsx("tbody", { className: "divide-y divide-ui-border-subtle", children: items.map((
|
|
1282
|
+
/* @__PURE__ */ jsx("tbody", { className: "divide-y divide-ui-border-subtle", children: items.map((t) => /* @__PURE__ */ jsxs(
|
|
1226
1283
|
"tr",
|
|
1227
1284
|
{
|
|
1228
1285
|
className: "hover:bg-ui-bg-subtle/60 cursor-pointer",
|
|
1229
|
-
onClick: () => navigate(`/
|
|
1286
|
+
onClick: () => navigate(`/payments/${t.payment_session_id}`),
|
|
1230
1287
|
children: [
|
|
1231
|
-
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 font-medium text-ui-fg-base", children:
|
|
1232
|
-
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 text-ui-fg-subtle", children:
|
|
1233
|
-
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 text-ui-fg-subtle", children:
|
|
1288
|
+
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 font-medium text-ui-fg-base", children: t.order_id ?? "—" }),
|
|
1289
|
+
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 text-ui-fg-subtle", children: displayAmount(t) }),
|
|
1290
|
+
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 text-ui-fg-subtle", children: t.provider_id }),
|
|
1234
1291
|
/* @__PURE__ */ jsx("td", { className: "px-4 py-4", children: /* @__PURE__ */ jsx(
|
|
1235
1292
|
Badge,
|
|
1236
1293
|
{
|
|
1237
1294
|
size: "2xsmall",
|
|
1238
|
-
className: `uppercase ${getStatusBadgeClass$6(
|
|
1239
|
-
children:
|
|
1295
|
+
className: `uppercase ${getStatusBadgeClass$6(displayStatus(t))}`,
|
|
1296
|
+
children: displayStatus(t) !== "—" ? displayStatus(t).replace(/_/g, " ") : "—"
|
|
1240
1297
|
}
|
|
1241
1298
|
) }),
|
|
1242
|
-
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 text-ui-fg-subtle", children:
|
|
1243
|
-
|
|
1244
|
-
if (amount == null || amount === void 0) {
|
|
1245
|
-
return "—";
|
|
1246
|
-
}
|
|
1247
|
-
const displayAmount = Number(amount) / 100;
|
|
1248
|
-
const currency = returnOrder.currency_code || "$";
|
|
1249
|
-
return `${currency}${displayAmount.toFixed(2)}`;
|
|
1250
|
-
})() }),
|
|
1251
|
-
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 text-ui-fg-subtle", children: new Date(returnOrder.created_at).toLocaleDateString("en-US", {
|
|
1299
|
+
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 text-ui-fg-subtle", children: t.payment_id != null ? "Yes" : "No" }),
|
|
1300
|
+
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 text-ui-fg-subtle", children: new Date(t.created_at).toLocaleDateString("en-US", {
|
|
1252
1301
|
year: "numeric",
|
|
1253
1302
|
month: "short",
|
|
1254
1303
|
day: "numeric",
|
|
@@ -1256,21 +1305,35 @@ const ReturnsPage = () => {
|
|
|
1256
1305
|
minute: "2-digit",
|
|
1257
1306
|
hour12: true
|
|
1258
1307
|
}) }),
|
|
1259
|
-
/* @__PURE__ */
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
e
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1308
|
+
/* @__PURE__ */ jsxs("td", { className: "px-4 py-4", children: [
|
|
1309
|
+
/* @__PURE__ */ jsx(
|
|
1310
|
+
Button,
|
|
1311
|
+
{
|
|
1312
|
+
variant: "transparent",
|
|
1313
|
+
size: "small",
|
|
1314
|
+
onClick: (e) => {
|
|
1315
|
+
e.stopPropagation();
|
|
1316
|
+
navigate(`/payments/${t.payment_session_id}`);
|
|
1317
|
+
},
|
|
1318
|
+
children: "View details"
|
|
1319
|
+
}
|
|
1320
|
+
),
|
|
1321
|
+
t.order_id ? /* @__PURE__ */ jsx(
|
|
1322
|
+
Button,
|
|
1323
|
+
{
|
|
1324
|
+
variant: "transparent",
|
|
1325
|
+
size: "small",
|
|
1326
|
+
onClick: (e) => {
|
|
1327
|
+
e.stopPropagation();
|
|
1328
|
+
navigate(`/orders/${t.order_id}`);
|
|
1329
|
+
},
|
|
1330
|
+
children: "Order"
|
|
1331
|
+
}
|
|
1332
|
+
) : null
|
|
1333
|
+
] })
|
|
1271
1334
|
]
|
|
1272
1335
|
},
|
|
1273
|
-
|
|
1336
|
+
t.payment_session_id
|
|
1274
1337
|
)) })
|
|
1275
1338
|
] }) }),
|
|
1276
1339
|
hasMore ? /* @__PURE__ */ jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ jsx(
|
|
@@ -1278,15 +1341,15 @@ const ReturnsPage = () => {
|
|
|
1278
1341
|
{
|
|
1279
1342
|
variant: "secondary",
|
|
1280
1343
|
isLoading: isFetchingMore,
|
|
1281
|
-
onClick: () =>
|
|
1344
|
+
onClick: () => loadTransactions(offset, false),
|
|
1282
1345
|
children: "Load more"
|
|
1283
1346
|
}
|
|
1284
1347
|
) }) : null
|
|
1285
1348
|
] }) });
|
|
1286
1349
|
};
|
|
1287
1350
|
const config$6 = defineRouteConfig({
|
|
1288
|
-
label: "
|
|
1289
|
-
icon:
|
|
1351
|
+
label: "Payments",
|
|
1352
|
+
icon: CreditCard
|
|
1290
1353
|
});
|
|
1291
1354
|
const useDebounce$1 = (value, delay) => {
|
|
1292
1355
|
const [debouncedValue, setDebouncedValue] = useState(value);
|
|
@@ -1297,275 +1360,212 @@ const useDebounce$1 = (value, delay) => {
|
|
|
1297
1360
|
return debouncedValue;
|
|
1298
1361
|
};
|
|
1299
1362
|
const getStatusBadgeClass$5 = (status) => {
|
|
1300
|
-
const
|
|
1301
|
-
if (
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
if (
|
|
1363
|
+
const statusLower = status.toLowerCase();
|
|
1364
|
+
if (statusLower === "requested") {
|
|
1365
|
+
return "bg-ui-tag-orange-bg text-ui-tag-orange-text";
|
|
1366
|
+
}
|
|
1367
|
+
if (statusLower === "received") {
|
|
1368
|
+
return "bg-ui-tag-blue-bg text-ui-tag-blue-text";
|
|
1369
|
+
}
|
|
1370
|
+
if (statusLower === "requires_action") {
|
|
1371
|
+
return "bg-ui-tag-red-bg text-ui-tag-red-text";
|
|
1372
|
+
}
|
|
1373
|
+
if (statusLower === "completed") {
|
|
1374
|
+
return "bg-ui-tag-green-bg text-ui-tag-green-text";
|
|
1375
|
+
}
|
|
1376
|
+
if (statusLower === "canceled") {
|
|
1377
|
+
return "bg-ui-tag-grey-bg text-ui-tag-grey-text";
|
|
1378
|
+
}
|
|
1305
1379
|
return "bg-ui-tag-purple-bg text-ui-tag-purple-text";
|
|
1306
1380
|
};
|
|
1307
|
-
const
|
|
1381
|
+
const ReturnsPage = () => {
|
|
1308
1382
|
const navigate = useNavigate();
|
|
1309
1383
|
const [items, setItems] = useState([]);
|
|
1310
|
-
const [
|
|
1311
|
-
const
|
|
1312
|
-
const [
|
|
1313
|
-
const
|
|
1314
|
-
const debouncedProvider = useDebounce$1(providerSearch, 300);
|
|
1315
|
-
const [currencySearch, setCurrencySearch] = useState("");
|
|
1316
|
-
const debouncedCurrency = useDebounce$1(currencySearch, 300);
|
|
1317
|
-
const [dateFrom, setDateFrom] = useState("");
|
|
1318
|
-
const [dateTo, setDateTo] = useState("");
|
|
1319
|
-
const [amountMin, setAmountMin] = useState("");
|
|
1320
|
-
const [amountMax, setAmountMax] = useState("");
|
|
1384
|
+
const [statusFilter, setStatusFilter] = useState("all");
|
|
1385
|
+
const [createdByFilter, setCreatedByFilter] = useState("all");
|
|
1386
|
+
const [searchQuery, setSearchQuery] = useState("");
|
|
1387
|
+
const debouncedSearchQuery = useDebounce$1(searchQuery, 300);
|
|
1321
1388
|
const [isLoading, setIsLoading] = useState(true);
|
|
1322
1389
|
const [isFetchingMore, setIsFetchingMore] = useState(false);
|
|
1323
1390
|
const [error, setError] = useState(null);
|
|
1324
1391
|
const [offset, setOffset] = useState(0);
|
|
1325
1392
|
const [count, setCount] = useState(0);
|
|
1326
1393
|
const limit = 50;
|
|
1327
|
-
const
|
|
1328
|
-
async (nextOffset, replace) => {
|
|
1394
|
+
const loadReturns = useCallback(
|
|
1395
|
+
async (nextOffset, replace = false) => {
|
|
1396
|
+
var _a;
|
|
1329
1397
|
try {
|
|
1330
|
-
if (replace)
|
|
1331
|
-
|
|
1398
|
+
if (replace) {
|
|
1399
|
+
setIsLoading(true);
|
|
1400
|
+
} else {
|
|
1401
|
+
setIsFetchingMore(true);
|
|
1402
|
+
}
|
|
1332
1403
|
setError(null);
|
|
1333
1404
|
const params = new URLSearchParams();
|
|
1334
1405
|
params.set("limit", String(limit));
|
|
1335
1406
|
params.set("offset", String(nextOffset));
|
|
1336
|
-
if (
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
if (
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
const response = await fetch(
|
|
1347
|
-
|
|
1348
|
-
|
|
1407
|
+
if (statusFilter !== "all") {
|
|
1408
|
+
params.set("status", statusFilter);
|
|
1409
|
+
}
|
|
1410
|
+
if (debouncedSearchQuery.trim()) {
|
|
1411
|
+
params.set("q", debouncedSearchQuery.trim());
|
|
1412
|
+
}
|
|
1413
|
+
if (createdByFilter !== "all") {
|
|
1414
|
+
params.set("created_by", createdByFilter);
|
|
1415
|
+
}
|
|
1416
|
+
params.set("order", "created_at");
|
|
1417
|
+
const response = await fetch(
|
|
1418
|
+
`/admin/return?${params.toString()}`,
|
|
1419
|
+
{ credentials: "include" }
|
|
1420
|
+
);
|
|
1349
1421
|
if (!response.ok) {
|
|
1350
|
-
const
|
|
1351
|
-
throw new Error(
|
|
1422
|
+
const message = await response.text();
|
|
1423
|
+
throw new Error(message || "Unable to load return orders");
|
|
1352
1424
|
}
|
|
1353
1425
|
const payload = await response.json();
|
|
1354
|
-
const list = payload.refunds ?? [];
|
|
1355
1426
|
setCount(payload.count ?? 0);
|
|
1356
|
-
setOffset(nextOffset +
|
|
1357
|
-
setItems(
|
|
1358
|
-
|
|
1359
|
-
|
|
1427
|
+
setOffset(nextOffset + (((_a = payload.returns) == null ? void 0 : _a.length) ?? 0));
|
|
1428
|
+
setItems(
|
|
1429
|
+
(prev) => replace ? payload.returns ?? [] : [...prev, ...payload.returns ?? []]
|
|
1430
|
+
);
|
|
1431
|
+
} catch (loadError) {
|
|
1432
|
+
const message = loadError instanceof Error ? loadError.message : "Unable to load return orders";
|
|
1433
|
+
setError(message);
|
|
1360
1434
|
} finally {
|
|
1361
1435
|
setIsLoading(false);
|
|
1362
1436
|
setIsFetchingMore(false);
|
|
1363
1437
|
}
|
|
1364
1438
|
},
|
|
1365
|
-
[
|
|
1366
|
-
debouncedOrderId,
|
|
1367
|
-
paymentStatusFilter,
|
|
1368
|
-
debouncedProvider,
|
|
1369
|
-
debouncedCurrency,
|
|
1370
|
-
dateFrom,
|
|
1371
|
-
dateTo,
|
|
1372
|
-
amountMin,
|
|
1373
|
-
amountMax
|
|
1374
|
-
]
|
|
1439
|
+
[statusFilter, createdByFilter, debouncedSearchQuery]
|
|
1375
1440
|
);
|
|
1376
1441
|
useEffect(() => {
|
|
1377
|
-
void
|
|
1378
|
-
}, [
|
|
1442
|
+
void loadReturns(0, true);
|
|
1443
|
+
}, [statusFilter, createdByFilter, debouncedSearchQuery, loadReturns]);
|
|
1379
1444
|
const hasMore = useMemo(() => offset < count, [offset, count]);
|
|
1380
|
-
const
|
|
1381
|
-
const
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
const s2 = r.payment_status ?? "";
|
|
1386
|
-
return s2 !== "" ? s2 : "—";
|
|
1387
|
-
};
|
|
1445
|
+
const availableStatuses = useMemo(() => {
|
|
1446
|
+
const statuses = /* @__PURE__ */ new Set();
|
|
1447
|
+
items.forEach((item) => statuses.add(item.status));
|
|
1448
|
+
return Array.from(statuses).sort();
|
|
1449
|
+
}, [items]);
|
|
1388
1450
|
return /* @__PURE__ */ jsx("div", { className: "w-full p-6", children: /* @__PURE__ */ jsxs(Container, { className: "mx-auto flex w-full max-w-7xl flex-col gap-6 p-6", children: [
|
|
1389
1451
|
/* @__PURE__ */ jsxs("header", { className: "flex flex-col gap-3 md:flex-row md:items-center md:justify-between", children: [
|
|
1390
1452
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
1391
|
-
/* @__PURE__ */ jsx(Heading, { level: "h1", children: "
|
|
1392
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "
|
|
1453
|
+
/* @__PURE__ */ jsx(Heading, { level: "h1", children: "Return Orders" }),
|
|
1454
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "View and manage all customer return orders" })
|
|
1393
1455
|
] }),
|
|
1394
|
-
/* @__PURE__ */ jsx(Button, { variant: "primary", onClick: () =>
|
|
1456
|
+
/* @__PURE__ */ jsx(Button, { variant: "primary", onClick: () => loadReturns(0, true), children: "Refresh" })
|
|
1395
1457
|
] }),
|
|
1396
|
-
/* @__PURE__ */
|
|
1397
|
-
/* @__PURE__ */ jsx(
|
|
1398
|
-
Input,
|
|
1399
|
-
{
|
|
1400
|
-
placeholder: "Order ID",
|
|
1401
|
-
value: orderIdSearch,
|
|
1402
|
-
onChange: (e) => setOrderIdSearch(e.target.value),
|
|
1403
|
-
className: "md:max-w-[180px]",
|
|
1404
|
-
"aria-label": "Filter by order ID"
|
|
1405
|
-
}
|
|
1406
|
-
),
|
|
1407
|
-
/* @__PURE__ */ jsx(
|
|
1408
|
-
Input,
|
|
1409
|
-
{
|
|
1410
|
-
placeholder: "Provider",
|
|
1411
|
-
value: providerSearch,
|
|
1412
|
-
onChange: (e) => setProviderSearch(e.target.value),
|
|
1413
|
-
className: "md:max-w-[140px]",
|
|
1414
|
-
"aria-label": "Filter by provider"
|
|
1415
|
-
}
|
|
1416
|
-
),
|
|
1417
|
-
/* @__PURE__ */ jsx(
|
|
1418
|
-
Input,
|
|
1419
|
-
{
|
|
1420
|
-
placeholder: "Currency",
|
|
1421
|
-
value: currencySearch,
|
|
1422
|
-
onChange: (e) => setCurrencySearch(e.target.value),
|
|
1423
|
-
className: "md:max-w-[100px]",
|
|
1424
|
-
"aria-label": "Filter by currency"
|
|
1425
|
-
}
|
|
1426
|
-
),
|
|
1427
|
-
/* @__PURE__ */ jsxs(
|
|
1428
|
-
"select",
|
|
1429
|
-
{
|
|
1430
|
-
value: paymentStatusFilter,
|
|
1431
|
-
onChange: (e) => setPaymentStatusFilter(e.target.value),
|
|
1432
|
-
className: "h-9 rounded-md border border-ui-border-base bg-transparent px-3 text-sm text-ui-fg-base outline-none transition focus:ring-2 focus:ring-ui-fg-interactive md:max-w-[160px]",
|
|
1433
|
-
"aria-label": "Filter by payment status",
|
|
1434
|
-
children: [
|
|
1435
|
-
/* @__PURE__ */ jsx("option", { value: "all", children: "All statuses" }),
|
|
1436
|
-
/* @__PURE__ */ jsx("option", { value: "pending", children: "Pending" }),
|
|
1437
|
-
/* @__PURE__ */ jsx("option", { value: "requires_more", children: "Requires more" }),
|
|
1438
|
-
/* @__PURE__ */ jsx("option", { value: "error", children: "Error" }),
|
|
1439
|
-
/* @__PURE__ */ jsx("option", { value: "canceled", children: "Canceled" }),
|
|
1440
|
-
/* @__PURE__ */ jsx("option", { value: "authorized", children: "Authorized" }),
|
|
1441
|
-
/* @__PURE__ */ jsx("option", { value: "captured", children: "Captured" })
|
|
1442
|
-
]
|
|
1443
|
-
}
|
|
1444
|
-
),
|
|
1445
|
-
/* @__PURE__ */ jsx(
|
|
1446
|
-
Input,
|
|
1447
|
-
{
|
|
1448
|
-
type: "date",
|
|
1449
|
-
placeholder: "From",
|
|
1450
|
-
value: dateFrom,
|
|
1451
|
-
onChange: (e) => setDateFrom(e.target.value),
|
|
1452
|
-
className: "md:max-w-[140px]",
|
|
1453
|
-
"aria-label": "Date from"
|
|
1454
|
-
}
|
|
1455
|
-
),
|
|
1456
|
-
/* @__PURE__ */ jsx(
|
|
1457
|
-
Input,
|
|
1458
|
-
{
|
|
1459
|
-
type: "date",
|
|
1460
|
-
placeholder: "To",
|
|
1461
|
-
value: dateTo,
|
|
1462
|
-
onChange: (e) => setDateTo(e.target.value),
|
|
1463
|
-
className: "md:max-w-[140px]",
|
|
1464
|
-
"aria-label": "Date to"
|
|
1465
|
-
}
|
|
1466
|
-
),
|
|
1458
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3 md:flex-row md:items-center md:justify-between", children: [
|
|
1467
1459
|
/* @__PURE__ */ jsx(
|
|
1468
1460
|
Input,
|
|
1469
1461
|
{
|
|
1470
|
-
placeholder: "
|
|
1471
|
-
value:
|
|
1472
|
-
onChange: (
|
|
1473
|
-
|
|
1474
|
-
min: 0,
|
|
1475
|
-
className: "md:max-w-[100px]",
|
|
1476
|
-
"aria-label": "Refund amount minimum"
|
|
1462
|
+
placeholder: "Search by return ID, order ID, or customer email",
|
|
1463
|
+
value: searchQuery,
|
|
1464
|
+
onChange: (event) => setSearchQuery(event.target.value),
|
|
1465
|
+
className: "md:max-w-sm"
|
|
1477
1466
|
}
|
|
1478
1467
|
),
|
|
1479
|
-
/* @__PURE__ */
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1468
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-3", children: [
|
|
1469
|
+
/* @__PURE__ */ jsxs(
|
|
1470
|
+
"select",
|
|
1471
|
+
{
|
|
1472
|
+
value: createdByFilter,
|
|
1473
|
+
onChange: (event) => setCreatedByFilter(event.target.value),
|
|
1474
|
+
className: "h-9 rounded-md border border-ui-border-base bg-transparent px-3 text-sm text-ui-fg-base outline-none transition focus:ring-2 focus:ring-ui-fg-interactive md:max-w-xs",
|
|
1475
|
+
children: [
|
|
1476
|
+
/* @__PURE__ */ jsx("option", { value: "all", children: "All (Created by)" }),
|
|
1477
|
+
/* @__PURE__ */ jsx("option", { value: "customer", children: "Customer" }),
|
|
1478
|
+
/* @__PURE__ */ jsx("option", { value: "admin", children: "Admin" })
|
|
1479
|
+
]
|
|
1480
|
+
}
|
|
1481
|
+
),
|
|
1482
|
+
/* @__PURE__ */ jsxs(
|
|
1483
|
+
"select",
|
|
1484
|
+
{
|
|
1485
|
+
value: statusFilter,
|
|
1486
|
+
onChange: (event) => setStatusFilter(event.target.value),
|
|
1487
|
+
className: "h-9 rounded-md border border-ui-border-base bg-transparent px-3 text-sm text-ui-fg-base outline-none transition focus:ring-2 focus:ring-ui-fg-interactive md:max-w-xs",
|
|
1488
|
+
children: [
|
|
1489
|
+
/* @__PURE__ */ jsx("option", { value: "all", children: "All Statuses" }),
|
|
1490
|
+
availableStatuses.map((status) => /* @__PURE__ */ jsx("option", { value: status, children: status.replace(/_/g, " ").toUpperCase() }, status))
|
|
1491
|
+
]
|
|
1492
|
+
}
|
|
1493
|
+
)
|
|
1494
|
+
] })
|
|
1495
|
+
] }),
|
|
1492
1496
|
error ? /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-ui-border-strong p-6 text-center", children: [
|
|
1493
1497
|
/* @__PURE__ */ jsx(Text, { weight: "plus", className: "text-ui-fg-error", children: error }),
|
|
1494
|
-
/* @__PURE__ */ jsx("div", { className: "mt-4 flex justify-center", children: /* @__PURE__ */ jsx(
|
|
1498
|
+
/* @__PURE__ */ jsx("div", { className: "mt-4 flex justify-center", children: /* @__PURE__ */ jsx(
|
|
1499
|
+
Button,
|
|
1500
|
+
{
|
|
1501
|
+
variant: "secondary",
|
|
1502
|
+
onClick: () => loadReturns(0, true),
|
|
1503
|
+
children: "Try again"
|
|
1504
|
+
}
|
|
1505
|
+
) })
|
|
1495
1506
|
] }) : null,
|
|
1496
|
-
isLoading ? /* @__PURE__ */ jsx("div", { className: "flex justify-center py-16", children: /* @__PURE__ */ jsx(Text, { children: "Loading
|
|
1497
|
-
/* @__PURE__ */ jsx(Heading, { level: "h3", className: "text-xl", children: "No
|
|
1498
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "mt-2 text-ui-fg-subtle", children: "
|
|
1499
|
-
] }) : /* @__PURE__ */ jsx("div", { className: "
|
|
1507
|
+
isLoading ? /* @__PURE__ */ jsx("div", { className: "flex justify-center py-16", children: /* @__PURE__ */ jsx(Text, { children: "Loading return orders..." }) }) : items.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-dashed border-ui-border-strong p-10 text-center", children: [
|
|
1508
|
+
/* @__PURE__ */ jsx(Heading, { level: "h3", className: "text-xl", children: "No return orders yet" }),
|
|
1509
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "mt-2 text-ui-fg-subtle", children: "Return orders created by customers will appear here." })
|
|
1510
|
+
] }) : /* @__PURE__ */ jsx("div", { className: "overflow-hidden rounded-xl border border-ui-border-base", children: /* @__PURE__ */ jsxs("table", { className: "min-w-full divide-y divide-ui-border-base", children: [
|
|
1500
1511
|
/* @__PURE__ */ jsx("thead", { className: "bg-ui-bg-subtle", children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
1501
|
-
/* @__PURE__ */ jsx("th", { className: "
|
|
1502
|
-
/* @__PURE__ */ jsx("th", { className: "
|
|
1503
|
-
/* @__PURE__ */ jsx("th", { className: "
|
|
1504
|
-
/* @__PURE__ */ jsx("th", { className: "
|
|
1505
|
-
/* @__PURE__ */ jsx("th", { className: "
|
|
1506
|
-
/* @__PURE__ */ jsx("th", { className: "
|
|
1507
|
-
/* @__PURE__ */ jsx("th", { className: "
|
|
1508
|
-
/* @__PURE__ */ jsx("th", { className: "w-[14%] min-w-0 px-3 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Note" }),
|
|
1509
|
-
/* @__PURE__ */ jsx("th", { className: "w-[11%] min-w-0 px-3 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Created" }),
|
|
1510
|
-
/* @__PURE__ */ jsx("th", { className: "w-[8%] min-w-0 px-3 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Actions" })
|
|
1512
|
+
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Return ID" }),
|
|
1513
|
+
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Order ID" }),
|
|
1514
|
+
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Customer" }),
|
|
1515
|
+
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Status" }),
|
|
1516
|
+
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Refund Amount" }),
|
|
1517
|
+
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Created" }),
|
|
1518
|
+
/* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-ui-fg-muted", children: "Actions" })
|
|
1511
1519
|
] }) }),
|
|
1512
|
-
/* @__PURE__ */ jsx("tbody", { className: "divide-y divide-ui-border-subtle", children: items.map((
|
|
1520
|
+
/* @__PURE__ */ jsx("tbody", { className: "divide-y divide-ui-border-subtle", children: items.map((returnOrder) => /* @__PURE__ */ jsxs(
|
|
1513
1521
|
"tr",
|
|
1514
1522
|
{
|
|
1515
|
-
className: "
|
|
1516
|
-
onClick: () => navigate(`/
|
|
1523
|
+
className: "hover:bg-ui-bg-subtle/60 cursor-pointer",
|
|
1524
|
+
onClick: () => navigate(`/returns/${returnOrder.id}`),
|
|
1517
1525
|
children: [
|
|
1518
|
-
/* @__PURE__ */ jsx("td", { className: "
|
|
1519
|
-
/* @__PURE__ */ jsx("td", { className: "
|
|
1520
|
-
/* @__PURE__ */ jsx("td", { className: "
|
|
1521
|
-
/* @__PURE__ */ jsx("td", { className: "
|
|
1522
|
-
/* @__PURE__ */ jsx("td", { className: "min-w-0 truncate px-3 py-3 text-ui-fg-subtle uppercase", children: r.currency_code || "—" }),
|
|
1523
|
-
/* @__PURE__ */ jsx("td", { className: "min-w-0 truncate px-3 py-3 text-ui-fg-subtle", title: r.provider_id || void 0, children: r.provider_id || "—" }),
|
|
1524
|
-
/* @__PURE__ */ jsx("td", { className: "min-w-0 px-3 py-3", children: /* @__PURE__ */ jsx(
|
|
1526
|
+
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 font-medium text-ui-fg-base", children: /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-0.5", children: /* @__PURE__ */ jsx("span", { children: returnOrder.id }) }) }),
|
|
1527
|
+
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 text-ui-fg-subtle", children: returnOrder.order_id }),
|
|
1528
|
+
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 text-ui-fg-subtle", children: returnOrder.customer_email || returnOrder.order_email || "—" }),
|
|
1529
|
+
/* @__PURE__ */ jsx("td", { className: "px-4 py-4", children: /* @__PURE__ */ jsx(
|
|
1525
1530
|
Badge,
|
|
1526
1531
|
{
|
|
1527
1532
|
size: "2xsmall",
|
|
1528
|
-
className: `uppercase ${getStatusBadgeClass$5(
|
|
1529
|
-
children:
|
|
1533
|
+
className: `uppercase ${getStatusBadgeClass$5(returnOrder.status)}`,
|
|
1534
|
+
children: returnOrder.status.replace(/_/g, " ")
|
|
1530
1535
|
}
|
|
1531
1536
|
) }),
|
|
1532
|
-
/* @__PURE__ */ jsx("td", { className: "
|
|
1533
|
-
|
|
1537
|
+
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 text-ui-fg-subtle", children: (() => {
|
|
1538
|
+
const amount = returnOrder.refund_amount;
|
|
1539
|
+
if (amount == null || amount === void 0) {
|
|
1540
|
+
return "—";
|
|
1541
|
+
}
|
|
1542
|
+
const displayAmount = Number(amount) / 100;
|
|
1543
|
+
const currency = returnOrder.currency_code || "$";
|
|
1544
|
+
return `${currency}${displayAmount.toFixed(2)}`;
|
|
1545
|
+
})() }),
|
|
1546
|
+
/* @__PURE__ */ jsx("td", { className: "px-4 py-4 text-ui-fg-subtle", children: new Date(returnOrder.created_at).toLocaleDateString("en-US", {
|
|
1547
|
+
year: "numeric",
|
|
1534
1548
|
month: "short",
|
|
1535
1549
|
day: "numeric",
|
|
1536
1550
|
hour: "numeric",
|
|
1537
1551
|
minute: "2-digit",
|
|
1538
1552
|
hour12: true
|
|
1539
1553
|
}) }),
|
|
1540
|
-
/* @__PURE__ */ jsx("td", { className: "
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
),
|
|
1553
|
-
r.order_id ? /* @__PURE__ */ jsx(
|
|
1554
|
-
Button,
|
|
1555
|
-
{
|
|
1556
|
-
variant: "transparent",
|
|
1557
|
-
size: "small",
|
|
1558
|
-
onClick: (e) => {
|
|
1559
|
-
e.stopPropagation();
|
|
1560
|
-
navigate(`/orders/${r.order_id}`);
|
|
1561
|
-
},
|
|
1562
|
-
children: "Order"
|
|
1563
|
-
}
|
|
1564
|
-
) : null
|
|
1565
|
-
] }) })
|
|
1554
|
+
/* @__PURE__ */ jsx("td", { className: "px-4 py-4", children: /* @__PURE__ */ jsx(
|
|
1555
|
+
Button,
|
|
1556
|
+
{
|
|
1557
|
+
variant: "transparent",
|
|
1558
|
+
size: "small",
|
|
1559
|
+
onClick: (e) => {
|
|
1560
|
+
e.stopPropagation();
|
|
1561
|
+
navigate(`/app/orders/${returnOrder.order_id}`);
|
|
1562
|
+
},
|
|
1563
|
+
children: "Go to order"
|
|
1564
|
+
}
|
|
1565
|
+
) })
|
|
1566
1566
|
]
|
|
1567
1567
|
},
|
|
1568
|
-
|
|
1568
|
+
returnOrder.id
|
|
1569
1569
|
)) })
|
|
1570
1570
|
] }) }),
|
|
1571
1571
|
hasMore ? /* @__PURE__ */ jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ jsx(
|
|
@@ -1573,15 +1573,15 @@ const RefundsPage = () => {
|
|
|
1573
1573
|
{
|
|
1574
1574
|
variant: "secondary",
|
|
1575
1575
|
isLoading: isFetchingMore,
|
|
1576
|
-
onClick: () =>
|
|
1576
|
+
onClick: () => loadReturns(offset, false),
|
|
1577
1577
|
children: "Load more"
|
|
1578
1578
|
}
|
|
1579
1579
|
) }) : null
|
|
1580
1580
|
] }) });
|
|
1581
1581
|
};
|
|
1582
1582
|
const config$5 = defineRouteConfig({
|
|
1583
|
-
label: "
|
|
1584
|
-
icon:
|
|
1583
|
+
label: "Return Orders",
|
|
1584
|
+
icon: ArrowPath
|
|
1585
1585
|
});
|
|
1586
1586
|
const useDebounce = (value, delay) => {
|
|
1587
1587
|
const [debouncedValue, setDebouncedValue] = useState(value);
|
|
@@ -1809,11 +1809,203 @@ const SwapsPage = () => {
|
|
|
1809
1809
|
) }) : null
|
|
1810
1810
|
] }) });
|
|
1811
1811
|
};
|
|
1812
|
-
const config$4 = defineRouteConfig({
|
|
1813
|
-
label: "Exchanges",
|
|
1814
|
-
icon: ArrowPath
|
|
1812
|
+
const config$4 = defineRouteConfig({
|
|
1813
|
+
label: "Exchanges",
|
|
1814
|
+
icon: ArrowPath
|
|
1815
|
+
});
|
|
1816
|
+
const getStatusBadgeClass$3 = (status) => {
|
|
1817
|
+
const s2 = status.toLowerCase();
|
|
1818
|
+
if (s2 === "captured" || s2 === "completed") return "bg-ui-tag-green-bg text-ui-tag-green-text";
|
|
1819
|
+
if (s2 === "authorized") return "bg-ui-tag-blue-bg text-ui-tag-blue-text";
|
|
1820
|
+
if (s2 === "error" || s2 === "canceled" || s2 === "cancelled") return "bg-ui-tag-red-bg text-ui-tag-red-text";
|
|
1821
|
+
if (s2 === "pending" || s2 === "requires_more") return "bg-ui-tag-orange-bg text-ui-tag-orange-text";
|
|
1822
|
+
return "bg-ui-tag-purple-bg text-ui-tag-purple-text";
|
|
1823
|
+
};
|
|
1824
|
+
const formatAmount = (value) => {
|
|
1825
|
+
return String(value);
|
|
1826
|
+
};
|
|
1827
|
+
const RefundDetailPage = () => {
|
|
1828
|
+
var _a, _b, _c;
|
|
1829
|
+
const navigate = useNavigate();
|
|
1830
|
+
const params = useParams();
|
|
1831
|
+
const id = (_a = params == null ? void 0 : params.id) == null ? void 0 : _a.trim();
|
|
1832
|
+
const [detail, setDetail] = useState(null);
|
|
1833
|
+
const [loading, setLoading] = useState(!!id);
|
|
1834
|
+
const [error, setError] = useState(null);
|
|
1835
|
+
const [gatewayExpanded, setGatewayExpanded] = useState(false);
|
|
1836
|
+
useEffect(() => {
|
|
1837
|
+
if (!id) {
|
|
1838
|
+
setLoading(false);
|
|
1839
|
+
return;
|
|
1840
|
+
}
|
|
1841
|
+
let cancelled = false;
|
|
1842
|
+
setLoading(true);
|
|
1843
|
+
setError(null);
|
|
1844
|
+
fetch(`/admin/refunds/${id}`, { credentials: "include" }).then((res) => {
|
|
1845
|
+
if (!res.ok) throw new Error(res.statusText || "Failed to load");
|
|
1846
|
+
return res.json();
|
|
1847
|
+
}).then((data) => {
|
|
1848
|
+
if (!cancelled) setDetail(data);
|
|
1849
|
+
}).catch((e) => {
|
|
1850
|
+
if (!cancelled) setError(e instanceof Error ? e.message : "Failed to load");
|
|
1851
|
+
}).finally(() => {
|
|
1852
|
+
if (!cancelled) setLoading(false);
|
|
1853
|
+
});
|
|
1854
|
+
return () => {
|
|
1855
|
+
cancelled = true;
|
|
1856
|
+
};
|
|
1857
|
+
}, [id]);
|
|
1858
|
+
const paymentStatus = ((_b = detail == null ? void 0 : detail.payment) == null ? void 0 : _b.status) ?? "—";
|
|
1859
|
+
const hasGatewayData = ((_c = detail == null ? void 0 : detail.payment) == null ? void 0 : _c.payment_data) && typeof detail.payment.payment_data === "object" && Object.keys(detail.payment.payment_data).length > 0;
|
|
1860
|
+
return /* @__PURE__ */ jsx("div", { className: "w-full p-6", children: /* @__PURE__ */ jsxs(Container, { className: "mx-auto flex w-full max-w-4xl flex-col gap-6 p-6", children: [
|
|
1861
|
+
/* @__PURE__ */ jsx("header", { className: "flex flex-col gap-3 md:flex-row md:items-center md:justify-between", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
1862
|
+
/* @__PURE__ */ jsx(Button, { variant: "transparent", size: "small", onClick: () => navigate("/refunds"), children: "← Refunds" }),
|
|
1863
|
+
/* @__PURE__ */ jsx(Heading, { level: "h1", children: "Refund details" }),
|
|
1864
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle font-mono", children: id ?? "—" })
|
|
1865
|
+
] }) }),
|
|
1866
|
+
error ? /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-ui-border-strong p-6 text-center", children: [
|
|
1867
|
+
/* @__PURE__ */ jsx(Text, { weight: "plus", className: "text-ui-fg-error", children: error }),
|
|
1868
|
+
/* @__PURE__ */ jsx(Button, { variant: "secondary", className: "mt-4", onClick: () => navigate("/refunds"), children: "Back to list" })
|
|
1869
|
+
] }) : loading ? /* @__PURE__ */ jsx("div", { className: "flex justify-center py-16", children: /* @__PURE__ */ jsx(Text, { children: "Loading…" }) }) : detail ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6", children: [
|
|
1870
|
+
/* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-ui-border-base p-6", children: [
|
|
1871
|
+
/* @__PURE__ */ jsx(Heading, { level: "h2", className: "text-lg mb-4", children: "Refund summary" }),
|
|
1872
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
1873
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
1874
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Refund ID" }),
|
|
1875
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block font-mono text-sm", children: detail.refund.id })
|
|
1876
|
+
] }),
|
|
1877
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
1878
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Amount" }),
|
|
1879
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: formatAmount(detail.refund.amount) })
|
|
1880
|
+
] }),
|
|
1881
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
1882
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Note" }),
|
|
1883
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: detail.refund.note ?? "—" })
|
|
1884
|
+
] }),
|
|
1885
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
1886
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Created at" }),
|
|
1887
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: new Date(detail.refund.created_at).toLocaleDateString("en-US", {
|
|
1888
|
+
year: "numeric",
|
|
1889
|
+
month: "short",
|
|
1890
|
+
day: "numeric",
|
|
1891
|
+
hour: "numeric",
|
|
1892
|
+
minute: "2-digit",
|
|
1893
|
+
hour12: true
|
|
1894
|
+
}) })
|
|
1895
|
+
] }),
|
|
1896
|
+
detail.refund.created_by ? /* @__PURE__ */ jsxs("div", { children: [
|
|
1897
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Created by" }),
|
|
1898
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block font-mono text-sm", children: detail.refund.created_by })
|
|
1899
|
+
] }) : null
|
|
1900
|
+
] })
|
|
1901
|
+
] }),
|
|
1902
|
+
/* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-ui-border-base p-6", children: [
|
|
1903
|
+
/* @__PURE__ */ jsx(Heading, { level: "h2", className: "text-lg mb-4", children: "Payment summary" }),
|
|
1904
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
1905
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
1906
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Payment amount" }),
|
|
1907
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: formatAmount(detail.payment.payment_amount) })
|
|
1908
|
+
] }),
|
|
1909
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
1910
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Captured amount" }),
|
|
1911
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: formatAmount(detail.payment.captured_amount) })
|
|
1912
|
+
] }),
|
|
1913
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
1914
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Refunded amount" }),
|
|
1915
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: formatAmount(detail.payment.refunded_amount) })
|
|
1916
|
+
] }),
|
|
1917
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
1918
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Provider" }),
|
|
1919
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: detail.payment.provider_id || "—" })
|
|
1920
|
+
] }),
|
|
1921
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
1922
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Status" }),
|
|
1923
|
+
/* @__PURE__ */ jsx("div", { className: "mt-1", children: /* @__PURE__ */ jsx(
|
|
1924
|
+
Badge,
|
|
1925
|
+
{
|
|
1926
|
+
size: "2xsmall",
|
|
1927
|
+
className: `uppercase ${getStatusBadgeClass$3(paymentStatus)}`,
|
|
1928
|
+
children: paymentStatus !== "—" ? paymentStatus.replace(/_/g, " ") : "—"
|
|
1929
|
+
}
|
|
1930
|
+
) })
|
|
1931
|
+
] }),
|
|
1932
|
+
detail.computed ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1933
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
1934
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Full refund" }),
|
|
1935
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: detail.computed.is_full_refund ? "Yes" : "No" })
|
|
1936
|
+
] }),
|
|
1937
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
1938
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Remaining refundable" }),
|
|
1939
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: formatAmount(detail.computed.remaining_refundable_amount) })
|
|
1940
|
+
] }),
|
|
1941
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
1942
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Refund %" }),
|
|
1943
|
+
/* @__PURE__ */ jsxs(Text, { className: "mt-1 block", children: [
|
|
1944
|
+
detail.computed.refund_percentage.toFixed(1),
|
|
1945
|
+
"%"
|
|
1946
|
+
] })
|
|
1947
|
+
] })
|
|
1948
|
+
] }) : null
|
|
1949
|
+
] })
|
|
1950
|
+
] }),
|
|
1951
|
+
/* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-ui-border-base p-6", children: [
|
|
1952
|
+
/* @__PURE__ */ jsx(Heading, { level: "h2", className: "text-lg mb-4", children: "Order summary" }),
|
|
1953
|
+
detail.order ? /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
1954
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
1955
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Order" }),
|
|
1956
|
+
/* @__PURE__ */ jsx("div", { className: "mt-1", children: /* @__PURE__ */ jsx(
|
|
1957
|
+
Button,
|
|
1958
|
+
{
|
|
1959
|
+
variant: "transparent",
|
|
1960
|
+
size: "small",
|
|
1961
|
+
onClick: () => navigate(`/orders/${detail.order.order_id}`),
|
|
1962
|
+
children: detail.order.order_number ?? detail.order.order_id
|
|
1963
|
+
}
|
|
1964
|
+
) })
|
|
1965
|
+
] }),
|
|
1966
|
+
detail.order.total != null ? /* @__PURE__ */ jsxs("div", { children: [
|
|
1967
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Total" }),
|
|
1968
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: formatAmount(detail.order.total) })
|
|
1969
|
+
] }) : null,
|
|
1970
|
+
detail.order.customer_id ? /* @__PURE__ */ jsxs("div", { children: [
|
|
1971
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Customer ID" }),
|
|
1972
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block font-mono text-sm", children: detail.order.customer_id })
|
|
1973
|
+
] }) : null,
|
|
1974
|
+
detail.order.region ? /* @__PURE__ */ jsxs("div", { children: [
|
|
1975
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Region" }),
|
|
1976
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: detail.order.region })
|
|
1977
|
+
] }) : null,
|
|
1978
|
+
detail.order.fulfillment_status ? /* @__PURE__ */ jsxs("div", { children: [
|
|
1979
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Fulfillment status" }),
|
|
1980
|
+
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: detail.order.fulfillment_status })
|
|
1981
|
+
] }) : null
|
|
1982
|
+
] }) : /* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "No order linked to this refund." })
|
|
1983
|
+
] }),
|
|
1984
|
+
/* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-ui-border-base p-6", children: [
|
|
1985
|
+
/* @__PURE__ */ jsxs(
|
|
1986
|
+
"button",
|
|
1987
|
+
{
|
|
1988
|
+
type: "button",
|
|
1989
|
+
className: "flex w-full items-center justify-between text-left",
|
|
1990
|
+
onClick: () => setGatewayExpanded((prev) => !prev),
|
|
1991
|
+
"aria-expanded": gatewayExpanded,
|
|
1992
|
+
"aria-label": gatewayExpanded ? "Collapse gateway data" : "Expand gateway data",
|
|
1993
|
+
children: [
|
|
1994
|
+
/* @__PURE__ */ jsx(Heading, { level: "h2", className: "text-lg", children: "Gateway data" }),
|
|
1995
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: gatewayExpanded ? "Collapse" : "Expand" })
|
|
1996
|
+
]
|
|
1997
|
+
}
|
|
1998
|
+
),
|
|
1999
|
+
gatewayExpanded && /* @__PURE__ */ jsx("div", { className: "mt-4", children: hasGatewayData ? /* @__PURE__ */ jsx("pre", { className: "text-xs bg-ui-bg-subtle p-4 rounded-lg overflow-auto max-h-96", children: JSON.stringify(detail.payment.payment_data, null, 2) }) : /* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "No gateway payload for this payment." }) })
|
|
2000
|
+
] })
|
|
2001
|
+
] }) : null
|
|
2002
|
+
] }) });
|
|
2003
|
+
};
|
|
2004
|
+
const config$3 = defineRouteConfig({
|
|
2005
|
+
label: "Refund details",
|
|
2006
|
+
icon: Receipt
|
|
1815
2007
|
});
|
|
1816
|
-
const getStatusBadgeClass$
|
|
2008
|
+
const getStatusBadgeClass$2 = (status) => {
|
|
1817
2009
|
const s2 = status.toLowerCase();
|
|
1818
2010
|
if (s2 === "captured" || s2 === "completed") return "bg-ui-tag-green-bg text-ui-tag-green-text";
|
|
1819
2011
|
if (s2 === "authorized") return "bg-ui-tag-blue-bg text-ui-tag-blue-text";
|
|
@@ -1892,7 +2084,7 @@ const PaymentDetailPage = () => {
|
|
|
1892
2084
|
Badge,
|
|
1893
2085
|
{
|
|
1894
2086
|
size: "2xsmall",
|
|
1895
|
-
className: `uppercase ${getStatusBadgeClass$
|
|
2087
|
+
className: `uppercase ${getStatusBadgeClass$2(displayStatus)}`,
|
|
1896
2088
|
children: displayStatus !== "—" ? displayStatus.replace(/_/g, " ") : "—"
|
|
1897
2089
|
}
|
|
1898
2090
|
) })
|
|
@@ -1928,11 +2120,11 @@ const PaymentDetailPage = () => {
|
|
|
1928
2120
|
] }) : null
|
|
1929
2121
|
] }) });
|
|
1930
2122
|
};
|
|
1931
|
-
const config$
|
|
2123
|
+
const config$2 = defineRouteConfig({
|
|
1932
2124
|
label: "Payment details",
|
|
1933
2125
|
icon: CreditCard
|
|
1934
2126
|
});
|
|
1935
|
-
const getStatusBadgeClass$
|
|
2127
|
+
const getStatusBadgeClass$1 = (status) => {
|
|
1936
2128
|
const statusLower = status.toLowerCase();
|
|
1937
2129
|
if (statusLower === "requested") {
|
|
1938
2130
|
return "bg-ui-tag-orange-bg text-ui-tag-orange-text";
|
|
@@ -2066,7 +2258,7 @@ const ReturnDetailPage = () => {
|
|
|
2066
2258
|
Badge,
|
|
2067
2259
|
{
|
|
2068
2260
|
size: "small",
|
|
2069
|
-
className: `uppercase ${getStatusBadgeClass$
|
|
2261
|
+
className: `uppercase ${getStatusBadgeClass$1(returnOrder.status)}`,
|
|
2070
2262
|
children: returnOrder.status.replace(/_/g, " ")
|
|
2071
2263
|
}
|
|
2072
2264
|
)
|
|
@@ -2148,7 +2340,7 @@ const ReturnDetailPage = () => {
|
|
|
2148
2340
|
Badge,
|
|
2149
2341
|
{
|
|
2150
2342
|
size: "2xsmall",
|
|
2151
|
-
className: `uppercase ${getStatusBadgeClass$
|
|
2343
|
+
className: `uppercase ${getStatusBadgeClass$1(entry.status)}`,
|
|
2152
2344
|
children: entry.status.replace(/_/g, " ")
|
|
2153
2345
|
}
|
|
2154
2346
|
) }),
|
|
@@ -2206,202 +2398,10 @@ const ReturnDetailPage = () => {
|
|
|
2206
2398
|
updateSuccess && /* @__PURE__ */ jsx("div", { className: "rounded-lg border border-ui-border-success bg-ui-bg-success-subtle p-4", children: /* @__PURE__ */ jsx(Text, { className: "text-ui-fg-success", children: "Action completed successfully" }) })
|
|
2207
2399
|
] }) });
|
|
2208
2400
|
};
|
|
2209
|
-
const config$
|
|
2401
|
+
const config$1 = defineRouteConfig({
|
|
2210
2402
|
label: "Return Order Details",
|
|
2211
2403
|
icon: CheckCircle
|
|
2212
2404
|
});
|
|
2213
|
-
const getStatusBadgeClass$1 = (status) => {
|
|
2214
|
-
const s2 = status.toLowerCase();
|
|
2215
|
-
if (s2 === "captured" || s2 === "completed") return "bg-ui-tag-green-bg text-ui-tag-green-text";
|
|
2216
|
-
if (s2 === "authorized") return "bg-ui-tag-blue-bg text-ui-tag-blue-text";
|
|
2217
|
-
if (s2 === "error" || s2 === "canceled" || s2 === "cancelled") return "bg-ui-tag-red-bg text-ui-tag-red-text";
|
|
2218
|
-
if (s2 === "pending" || s2 === "requires_more") return "bg-ui-tag-orange-bg text-ui-tag-orange-text";
|
|
2219
|
-
return "bg-ui-tag-purple-bg text-ui-tag-purple-text";
|
|
2220
|
-
};
|
|
2221
|
-
const formatAmount = (value) => {
|
|
2222
|
-
return String(value);
|
|
2223
|
-
};
|
|
2224
|
-
const RefundDetailPage = () => {
|
|
2225
|
-
var _a, _b, _c;
|
|
2226
|
-
const navigate = useNavigate();
|
|
2227
|
-
const params = useParams();
|
|
2228
|
-
const id = (_a = params == null ? void 0 : params.id) == null ? void 0 : _a.trim();
|
|
2229
|
-
const [detail, setDetail] = useState(null);
|
|
2230
|
-
const [loading, setLoading] = useState(!!id);
|
|
2231
|
-
const [error, setError] = useState(null);
|
|
2232
|
-
const [gatewayExpanded, setGatewayExpanded] = useState(false);
|
|
2233
|
-
useEffect(() => {
|
|
2234
|
-
if (!id) {
|
|
2235
|
-
setLoading(false);
|
|
2236
|
-
return;
|
|
2237
|
-
}
|
|
2238
|
-
let cancelled = false;
|
|
2239
|
-
setLoading(true);
|
|
2240
|
-
setError(null);
|
|
2241
|
-
fetch(`/admin/refunds/${id}`, { credentials: "include" }).then((res) => {
|
|
2242
|
-
if (!res.ok) throw new Error(res.statusText || "Failed to load");
|
|
2243
|
-
return res.json();
|
|
2244
|
-
}).then((data) => {
|
|
2245
|
-
if (!cancelled) setDetail(data);
|
|
2246
|
-
}).catch((e) => {
|
|
2247
|
-
if (!cancelled) setError(e instanceof Error ? e.message : "Failed to load");
|
|
2248
|
-
}).finally(() => {
|
|
2249
|
-
if (!cancelled) setLoading(false);
|
|
2250
|
-
});
|
|
2251
|
-
return () => {
|
|
2252
|
-
cancelled = true;
|
|
2253
|
-
};
|
|
2254
|
-
}, [id]);
|
|
2255
|
-
const paymentStatus = ((_b = detail == null ? void 0 : detail.payment) == null ? void 0 : _b.status) ?? "—";
|
|
2256
|
-
const hasGatewayData = ((_c = detail == null ? void 0 : detail.payment) == null ? void 0 : _c.payment_data) && typeof detail.payment.payment_data === "object" && Object.keys(detail.payment.payment_data).length > 0;
|
|
2257
|
-
return /* @__PURE__ */ jsx("div", { className: "w-full p-6", children: /* @__PURE__ */ jsxs(Container, { className: "mx-auto flex w-full max-w-4xl flex-col gap-6 p-6", children: [
|
|
2258
|
-
/* @__PURE__ */ jsx("header", { className: "flex flex-col gap-3 md:flex-row md:items-center md:justify-between", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
2259
|
-
/* @__PURE__ */ jsx(Button, { variant: "transparent", size: "small", onClick: () => navigate("/refunds"), children: "← Refunds" }),
|
|
2260
|
-
/* @__PURE__ */ jsx(Heading, { level: "h1", children: "Refund details" }),
|
|
2261
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle font-mono", children: id ?? "—" })
|
|
2262
|
-
] }) }),
|
|
2263
|
-
error ? /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-ui-border-strong p-6 text-center", children: [
|
|
2264
|
-
/* @__PURE__ */ jsx(Text, { weight: "plus", className: "text-ui-fg-error", children: error }),
|
|
2265
|
-
/* @__PURE__ */ jsx(Button, { variant: "secondary", className: "mt-4", onClick: () => navigate("/refunds"), children: "Back to list" })
|
|
2266
|
-
] }) : loading ? /* @__PURE__ */ jsx("div", { className: "flex justify-center py-16", children: /* @__PURE__ */ jsx(Text, { children: "Loading…" }) }) : detail ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6", children: [
|
|
2267
|
-
/* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-ui-border-base p-6", children: [
|
|
2268
|
-
/* @__PURE__ */ jsx(Heading, { level: "h2", className: "text-lg mb-4", children: "Refund summary" }),
|
|
2269
|
-
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
2270
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2271
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Refund ID" }),
|
|
2272
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block font-mono text-sm", children: detail.refund.id })
|
|
2273
|
-
] }),
|
|
2274
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2275
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Amount" }),
|
|
2276
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: formatAmount(detail.refund.amount) })
|
|
2277
|
-
] }),
|
|
2278
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2279
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Note" }),
|
|
2280
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: detail.refund.note ?? "—" })
|
|
2281
|
-
] }),
|
|
2282
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2283
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Created at" }),
|
|
2284
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: new Date(detail.refund.created_at).toLocaleDateString("en-US", {
|
|
2285
|
-
year: "numeric",
|
|
2286
|
-
month: "short",
|
|
2287
|
-
day: "numeric",
|
|
2288
|
-
hour: "numeric",
|
|
2289
|
-
minute: "2-digit",
|
|
2290
|
-
hour12: true
|
|
2291
|
-
}) })
|
|
2292
|
-
] }),
|
|
2293
|
-
detail.refund.created_by ? /* @__PURE__ */ jsxs("div", { children: [
|
|
2294
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Created by" }),
|
|
2295
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block font-mono text-sm", children: detail.refund.created_by })
|
|
2296
|
-
] }) : null
|
|
2297
|
-
] })
|
|
2298
|
-
] }),
|
|
2299
|
-
/* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-ui-border-base p-6", children: [
|
|
2300
|
-
/* @__PURE__ */ jsx(Heading, { level: "h2", className: "text-lg mb-4", children: "Payment summary" }),
|
|
2301
|
-
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
2302
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2303
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Payment amount" }),
|
|
2304
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: formatAmount(detail.payment.payment_amount) })
|
|
2305
|
-
] }),
|
|
2306
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2307
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Captured amount" }),
|
|
2308
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: formatAmount(detail.payment.captured_amount) })
|
|
2309
|
-
] }),
|
|
2310
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2311
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Refunded amount" }),
|
|
2312
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: formatAmount(detail.payment.refunded_amount) })
|
|
2313
|
-
] }),
|
|
2314
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2315
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Provider" }),
|
|
2316
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: detail.payment.provider_id || "—" })
|
|
2317
|
-
] }),
|
|
2318
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2319
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Status" }),
|
|
2320
|
-
/* @__PURE__ */ jsx("div", { className: "mt-1", children: /* @__PURE__ */ jsx(
|
|
2321
|
-
Badge,
|
|
2322
|
-
{
|
|
2323
|
-
size: "2xsmall",
|
|
2324
|
-
className: `uppercase ${getStatusBadgeClass$1(paymentStatus)}`,
|
|
2325
|
-
children: paymentStatus !== "—" ? paymentStatus.replace(/_/g, " ") : "—"
|
|
2326
|
-
}
|
|
2327
|
-
) })
|
|
2328
|
-
] }),
|
|
2329
|
-
detail.computed ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2330
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2331
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Full refund" }),
|
|
2332
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: detail.computed.is_full_refund ? "Yes" : "No" })
|
|
2333
|
-
] }),
|
|
2334
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2335
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Remaining refundable" }),
|
|
2336
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: formatAmount(detail.computed.remaining_refundable_amount) })
|
|
2337
|
-
] }),
|
|
2338
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2339
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Refund %" }),
|
|
2340
|
-
/* @__PURE__ */ jsxs(Text, { className: "mt-1 block", children: [
|
|
2341
|
-
detail.computed.refund_percentage.toFixed(1),
|
|
2342
|
-
"%"
|
|
2343
|
-
] })
|
|
2344
|
-
] })
|
|
2345
|
-
] }) : null
|
|
2346
|
-
] })
|
|
2347
|
-
] }),
|
|
2348
|
-
/* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-ui-border-base p-6", children: [
|
|
2349
|
-
/* @__PURE__ */ jsx(Heading, { level: "h2", className: "text-lg mb-4", children: "Order summary" }),
|
|
2350
|
-
detail.order ? /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
2351
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2352
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Order" }),
|
|
2353
|
-
/* @__PURE__ */ jsx("div", { className: "mt-1", children: /* @__PURE__ */ jsx(
|
|
2354
|
-
Button,
|
|
2355
|
-
{
|
|
2356
|
-
variant: "transparent",
|
|
2357
|
-
size: "small",
|
|
2358
|
-
onClick: () => navigate(`/orders/${detail.order.order_id}`),
|
|
2359
|
-
children: detail.order.order_number ?? detail.order.order_id
|
|
2360
|
-
}
|
|
2361
|
-
) })
|
|
2362
|
-
] }),
|
|
2363
|
-
detail.order.total != null ? /* @__PURE__ */ jsxs("div", { children: [
|
|
2364
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Total" }),
|
|
2365
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: formatAmount(detail.order.total) })
|
|
2366
|
-
] }) : null,
|
|
2367
|
-
detail.order.customer_id ? /* @__PURE__ */ jsxs("div", { children: [
|
|
2368
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Customer ID" }),
|
|
2369
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block font-mono text-sm", children: detail.order.customer_id })
|
|
2370
|
-
] }) : null,
|
|
2371
|
-
detail.order.region ? /* @__PURE__ */ jsxs("div", { children: [
|
|
2372
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Region" }),
|
|
2373
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: detail.order.region })
|
|
2374
|
-
] }) : null,
|
|
2375
|
-
detail.order.fulfillment_status ? /* @__PURE__ */ jsxs("div", { children: [
|
|
2376
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "Fulfillment status" }),
|
|
2377
|
-
/* @__PURE__ */ jsx(Text, { className: "mt-1 block", children: detail.order.fulfillment_status })
|
|
2378
|
-
] }) : null
|
|
2379
|
-
] }) : /* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "No order linked to this refund." })
|
|
2380
|
-
] }),
|
|
2381
|
-
/* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-ui-border-base p-6", children: [
|
|
2382
|
-
/* @__PURE__ */ jsxs(
|
|
2383
|
-
"button",
|
|
2384
|
-
{
|
|
2385
|
-
type: "button",
|
|
2386
|
-
className: "flex w-full items-center justify-between text-left",
|
|
2387
|
-
onClick: () => setGatewayExpanded((prev) => !prev),
|
|
2388
|
-
"aria-expanded": gatewayExpanded,
|
|
2389
|
-
"aria-label": gatewayExpanded ? "Collapse gateway data" : "Expand gateway data",
|
|
2390
|
-
children: [
|
|
2391
|
-
/* @__PURE__ */ jsx(Heading, { level: "h2", className: "text-lg", children: "Gateway data" }),
|
|
2392
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: gatewayExpanded ? "Collapse" : "Expand" })
|
|
2393
|
-
]
|
|
2394
|
-
}
|
|
2395
|
-
),
|
|
2396
|
-
gatewayExpanded && /* @__PURE__ */ jsx("div", { className: "mt-4", children: hasGatewayData ? /* @__PURE__ */ jsx("pre", { className: "text-xs bg-ui-bg-subtle p-4 rounded-lg overflow-auto max-h-96", children: JSON.stringify(detail.payment.payment_data, null, 2) }) : /* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-muted", children: "No gateway payload for this payment." }) })
|
|
2397
|
-
] })
|
|
2398
|
-
] }) : null
|
|
2399
|
-
] }) });
|
|
2400
|
-
};
|
|
2401
|
-
const config$1 = defineRouteConfig({
|
|
2402
|
-
label: "Refund details",
|
|
2403
|
-
icon: Receipt
|
|
2404
|
-
});
|
|
2405
2405
|
const getStatusBadgeClass = (status) => {
|
|
2406
2406
|
const statusLower = status.toLowerCase();
|
|
2407
2407
|
if (statusLower === "requested") {
|
|
@@ -2694,6 +2694,10 @@ const widgetModule = { widgets: [
|
|
|
2694
2694
|
] };
|
|
2695
2695
|
const routeModule = {
|
|
2696
2696
|
routes: [
|
|
2697
|
+
{
|
|
2698
|
+
Component: RefundsPage,
|
|
2699
|
+
path: "/refunds"
|
|
2700
|
+
},
|
|
2697
2701
|
{
|
|
2698
2702
|
Component: PaymentsPage,
|
|
2699
2703
|
path: "/payments"
|
|
@@ -2702,14 +2706,14 @@ const routeModule = {
|
|
|
2702
2706
|
Component: ReturnsPage,
|
|
2703
2707
|
path: "/returns"
|
|
2704
2708
|
},
|
|
2705
|
-
{
|
|
2706
|
-
Component: RefundsPage,
|
|
2707
|
-
path: "/refunds"
|
|
2708
|
-
},
|
|
2709
2709
|
{
|
|
2710
2710
|
Component: SwapsPage,
|
|
2711
2711
|
path: "/swaps"
|
|
2712
2712
|
},
|
|
2713
|
+
{
|
|
2714
|
+
Component: RefundDetailPage,
|
|
2715
|
+
path: "/refunds/:id"
|
|
2716
|
+
},
|
|
2713
2717
|
{
|
|
2714
2718
|
Component: PaymentDetailPage,
|
|
2715
2719
|
path: "/payments/:id"
|
|
@@ -2718,10 +2722,6 @@ const routeModule = {
|
|
|
2718
2722
|
Component: ReturnDetailPage,
|
|
2719
2723
|
path: "/returns/:id"
|
|
2720
2724
|
},
|
|
2721
|
-
{
|
|
2722
|
-
Component: RefundDetailPage,
|
|
2723
|
-
path: "/refunds/:id"
|
|
2724
|
-
},
|
|
2725
2725
|
{
|
|
2726
2726
|
Component: SwapDetailPage,
|
|
2727
2727
|
path: "/swaps/:id"
|
|
@@ -2731,20 +2731,20 @@ const routeModule = {
|
|
|
2731
2731
|
const menuItemModule = {
|
|
2732
2732
|
menuItems: [
|
|
2733
2733
|
{
|
|
2734
|
-
label: config$
|
|
2735
|
-
icon: config$
|
|
2734
|
+
label: config$6.label,
|
|
2735
|
+
icon: config$6.icon,
|
|
2736
2736
|
path: "/payments",
|
|
2737
2737
|
nested: void 0
|
|
2738
2738
|
},
|
|
2739
2739
|
{
|
|
2740
|
-
label: config$
|
|
2741
|
-
icon: config$
|
|
2740
|
+
label: config$7.label,
|
|
2741
|
+
icon: config$7.icon,
|
|
2742
2742
|
path: "/refunds",
|
|
2743
2743
|
nested: void 0
|
|
2744
2744
|
},
|
|
2745
2745
|
{
|
|
2746
|
-
label: config$
|
|
2747
|
-
icon: config$
|
|
2746
|
+
label: config$5.label,
|
|
2747
|
+
icon: config$5.icon,
|
|
2748
2748
|
path: "/returns",
|
|
2749
2749
|
nested: void 0
|
|
2750
2750
|
},
|
|
@@ -2757,19 +2757,13 @@ const menuItemModule = {
|
|
|
2757
2757
|
{
|
|
2758
2758
|
label: config$3.label,
|
|
2759
2759
|
icon: config$3.icon,
|
|
2760
|
-
path: "/payments/:id",
|
|
2761
|
-
nested: void 0
|
|
2762
|
-
},
|
|
2763
|
-
{
|
|
2764
|
-
label: config$1.label,
|
|
2765
|
-
icon: config$1.icon,
|
|
2766
2760
|
path: "/refunds/:id",
|
|
2767
2761
|
nested: void 0
|
|
2768
2762
|
},
|
|
2769
2763
|
{
|
|
2770
2764
|
label: config$2.label,
|
|
2771
2765
|
icon: config$2.icon,
|
|
2772
|
-
path: "/
|
|
2766
|
+
path: "/payments/:id",
|
|
2773
2767
|
nested: void 0
|
|
2774
2768
|
},
|
|
2775
2769
|
{
|
|
@@ -2777,6 +2771,12 @@ const menuItemModule = {
|
|
|
2777
2771
|
icon: config.icon,
|
|
2778
2772
|
path: "/swaps/:id",
|
|
2779
2773
|
nested: void 0
|
|
2774
|
+
},
|
|
2775
|
+
{
|
|
2776
|
+
label: config$1.label,
|
|
2777
|
+
icon: config$1.icon,
|
|
2778
|
+
path: "/returns/:id",
|
|
2779
|
+
nested: void 0
|
|
2780
2780
|
}
|
|
2781
2781
|
]
|
|
2782
2782
|
};
|