package com.gree.mall.miniapp.bean.material.parts;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.gree.mall.miniapp.bean.inf.ValidGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Data
@ApiModel
@Accessors(chain = true)
@JsonIgnoreProperties(value = {"createBy", "createTime", "updateBy", "updateTime", "submitBy"
        , "submitTime", "examineBy", "examineTime", "refundedBy", "refundedTime"}, allowGetters = true)
public class NewRefundManageBean {

    private String companyWechatId;
    private String companyWechatName;

    @ApiModelProperty("申请单号")
    @Null(groups = ValidGroup.Add.class, message = "申请单号必须为空")
    @NotNull(groups = ValidGroup.Edit.class, message = "申请单号不能为空")
    private String applyNo;

    @ApiModelProperty("销售单号")
    @NotBlank(groups = {ValidGroup.Add.class, ValidGroup.Edit.class}, message = "销售单id不能空")
    private String salesId;

    @ApiModelProperty(value = "申请类别", required = true)
    @NotBlank(groups = {ValidGroup.Add.class, ValidGroup.Edit.class}, message = "申请类别不能空")
    private String applyCategory;

    @ApiModelProperty(value = "申请类别")
    private String applyCategoryName;

    @ApiModelProperty(value = "申请类型", required = true)
    @NotBlank(groups = {ValidGroup.Add.class, ValidGroup.Edit.class}, message = "申请类型不能空")
    @Pattern(regexp = "^NEW|LOST|BUG$", message = "申请类型错误")
    private String applyType;

    @ApiModelProperty(value = "申请类型")
    private String applyTypeName;

    @ApiModelProperty(value = "返还方式", required = true)
    @NotBlank(groups = {ValidGroup.Add.class, ValidGroup.Edit.class}, message = "返还方式不能空")
    private String refundMode;

    @ApiModelProperty(value = "返还方式")
    private String refundModeName;

    @ApiModelProperty("快递单号")
    private String expressNo;

    @ApiModelProperty("收货地址")
    private String receiveAddress;

    @ApiModelProperty(value = "接收网点编号", required = true)
    @NotBlank(groups = {ValidGroup.Add.class, ValidGroup.Edit.class}, message = "接收网点编号不能空")
    private String receiveWebsitId;

    @ApiModelProperty("接收网点名称")
    private String receiveWebsitName;

    @ApiModelProperty("接收配件网点编号")
    private String receivePartsWebsitId;

    @ApiModelProperty("网点地址")
    private String websitAddress;

    @ApiModelProperty(value = "师傅身份证", required = true)
    @NotBlank(groups = {ValidGroup.Add.class, ValidGroup.Edit.class}, message = "师傅身份证不能空")
    private String identity;

    @ApiModelProperty(value = "师傅编号", required = true)
    @NotBlank(groups = {ValidGroup.Add.class, ValidGroup.Edit.class}, message = "师傅编号不能空")
    private String workerId;

    @ApiModelProperty(value = "师傅名称", required = true)
    @NotBlank(groups = {ValidGroup.Add.class, ValidGroup.Edit.class}, message = "师傅名称不能空")
    private String workerName;

    @ApiModelProperty("退款金额")
    private BigDecimal refundAmount;

    @ApiModelProperty("退款方式")
    private String refundAmountMode;

    @ApiModelProperty("退款方式")
    private String refundAmountModeName;

    @ApiModelProperty("备注")
    private String remark;

    @ApiModelProperty("审批备注")
    private String examineRemark;

    @ApiModelProperty("单据状态")
    private String flag;

    @ApiModelProperty("单据状态")
    private String flagName;

    @ApiModelProperty("创建人")
    private String createBy;

    @ApiModelProperty("创建时间")
    private Date createTime;

    @ApiModelProperty("更新人")
    private String updateBy;

    @ApiModelProperty("更新时间")
    private Date updateTime;

    @ApiModelProperty("提交人")
    private String submitBy;

    @ApiModelProperty("提交时间")
    private Date submitTime;

    @ApiModelProperty("审核人")
    private String examineBy;

    @ApiModelProperty("审核时间")
    private Date examineTime;

    @ApiModelProperty("确认返还人")
    private String refundedBy;

    @ApiModelProperty("确认返还时间")
    private Date refundedTime;

    @ApiModelProperty("申请明细")
    @NotEmpty(groups = {ValidGroup.Add.class, ValidGroup.Edit.class}, message = "申请明细不能空")
    private List<NewRefundManageItemBean> newRefundManageItemBeanList;

    @ApiModelProperty("记录")
    private List<NewRefundManageRecordBean> partsNewRefundManageRecordList;
}
