package com.huimv.employment.service.draft.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;

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

/**
 * 用工草稿详情：头表字段与 {@code FeEmploymentDraft} / {@code fe_employment_draft} 对齐；
 * 用工明细见 {@link #workerGroups}（来自 {@code fe_draft_work_item}）。
 */
@Schema(description = "用工草稿详情（头表对齐 FeEmploymentDraft，明细为 worker_groups）")
public class DraftDetailResponse {

    @Schema(description = "草稿主键 ID", example = "1")
    private Long id;

    @Schema(description = "草稿业务编号", example = "draft_001")
    private String draftNo;

    @Schema(description = "所属企业 ID（可空，企业认证后回填）")
    private Long enterpriseId;

    @Schema(description = "发起用户 ID")
    private Long userId;

    @Schema(description = "来源会话 ID")
    private Long conversationId;

    @Schema(description = "标题")
    private String title;

    @Schema(description = "状态：pending / confirmed / cancelled / expired")
    private String status;

    @Schema(description = "临时工来源：existing=人员登记；recruit=临时工招聘")
    private String workerSource;

    @Schema(description = "待补充字段名列表")
    private List<String> missingFields;

    @Schema(description = "风险提示")
    private List<String> riskPrompts;

    @Schema(description = "已选方案 ID")
    private Long selectedPlanId;

    @Schema(description = "确认时间")
    private LocalDateTime confirmedAt;

    @Schema(description = "确认人用户 ID")
    private Long confirmedBy;

    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    @Schema(description = "更新时间")
    private LocalDateTime updateTime;

    @Schema(description = "用工明细组（来自 fe_draft_work_item，非头表字段）")
    @JsonProperty("worker_groups")
    private List<DraftWorkerGroupItem> workerGroups;

    @Schema(description = "登记小程序码图片 URL（确认后由 fe_registration_batch 带回；未确认时为 null）")
    private String qrCodeUrl;

    @Schema(description = "登记扫码 token（fe_registration_batch.qr_token；未确认时为 null）")
    private String qrToken;

    @JsonProperty("order_id")
    @Schema(description = "关联订单 ID；草稿未确认生成订单时为 null")
    private Long orderId;

    @JsonProperty("order_no")
    @Schema(description = "关联订单编号；草稿未确认生成订单时为 null")
    private String orderNo;

    @JsonProperty("batch_id")
    @Schema(description = "关联登记批次 ID；无批次时为 null")
    private Long batchId;

    @JsonProperty("batch_no")
    @Schema(description = "关联登记批次编号；无批次时为 null")
    private String batchNo;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getDraftNo() {
        return draftNo;
    }

    public void setDraftNo(String draftNo) {
        this.draftNo = draftNo;
    }

    public Long getEnterpriseId() {
        return enterpriseId;
    }

    public void setEnterpriseId(Long enterpriseId) {
        this.enterpriseId = enterpriseId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getConversationId() {
        return conversationId;
    }

    public void setConversationId(Long conversationId) {
        this.conversationId = conversationId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getWorkerSource() {
        return workerSource;
    }

    public void setWorkerSource(String workerSource) {
        this.workerSource = workerSource;
    }

    public List<String> getMissingFields() {
        return missingFields;
    }

    public void setMissingFields(List<String> missingFields) {
        this.missingFields = missingFields;
    }

    public List<String> getRiskPrompts() {
        return riskPrompts;
    }

    public void setRiskPrompts(List<String> riskPrompts) {
        this.riskPrompts = riskPrompts;
    }

    public Long getSelectedPlanId() {
        return selectedPlanId;
    }

    public void setSelectedPlanId(Long selectedPlanId) {
        this.selectedPlanId = selectedPlanId;
    }

    public LocalDateTime getConfirmedAt() {
        return confirmedAt;
    }

    public void setConfirmedAt(LocalDateTime confirmedAt) {
        this.confirmedAt = confirmedAt;
    }

    public Long getConfirmedBy() {
        return confirmedBy;
    }

    public void setConfirmedBy(Long confirmedBy) {
        this.confirmedBy = confirmedBy;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

    public List<DraftWorkerGroupItem> getWorkerGroups() {
        return workerGroups;
    }

    public void setWorkerGroups(List<DraftWorkerGroupItem> workerGroups) {
        this.workerGroups = workerGroups;
    }

    public String getQrCodeUrl() {
        return qrCodeUrl;
    }

    public void setQrCodeUrl(String qrCodeUrl) {
        this.qrCodeUrl = qrCodeUrl;
    }

    public String getQrToken() {
        return qrToken;
    }

    public void setQrToken(String qrToken) {
        this.qrToken = qrToken;
    }

    public Long getOrderId() {
        return orderId;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public Long getBatchId() {
        return batchId;
    }

    public void setBatchId(Long batchId) {
        this.batchId = batchId;
    }

    public String getBatchNo() {
        return batchNo;
    }

    public void setBatchNo(String batchNo) {
        this.batchNo = batchNo;
    }
}
