import type { TierId } from "@/lib/types/pricing";

export interface BillingHistoryEntry {
  id: string;
  event: string;
  amount: number;
  currency: string;
  createdAt: string;
  metadata?: Record<string, unknown> | null;
  invoiceId?: string | null;
}

export interface DashboardSubscriptionDetails {
  subscription: {
    id: string;
    tierId: TierId;
    status: string;
    billingPeriod: "monthly" | "yearly";
    currentPeriodEnd: string;
    trialEndsAt: string | null;
    setupFeePaid: boolean;
    setupFeeAmount: number | null;
    setupFeePaidAt?: string | null;
    paymentMethod: {
      brand: string;
      lastFour: string;
      id: string;
    } | null;
    stripeCustomerId: string;
    stripeSubscriptionId: string;
    cancelAtPeriodEnd: boolean;
    cancelledAt?: string | null;
    lastPaymentDate: string | null;
    paymentFailureCount: number;
  };
  user: {
    id: string;
    email: string;
    name: string;
    companyName: string | null;
  };
  billingHistory: BillingHistoryEntry[];
}
