/**
 * Event 도메인 타입 정의
 * Event Service API 응답 형식과 일치
 */

/**
 * 이벤트 상태
 */
export type EventStatus = 'DRAFT' | 'PUBLISHED' | 'ENDED';

/**
 * 이벤트 목적
 */
export type EventObjective =
  | 'CUSTOMER_ACQUISITION'
  | 'Sales Promotion'
  | 'Customer Retention'
  | 'New Customer Acquisition'
  | 'awareness'
  | 'sales'
  | 'new_customer';

/**
 * 배포 채널
 */
export type DistributionChannel = 'SMS' | 'EMAIL' | 'KAKAO' | 'PUSH';

/**
 * 이벤트 이미지
 */
export interface EventImage {
  imageId: string;
  imageUrl: string;
  prompt?: string;
  isSelected: boolean;
  createdAt: string;
}

/**
 * AI 추천
 */
export interface AiRecommendation {
  recommendationId: string;
  eventName: string;
  description: string;
  reward: string;
  participationMethod: string;
  startDate: string;
  endDate: string;
  targetParticipants: number;
  isSelected: boolean;
  createdAt: string;
}

/**
 * 이벤트 상세 정보
 */
export interface EventDetail {
  eventId: string;
  userId: string;
  storeId: string;
  eventName: string;
  description: string | null;
  objective: EventObjective;
  startDate: string | null;
  endDate: string | null;
  status: EventStatus;
  selectedImageId: string | null;
  selectedImageUrl: string | null;
  participants: number | null;
  targetParticipants: number | null;
  roi: number | null;
  generatedImages: EventImage[];
  aiRecommendations: AiRecommendation[];
  channels: DistributionChannel[];
  createdAt: string;
  updatedAt: string;
}

/**
 * 페이지 응답
 */
export interface PageResponse<T> {
  content: T[];
  page: number;
  size: number;
  totalElements: number;
  totalPages: number;
  first: boolean;
  last: boolean;
}

/**
 * API 표준 응답
 */
export interface ApiResponse<T> {
  success: boolean;
  data: T;
  timestamp: string;
}

/**
 * 이벤트 목록 조회 요청
 */
export interface GetEventsRequest {
  status?: EventStatus;
  search?: string;
  objective?: string;
  page?: number;
  size?: number;
  sort?: string;
  order?: 'asc' | 'desc';
}

/**
 * 이벤트 목록 조회 응답
 */
export type GetEventsResponse = ApiResponse<PageResponse<EventDetail>>;

/**
 * 이벤트 목적 선택 요청
 */
export interface SelectObjectiveRequest {
  objective: EventObjective;
}

/**
 * 이벤트 생성 응답
 */
export interface EventCreatedResponse {
  eventId: string;
  objective: EventObjective;
  status: EventStatus;
  createdAt: string;
}

/**
 * AI 추천 요청
 */
export interface AiRecommendationRequest {
  storeCategory?: string;
  targetAudience?: string;
  budget?: number;
  additionalInfo?: string;
}

/**
 * Job 수락 응답
 */
export interface JobAcceptedResponse {
  jobId: string;
  eventId: string;
  status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED';
  estimatedCompletionTime?: string;
}

/**
 * 이미지 생성 요청
 */
export interface ImageGenerationRequest {
  prompt: string;
  numberOfImages?: number;
  style?: string;
}

/**
 * 이미지 생성 응답
 */
export interface ImageGenerationResponse {
  jobId: string;
  eventId: string;
  status: string;
}

/**
 * 이벤트 수정 요청
 */
export interface UpdateEventRequest {
  eventName?: string;
  description?: string;
  startDate?: string;
  endDate?: string;
  discountRate?: number;
}

/**
 * 배포 채널 선택 요청
 */
export interface SelectChannelsRequest {
  channels: string[];
}

/**
 * 이미지 선택 요청
 */
export interface SelectImageRequest {
  selectedImageId: string;
}
