package com.loan.system.domain.entity;

import lombok.*;

import javax.persistence.*;
import java.math.BigDecimal;
import java.time.Instant;

@Entity
@Table(name = "contract", indexes = {
        @Index(name = "idx_case_id", columnList = "case_id")
}, uniqueConstraints = {
        @UniqueConstraint(name = "contract_no", columnNames = {"contract_no"})
})
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Contract extends BaseEntity{
    private static final long serialVersionUID = 4L;

    @Column(name = "business_attr", length = 200)
    private String businessAttr;

    @Column(name = "case_id")
    private Long caseId;

    @Column(name = "customer_id")
    private Long customerId;

    @Column(name = "contract_no", length = 50)
    private String contractNo;

    @Column(name = "contract_name", length = 50)
    private String contractName;

    @Column(name = "contract_version")
    private Integer contractVersion;

    @Column(name = "contract_amount", precision = 15, scale = 2)
    private BigDecimal contractAmount;

    @Column(name = "interest_rate", precision = 5, scale = 4)
    private BigDecimal interestRate;

    @Column(name = "loan_period")
    private Integer loanPeriod;

    @Lob
    @Column(name = "content")
    private String content;

    @Column(name = "signed_by_customer")
    private Boolean signedByCustomer;

    @Column(name = "commited_id")
    private Long commitedId;

    @Column(name = "sifned_id")
    private Long sifnedId;

    @Column(name = "signed_time")
    private String signedTime;

    @Column(name = "is_push")
    private Boolean isPush;

    @Column(name = "create_time")
    private String createTime;

    @Column(name = "update_time")
    private String updateTime;

    @Column(name = "is_delete")
    private Boolean isDelete;

}