package dev.lions.unionflow.server.entity;

import jakarta.persistence.*;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import java.util.UUID;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * Donateur — registre obligatoire pour les entités relevant de SYCEBNL (associations, ONG,
 * mutuelles sociales).
 *
 * @since 2026-04-25 (P1-NEW-13)
 */
@Entity
@Table(name = "donateurs", indexes = {
    @Index(name = "idx_donateur_org", columnList = "organisation_id"),
    @Index(name = "idx_donateur_type", columnList = "type_donateur")
})
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@EqualsAndHashCode(callSuper = true)
public class Donateur extends BaseEntity {

  @NotNull
  @Column(name = "organisation_id", nullable = false)
  private UUID organisationId;

  @NotBlank
  @Column(name = "type_donateur", nullable = false, length = 20)
  private String typeDonateur; // PERSONNE_PHYSIQUE, PERSONNE_MORALE, ANONYME

  @Column(name = "nom_prenoms", length = 255)
  private String nomPrenoms;

  @Column(name = "raison_sociale", length = 255)
  private String raisonSociale;

  @Column(name = "pays", length = 3)
  private String pays;

  @Column(name = "email", length = 255)
  private String email;

  @Column(name = "telephone", length = 20)
  private String telephone;
}
