import { Repository } from 'typeorm'; import { StripeService } from './stripe.service'; import { Subscription } from '../subscriptions/entities/subscription.entity'; import { Plan } from '../subscriptions/entities/plan.entity'; import { TokenBalance } from '../subscriptions/entities/token-balance.entity'; import { TokenUsage } from '../subscriptions/entities/token-usage.entity'; export interface TokenPackage { code: string; name: string; tokens: number; priceMxn: number; stripePriceId?: string; } export declare class BillingService { private stripeService; private subscriptionRepo; private planRepo; private tokenBalanceRepo; private tokenUsageRepo; private readonly logger; private readonly tokenPackages; constructor(stripeService: StripeService, subscriptionRepo: Repository, planRepo: Repository, tokenBalanceRepo: Repository, tokenUsageRepo: Repository); getPlans(): Promise; getTokenPackages(): TokenPackage[]; createSubscriptionCheckout(tenantId: string, planCode: string, successUrl: string, cancelUrl: string): Promise<{ checkoutUrl: string; }>; createTokenPurchaseCheckout(tenantId: string, packageCode: string, successUrl: string, cancelUrl: string): Promise<{ checkoutUrl: string; }>; createPortalSession(tenantId: string, returnUrl: string): Promise<{ portalUrl: string; }>; handleSubscriptionCreated(stripeSubscriptionId: string, stripeCustomerId: string, stripePriceId: string): Promise; handleSubscriptionCancelled(stripeSubscriptionId: string): Promise; handleTokenPurchase(tenantId: string, packageCode: string, tokens: number): Promise; getTokenBalance(tenantId: string): Promise; addTokensToBalance(tenantId: string, tokens: number, source: 'subscription' | 'purchase' | 'bonus'): Promise; consumeTokens(tenantId: string, tokens: number, action: string, description?: string): Promise; getTokenUsageHistory(tenantId: string, limit?: number): Promise; getBillingSummary(tenantId: string): Promise<{ subscription: Subscription | null; plan: Plan | null; tokenBalance: TokenBalance | null; invoices: any[]; }>; }