Refactor subcription layer

This commit is contained in:
Urtzi Alfaro
2026-01-11 21:40:04 +01:00
parent 54163843ec
commit 55bb1c6451
7 changed files with 1369 additions and 300 deletions

View File

@@ -402,6 +402,24 @@ export class SubscriptionService {
return apiClient.get(`/subscriptions/${tenantId}/invoices`);
}
/**
* Update the default payment method for a subscription
*/
async updatePaymentMethod(
tenantId: string,
paymentMethodId: string
): Promise<{
success: boolean;
message: string;
payment_method_id: string;
brand: string;
last4: string;
exp_month?: number;
exp_year?: number;
}> {
return apiClient.post(`/subscriptions/${tenantId}/update-payment-method?payment_method_id=${paymentMethodId}`, {});
}
// ============================================================================
// NEW METHODS - Usage Forecasting & Predictive Analytics
// ============================================================================