package io.gmss.fiscad.entities.rfu.metier;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.gmss.fiscad.entities.BaseEntity;
import io.gmss.fiscad.entities.infocad.metier.Tpe;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.Where;

import java.io.Serializable;
import java.util.List;

@EqualsAndHashCode(callSuper = true)
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@Where(clause = " deleted = false")
public class UniteLogement extends BaseEntity implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    private String nul;
    private String numeroEtage;
    private String code;
    @JsonIgnore
    @OneToMany(mappedBy = "uniteLogement")
    private List<EnqueteUniteLogement> enqueteUniteLogements;
    @ManyToOne
    private Batiment batiment;
    private Long batimentExternalKey;
    private Long idDerniereEnquete;
    @JsonIgnore
    @ManyToOne
    private Tpe terminal;
    private Long enqueteId;
    private Long mobileDataId;
}
