fix(payments): show already refunded amount, limit new refund to remaining

This commit is contained in:
chattie
2026-08-24 17:42:29 +02:00
parent 85ecee935b
commit 8ce1a36ef6
3 changed files with 4 additions and 2 deletions

View File

@@ -300,6 +300,7 @@ export interface PaymentTransaction {
id: string; provider: string; providerPaymentId: string | null; id: string; provider: string; providerPaymentId: string | null;
orderId: string | null; amountCents: number; currency: string; orderId: string | null; amountCents: number; currency: string;
status: string; raw: unknown; createdAt: string; status: string; raw: unknown; createdAt: string;
refundedAmountCents?: number; // amount already refunded
} }
export const paymentsApi = { export const paymentsApi = {
list: (params?: { limit?: number; offset?: number; status?: string; q?: string }) => { list: (params?: { limit?: number; offset?: number; status?: string; q?: string }) => {

View File

@@ -219,6 +219,7 @@ export async function registerPaymentsRoutes(
status: r.status, status: r.status,
raw: r.raw, raw: r.raw,
createdAt: r.created_at, createdAt: r.created_at,
refundedAmountCents: r.refunded_amount_cents ?? 0,
})), })),
total, total,
}); });

View File

@@ -1,7 +1,7 @@
/// <reference types="next" /> /// <reference types="next" />
/// <reference types="next/image-types/global" /> /// <reference types="next/image-types/global" />
import "./.next/dev/types/routes.d.ts"; import "./.next/types/routes.d.ts";
import "./.next/dev/types/root-params.d.ts"; import "./.next/types/root-params.d.ts";
// NOTE: This file should not be edited // NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information. // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.