package com.loan.system.domain.entity;

import lombok.*;

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

@Getter
@Setter
@Entity
@Table(name = "disbursement", indexes = {
        @Index(name = "idx_case_id", columnList = "case_id"),
        @Index(name = "idx_disbursement_status", columnList = "disbursement_status")
})
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Disbursement extends BaseEntity{
    private static final long serialVersionUID = 14L;

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

    @Column(name = "payout_approve_user_id")
    private Long payoutApproveUserId;

    @Column(name = "payout_operator_user_id")
    private Long payoutOperatorUserId;

    @Column(name = "apply_by")
    private Long applyBy;

    @Column(name = "apply_at")
    private String applyAt;

    @Column(name = "disbursement_type", length = 10)
    private String disbursementType;

    @Column(name = "planned_amount", precision = 18, scale = 2)
    private BigDecimal plannedAmount;

    @Column(name = "planned_location")
    private String plannedLocation;

    @Column(name = "disbursement_status", length = 30)
    private String disbursementStatus;

    @Column(name = "contract_id")
    private Long contractId;

    @Column(name = "payout_time")
    private String payoutTime;

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

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

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

}