package com.kt.event.eventservice.infrastructure.client.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

/**
 * AI Service 추천안 응답 DTO
 *
 * @author Event Service Team
 * @version 1.0.0
 * @since 2025-10-30
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AIRecommendationResponse {

    private String eventId;
    private TrendAnalysis trendAnalysis;
    private List<EventRecommendation> recommendations;
    private LocalDateTime generatedAt;
    private LocalDateTime expiresAt;
    private String aiProvider;

    /**
     * 트렌드 분석
     */
    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class TrendAnalysis {
        private List<TrendKeyword> industryTrends;
        private List<TrendKeyword> regionalTrends;
        private List<TrendKeyword> seasonalTrends;

        @Data
        @Builder
        @NoArgsConstructor
        @AllArgsConstructor
        public static class TrendKeyword {
            private String keyword;
            private Double relevance;
            private String description;
        }
    }

    /**
     * 이벤트 추천안
     */
    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class EventRecommendation {
        private Integer optionNumber;
        private String concept;
        private String title;
        private String description;
        private String targetAudience;
        private Duration duration;
        private Mechanics mechanics;
        private List<String> promotionChannels;
        private EstimatedCost estimatedCost;
        private ExpectedMetrics expectedMetrics;
        private String differentiator;

        @Data
        @Builder
        @NoArgsConstructor
        @AllArgsConstructor
        public static class Duration {
            private Integer recommendedDays;
            private String recommendedPeriod;
        }

        @Data
        @Builder
        @NoArgsConstructor
        @AllArgsConstructor
        public static class Mechanics {
            private String type;
            private String details;
        }

        @Data
        @Builder
        @NoArgsConstructor
        @AllArgsConstructor
        public static class EstimatedCost {
            private Integer min;
            private Integer max;
            private Map<String, Integer> breakdown;
        }

        @Data
        @Builder
        @NoArgsConstructor
        @AllArgsConstructor
        public static class ExpectedMetrics {
            private Range newCustomers;
            private Range revenueIncrease;
            private Range roi;

            @Data
            @Builder
            @NoArgsConstructor
            @AllArgsConstructor
            public static class Range {
                private Double min;
                private Double max;
            }
        }
    }
}
