// Topup Plan
export interface TopupPlan {
  _id: string
  name: string
  amountPaid: number
  credits: number
  isActive: boolean
  createdAt: string
  updatedAt: string
  __v?: number
}

// Topup purchase payload
export interface PurchaseTopupPayload {
  topupPlanId: string
}

export interface TopupPlanGetSecretResponse {
  clientSecret: string
}

export interface TopupCredeitsBalanceResponse {
  totalCredits: number
}

// User Topup Transaction
export interface UserTopupTransaction {
  _id: string
  salonId: string
  topupPlanId: string
  amountPaid: number
  credits: number
  usedCredits: number
  isActive: boolean
  createdAt: string
  updatedAt: string
  __v?: number
}

// Response types
export type TopupPlansResponse = TopupPlan[]
export type UserTopupTransactionsResponse = UserTopupTransaction[]

// Credits Usage Types
export interface Salon {
  _id: string
  name: string
}

export interface CreditsUsageMetadata {
  callSid?: string
  duration_in_seconds?: string
  callSessionId?: string
}

export interface CreditsUsage {
  _id: string
  salonId: Salon
  salonCreditId: string
  credits: number
  reason: string
  metadata: CreditsUsageMetadata
  createdAt: string
  updatedAt: string
  __v?: number
}

export interface CreditsUsageMeta {
  total: number
  page: number
  limit: number
  totalPages: number
}

export interface CreditsUsageResponse {
  data: CreditsUsage[]
  meta: CreditsUsageMeta
}

export interface CreditRate {
  type: 'call' | 'sms' | 'whatsapp'
  credits: number
  unit: string
  _id?: string
  createdAt?: string
  updatedAt?: string
  __v?: number
}

export type CreditRatesResponse = CreditRate[]
