package kz.konturai.parser.model;

import kz.konturai.parser.dto.MarketingAnalysisResponseV2;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

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

@Data
@Document(collection = "marketing_analysis_v2")
public class MarketingAnalysisV2Document {

    @Id
    private String id;

    @Field("user_id")
    private String userId;

    @Field("business_niche")
    private String businessNiche;

    @Field("product")
    private String product;

    @Field("target_audience")
    private Map<String, Object> targetAudience;

    @Field("region")
    private List<String> region;

    @Field("goal")
    private String goal;

    @Field("detail_level")
    private String detailLevel;

    @Field("strong_side")
    private String strongSide;

    @Field("weak_side")
    private String weakSide;

    @Field("analysis_type")
    private List<String> analysisType;

    @Field("analysis_data")
    private MarketingAnalysisResponseV2 analysisData;

    @Field("created_at")
    private LocalDateTime createdAt;

    @Field("updated_at")
    private LocalDateTime updatedAt;

    @Field("analysis_id")
    private String analysisId; // ID связанного обычного анализа

    public MarketingAnalysisV2Document() {
        this.createdAt = LocalDateTime.now();
        this.updatedAt = LocalDateTime.now();
    }


}
