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

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.gmss.fiscad.entities.BaseEntity;
import io.gmss.fiscad.entities.infocad.parametre.Personne;
import io.gmss.fiscad.entities.infocad.parametre.PositionRepresentation;
import io.gmss.fiscad.entities.infocad.parametre.TypeRepresentation;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.annotations.Where;

import java.io.Serializable;
import java.util.Set;

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

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    @ManyToOne
    private Personne personneRepresantee;  // la personne que l'on représente (PM ou PP)
    @ManyToOne
    private Personne personneRepresantante; // la personne qui représente la personne représentee
    @ManyToOne
    private TypeRepresentation typeRepresentation;
    @ManyToOne
    private PositionRepresentation positionRepresentation;
    @JsonIgnore
    @OneToMany(mappedBy = "membreGroupe")
    private Set<Upload> uploads;
    @JsonIgnore
    @ManyToOne
    private Tpe terminal;
    private Long mobileDataId;
    private Long max_numero_piece_id;
    private Long max_numero_acteur_concerne_id;
    private Long enqueteId;
    private Long blocId;
    private String observation;
    @ColumnDefault("false")
    private boolean synchronise;


}
