Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Add Returns, Exchanges and Claims pages to the dashboard

Damian Legawieca79320103650
diff --git a/packages/dashboard-starter/src/routeTree.gen.ts b/packages/dashboard-starter/src/routeTree.gen.ts
index 67263aaff1..4afcb968cb 100644
--- a/packages/dashboard-starter/src/routeTree.gen.ts
+++ b/packages/dashboard-starter/src/routeTree.gen.ts
@@ -18,7 +18,10 @@ import { Route as acceptInvitationDotinvitationIdRouteImport } from './../../das
import { Route as authenticatedStoreIdRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId'
import { Route as IndexRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/index'
import { Route as SettingsRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/settings'
+import { Route as ReturnsRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/returns'
import { Route as GettingStartedRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/getting-started'
+import { Route as ExchangesRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/exchanges'
+import { Route as ClaimsRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/claims'
import { Route as SplatRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/$'
import { Route as SettingsIndexRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/settings/index'
import { Route as PromotionsIndexRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/promotions/index'
@@ -109,11 +112,26 @@ const SettingsRoute = SettingsRouteImport.update({
path: '/settings',
getParentRoute: () => authenticatedStoreIdRoute,
} as any)
+const ReturnsRoute = ReturnsRouteImport.update({
+ id: '/returns',
+ path: '/returns',
+ getParentRoute: () => authenticatedStoreIdRoute,
+} as any)
const GettingStartedRoute = GettingStartedRouteImport.update({
id: '/getting-started',
path: '/getting-started',
getParentRoute: () => authenticatedStoreIdRoute,
} as any)
+const ExchangesRoute = ExchangesRouteImport.update({
+ id: '/exchanges',
+ path: '/exchanges',
+ getParentRoute: () => authenticatedStoreIdRoute,
+} as any)
+const ClaimsRoute = ClaimsRouteImport.update({
+ id: '/claims',
+ path: '/claims',
+ getParentRoute: () => authenticatedStoreIdRoute,
+} as any)
const SplatRoute = SplatRouteImport.update({
id: '/$',
path: '/$',
@@ -347,7 +365,10 @@ export interface FileRoutesByFullPath {
'/$storeId': typeof authenticatedStoreIdRouteWithChildren
'/accept-invitation/$invitationId': typeof acceptInvitationDotinvitationIdRoute
'/$storeId/$': typeof SplatRoute
+ '/$storeId/claims': typeof ClaimsRoute
+ '/$storeId/exchanges': typeof ExchangesRoute
'/$storeId/getting-started': typeof GettingStartedRoute
+ '/$storeId/returns': typeof ReturnsRoute
'/$storeId/settings': typeof SettingsRouteWithChildren
'/$storeId/': typeof IndexRoute
'/$storeId/brands/$brandId': typeof BrandsDotbrandIdRoute
@@ -401,7 +422,10 @@ export interface FileRoutesByTo {
'/accept-invitation/$invitationId': typeof acceptInvitationDotinvitationIdRoute
'/': typeof authenticatedIndexRoute
'/$storeId/$': typeof SplatRoute
+ '/$storeId/claims': typeof ClaimsRoute
+ '/$storeId/exchanges': typeof ExchangesRoute
'/$storeId/getting-started': typeof GettingStartedRoute
+ '/$storeId/returns': typeof ReturnsRoute
'/$storeId': typeof IndexRoute
'/$storeId/brands/$brandId': typeof BrandsDotbrandIdRoute
'/$storeId/customers/$customerId': typeof CustomersCustomerIdRoute
@@ -457,7 +481,10 @@ export interface FileRoutesById {
'/accept-invitation/$invitationId': typeof acceptInvitationDotinvitationIdRoute
'/_authenticated/': typeof authenticatedIndexRoute
'/_authenticated/$storeId/$': typeof SplatRoute
+ '/_authenticated/$storeId/claims': typeof ClaimsRoute
+ '/_authenticated/$storeId/exchanges': typeof ExchangesRoute
'/_authenticated/$storeId/getting-started': typeof GettingStartedRoute
+ '/_authenticated/$storeId/returns': typeof ReturnsRoute
'/_authenticated/$storeId/settings': typeof SettingsRouteWithChildren
'/_authenticated/$storeId/': typeof IndexRoute
'/_authenticated/$storeId/brands/$brandId': typeof BrandsDotbrandIdRoute
@@ -514,7 +541,10 @@ export interface FileRouteTypes {
| '/$storeId'
| '/accept-invitation/$invitationId'
| '/$storeId/$'
+ | '/$storeId/claims'
+ | '/$storeId/exchanges'
| '/$storeId/getting-started'
+ | '/$storeId/returns'
| '/$storeId/settings'
| '/$storeId/'
| '/$storeId/brands/$brandId'
@@ -568,7 +598,10 @@ export interface FileRouteTypes {
| '/accept-invitation/$invitationId'
| '/'
| '/$storeId/$'
+ | '/$storeId/claims'
+ | '/$storeId/exchanges'
| '/$storeId/getting-started'
+ | '/$storeId/returns'
| '/$storeId'
| '/$storeId/brands/$brandId'
| '/$storeId/customers/$customerId'
@@ -623,7 +656,10 @@ export interface FileRouteTypes {
| '/accept-invitation/$invitationId'
| '/_authenticated/'
| '/_authenticated/$storeId/$'
+ | '/_authenticated/$storeId/claims'
+ | '/_authenticated/$storeId/exchanges'
| '/_authenticated/$storeId/getting-started'
+ | '/_authenticated/$storeId/returns'
| '/_authenticated/$storeId/settings'
| '/_authenticated/$storeId/'
| '/_authenticated/$storeId/brands/$brandId'
@@ -744,6 +780,13 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof SettingsRouteImport
parentRoute: typeof authenticatedStoreIdRoute
}
+ '/_authenticated/$storeId/returns': {
+ id: '/_authenticated/$storeId/returns'
+ path: '/returns'
+ fullPath: '/$storeId/returns'
+ preLoaderRoute: typeof ReturnsRouteImport
+ parentRoute: typeof authenticatedStoreIdRoute
+ }
'/_authenticated/$storeId/getting-started': {
id: '/_authenticated/$storeId/getting-started'
path: '/getting-started'
@@ -751,6 +794,20 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof GettingStartedRouteImport
parentRoute: typeof authenticatedStoreIdRoute
}
+ '/_authenticated/$storeId/exchanges': {
+ id: '/_authenticated/$storeId/exchanges'
+ path: '/exchanges'
+ fullPath: '/$storeId/exchanges'
+ preLoaderRoute: typeof ExchangesRouteImport
+ parentRoute: typeof authenticatedStoreIdRoute
+ }
+ '/_authenticated/$storeId/claims': {
+ id: '/_authenticated/$storeId/claims'
+ path: '/claims'
+ fullPath: '/$storeId/claims'
+ preLoaderRoute: typeof ClaimsRouteImport
+ parentRoute: typeof authenticatedStoreIdRoute
+ }
'/_authenticated/$storeId/$': {
id: '/_authenticated/$storeId/$'
path: '/$'
@@ -1113,7 +1170,10 @@ const SettingsRouteWithChildren = SettingsRoute._addFileChildren(
interface authenticatedStoreIdRouteChildren {
SplatRoute: typeof SplatRoute
+ ClaimsRoute: typeof ClaimsRoute
+ ExchangesRoute: typeof ExchangesRoute
GettingStartedRoute: typeof GettingStartedRoute
+ ReturnsRoute: typeof ReturnsRoute
SettingsRoute: typeof SettingsRouteWithChildren
IndexRoute: typeof IndexRoute
BrandsDotbrandIdRoute: typeof BrandsDotbrandIdRoute
@@ -1144,7 +1204,10 @@ interface authenticatedStoreIdRouteChildren {
const authenticatedStoreIdRouteChildren: authenticatedStoreIdRouteChildren = {
SplatRoute: SplatRoute,
+ ClaimsRoute: ClaimsRoute,
+ ExchangesRoute: ExchangesRoute,
GettingStartedRoute: GettingStartedRoute,
+ ReturnsRoute: ReturnsRoute,
SettingsRoute: SettingsRouteWithChildren,
IndexRoute: IndexRoute,
BrandsDotbrandIdRoute: BrandsDotbrandIdRoute,
diff --git a/packages/dashboard/src/locales/ar.json b/packages/dashboard/src/locales/ar.json
index 2e80c914eb..bd2c3760e6 100644
--- a/packages/dashboard/src/locales/ar.json
+++ b/packages/dashboard/src/locales/ar.json
@@ -1291,9 +1291,11 @@
"nav": {
"account": "الحساب",
"categories": "الفئات",
+ "claims": "المطالبات",
"customer_groups": "المجموعات",
"customers": "العملاء",
"draft_orders": "مسودات الطلبات",
+ "exchanges": "الاستبدالات",
"getting_started": "البدء",
"gift_cards": "بطاقات الهدايا",
"home": "الرئيسية",
@@ -1303,6 +1305,7 @@
"products": "المنتجات",
"promotions": "العروض الترويجية",
"reports": "التقارير",
+ "returns": "المرتجعات",
"settings": "الإعدادات",
"transfers": "التحويلات"
},
@@ -2346,6 +2349,23 @@
},
"title": "Payment Methods"
},
+ "post_sale": {
+ "search_placeholder": "البحث بالرقم…",
+ "returns_empty": "لا توجد مرتجعات بعد.",
+ "exchanges_empty": "لا توجد استبدالات بعد.",
+ "claims_empty": "لا توجد مطالبات بعد.",
+ "statuses": {
+ "requested": "مطلوب",
+ "open": "مفتوحة",
+ "approved": "تمت الموافقة",
+ "received": "تم الاستلام",
+ "refunded": "تم الاسترداد",
+ "fulfilled": "تم الشحن",
+ "resolved": "تم الحل",
+ "denied": "مرفوضة",
+ "canceled": "ملغى"
+ }
+ },
"preferences": {
"additional_item": "Additional Item Cost",
"amount": "كمية",
diff --git a/packages/dashboard/src/locales/de.json b/packages/dashboard/src/locales/de.json
index d62cebc3aa..8c43d14c45 100644
--- a/packages/dashboard/src/locales/de.json
+++ b/packages/dashboard/src/locales/de.json
@@ -1291,9 +1291,11 @@
"nav": {
"account": "Konto",
"categories": "Kategorien",
+ "claims": "Reklamationen",
"customer_groups": "Gruppen",
"customers": "Kunden",
"draft_orders": "Bestellentwürfe",
+ "exchanges": "Umtausch",
"getting_started": "Erste Schritte",
"gift_cards": "Geschenkkarten",
"home": "Startseite",
@@ -1303,6 +1305,7 @@
"products": "Produkte",
"promotions": "Aktionen",
"reports": "Berichte",
+ "returns": "Retouren",
"settings": "Einstellungen",
"transfers": "Umlagerungen"
},
@@ -2346,6 +2349,23 @@
},
"title": "Zahlungsarten"
},
+ "post_sale": {
+ "search_placeholder": "Nach Nummer suchen…",
+ "returns_empty": "Noch keine Retouren.",
+ "exchanges_empty": "Noch kein Umtausch.",
+ "claims_empty": "Noch keine Reklamationen.",
+ "statuses": {
+ "requested": "Angefragt",
+ "open": "Offen",
+ "approved": "Genehmigt",
+ "received": "Erhalten",
+ "refunded": "Erstattet",
+ "fulfilled": "Versandt",
+ "resolved": "Gelöst",
+ "denied": "Abgelehnt",
+ "canceled": "Storniert"
+ }
+ },
"preferences": {
"additional_item": "Kosten für jeden weiteren Artikel",
"amount": "Betrag",
diff --git a/packages/dashboard/src/locales/en.json b/packages/dashboard/src/locales/en.json
index 2535768347..df15df05bb 100644
--- a/packages/dashboard/src/locales/en.json
+++ b/packages/dashboard/src/locales/en.json
@@ -1291,9 +1291,11 @@
"nav": {
"account": "Account",
"categories": "Categories",
+ "claims": "Claims",
"customer_groups": "Groups",
"customers": "Customers",
"draft_orders": "Draft Orders",
+ "exchanges": "Exchanges",
"getting_started": "Getting Started",
"gift_cards": "Gift Cards",
"home": "Home",
@@ -1303,6 +1305,7 @@
"products": "Products",
"promotions": "Promotions",
"reports": "Reports",
+ "returns": "Returns",
"settings": "Settings",
"transfers": "Transfers"
},
@@ -2346,6 +2349,23 @@
},
"title": "Payment Methods"
},
+ "post_sale": {
+ "search_placeholder": "Search by number…",
+ "returns_empty": "No returns yet.",
+ "exchanges_empty": "No exchanges yet.",
+ "claims_empty": "No claims yet.",
+ "statuses": {
+ "requested": "Requested",
+ "open": "Open",
+ "approved": "Approved",
+ "received": "Received",
+ "refunded": "Refunded",
+ "fulfilled": "Fulfilled",
+ "resolved": "Resolved",
+ "denied": "Denied",
+ "canceled": "Canceled"
+ }
+ },
"preferences": {
"additional_item": "Additional Item Cost",
"amount": "Amount",
diff --git a/packages/dashboard/src/locales/fr.json b/packages/dashboard/src/locales/fr.json
index 99080aed82..1f133f27ff 100644
--- a/packages/dashboard/src/locales/fr.json
+++ b/packages/dashboard/src/locales/fr.json
@@ -1291,9 +1291,11 @@
"nav": {
"account": "Compte",
"categories": "Catégories",
+ "claims": "Réclamations",
"customer_groups": "Groupes",
"customers": "Clients",
"draft_orders": "Commandes provisoires",
+ "exchanges": "Échanges",
"getting_started": "Premiers pas",
"gift_cards": "Cartes cadeaux",
"home": "Accueil",
@@ -1303,6 +1305,7 @@
"products": "Produits",
"promotions": "Promotions",
"reports": "Rapports",
+ "returns": "Retours",
"settings": "Paramètres",
"transfers": "Transferts"
},
@@ -2346,6 +2349,23 @@
},
"title": "Moyens de paiement"
},
+ "post_sale": {
+ "search_placeholder": "Rechercher par numéro…",
+ "returns_empty": "Aucun retour pour l’instant.",
+ "exchanges_empty": "Aucun échange pour l’instant.",
+ "claims_empty": "Aucune réclamation pour l’instant.",
+ "statuses": {
+ "requested": "Demandé",
+ "open": "Ouvert",
+ "approved": "Approuvé",
+ "received": "Reçu",
+ "refunded": "Remboursé",
+ "fulfilled": "Expédié",
+ "resolved": "Résolu",
+ "denied": "Refusé",
+ "canceled": "Annulé"
+ }
+ },
"preferences": {
"additional_item": "Coût de chaque article supplémentaire",
"amount": "Montant",
diff --git a/packages/dashboard/src/locales/pl.json b/packages/dashboard/src/locales/pl.json
index 4e134b5306..cd763adc62 100644
--- a/packages/dashboard/src/locales/pl.json
+++ b/packages/dashboard/src/locales/pl.json
@@ -1295,9 +1295,11 @@
"nav": {
"account": "Konto",
"categories": "Kategorie",
+ "claims": "Reklamacje",
"customer_groups": "Grupy",
"customers": "Klienci",
"draft_orders": "Zamówienia robocze",
+ "exchanges": "Wymiany",
"getting_started": "Pierwsze kroki",
"gift_cards": "Karty podarunkowe",
"home": "Strona główna",
@@ -1307,6 +1309,7 @@
"products": "Produkty",
"promotions": "Promocje",
"reports": "Raporty",
+ "returns": "Zwroty",
"settings": "Ustawienia",
"transfers": "Transfery"
},
@@ -2374,6 +2377,23 @@
},
"title": "Metody płatności"
},
+ "post_sale": {
+ "search_placeholder": "Szukaj po numerze…",
+ "returns_empty": "Brak zwrotów.",
+ "exchanges_empty": "Brak wymian.",
+ "claims_empty": "Brak reklamacji.",
+ "statuses": {
+ "requested": "Zgłoszony",
+ "open": "Otwarta",
+ "approved": "Zatwierdzony",
+ "received": "Otrzymany",
+ "refunded": "Zwrócony",
+ "fulfilled": "Wysłany",
+ "resolved": "Rozwiązana",
+ "denied": "Odrzucona",
+ "canceled": "Anulowany"
+ }
+ },
"preferences": {
"additional_item": "Koszt każdej kolejnej pozycji",
"amount": "Kwota",
diff --git a/packages/dashboard/src/locales/zh-CN.json b/packages/dashboard/src/locales/zh-CN.json
index 59b8dfef5d..1a5a27a0cb 100644
--- a/packages/dashboard/src/locales/zh-CN.json
+++ b/packages/dashboard/src/locales/zh-CN.json
@@ -1291,9 +1291,11 @@
"nav": {
"account": "账户",
"categories": "分类",
+ "claims": "索赔",
"customer_groups": "分组",
"customers": "客户",
"draft_orders": "草稿订单",
+ "exchanges": "换货",
"getting_started": "快速入门",
"gift_cards": "礼品卡",
"home": "首页",
@@ -1303,6 +1305,7 @@
"products": "商品",
"promotions": "促销",
"reports": "报表",
+ "returns": "退货",
"settings": "设置",
"transfers": "调拨"
},
@@ -2346,6 +2349,23 @@
},
"title": "支付方式"
},
+ "post_sale": {
+ "search_placeholder": "按编号搜索…",
+ "returns_empty": "暂无退货。",
+ "exchanges_empty": "暂无换货。",
+ "claims_empty": "暂无索赔。",
+ "statuses": {
+ "requested": "已申请",
+ "open": "待处理",
+ "approved": "已批准",
+ "received": "已收到",
+ "refunded": "已退款",
+ "fulfilled": "已发货",
+ "resolved": "已解决",
+ "denied": "已拒绝",
+ "canceled": "已取消"
+ }
+ },
"preferences": {
"additional_item": "附加件费用",
"amount": "金额",
diff --git a/packages/dashboard/src/nav/default.ts b/packages/dashboard/src/nav/default.ts
index 225d2efcd8..0399bc689d 100644
--- a/packages/dashboard/src/nav/default.ts
+++ b/packages/dashboard/src/nav/default.ts
@@ -47,6 +47,30 @@ nav.add({
subject: Subject.Order,
position: 100,
},
+ // Post-sale. These live under Orders because they are always about one,
+ // and gating them on Order keeps a role that can see orders able to see
+ // what came back from them.
+ {
+ key: 'returns',
+ label: i18n.t('admin.nav.returns'),
+ path: '/returns',
+ subject: Subject.Order,
+ position: 200,
+ },
+ {
+ key: 'exchanges',
+ label: i18n.t('admin.nav.exchanges'),
+ path: '/exchanges',
+ subject: Subject.Order,
+ position: 300,
+ },
+ {
+ key: 'claims',
+ label: i18n.t('admin.nav.claims'),
+ path: '/claims',
+ subject: Subject.Order,
+ position: 400,
+ },
],
})
diff --git a/packages/dashboard/src/routeTree.gen.ts b/packages/dashboard/src/routeTree.gen.ts
index 7915892a87..bac800ca32 100644
--- a/packages/dashboard/src/routeTree.gen.ts
+++ b/packages/dashboard/src/routeTree.gen.ts
@@ -18,7 +18,10 @@ import { Route as acceptInvitationDotinvitationIdRouteImport } from './routes/ac
import { Route as authenticatedStoreIdRouteImport } from './routes/_authenticated/$storeId'
import { Route as IndexRouteImport } from './routes/_authenticated/$storeId/index'
import { Route as SettingsRouteImport } from './routes/_authenticated/$storeId/settings'
+import { Route as ReturnsRouteImport } from './routes/_authenticated/$storeId/returns'
import { Route as GettingStartedRouteImport } from './routes/_authenticated/$storeId/getting-started'
+import { Route as ExchangesRouteImport } from './routes/_authenticated/$storeId/exchanges'
+import { Route as ClaimsRouteImport } from './routes/_authenticated/$storeId/claims'
import { Route as SplatRouteImport } from './routes/_authenticated/$storeId/$'
import { Route as SettingsIndexRouteImport } from './routes/_authenticated/$storeId/settings/index'
import { Route as PromotionsIndexRouteImport } from './routes/_authenticated/$storeId/promotions/index'
@@ -107,11 +110,26 @@ const SettingsRoute = SettingsRouteImport.update({
path: '/settings',
getParentRoute: () => authenticatedStoreIdRoute,
} as any)
+const ReturnsRoute = ReturnsRouteImport.update({
+ id: '/returns',
+ path: '/returns',
+ getParentRoute: () => authenticatedStoreIdRoute,
+} as any)
const GettingStartedRoute = GettingStartedRouteImport.update({
id: '/getting-started',
path: '/getting-started',
getParentRoute: () => authenticatedStoreIdRoute,
} as any)
+const ExchangesRoute = ExchangesRouteImport.update({
+ id: '/exchanges',
+ path: '/exchanges',
+ getParentRoute: () => authenticatedStoreIdRoute,
+} as any)
+const ClaimsRoute = ClaimsRouteImport.update({
+ id: '/claims',
+ path: '/claims',
+ getParentRoute: () => authenticatedStoreIdRoute,
+} as any)
const SplatRoute = SplatRouteImport.update({
id: '/$',
path: '/$',
@@ -335,7 +353,10 @@ export interface FileRoutesByFullPath {
'/$storeId': typeof authenticatedStoreIdRouteWithChildren
'/accept-invitation/$invitationId': typeof acceptInvitationDotinvitationIdRoute
'/$storeId/$': typeof SplatRoute
+ '/$storeId/claims': typeof ClaimsRoute
+ '/$storeId/exchanges': typeof ExchangesRoute
'/$storeId/getting-started': typeof GettingStartedRoute
+ '/$storeId/returns': typeof ReturnsRoute
'/$storeId/settings': typeof SettingsRouteWithChildren
'/$storeId/': typeof IndexRoute
'/$storeId/customers/$customerId': typeof CustomersCustomerIdRoute
@@ -387,7 +408,10 @@ export interface FileRoutesByTo {
'/accept-invitation/$invitationId': typeof acceptInvitationDotinvitationIdRoute
'/': typeof authenticatedIndexRoute
'/$storeId/$': typeof SplatRoute
+ '/$storeId/claims': typeof ClaimsRoute
+ '/$storeId/exchanges': typeof ExchangesRoute
'/$storeId/getting-started': typeof GettingStartedRoute
+ '/$storeId/returns': typeof ReturnsRoute
'/$storeId': typeof IndexRoute
'/$storeId/customers/$customerId': typeof CustomersCustomerIdRoute
'/$storeId/customers/groups': typeof CustomersGroupsRoute
@@ -441,7 +465,10 @@ export interface FileRoutesById {
'/accept-invitation/$invitationId': typeof acceptInvitationDotinvitationIdRoute
'/_authenticated/': typeof authenticatedIndexRoute
'/_authenticated/$storeId/$': typeof SplatRoute
+ '/_authenticated/$storeId/claims': typeof ClaimsRoute
+ '/_authenticated/$storeId/exchanges': typeof ExchangesRoute
'/_authenticated/$storeId/getting-started': typeof GettingStartedRoute
+ '/_authenticated/$storeId/returns': typeof ReturnsRoute
'/_authenticated/$storeId/settings': typeof SettingsRouteWithChildren
'/_authenticated/$storeId/': typeof IndexRoute
'/_authenticated/$storeId/customers/$customerId': typeof CustomersCustomerIdRoute
@@ -496,7 +523,10 @@ export interface FileRouteTypes {
| '/$storeId'
| '/accept-invitation/$invitationId'
| '/$storeId/$'
+ | '/$storeId/claims'
+ | '/$storeId/exchanges'
| '/$storeId/getting-started'
+ | '/$storeId/returns'
| '/$storeId/settings'
| '/$storeId/'
| '/$storeId/customers/$customerId'
@@ -548,7 +578,10 @@ export interface FileRouteTypes {
| '/accept-invitation/$invitationId'
| '/'
| '/$storeId/$'
+ | '/$storeId/claims'
+ | '/$storeId/exchanges'
| '/$storeId/getting-started'
+ | '/$storeId/returns'
| '/$storeId'
| '/$storeId/customers/$customerId'
| '/$storeId/customers/groups'
@@ -601,7 +634,10 @@ export interface FileRouteTypes {
| '/accept-invitation/$invitationId'
| '/_authenticated/'
| '/_authenticated/$storeId/$'
+ | '/_authenticated/$storeId/claims'
+ | '/_authenticated/$storeId/exchanges'
| '/_authenticated/$storeId/getting-started'
+ | '/_authenticated/$storeId/returns'
| '/_authenticated/$storeId/settings'
| '/_authenticated/$storeId/'
| '/_authenticated/$storeId/customers/$customerId'
@@ -720,6 +756,13 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof SettingsRouteImport
parentRoute: typeof authenticatedStoreIdRoute
}
+ '/_authenticated/$storeId/returns': {
+ id: '/_authenticated/$storeId/returns'
+ path: '/returns'
+ fullPath: '/$storeId/returns'
+ preLoaderRoute: typeof ReturnsRouteImport
+ parentRoute: typeof authenticatedStoreIdRoute
+ }
'/_authenticated/$storeId/getting-started': {
id: '/_authenticated/$storeId/getting-started'
path: '/getting-started'
@@ -727,6 +770,20 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof GettingStartedRouteImport
parentRoute: typeof authenticatedStoreIdRoute
}
+ '/_authenticated/$storeId/exchanges': {
+ id: '/_authenticated/$storeId/exchanges'
+ path: '/exchanges'
+ fullPath: '/$storeId/exchanges'
+ preLoaderRoute: typeof ExchangesRouteImport
+ parentRoute: typeof authenticatedStoreIdRoute
+ }
+ '/_authenticated/$storeId/claims': {
+ id: '/_authenticated/$storeId/claims'
+ path: '/claims'
+ fullPath: '/$storeId/claims'
+ preLoaderRoute: typeof ClaimsRouteImport
+ parentRoute: typeof authenticatedStoreIdRoute
+ }
'/_authenticated/$storeId/$': {
id: '/_authenticated/$storeId/$'
path: '/$'
@@ -1075,7 +1132,10 @@ const SettingsRouteWithChildren = SettingsRoute._addFileChildren(
interface authenticatedStoreIdRouteChildren {
SplatRoute: typeof SplatRoute
+ ClaimsRoute: typeof ClaimsRoute
+ ExchangesRoute: typeof ExchangesRoute
GettingStartedRoute: typeof GettingStartedRoute
+ ReturnsRoute: typeof ReturnsRoute
SettingsRoute: typeof SettingsRouteWithChildren
IndexRoute: typeof IndexRoute
CustomersCustomerIdRoute: typeof CustomersCustomerIdRoute
@@ -1104,7 +1164,10 @@ interface authenticatedStoreIdRouteChildren {
const authenticatedStoreIdRouteChildren: authenticatedStoreIdRouteChildren = {
SplatRoute: SplatRoute,
+ ClaimsRoute: ClaimsRoute,
+ ExchangesRoute: ExchangesRoute,
GettingStartedRoute: GettingStartedRoute,
+ ReturnsRoute: ReturnsRoute,
SettingsRoute: SettingsRouteWithChildren,
IndexRoute: IndexRoute,
CustomersCustomerIdRoute: CustomersCustomerIdRoute,
diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/claims.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/claims.tsx
new file mode 100644
index 0000000000..8b4ca81681
--- /dev/null
+++ b/packages/dashboard/src/routes/_authenticated/$storeId/claims.tsx
@@ -0,0 +1,29 @@
+import { adminClient, ResourceTable, resourceSearchSchema } from '@spree/dashboard-core'
+import { createFileRoute } from '@tanstack/react-router'
+import { useTranslation } from 'react-i18next'
+import '../../../tables/post-sale'
+
+export const Route = createFileRoute('/_authenticated/$storeId/claims')({
+ validateSearch: resourceSearchSchema,
+ component: ClaimsPage,
+})
+
+/**
+ * Cross-order view — "what is still waiting on us". Records are opened and
+ * actioned from the order they belong to, so this list is read-only.
+ */
+function ClaimsPage() {
+ const { t } = useTranslation()
+ const searchParams = Route.useSearch()
+
+ return (
+ <ResourceTable
+ tableKey="claims"
+ queryKey="claims"
+ queryFn={(params) => adminClient.claims.list(params)}
+ searchParams={searchParams}
+ defaultParams={{ expand: ['order'] }}
+ title={t('admin.nav.claims')}
+ />
+ )
+}
diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/exchanges.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/exchanges.tsx
new file mode 100644
index 0000000000..228e674e86
--- /dev/null
+++ b/packages/dashboard/src/routes/_authenticated/$storeId/exchanges.tsx
@@ -0,0 +1,29 @@
+import { adminClient, ResourceTable, resourceSearchSchema } from '@spree/dashboard-core'
+import { createFileRoute } from '@tanstack/react-router'
+import { useTranslation } from 'react-i18next'
+import '../../../tables/post-sale'
+
+export const Route = createFileRoute('/_authenticated/$storeId/exchanges')({
+ validateSearch: resourceSearchSchema,
+ component: ExchangesPage,
+})
+
+/**
+ * Cross-order view — "what is still waiting on us". Records are opened and
+ * actioned from the order they belong to, so this list is read-only.
+ */
+function ExchangesPage() {
+ const { t } = useTranslation()
+ const searchParams = Route.useSearch()
+
+ return (
+ <ResourceTable
+ tableKey="exchanges"
+ queryKey="exchanges"
+ queryFn={(params) => adminClient.exchanges.list(params)}
+ searchParams={searchParams}
+ defaultParams={{ expand: ['order'] }}
+ title={t('admin.nav.exchanges')}
+ />
+ )
+}
diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/returns.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/returns.tsx
new file mode 100644
index 0000000000..4d7135112a
--- /dev/null
+++ b/packages/dashboard/src/routes/_authenticated/$storeId/returns.tsx
@@ -0,0 +1,29 @@
+import { adminClient, ResourceTable, resourceSearchSchema } from '@spree/dashboard-core'
+import { createFileRoute } from '@tanstack/react-router'
+import { useTranslation } from 'react-i18next'
+import '../../../tables/post-sale'
+
+export const Route = createFileRoute('/_authenticated/$storeId/returns')({
+ validateSearch: resourceSearchSchema,
+ component: ReturnsPage,
+})
+
+/**
+ * Cross-order view — "what is still waiting on us". Records are opened and
+ * actioned from the order they belong to, so this list is read-only.
+ */
+function ReturnsPage() {
+ const { t } = useTranslation()
+ const searchParams = Route.useSearch()
+
+ return (
+ <ResourceTable
+ tableKey="returns"
+ queryKey="returns"
+ queryFn={(params) => adminClient.returns.list(params)}
+ searchParams={searchParams}
+ defaultParams={{ expand: ['order'] }}
+ title={t('admin.nav.returns')}
+ />
+ )
+}
diff --git a/packages/dashboard/src/tables/post-sale.tsx b/packages/dashboard/src/tables/post-sale.tsx
new file mode 100644
index 0000000000..a38d590055
--- /dev/null
+++ b/packages/dashboard/src/tables/post-sale.tsx
@@ -0,0 +1,161 @@
+import type { Claim, Exchange, Return } from '@spree/admin-sdk'
+import { defineTable } from '@spree/dashboard-core'
+import { Badge, RelativeTime, ResourceNameCell } from '@spree/dashboard-ui'
+import i18n from 'i18next'
+import { RepeatIcon, RotateCcwIcon, ShieldAlertIcon } from 'lucide-react'
+
+/**
+ * Status colours read the same way across all three: amber while the merchant
+ * still owes an action, green once settled, muted when it went nowhere.
+ */
+const STATUS_VARIANT: Record<
+ string,
+ 'success' | 'destructive' | 'secondary' | 'default' | 'outline'
+> = {
+ requested: 'default',
+ open: 'default',
+ approved: 'default',
+ received: 'default',
+ refunded: 'success',
+ fulfilled: 'success',
+ resolved: 'success',
+ denied: 'destructive',
+ canceled: 'secondary',
+}
+
+function statusLabel(value: string): string {
+ const key = `admin.post_sale.statuses.${value}`
+ return i18n.exists(key)
+ ? i18n.t(key)
+ : value.replace(/_/g, ' ').replace(/\b\w/g, (c) => c.toUpperCase())
+}
+
+function statusColumn(values: string[]) {
+ return {
+ key: 'status',
+ label: i18n.t('admin.fields.status.label'),
+ sortable: true,
+ filterable: true,
+ filterType: 'enum' as const,
+ filterOptions: values.map((value) => ({ value, label: statusLabel(value) })),
+ default: true,
+ render: (record: { status: string }) => (
+ <Badge variant={STATUS_VARIANT[record.status] ?? 'secondary'}>
+ {statusLabel(record.status)}
+ </Badge>
+ ),
+ }
+}
+
+function orderColumn<T extends { order?: { number?: string } | null }>() {
+ return {
+ key: 'order',
+ label: i18n.t('admin.nav.orders'),
+ default: true,
+ render: (record: T) => record.order?.number ?? '—',
+ }
+}
+
+function createdColumn<T extends { created_at: string }>() {
+ return {
+ key: 'created_at',
+ label: i18n.t('admin.fields.created_at.label'),
+ sortable: true,
+ default: true,
+ render: (record: T) => <RelativeTime iso={record.created_at} />,
+ }
+}
+
+defineTable<Return>('returns', {
+ title: i18n.t('admin.nav.returns'),
+ searchParam: 'number_cont',
+ searchPlaceholder: i18n.t('admin.post_sale.search_placeholder'),
+ defaultSort: { field: 'created_at', direction: 'desc' },
+ emptyIcon: <RotateCcwIcon className="size-8 text-muted-foreground" />,
+ emptyMessage: i18n.t('admin.post_sale.returns_empty'),
+ columns: [
+ {
+ key: 'number',
+ label: i18n.t('admin.fields.number.label'),
+ sortable: true,
+ filterable: true,
+ default: true,
+ render: (r) => <ResourceNameCell id={r.id} dataAttr="data-return-id" name={r.number} />,
+ },
+ statusColumn(['requested', 'approved', 'received', 'refunded', 'canceled']),
+ orderColumn<Return>(),
+ {
+ key: 'display_refund_total',
+ label: i18n.t('admin.pages.orders.detail.returns.refund_total'),
+ default: true,
+ className: 'text-right tabular-nums whitespace-nowrap font-medium',
+ render: (r) => r.display_refund_total,
+ },
+ createdColumn<Return>(),
+ ],
+})
+
+defineTable<Exchange>('exchanges', {
+ title: i18n.t('admin.nav.exchanges'),
+ searchParam: 'number_cont',
+ searchPlaceholder: i18n.t('admin.post_sale.search_placeholder'),
+ defaultSort: { field: 'created_at', direction: 'desc' },
+ emptyIcon: <RepeatIcon className="size-8 text-muted-foreground" />,
+ emptyMessage: i18n.t('admin.post_sale.exchanges_empty'),
+ columns: [
+ {
+ key: 'number',
+ label: i18n.t('admin.fields.number.label'),
+ sortable: true,
+ filterable: true,
+ default: true,
+ render: (e) => <ResourceNameCell id={e.id} dataAttr="data-exchange-id" name={e.number} />,
+ },
+ statusColumn(['requested', 'approved', 'received', 'fulfilled', 'canceled']),
+ orderColumn<Exchange>(),
+ {
+ key: 'display_price_difference',
+ label: i18n.t('admin.pages.orders.detail.exchanges.price_difference'),
+ default: true,
+ className: 'text-right tabular-nums whitespace-nowrap font-medium',
+ render: (e) => e.display_price_difference,
+ },
+ createdColumn<Exchange>(),
+ ],
+})
+
+defineTable<Claim>('claims', {
+ title: i18n.t('admin.nav.claims'),
+ searchParam: 'number_cont',
+ searchPlaceholder: i18n.t('admin.post_sale.search_placeholder'),
+ defaultSort: { field: 'created_at', direction: 'desc' },
+ emptyIcon: <ShieldAlertIcon className="size-8 text-muted-foreground" />,
+ emptyMessage: i18n.t('admin.post_sale.claims_empty'),
+ columns: [
+ {
+ key: 'number',
+ label: i18n.t('admin.fields.number.label'),
+ sortable: true,
+ filterable: true,
+ default: true,
+ render: (c) => <ResourceNameCell id={c.id} dataAttr="data-claim-id" name={c.number} />,
+ },
+ statusColumn(['open', 'approved', 'resolved', 'denied', 'canceled']),
+ {
+ key: 'claim_type',
+ label: i18n.t('admin.pages.orders.detail.claims.claim_type'),
+ sortable: true,
+ filterable: true,
+ default: true,
+ render: (c) => (
+ <Badge variant="outline">
+ {i18n.t(`admin.pages.orders.detail.claims.types.${c.claim_type}`, {
+ defaultValue: c.claim_type,
+ })}
+ </Badge>
+ ),
+ },
+ orderColumn<Claim>(),
+ createdColumn<Claim>(),
+ ],
+})