package kz.konturai.parser.dto;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import kz.konturai.parser.enums.*;
import kz.konturai.parser.validator.ValidAnalysisType;
import kz.konturai.parser.validator.ValidDetailLevel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class MarketingAnalysisV3Request {

    // --- CORE IDENTIFIERS (Re-added from V1 for Search Logic) ---

    @NotBlank(message = "Business Niche is required (e.g., 'Кофейня', 'Салон красоты')")
    @Size(min = 2, max = 100)
    private String businessNiche;

    @NotBlank(message = "Product/Brand Name is required (e.g., 'Starbucks', 'MyBrand')")
    @Size(min = 2, max = 100)
    private String productName;

    @NotBlank(message = "Goal is required (e.g., 'Увеличить продажи на 20%')")
    @Size(min = 5, max = 300)
    private String goal;

    // --- BLOCK 1: Business Info ---

    @NotNull(message = "Question 1 (Business Stage) is required")
    private BusinessStage businessStage;

    @NotNull(message = "Question 2 (Client Target) is required")
    private ClientTarget clientTarget;

    @NotNull(message = "Question 3 (Offer Type) is required")
    private OfferType offerType;

    @NotNull(message = "Question 4 (Average Check) is required")
    private AverageCheck averageCheck;

    @NotEmpty(message = "Question 5 (Customer Behavior) must have 1-2 options")
    private List<CustomerBehavior> customerBehaviors;

    // --- BLOCK 2: Geography ---

    @NotNull(message = "Question 6 (Geo Scope) is required")
    private GeoScope geoScope;

    private String mainCity;

    @Size(max = 5, message = "You can specify up to 5 presence cities")
    private List<String> presenceCities;

    @NotEmpty(message = "Question 7 (Target Cities) is required")
    @Size(max = 5, message = "Select up to 5 cities for promotion")
    private List<String> promotionCities;

    // --- BLOCK 3: Product & Content ---

    @NotBlank(message = "Question 8 (Product Description) is required")
    @Size(min = 10, max = 1000, message = "Description should be detailed")
    private String productDescription;

    @NotNull(message = "Question 9 (Purchase Frequency) is required")
    private PurchaseFrequency purchaseFrequency;

    @NotNull(message = "Question 10 (Visual Factor) is required")
    private VisualFactor visualFactor;

    // --- BLOCK 4: Decision Making ---

    @NotEmpty(message = "Question 11 (Priorities) must have 1-2 options")
    private List<DecisionPriority> decisionPriorities;

    @NotEmpty(message = "Question 12 (Discovery Method) must have 1-2 options")
    private List<DiscoveryMethod> discoveryMethods;

    @NotNull(message = "Question 13 (Price Feedback) is required")
    private PriceFeedback priceFeedback;

    // --- BLOCK 5: Current Situation ---

    @NotNull(message = "Question 14 (SMM Status) is required")
    private SmmStatus smmStatus;

    @NotNull(message = "Question 15 (Lead Volume) is required")
    private LeadVolume leadVolume;

    @NotNull(message = "Question 16 (Response Handling) is required")
    private ResponseHandler responseHandler;

    private List<BusinessConstraint> constraints;

    // --- BLOCK 6: Digital Assets (For v4.0 User Positioning) ---

    @Size(max = 5, message = "Provide up to 5 links to your current social media/website")
    private List<String> userSocialLinks;

    @Size(max = 5, message = "Provide up to 5 known competitors (optional)")
    private List<String> knownCompetitorLinks;

    // --- TECHNICAL FIELDS ---

    @NotBlank(message = "Detail Level is required")
    @ValidDetailLevel
    private String detailLevel;

    @NotEmpty(message = "Analysis Type is required")
    @ValidAnalysisType
    private List<String> analysisType;
}