Skip to content

Commit

Permalink
fix: add support for refunded payments on ui
Browse files Browse the repository at this point in the history
  • Loading branch information
kelsos committed Jan 17, 2025
1 parent 2cc199a commit 4e90469
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions components/account/home/PaymentsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const headers: DataTableColumn<Payment>[] = [
sortable: true,
align: 'end',
},
{ label: t('common.status'), key: 'status', class: 'capitalize' },
{ label: t('common.status'), key: 'isRefund', class: 'capitalize' },
{
label: t('common.actions'),
key: 'actions',
Expand Down Expand Up @@ -69,12 +69,12 @@ const payments = computed(() => {
outlined
row-attr="identifier"
>
<template #item.status>
<template #item.isRefund="{ row }">
<RuiChip
size="sm"
color="success"
:color="row.isRefund ? 'info' : 'success'"
>
{{ t('account.payments.paid') }}
{{ row.isRefund ? t("account.payments.refunded") : t("account.payments.paid") }}
</RuiChip>
</template>

Expand Down
1 change: 1 addition & 0 deletions i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
},
"no_payments_found": "No payments found",
"paid": "Paid",
"refunded": "Refunded",
"title": "Your latest payments"
},
"subscriptions": {
Expand Down
1 change: 1 addition & 0 deletions types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export type Subscription = z.infer<typeof Subscription>;
export const Payment = z.object({
eurAmount: z.string(),
identifier: z.string().min(1),
isRefund: z.boolean().optional().default(false),
paidAt: z.string(),
plan: z.string(),
});
Expand Down

0 comments on commit 4e90469

Please sign in to comment.