package com.cool.store.request;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.persistence.Column;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.io.Serializable;

@Data
public class SplitOrderRequest implements Serializable {

    @ApiModelProperty("主键ID（编辑时必填）")
    private Long id;

    @ApiModelProperty("分账类型（1-门店付款/2-门店收款/3-公司间结算）")
    @NotNull(message = "分账类型不能为空")
    private Integer splitType;

    @ApiModelProperty("关联门店")
    private String relatedStoreId;

    @ApiModelProperty("付款账户名称")
    @NotBlank(message = "付款账户名称不能为空")
    @Length(max = 128, message = "付款账户名称长度不能超过128")
    private String payerAccountName;

    @ApiModelProperty("付款账户账号")
    private String payerAccountNo;

    @ApiModelProperty("收款账户名称")
    @NotBlank(message = "收款账户名称不能为空")
    @Length(max = 128, message = "收款账户名称长度不能超过128")
    private String payeeAccountName;

    @ApiModelProperty("收款账户")
    private String payeeAccountNo;

    @ApiModelProperty("费用类型（装修类/采购设备类/设备类）")
    @NotBlank(message = "费用类型不能为空")
    private String expenseTypeCode;

    @ApiModelProperty("分账金额")
    @NotNull(message = "分账金额不能为空")
    @DecimalMin(value = "0.01", message = "分账金额必须大于0")
    private BigDecimal splitAmount;

    @ApiModelProperty("关联单据号（如费用调整单号）")
    private String relatedDocNo;

    @ApiModelProperty("备注")
    @Length(max = 255, message = "备注长度不能超过255")
    private String remark;

    @ApiModelProperty("附件信息")
    private String attachmentInfo;
}
