import type { DateISOString } from "@/types/date-serialization"

import type { EmptyResponse, StructuredSuccessResponse } from "../../types"

// Request types
export interface GetReferralDaysRequest {
  code: string
}

export interface VerifyReceiptRequest {
  appReceipt: string
}

// Response data types
export interface ReferralUser {
  id: string
  name: string | null
  image: string | null
}

export interface ReferralInvitation {
  code: string
  createdAt: DateISOString | null
  usedAt: DateISOString | null
  toUserId: string | null
  user: ReferralUser | null
}

export interface ReferralsData {
  referralCycleDays: number
  invitations: ReferralInvitation[]
}

export interface ReferralDaysData {
  referralCycleDays: number
}

// Response types
export type GetReferralsResponse = StructuredSuccessResponse<ReferralsData>
export type GetReferralDaysResponse = StructuredSuccessResponse<ReferralDaysData>
export type VerifyReceiptResponse = EmptyResponse
