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_adjustment_order")
public class AdjustmentOrderDO {

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

    @ApiModelProperty("调整单号")
    @Column(name = "adjustment_no")
    private String adjustmentNo;

    @ApiModelProperty("门店ID")
    @Column(name = "store_id")
    private String storeId;

    @ApiModelProperty("业务类型 字典表")
    @Column(name = "business_type_code")
    private String businessTypeCode;

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

    @ApiModelProperty("调整类型（1-调增 2-调减）")
    @Column(name = "adjust_type")
    private Integer adjustType;

    @ApiModelProperty("调整金额")
    @Column(name = "adjust_amount")
    private BigDecimal adjustAmount;

    @ApiModelProperty("调整原因")
    @Column(name = "adjust_reason")
    private String adjustReason;

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

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

    @ApiModelProperty("单据状态（10-待充值/20-已充值待认款/30-认款完成/40-分部分账/50-分账完成）")
    @Column(name = "status")
    private Integer status;

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

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

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

    @ApiModelProperty("已分账金额")
    @Column(name = "settled_amount", columnDefinition = "decimal(12,2) NOT NULL")
    private BigDecimal settledAmount;

    @ApiModelProperty("待分账金额")
    @Column(name = "pending_settlement_amount", columnDefinition = "decimal(12,2) NOT NULL")
    private BigDecimal pendingSettlementAmount;

    @ApiModelProperty("认领人ID")
    @Column(name = "claim_user_id", length = 64)
    private String claimUserId;

    @ApiModelProperty("认领时间")
    @Column(name = "claim_time")
    private Date claimTime;

    @ApiModelProperty("费用单类型 1-费用单 2-调整单")
    @Column(name = "expense_sheet_type")
    private Integer expenseSheetType;

    @ApiModelProperty("合同附件信息")
    @Column(name = "contract_attachment_info", columnDefinition = "TEXT")
    private String contractAttachmentInfo;

    @ApiModelProperty("支付时间")
    @Column(name = "pay_time")
    private Date payTime;
}
