Skip to content

Commit 95dec6d

Browse files
committed
feat: add order column to stats table and update related types and routes
1 parent 2233d32 commit 95dec6d

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

client/src/pages/stats.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ export default function StatsPage() {
330330
<tr className="bg-default-100">
331331
<th className="p-3 text-left">{t("purchase-date")}</th>
332332
<th className="p-3 text-left">{t("refund-date")}</th>
333+
<th className="p-3 text-left">{t("order")}</th>
333334
<th className="p-3 text-right">{t("purchase-amount")}</th>
334335
<th className="p-3 text-right">{t("refund-amount")}</th>
335336
<th className="p-3 text-right">{t("difference")}</th>
@@ -348,6 +349,7 @@ export default function StatsPage() {
348349
<td className="p-3">
349350
{new Date(item.refundDate).toLocaleDateString()}
350351
</td>
352+
<td className="p-3">{item.order}</td>
351353
<td className="p-3 text-right">
352354
{item.purchaseAmount.toFixed(2)}
353355
</td>

cloudflare-worker/src/routes/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2119,6 +2119,8 @@ const statsRoutes = (router: Router, env: Env) => {
21192119
* refundDate:
21202120
* type: string
21212121
* format: date
2122+
* order:
2123+
* type: string
21222124
* averageDelayInDays:
21232125
* type: number
21242126
* description: Average delay between purchase and refund in days
@@ -2186,7 +2188,8 @@ const statsRoutes = (router: Router, env: Env) => {
21862188
refundAmount: refund.amount,
21872189
delayInDays,
21882190
purchaseDate: purchase.date,
2189-
refundDate: refund.refundDate
2191+
refundDate: refund.refundDate,
2192+
order: purchase.order,
21902193
});
21912194
}
21922195
}

cloudflare-worker/src/types/data.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ export interface RefundDelayData {
308308
delayInDays: number;
309309
purchaseDate: Date;
310310
refundDate: Date;
311+
order: string;
311312
}
312313

313314
export interface RefundBalanceResponse {

0 commit comments

Comments
 (0)