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

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

import javax.validation.constraints.NotNull;
import java.time.LocalDate;

/**
 * 任务发布时单个工种的计划起止日期。
 * <p>匹配优先级：{@code id} → {@code group_no} → {@code job_type}。</p>
 */
@Schema(description = "任务发布用工明细（工种起止日期）")
public class TaskPublishWorkItemRequest {

    @JsonProperty("id")
    @JsonAlias({"work_item_id", "workItemId"})
    @Schema(description = "fe_order_work_item.id，优先匹配")
    private Long id;

    @JsonProperty("group_no")
    @JsonAlias({"groupNo"})
    @Schema(description = "用工分组号，其次匹配")
    private String groupNo;

    @JsonProperty("job_type")
    @JsonAlias({"jobType"})
    @Schema(description = "工种名称，再次匹配")
    private String jobType;

    @NotNull(message = "work_start_date 不能为空")
    @JsonProperty("work_start_date")
    @JsonAlias({"workStartDate"})
    @Schema(description = "计划开工日", requiredMode = Schema.RequiredMode.REQUIRED, example = "2026-08-01")
    private LocalDate workStartDate;

    @NotNull(message = "work_end_date 不能为空")
    @JsonProperty("work_end_date")
    @JsonAlias({"workEndDate"})
    @Schema(description = "计划结束日", requiredMode = Schema.RequiredMode.REQUIRED, example = "2026-08-10")
    private LocalDate workEndDate;

    public Long getId() {
        return id;
    }

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

    public String getGroupNo() {
        return groupNo;
    }

    public void setGroupNo(String groupNo) {
        this.groupNo = groupNo;
    }

    public String getJobType() {
        return jobType;
    }

    public void setJobType(String jobType) {
        this.jobType = jobType;
    }

    public LocalDate getWorkStartDate() {
        return workStartDate;
    }

    public void setWorkStartDate(LocalDate workStartDate) {
        this.workStartDate = workStartDate;
    }

    public LocalDate getWorkEndDate() {
        return workEndDate;
    }

    public void setWorkEndDate(LocalDate workEndDate) {
        this.workEndDate = workEndDate;
    }
}
