import Stripe from 'stripe';

// Define the structure for subscription package data with all Stripe information
export interface SubscriptionPackage {
  id: string;
  object: string;
  active: boolean;
  name: string;
  description: string;
  caption: string | null;
  attributes: string[] | null;
  shippable: boolean | null;
  url: string | null;
  statement_descriptor: string | null;
  tax_code: string | null;
  created: number;
  updated: number;
  livemode: boolean;
  metadata: Stripe.Product['metadata'];
  features: string[];
  default_price: Stripe.Product['default_price'];
  price: PriceInfo | null;
  tier: string;
}

export interface PriceInfo {
  id: string;
  object: string;
  active: boolean;
  billing_scheme: string;
  unit_amount: number | null;
  unit_amount_decimal: string | null;
  currency: string;
  description: string;
  type: string;
  recurring: Stripe.Price.Recurring | null;
  transform_quantity: Stripe.Price.TransformQuantity | null;
  tax_behavior: string | null;
  lookup_key: string | null;
  tiers_mode: string | null;
  tiers: Stripe.Price.Tier[] | null;
  created: number;
  livemode: boolean;
  metadata: Stripe.Price['metadata'];
}

// Define the structure for the free tier
export interface FreeTierPackage {
  id: string;
  object: 'product';
  active: boolean;
  name: string;
  description: string;
  caption: '';
  attributes: [];
  shippable: false;
  url: null;
  statement_descriptor: null;
  tax_code: null;
  created: number;
  updated: number;
  livemode: boolean;
  metadata: {
    tier: string;
    amount: string;
    interval: string;
  };
  features: string[];
  default_price: PriceInfo;
  price: PriceInfo;
  tier: 'free';
}