package com.cool.store.entity;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 分账主表
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "zxjp_split_order")
public class SplitOrderDO {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @ApiModelProperty("主键ID")
    private Long id;

    @ApiModelProperty("分账单号")
    @Column(name = "split_no")
    private String splitNo;

    @ApiModelProperty("分账类型（1-门店付款/2-门店收款/3-公司间结算）")
    @Column(name = "split_type")
    private Integer splitType;

    @ApiModelProperty("关联门店")
    @Column(name = "related_store_id")
    private String relatedStoreId;

    @ApiModelProperty("付款账户名称")
    @Column(name = "payer_account_name")
    private String payerAccountName;

    @ApiModelProperty("付款账户")
    @Column(name = "payer_account_no")
    private String payerAccountNo;

    @ApiModelProperty("收款账户名称")
    @Column(name = "payee_account_name")
    private String payeeAccountName;

    @ApiModelProperty("收款账户")
    @Column(name = "payee_account_no")
    private String payeeAccountNo;

    @ApiModelProperty("费用类型（装修类/采购设备类/设备类）字典表")
    @Column(name = "expense_type_code")
    private String expenseTypeCode;

    @ApiModelProperty("分账金额")
    @Column(name = "split_amount")
    private BigDecimal splitAmount;

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

    @ApiModelProperty("附件信息")
    @Column(name = "attachment_info", columnDefinition = "TEXT")
    private String attachmentInfo;

    @ApiModelProperty("备注")
    @Column(name = "remark")
    private String remark;

    @ApiModelProperty("分账失败原因")
    @Column(name = "fail_reason", length = 256)
    private String failReason;

    @ApiModelProperty("状态 1-已分账 2-分账失败 3-分账中 5-待分账")
    @Column(name = "status")
    private Integer status;

    @ApiModelProperty("确认人")
    @Column(name = "confirmer")
    private String confirmer;

    @ApiModelProperty("确认时间")
    @Column(name = "confirm_time")
    private Date confirmTime;

    @ApiModelProperty("创建人")
    @Column(name = "create_user_id")
    private String createUserId;

    @ApiModelProperty("创建时间")
    @Column(name = "create_time")
    private Date createTime;

    @ApiModelProperty("单据来源（1-手工新增/2-费用调整单/3-费用单）")
    @Column(name = "source")
    private Integer source;

    @ApiModelProperty("删除 0-未删除 1-删除")
    @Column(name = "deleted")
    private Integer deleted;
}
