package io.gmss.fiscad.entities.user;

import io.gmss.fiscad.entities.BaseEntity;
import io.gmss.fiscad.enums.EtatDemande;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;

import java.io.Serializable;

@EqualsAndHashCode(callSuper = true)
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@SQLDelete(sql =
        "UPDATE tpe " +
                "SET deleted = true " +
                "WHERE id = ?")
@Where(clause = " deleted = false")
public class DemandeReinitialisationMP extends BaseEntity implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    @ManyToOne
    private User user;
    @Enumerated(EnumType.STRING)
    private EtatDemande etatDemande;
}
