package dev.lions.unionflow.server.entity.mutuelle.credit;

import dev.lions.unionflow.server.api.enums.mutuelle.credit.TypeGarantie;
import dev.lions.unionflow.server.entity.BaseEntity;

import jakarta.persistence.*;
import jakarta.validation.constraints.NotNull;
import lombok.*;

import java.math.BigDecimal;

@Entity
@Table(name = "garanties_demande")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@EqualsAndHashCode(callSuper = true)
@ToString(exclude = "demandeCredit")
public class GarantieDemande extends BaseEntity {

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "demande_credit_id", nullable = false)
    private DemandeCredit demandeCredit;

    @NotNull
    @Enumerated(EnumType.STRING)
    @Column(name = "type_garantie", nullable = false, length = 50)
    private TypeGarantie typeGarantie;

    @Column(name = "valeur_estimee", precision = 19, scale = 4)
    private BigDecimal valeurEstimee;

    @Column(name = "reference_description", length = 500)
    private String referenceOuDescription;

    @Column(name = "document_preuve_id", length = 36)
    private String documentPreuveId;
}
