Implement billing status feature in Telegram bot
- 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:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user