import { PlatformPlan } from "@/modules/billing/types"; import type { StripeService } from "@/modules/stripe/stripe.service"; import Stripe from "stripe"; import { PlatformBilling, Team } from "@calcom/prisma/client"; export type BillingData = { team: (Team & { platformBilling: PlatformBilling | null }) | null; status: "valid" | "no_subscription" | "no_billing"; plan: string; }; export interface IBillingService { getBillingData(teamId: number): Promise; createTeamBilling(teamId: number): Promise; redirectToSubscribeCheckout(teamId: number, plan: PlatformPlan, customerId?: string): Promise; updateSubscriptionForTeam(teamId: number, plan: PlatformPlan): Promise; cancelTeamSubscription(teamId: number): Promise; handleStripeSubscriptionDeleted(event: Stripe.Event): Promise; handleStripePaymentSuccess(event: Stripe.Event): Promise; handleStripePaymentFailed(event: Stripe.Event): Promise; handleStripePaymentPastDue(event: Stripe.Event): Promise; handleStripeCheckoutEvents(event: Stripe.Event): Promise; handleStripeSubscriptionForActiveManagedUsers(event: Stripe.Event): Promise; getSubscriptionIdFromInvoice(invoice: Stripe.Invoice): string | null; getCustomerIdFromInvoice(invoice: Stripe.Invoice): string | null; stripeService: StripeService; }