Sync: code local unifié
Synchronisation du code source local (fait foi). Signed-off-by: lions dev Team
This commit is contained in:
@@ -19,15 +19,13 @@ import lombok.NoArgsConstructor;
|
||||
* @since 2025-01-29
|
||||
*/
|
||||
@Entity
|
||||
@Table(
|
||||
name = "webhooks_wave",
|
||||
indexes = {
|
||||
@Index(name = "idx_webhook_wave_event_id", columnList = "wave_event_id", unique = true),
|
||||
@Index(name = "idx_webhook_wave_statut", columnList = "statut_traitement"),
|
||||
@Index(name = "idx_webhook_wave_type", columnList = "type_evenement"),
|
||||
@Index(name = "idx_webhook_wave_transaction", columnList = "transaction_wave_id"),
|
||||
@Index(name = "idx_webhook_wave_paiement", columnList = "paiement_id")
|
||||
})
|
||||
@Table(name = "webhooks_wave", indexes = {
|
||||
@Index(name = "idx_webhook_wave_event_id", columnList = "wave_event_id", unique = true),
|
||||
@Index(name = "idx_webhook_wave_statut", columnList = "statut_traitement"),
|
||||
@Index(name = "idx_webhook_wave_type", columnList = "type_evenement"),
|
||||
@Index(name = "idx_webhook_wave_transaction", columnList = "transaction_wave_id"),
|
||||
@Index(name = "idx_webhook_wave_paiement", columnList = "paiement_id")
|
||||
})
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@@ -41,15 +39,13 @@ public class WebhookWave extends BaseEntity {
|
||||
private String waveEventId;
|
||||
|
||||
/** Type d'événement */
|
||||
@Enumerated(EnumType.STRING)
|
||||
@Column(name = "type_evenement", length = 50)
|
||||
private TypeEvenementWebhook typeEvenement;
|
||||
private String typeEvenement;
|
||||
|
||||
/** Statut de traitement */
|
||||
@Enumerated(EnumType.STRING)
|
||||
@Builder.Default
|
||||
@Column(name = "statut_traitement", nullable = false, length = 30)
|
||||
private StatutWebhook statutTraitement = StatutWebhook.EN_ATTENTE;
|
||||
private String statutTraitement = StatutWebhook.EN_ATTENTE.name();
|
||||
|
||||
/** Payload JSON reçu */
|
||||
@Column(name = "payload", columnDefinition = "TEXT")
|
||||
@@ -91,12 +87,13 @@ public class WebhookWave extends BaseEntity {
|
||||
|
||||
/** Méthode métier pour vérifier si le webhook est traité */
|
||||
public boolean isTraite() {
|
||||
return StatutWebhook.TRAITE.equals(statutTraitement);
|
||||
return StatutWebhook.TRAITE.name().equals(statutTraitement);
|
||||
}
|
||||
|
||||
/** Méthode métier pour vérifier si le webhook peut être retenté */
|
||||
public boolean peutEtreRetente() {
|
||||
return (statutTraitement == StatutWebhook.ECHOUE || statutTraitement == StatutWebhook.EN_ATTENTE)
|
||||
return (StatutWebhook.ECHOUE.name().equals(statutTraitement)
|
||||
|| StatutWebhook.EN_ATTENTE.name().equals(statutTraitement))
|
||||
&& (nombreTentatives == null || nombreTentatives < 5);
|
||||
}
|
||||
|
||||
@@ -105,7 +102,7 @@ public class WebhookWave extends BaseEntity {
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
if (statutTraitement == null) {
|
||||
statutTraitement = StatutWebhook.EN_ATTENTE;
|
||||
statutTraitement = StatutWebhook.EN_ATTENTE.name();
|
||||
}
|
||||
if (dateReception == null) {
|
||||
dateReception = LocalDateTime.now();
|
||||
@@ -115,4 +112,3 @@ public class WebhookWave extends BaseEntity {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user