New alert service

This commit is contained in:
Urtzi Alfaro
2025-12-05 20:07:01 +01:00
parent 1fe3a73549
commit 667e6e0404
393 changed files with 26002 additions and 61033 deletions

View File

@@ -380,6 +380,8 @@ export class SubscriptionService {
is_read_only: boolean;
cancellation_effective_date: string | null;
days_until_inactive: number | null;
billing_cycle?: string;
next_billing_date?: string;
}> {
return apiClient.get(`/subscriptions/${tenantId}/status`);
}
@@ -483,10 +485,10 @@ export class SubscriptionService {
return {
tier: status.plan as SubscriptionTier,
billing_cycle: 'monthly', // TODO: Get from actual subscription data
billing_cycle: (status.billing_cycle as 'monthly' | 'yearly') || 'monthly',
monthly_price: currentPlan?.monthly_price || 0,
yearly_price: currentPlan?.yearly_price || 0,
renewal_date: new Date(Date.now() + 30 * 24 * 60 * 60 * 1000).toISOString(), // TODO: Get from actual subscription
renewal_date: status.next_billing_date || new Date(Date.now() + 30 * 24 * 60 * 60 * 1000).toISOString(),
limits: {
users: currentPlan?.limits?.users ?? null,
locations: currentPlan?.limits?.locations ?? null,