This commit is contained in:
sidibe
2025-11-19 12:20:37 +00:00
commit 1972c8ff90
86 changed files with 3373 additions and 0 deletions

View File

@@ -0,0 +1,67 @@
package com.pmu.betengine.model;
import com.pmu.betengine.model.statut.StatutTPE;
import com.pmu.betengine.model.type.TypeTPE;
import jakarta.persistence.*;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;
import java.time.LocalDateTime;
@Entity
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "tpe", uniqueConstraints = {
@UniqueConstraint(columnNames = "imei"),
@UniqueConstraint(columnNames = "serial")
})
public class TPE {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@NotBlank(message = "L'IMEI est obligatoire")
@Column(unique = true, nullable = false, length = 15)
private String imei;
@NotBlank(message = "Le numéro de série est obligatoire")
@Column(unique = true, nullable = false)
private String serial;
@Enumerated(EnumType.STRING)
@NotNull(message = "Le type est obligatoire")
@Column(nullable = false)
private TypeTPE type;
@NotBlank(message = "La marque est obligatoire")
@Column(nullable = false)
private String marque;
@NotBlank(message = "Le modèle est obligatoire")
@Column(nullable = false)
private String modele;
@Enumerated(EnumType.STRING)
@NotNull(message = "Le statut est obligatoire")
@Column(nullable = false)
private StatutTPE statut = StatutTPE.DISPONIBLE;
@Column(nullable = false)
private boolean assigne = false;
@CreationTimestamp
@Column(nullable = false, updatable = false)
private LocalDateTime createdAt;
@UpdateTimestamp
@Column(nullable = false)
private LocalDateTime updatedAt;
}