package com.bonus.canteen.core.order.domain.param;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Data
public class OrderAddParam {
    private @NotNull(
            message = "订单实付金额不能为空"
    ) @DecimalMin(
            value = "0",
            message = "订单实付金额不能小于0"
    ) BigDecimal realAmount;
    private @NotNull(
            message = "订单应付金额不能为空"
    ) @DecimalMin(
            value = "0",
            message = "订单应付金额不能小于0"
    ) BigDecimal payableAmount;
    @NotNull(message = "用户ID不能为空")
    private Long userId;
    @NotNull(message = "下单日期不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date placeDate;
    @NotNull(message = "支付类型不能为空")
    private Integer payType;
    @NotNull(message = "订单来源不能为空")
    private Integer sourceType;
    private Integer isOnline;
    @Valid
    @NotNull(message = "订单列表不能为空")
    private List<OrderInfoAddParam> orderList;
}
