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

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.gmss.fiscad.entities.BaseEntity;
import io.gmss.fiscad.entities.decoupage.Quartier;
import io.gmss.fiscad.entities.infocad.parametre.NatureDomaine;
import io.gmss.fiscad.entities.rfu.metier.Batiment;
import jakarta.persistence.*;
import lombok.*;
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;

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

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

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    private String qip;
    private String q;
    private String nup;
    private String nupProvisoire;
    private String numeroParcelle;
    private String longitude;
    private String latitude;
    private String situationGeographique;
    @ColumnDefault("0")
    private int superficie;
    @ManyToOne
    private NatureDomaine natureDomaine;
    @JsonIgnore
    @ManyToOne
    private Quartier quartier;
    private String i;
    private String p;
    private String observation;
    private String numTitreFoncier;
    @JsonIgnore
    @ManyToOne
    private Tpe terminal;
    private String autreNumeroTitreFoncier;

    private Long typeDomaineId;
    private Long numeroProvisoire;
    private Long blocId;
    @ColumnDefault("false")
    private boolean synchronise;
    private Long idDerniereEnquete;
    private Long mobileDataId;
//    @JsonIgnore
//    @OneToMany(mappedBy = "parcelle")
//    private List<Batiment> batiments;

    //    @ColumnDefault("0")
//    private int  geomSrid;
//
//    @JsonSerialize(using = GeometrySerializer.class)
//    @JsonDeserialize(contentUsing = GeometryDeserializer.class)
//    @Column(name = "geom",columnDefinition = "geometry(MultiPolygon,4326)")
//    private Point geometry;
//
//    @JsonSerialize(using = GeometrySerializer.class)
//    @JsonDeserialize(contentUsing = GeometryDeserializer.class)
//    @Column(name = "geom_32631",columnDefinition = "geometry(MultiPolygon,32631)")
//    private Point geometry32631;
}
