package com.yhy.module.core.controller.admin.infoprice.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.Map;

import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;

@Schema(description = "管理后台 - 信息价工料机价格历史创建/更新 Request VO")
@Data
public class InfoPriceResourcePriceSaveReqVO {

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

    @Schema(description = "工料机信息ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "工料机信息ID不能为空")
    private Long resourceId;

    @Schema(description = "开始时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2024-01-01")
    @NotNull(message = "开始时间不能为空")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDate startTime;

    @Schema(description = "结束时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2024-01-31")
    @NotNull(message = "结束时间不能为空")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDate endTime;

    @Schema(description = "除税单价", requiredMode = Schema.RequiredMode.REQUIRED, example = "450.00")
    @NotNull(message = "除税单价不能为空")
    private BigDecimal priceTaxExcl;

    @Schema(description = "税率", requiredMode = Schema.RequiredMode.REQUIRED, example = "0.09")
    @NotNull(message = "税率不能为空")
    private BigDecimal taxRate;

    @Schema(description = "含税单价", requiredMode = Schema.RequiredMode.REQUIRED, example = "490.50")
    @NotNull(message = "含税单价不能为空")
    private BigDecimal priceTaxIncl;

    @Schema(description = "扩展属性", example = "{}")
    private Map<String, Object> attributes;

}
