package com.sckw.order.model.vo.req;

import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.Valid;
import jakarta.validation.constraints.DecimalMin;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.math.BigDecimal;
import java.time.LocalDate;

/**
 * @desc: 受理订单请求参数
 * @author: yzc
 * @date: 2023-07-12 11:08
 */
@Getter
@Setter
@ToString
public class AcceptanceOrderParam {

    @NotNull(message = "订单id不能为空")
    private Long id;

    @NotNull(message = "订单总量不能为空")
    @DecimalMin(value = "0.01",message = "订单总量必须大于零")
    private BigDecimal amount;

    @NotNull(message = "订单成交单价不能为空")
    @DecimalMin(value = "0.01",message = "订单成交单价必须大于零")
    private BigDecimal unitPrice;

    @NotNull(message = "订单金额不能为空")
    @DecimalMin(value = "0.01",message = "订单金额必须大于零")
    private BigDecimal price;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @NotNull(message = "开始时间不能为空")
    private LocalDate startTime;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @NotNull(message = "结束时间不能为空")
    private LocalDate endTime;

    @NotBlank(message = "交易方式不能为空")
    private String trading;

    @NotBlank(message = "提货方式不能为空")
    private String pickupType;

    @NotBlank(message = "交付类型不能为空")
    private String deliveryType;

    @NotNull(message = "合同信息不能为空")
    @Valid
    private ContractInfo contractInfo;
}
