export type SubscriptionPlanId = 'trial' | 'starter' | 'professional' | 'enterprise';

export type SubscriptionStatus =
  | 'trialing'
  | 'active'
  | 'past_due'
  | 'canceled'
  | 'expired';

export type BillingCycle = 'monthly' | 'annual';

export type PaymentProvider = 'payfast';

export interface OrganisationSubscription {
  planId: SubscriptionPlanId;
  status: SubscriptionStatus;
  provider?: PaymentProvider;
  trialEndsAt?: string;
  currentPeriodStart?: string;
  currentPeriodEnd?: string;
  canceledAt?: string;
  billingCycle?: BillingCycle;
  billingEmail?: string;
  /** PayFast token returned after initial payment — populated when PayFast is connected */
  payfastToken?: string;
  /** PayFast subscription identifier */
  payfastSubscriptionId?: string;
  /** Latest PayFast payment identifier */
  payfastPaymentId?: string;
}

export interface SubscriptionUsage {
  seatsUsed: number;
  seatLimit: number;
  sitesUsed: number;
  siteLimit: number;
}
