Implement billing status feature in Telegram bot
CI / Backend (build + test) (push) Successful in 1m20s
CI / Frontend (lint + typecheck + build) (push) Successful in 32s

- Added a new command `/billing` and a corresponding menu option for users with billing roles to check their payment status.
- Implemented `HandleBillingStatusAsync` method to retrieve and display billing information, including the payment expiration date and remaining time in a user-friendly format.
- Updated the main menu to conditionally show the billing status option based on the user's role.
- Enhanced the `PaidUntilBadge` component to format and display the remaining time until the next payment in both days and hours/minutes.
- Updated documentation to reflect the new billing status feature and its usage in the Telegram bot.
This commit is contained in:
Leonid Pershin
2026-07-19 05:04:54 +03:00
parent 450ad1ea1f
commit e088e302e9
6 changed files with 178 additions and 18 deletions
+3 -1
View File
@@ -7,6 +7,7 @@ import { Card, CardContent, CardHeader, CardTitle } from '@/shared/ui/card'
import { Badge } from '@/shared/ui/badge'
import { Button } from '@/shared/ui/button'
import { getMyBillingStatus } from '@/features/billing/api'
import { PaidUntilBadge } from '@/features/billing/PaidUntilBadge'
import { PaymentRequestPanel } from '@/features/billing/PaymentRequestPanel'
export const Route = createFileRoute('/billing')({ component: BillingPage })
@@ -56,12 +57,13 @@ function BillingContent() {
<CardTitle className="text-base">{t('billing.status')}</CardTitle>
{data.suspended && <Badge variant="destructive">{t('billing.suspended')}</Badge>}
</CardHeader>
<CardContent>
<CardContent className="flex flex-col gap-2">
<p className="text-sm text-muted-foreground">
{data.paidUntil
? t('billing.paidUntil', { date: new Date(data.paidUntil).toLocaleDateString() })
: t('billing.neverPaid')}
</p>
{data.paidUntil && <PaidUntilBadge paidUntil={data.paidUntil} />}
</CardContent>
</Card>