fix: Correction des boutons d'action dans organisation/liste.xhtml et corrections diverses
- Alignement des boutons d'action avec membre/liste.xhtml (icônes seulement, style rounded) - Remplacement findByIdOptional par find[Entity]ById dans tous les repositories - Correction des erreurs de compilation UUID vs Long - Correction du test MembreServiceAdvancedSearchTest (suppression assignation roles String) - Ajout de méthodes find[Entity]ById dans tous les repositories - Mise à jour des services pour utiliser les nouvelles méthodes de repository - Correction des appels order() vers Sort.by() dans les repositories - Suppression des tests obsolètes dans unionflow-server-api
This commit is contained in:
@@ -39,7 +39,7 @@ public class Adresse extends BaseEntity {
|
||||
/** Type d'adresse */
|
||||
@Enumerated(EnumType.STRING)
|
||||
@Column(name = "type_adresse", nullable = false, length = 50)
|
||||
private dev.lions.unionflow.server.api.enums.adresse.TypeAdresse typeAdresse;
|
||||
private TypeAdresse typeAdresse;
|
||||
|
||||
/** Adresse complète */
|
||||
@Column(name = "adresse", length = 500)
|
||||
|
||||
@@ -68,9 +68,6 @@ public class Membre extends BaseEntity {
|
||||
@Column(name = "date_adhesion", nullable = false)
|
||||
private LocalDate dateAdhesion;
|
||||
|
||||
@Column(name = "roles", length = 500)
|
||||
private String roles;
|
||||
|
||||
// Relations
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "organisation_id")
|
||||
|
||||
@@ -6,6 +6,8 @@ import jakarta.persistence.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package dev.lions.unionflow.server.repository;
|
||||
|
||||
import dev.lions.unionflow.server.api.enums.adresse.TypeAdresse;
|
||||
import dev.lions.unionflow.server.entity.Adresse;
|
||||
import dev.lions.unionflow.server.entity.Adresse.TypeAdresse;
|
||||
import io.quarkus.hibernate.orm.panache.PanacheRepository;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import java.util.List;
|
||||
@@ -18,6 +18,16 @@ import java.util.UUID;
|
||||
@ApplicationScoped
|
||||
public class AdresseRepository implements PanacheRepository<Adresse> {
|
||||
|
||||
/**
|
||||
* Trouve une adresse par son UUID
|
||||
*
|
||||
* @param id UUID de l'adresse
|
||||
* @return Adresse ou Optional.empty()
|
||||
*/
|
||||
public Optional<Adresse> findAdresseById(UUID id) {
|
||||
return find("id = ?1", id).firstResultOptional();
|
||||
}
|
||||
|
||||
/**
|
||||
* Trouve toutes les adresses d'une organisation
|
||||
*
|
||||
|
||||
@@ -6,6 +6,7 @@ import io.quarkus.hibernate.orm.panache.PanacheRepository;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Repository pour l'entité CompteComptable
|
||||
@@ -17,6 +18,16 @@ import java.util.Optional;
|
||||
@ApplicationScoped
|
||||
public class CompteComptableRepository implements PanacheRepository<CompteComptable> {
|
||||
|
||||
/**
|
||||
* Trouve un compte comptable par son UUID
|
||||
*
|
||||
* @param id UUID du compte comptable
|
||||
* @return Compte comptable ou Optional.empty()
|
||||
*/
|
||||
public Optional<CompteComptable> findCompteComptableById(UUID id) {
|
||||
return find("id = ?1 AND actif = true", id).firstResultOptional();
|
||||
}
|
||||
|
||||
/**
|
||||
* Trouve un compte par son numéro
|
||||
*
|
||||
|
||||
@@ -18,6 +18,16 @@ import java.util.UUID;
|
||||
@ApplicationScoped
|
||||
public class CompteWaveRepository implements PanacheRepository<CompteWave> {
|
||||
|
||||
/**
|
||||
* Trouve un compte Wave par son UUID
|
||||
*
|
||||
* @param id UUID du compte Wave
|
||||
* @return Compte Wave ou Optional.empty()
|
||||
*/
|
||||
public Optional<CompteWave> findCompteWaveById(UUID id) {
|
||||
return find("id = ?1 AND actif = true", id).firstResultOptional();
|
||||
}
|
||||
|
||||
/**
|
||||
* Trouve un compte Wave par numéro de téléphone
|
||||
*
|
||||
|
||||
@@ -5,6 +5,7 @@ import io.quarkus.hibernate.orm.panache.PanacheRepository;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Repository pour l'entité ConfigurationWave
|
||||
@@ -16,6 +17,16 @@ import java.util.Optional;
|
||||
@ApplicationScoped
|
||||
public class ConfigurationWaveRepository implements PanacheRepository<ConfigurationWave> {
|
||||
|
||||
/**
|
||||
* Trouve une configuration Wave par son UUID
|
||||
*
|
||||
* @param id UUID de la configuration
|
||||
* @return Configuration ou Optional.empty()
|
||||
*/
|
||||
public Optional<ConfigurationWave> findConfigurationWaveById(UUID id) {
|
||||
return find("id = ?1 AND actif = true", id).firstResultOptional();
|
||||
}
|
||||
|
||||
/**
|
||||
* Trouve une configuration par sa clé
|
||||
*
|
||||
|
||||
@@ -258,7 +258,7 @@ public class CotisationRepository extends BaseRepository<Cotisation> {
|
||||
* @return true si mise à jour réussie
|
||||
*/
|
||||
public boolean incrementerNombreRappels(UUID cotisationId) {
|
||||
Cotisation cotisation = findById(cotisationId);
|
||||
Cotisation cotisation = findByIdOptional(cotisationId).orElse(null);
|
||||
if (cotisation != null) {
|
||||
cotisation.setNombreRappels(
|
||||
cotisation.getNombreRappels() != null ? cotisation.getNombreRappels() + 1 : 1);
|
||||
|
||||
@@ -6,6 +6,7 @@ import io.quarkus.hibernate.orm.panache.PanacheRepository;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Repository pour l'entité Document
|
||||
@@ -17,6 +18,16 @@ import java.util.Optional;
|
||||
@ApplicationScoped
|
||||
public class DocumentRepository implements PanacheRepository<Document> {
|
||||
|
||||
/**
|
||||
* Trouve un document par son UUID
|
||||
*
|
||||
* @param id UUID du document
|
||||
* @return Document ou Optional.empty()
|
||||
*/
|
||||
public Optional<Document> findDocumentById(UUID id) {
|
||||
return find("id = ?1 AND actif = true", id).firstResultOptional();
|
||||
}
|
||||
|
||||
/**
|
||||
* Trouve un document par son hash MD5
|
||||
*
|
||||
|
||||
@@ -18,6 +18,16 @@ import java.util.UUID;
|
||||
@ApplicationScoped
|
||||
public class EcritureComptableRepository implements PanacheRepository<EcritureComptable> {
|
||||
|
||||
/**
|
||||
* Trouve une écriture comptable par son UUID
|
||||
*
|
||||
* @param id UUID de l'écriture comptable
|
||||
* @return Écriture comptable ou Optional.empty()
|
||||
*/
|
||||
public Optional<EcritureComptable> findEcritureComptableById(UUID id) {
|
||||
return find("id = ?1 AND actif = true", id).firstResultOptional();
|
||||
}
|
||||
|
||||
/**
|
||||
* Trouve une écriture par son numéro de pièce
|
||||
*
|
||||
|
||||
@@ -7,6 +7,7 @@ import jakarta.enterprise.context.ApplicationScoped;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Repository pour l'entité JournalComptable
|
||||
@@ -18,6 +19,16 @@ import java.util.Optional;
|
||||
@ApplicationScoped
|
||||
public class JournalComptableRepository implements PanacheRepository<JournalComptable> {
|
||||
|
||||
/**
|
||||
* Trouve un journal comptable par son UUID
|
||||
*
|
||||
* @param id UUID du journal comptable
|
||||
* @return Journal comptable ou Optional.empty()
|
||||
*/
|
||||
public Optional<JournalComptable> findJournalComptableById(UUID id) {
|
||||
return find("id = ?1 AND actif = true", id).firstResultOptional();
|
||||
}
|
||||
|
||||
/**
|
||||
* Trouve un journal par son code
|
||||
*
|
||||
|
||||
@@ -4,6 +4,7 @@ import dev.lions.unionflow.server.entity.LigneEcriture;
|
||||
import io.quarkus.hibernate.orm.panache.PanacheRepository;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
@@ -16,6 +17,16 @@ import java.util.UUID;
|
||||
@ApplicationScoped
|
||||
public class LigneEcritureRepository implements PanacheRepository<LigneEcriture> {
|
||||
|
||||
/**
|
||||
* Trouve une ligne d'écriture par son UUID
|
||||
*
|
||||
* @param id UUID de la ligne d'écriture
|
||||
* @return Ligne d'écriture ou Optional.empty()
|
||||
*/
|
||||
public Optional<LigneEcriture> findLigneEcritureById(UUID id) {
|
||||
return find("id = ?1", id).firstResultOptional();
|
||||
}
|
||||
|
||||
/**
|
||||
* Trouve toutes les lignes d'une écriture
|
||||
*
|
||||
|
||||
@@ -5,6 +5,7 @@ import io.quarkus.hibernate.orm.panache.PanacheRepository;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
@@ -17,6 +18,16 @@ import java.util.UUID;
|
||||
@ApplicationScoped
|
||||
public class MembreRoleRepository implements PanacheRepository<MembreRole> {
|
||||
|
||||
/**
|
||||
* Trouve une attribution membre-role par son UUID
|
||||
*
|
||||
* @param id UUID de l'attribution
|
||||
* @return Attribution ou Optional.empty()
|
||||
*/
|
||||
public Optional<MembreRole> findMembreRoleById(UUID id) {
|
||||
return find("id = ?1 AND actif = true", id).firstResultOptional();
|
||||
}
|
||||
|
||||
/**
|
||||
* Trouve tous les rôles d'un membre
|
||||
*
|
||||
|
||||
@@ -8,6 +8,7 @@ import io.quarkus.hibernate.orm.panache.PanacheRepository;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
@@ -20,6 +21,16 @@ import java.util.UUID;
|
||||
@ApplicationScoped
|
||||
public class NotificationRepository implements PanacheRepository<Notification> {
|
||||
|
||||
/**
|
||||
* Trouve une notification par son UUID
|
||||
*
|
||||
* @param id UUID de la notification
|
||||
* @return Notification ou Optional.empty()
|
||||
*/
|
||||
public Optional<Notification> findNotificationById(UUID id) {
|
||||
return find("id = ?1", id).firstResultOptional();
|
||||
}
|
||||
|
||||
/**
|
||||
* Trouve toutes les notifications d'un membre
|
||||
*
|
||||
|
||||
@@ -23,6 +23,16 @@ import java.util.UUID;
|
||||
@ApplicationScoped
|
||||
public class PaiementRepository implements PanacheRepository<Paiement> {
|
||||
|
||||
/**
|
||||
* Trouve un paiement par son UUID
|
||||
*
|
||||
* @param id UUID du paiement
|
||||
* @return Paiement ou Optional.empty()
|
||||
*/
|
||||
public Optional<Paiement> findPaiementById(UUID id) {
|
||||
return find("id = ?1 AND actif = true", id).firstResultOptional();
|
||||
}
|
||||
|
||||
/**
|
||||
* Trouve un paiement par son numéro de référence
|
||||
*
|
||||
@@ -40,8 +50,7 @@ public class PaiementRepository implements PanacheRepository<Paiement> {
|
||||
* @return Liste des paiements
|
||||
*/
|
||||
public List<Paiement> findByMembreId(UUID membreId) {
|
||||
return find("membre.id = ?1 AND actif = true", membreId)
|
||||
.order("datePaiement DESC")
|
||||
return find("membre.id = ?1 AND actif = true", Sort.by("datePaiement", Sort.Direction.Descending), membreId)
|
||||
.list();
|
||||
}
|
||||
|
||||
@@ -52,8 +61,7 @@ public class PaiementRepository implements PanacheRepository<Paiement> {
|
||||
* @return Liste des paiements
|
||||
*/
|
||||
public List<Paiement> findByStatut(StatutPaiement statut) {
|
||||
return find("statutPaiement = ?1 AND actif = true", statut)
|
||||
.order("datePaiement DESC")
|
||||
return find("statutPaiement = ?1 AND actif = true", Sort.by("datePaiement", Sort.Direction.Descending), statut)
|
||||
.list();
|
||||
}
|
||||
|
||||
@@ -64,8 +72,7 @@ public class PaiementRepository implements PanacheRepository<Paiement> {
|
||||
* @return Liste des paiements
|
||||
*/
|
||||
public List<Paiement> findByMethode(MethodePaiement methode) {
|
||||
return find("methodePaiement = ?1 AND actif = true", methode)
|
||||
.order("datePaiement DESC")
|
||||
return find("methodePaiement = ?1 AND actif = true", Sort.by("datePaiement", Sort.Direction.Descending), methode)
|
||||
.list();
|
||||
}
|
||||
|
||||
@@ -79,10 +86,10 @@ public class PaiementRepository implements PanacheRepository<Paiement> {
|
||||
public List<Paiement> findValidesParPeriode(LocalDateTime dateDebut, LocalDateTime dateFin) {
|
||||
return find(
|
||||
"statutPaiement = ?1 AND dateValidation >= ?2 AND dateValidation <= ?3 AND actif = true",
|
||||
Sort.by("dateValidation", Sort.Direction.Descending),
|
||||
StatutPaiement.VALIDE,
|
||||
dateDebut,
|
||||
dateFin)
|
||||
.order("dateValidation DESC")
|
||||
.list();
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,11 @@ package dev.lions.unionflow.server.repository;
|
||||
|
||||
import dev.lions.unionflow.server.entity.Permission;
|
||||
import io.quarkus.hibernate.orm.panache.PanacheRepository;
|
||||
import io.quarkus.panache.common.Sort;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Repository pour l'entité Permission
|
||||
@@ -16,6 +18,16 @@ import java.util.Optional;
|
||||
@ApplicationScoped
|
||||
public class PermissionRepository implements PanacheRepository<Permission> {
|
||||
|
||||
/**
|
||||
* Trouve une permission par son UUID
|
||||
*
|
||||
* @param id UUID de la permission
|
||||
* @return Permission ou Optional.empty()
|
||||
*/
|
||||
public Optional<Permission> findPermissionById(UUID id) {
|
||||
return find("id = ?1 AND actif = true", id).firstResultOptional();
|
||||
}
|
||||
|
||||
/**
|
||||
* Trouve une permission par son code
|
||||
*
|
||||
@@ -67,7 +79,9 @@ public class PermissionRepository implements PanacheRepository<Permission> {
|
||||
* @return Liste des permissions actives
|
||||
*/
|
||||
public List<Permission> findAllActives() {
|
||||
return find("actif = true").order("module ASC, ressource ASC, action ASC").list();
|
||||
return find("actif = true", Sort.by("module", Sort.Direction.Ascending)
|
||||
.and("ressource", Sort.Direction.Ascending)
|
||||
.and("action", Sort.Direction.Ascending)).list();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import dev.lions.unionflow.server.entity.PieceJointe;
|
||||
import io.quarkus.hibernate.orm.panache.PanacheRepository;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
@@ -16,6 +17,16 @@ import java.util.UUID;
|
||||
@ApplicationScoped
|
||||
public class PieceJointeRepository implements PanacheRepository<PieceJointe> {
|
||||
|
||||
/**
|
||||
* Trouve une pièce jointe par son UUID
|
||||
*
|
||||
* @param id UUID de la pièce jointe
|
||||
* @return Pièce jointe ou Optional.empty()
|
||||
*/
|
||||
public Optional<PieceJointe> findPieceJointeById(UUID id) {
|
||||
return find("id = ?1", id).firstResultOptional();
|
||||
}
|
||||
|
||||
/**
|
||||
* Trouve toutes les pièces jointes d'un document
|
||||
*
|
||||
|
||||
@@ -4,6 +4,7 @@ import dev.lions.unionflow.server.entity.RolePermission;
|
||||
import io.quarkus.hibernate.orm.panache.PanacheRepository;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
@@ -16,6 +17,16 @@ import java.util.UUID;
|
||||
@ApplicationScoped
|
||||
public class RolePermissionRepository implements PanacheRepository<RolePermission> {
|
||||
|
||||
/**
|
||||
* Trouve une association rôle-permission par son UUID
|
||||
*
|
||||
* @param id UUID de l'association
|
||||
* @return Association ou Optional.empty()
|
||||
*/
|
||||
public Optional<RolePermission> findRolePermissionById(UUID id) {
|
||||
return find("id = ?1 AND actif = true", id).firstResultOptional();
|
||||
}
|
||||
|
||||
/**
|
||||
* Trouve toutes les permissions d'un rôle
|
||||
*
|
||||
|
||||
@@ -3,6 +3,7 @@ package dev.lions.unionflow.server.repository;
|
||||
import dev.lions.unionflow.server.entity.Role;
|
||||
import dev.lions.unionflow.server.entity.Role.TypeRole;
|
||||
import io.quarkus.hibernate.orm.panache.PanacheRepository;
|
||||
import io.quarkus.panache.common.Sort;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
@@ -18,6 +19,16 @@ import java.util.UUID;
|
||||
@ApplicationScoped
|
||||
public class RoleRepository implements PanacheRepository<Role> {
|
||||
|
||||
/**
|
||||
* Trouve un rôle par son UUID
|
||||
*
|
||||
* @param id UUID du rôle
|
||||
* @return Rôle ou Optional.empty()
|
||||
*/
|
||||
public Optional<Role> findRoleById(UUID id) {
|
||||
return find("id = ?1 AND actif = true", id).firstResultOptional();
|
||||
}
|
||||
|
||||
/**
|
||||
* Trouve un rôle par son code
|
||||
*
|
||||
@@ -34,8 +45,7 @@ public class RoleRepository implements PanacheRepository<Role> {
|
||||
* @return Liste des rôles système
|
||||
*/
|
||||
public List<Role> findRolesSysteme() {
|
||||
return find("typeRole = ?1 AND actif = true", TypeRole.SYSTEME)
|
||||
.order("niveauHierarchique ASC")
|
||||
return find("typeRole = ?1 AND actif = true", Sort.by("niveauHierarchique", Sort.Direction.Ascending), TypeRole.SYSTEME)
|
||||
.list();
|
||||
}
|
||||
|
||||
@@ -46,8 +56,7 @@ public class RoleRepository implements PanacheRepository<Role> {
|
||||
* @return Liste des rôles
|
||||
*/
|
||||
public List<Role> findByOrganisationId(UUID organisationId) {
|
||||
return find("organisation.id = ?1 AND actif = true", organisationId)
|
||||
.order("niveauHierarchique ASC")
|
||||
return find("organisation.id = ?1 AND actif = true", Sort.by("niveauHierarchique", Sort.Direction.Ascending), organisationId)
|
||||
.list();
|
||||
}
|
||||
|
||||
@@ -57,7 +66,7 @@ public class RoleRepository implements PanacheRepository<Role> {
|
||||
* @return Liste des rôles actifs
|
||||
*/
|
||||
public List<Role> findAllActifs() {
|
||||
return find("actif = true").order("niveauHierarchique ASC").list();
|
||||
return find("actif = true", Sort.by("niveauHierarchique", Sort.Direction.Ascending)).list();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -67,8 +76,7 @@ public class RoleRepository implements PanacheRepository<Role> {
|
||||
* @return Liste des rôles
|
||||
*/
|
||||
public List<Role> findByType(TypeRole typeRole) {
|
||||
return find("typeRole = ?1 AND actif = true", typeRole)
|
||||
.order("niveauHierarchique ASC")
|
||||
return find("typeRole = ?1 AND actif = true", Sort.by("niveauHierarchique", Sort.Direction.Ascending), typeRole)
|
||||
.list();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import io.quarkus.hibernate.orm.panache.PanacheRepository;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Repository pour l'entité TemplateNotification
|
||||
@@ -16,6 +17,16 @@ import java.util.Optional;
|
||||
@ApplicationScoped
|
||||
public class TemplateNotificationRepository implements PanacheRepository<TemplateNotification> {
|
||||
|
||||
/**
|
||||
* Trouve un template par son UUID
|
||||
*
|
||||
* @param id UUID du template
|
||||
* @return Template ou Optional.empty()
|
||||
*/
|
||||
public Optional<TemplateNotification> findTemplateNotificationById(UUID id) {
|
||||
return find("id = ?1 AND actif = true", id).firstResultOptional();
|
||||
}
|
||||
|
||||
/**
|
||||
* Trouve un template par son code
|
||||
*
|
||||
|
||||
@@ -19,6 +19,16 @@ import java.util.UUID;
|
||||
@ApplicationScoped
|
||||
public class TransactionWaveRepository implements PanacheRepository<TransactionWave> {
|
||||
|
||||
/**
|
||||
* Trouve une transaction par son UUID
|
||||
*
|
||||
* @param id UUID de la transaction
|
||||
* @return Transaction ou Optional.empty()
|
||||
*/
|
||||
public Optional<TransactionWave> findTransactionWaveById(UUID id) {
|
||||
return find("id = ?1", id).firstResultOptional();
|
||||
}
|
||||
|
||||
/**
|
||||
* Trouve une transaction par son identifiant Wave
|
||||
*
|
||||
|
||||
@@ -19,6 +19,16 @@ import java.util.UUID;
|
||||
@ApplicationScoped
|
||||
public class WebhookWaveRepository implements PanacheRepository<WebhookWave> {
|
||||
|
||||
/**
|
||||
* Trouve un webhook Wave par son UUID
|
||||
*
|
||||
* @param id UUID du webhook
|
||||
* @return Webhook ou Optional.empty()
|
||||
*/
|
||||
public Optional<WebhookWave> findWebhookWaveById(UUID id) {
|
||||
return find("id = ?1", id).firstResultOptional();
|
||||
}
|
||||
|
||||
/**
|
||||
* Trouve un webhook par son identifiant d'événement Wave
|
||||
*
|
||||
|
||||
@@ -75,7 +75,7 @@ public class AdresseService {
|
||||
|
||||
Adresse adresse =
|
||||
adresseRepository
|
||||
.findByIdOptional(id)
|
||||
.findAdresseById(id)
|
||||
.orElseThrow(() -> new NotFoundException("Adresse non trouvée avec l'ID: " + id));
|
||||
|
||||
// Mise à jour des champs
|
||||
@@ -103,7 +103,7 @@ public class AdresseService {
|
||||
|
||||
Adresse adresse =
|
||||
adresseRepository
|
||||
.findByIdOptional(id)
|
||||
.findAdresseById(id)
|
||||
.orElseThrow(() -> new NotFoundException("Adresse non trouvée avec l'ID: " + id));
|
||||
|
||||
adresseRepository.delete(adresse);
|
||||
@@ -118,7 +118,7 @@ public class AdresseService {
|
||||
*/
|
||||
public AdresseDTO trouverParId(UUID id) {
|
||||
return adresseRepository
|
||||
.findByIdOptional(id)
|
||||
.findAdresseById(id)
|
||||
.map(this::convertToDTO)
|
||||
.orElseThrow(() -> new NotFoundException("Adresse non trouvée avec l'ID: " + id));
|
||||
}
|
||||
@@ -346,11 +346,6 @@ public class AdresseService {
|
||||
}
|
||||
|
||||
/** Convertit TypeAdresse (entité) vers TypeAdresse (DTO) - même enum, pas de conversion nécessaire */
|
||||
private TypeAdresse convertTypeAdresse(TypeAdresse type) {
|
||||
return type; // Même enum, pas de conversion nécessaire
|
||||
}
|
||||
|
||||
/** Convertit TypeAdresse (DTO) vers TypeAdresse (entité) - même enum, pas de conversion nécessaire */
|
||||
private TypeAdresse convertTypeAdresse(TypeAdresse type) {
|
||||
return type != null ? type : TypeAdresse.AUTRE; // Même enum, valeur par défaut si null
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ public class ComptabiliteService {
|
||||
*/
|
||||
public CompteComptableDTO trouverCompteParId(UUID id) {
|
||||
return compteComptableRepository
|
||||
.findByIdOptional(id)
|
||||
.findCompteComptableById(id)
|
||||
.map(this::convertToDTO)
|
||||
.orElseThrow(() -> new NotFoundException("Compte comptable non trouvé avec l'ID: " + id));
|
||||
}
|
||||
@@ -129,7 +129,7 @@ public class ComptabiliteService {
|
||||
*/
|
||||
public JournalComptableDTO trouverJournalParId(UUID id) {
|
||||
return journalComptableRepository
|
||||
.findByIdOptional(id)
|
||||
.findJournalComptableById(id)
|
||||
.map(this::convertToDTO)
|
||||
.orElseThrow(() -> new NotFoundException("Journal comptable non trouvé avec l'ID: " + id));
|
||||
}
|
||||
@@ -184,7 +184,7 @@ public class ComptabiliteService {
|
||||
*/
|
||||
public EcritureComptableDTO trouverEcritureParId(UUID id) {
|
||||
return ecritureComptableRepository
|
||||
.findByIdOptional(id)
|
||||
.findEcritureComptableById(id)
|
||||
.map(this::convertToDTO)
|
||||
.orElseThrow(() -> new NotFoundException("Écriture comptable non trouvée avec l'ID: " + id));
|
||||
}
|
||||
@@ -382,7 +382,7 @@ public class ComptabiliteService {
|
||||
if (dto.getJournalId() != null) {
|
||||
JournalComptable journal =
|
||||
journalComptableRepository
|
||||
.findByIdOptional(dto.getJournalId())
|
||||
.findJournalComptableById(dto.getJournalId())
|
||||
.orElseThrow(
|
||||
() -> new NotFoundException("Journal comptable non trouvé avec l'ID: " + dto.getJournalId()));
|
||||
ecriture.setJournal(journal);
|
||||
@@ -402,7 +402,7 @@ public class ComptabiliteService {
|
||||
if (dto.getPaiementId() != null) {
|
||||
Paiement paiement =
|
||||
paiementRepository
|
||||
.findByIdOptional(dto.getPaiementId())
|
||||
.findPaiementById(dto.getPaiementId())
|
||||
.orElseThrow(
|
||||
() -> new NotFoundException("Paiement non trouvé avec l'ID: " + dto.getPaiementId()));
|
||||
ecriture.setPaiement(paiement);
|
||||
@@ -465,7 +465,7 @@ public class ComptabiliteService {
|
||||
if (dto.getCompteComptableId() != null) {
|
||||
CompteComptable compte =
|
||||
compteComptableRepository
|
||||
.findByIdOptional(dto.getCompteComptableId())
|
||||
.findCompteComptableById(dto.getCompteComptableId())
|
||||
.orElseThrow(
|
||||
() ->
|
||||
new NotFoundException(
|
||||
|
||||
@@ -72,7 +72,7 @@ public class DocumentService {
|
||||
*/
|
||||
public DocumentDTO trouverParId(UUID id) {
|
||||
return documentRepository
|
||||
.findByIdOptional(id)
|
||||
.findDocumentById(id)
|
||||
.map(this::convertToDTO)
|
||||
.orElseThrow(() -> new NotFoundException("Document non trouvé avec l'ID: " + id));
|
||||
}
|
||||
@@ -86,7 +86,7 @@ public class DocumentService {
|
||||
public void enregistrerTelechargement(UUID id) {
|
||||
Document document =
|
||||
documentRepository
|
||||
.findByIdOptional(id)
|
||||
.findDocumentById(id)
|
||||
.orElseThrow(() -> new NotFoundException("Document non trouvé avec l'ID: " + id));
|
||||
|
||||
document.setNombreTelechargements(
|
||||
@@ -240,7 +240,7 @@ public class DocumentService {
|
||||
if (dto.getDocumentId() != null) {
|
||||
Document document =
|
||||
documentRepository
|
||||
.findByIdOptional(dto.getDocumentId())
|
||||
.findDocumentById(dto.getDocumentId())
|
||||
.orElseThrow(() -> new NotFoundException("Document non trouvé avec l'ID: " + dto.getDocumentId()));
|
||||
pieceJointe.setDocument(document);
|
||||
}
|
||||
@@ -297,7 +297,7 @@ public class DocumentService {
|
||||
if (dto.getTransactionWaveId() != null) {
|
||||
TransactionWave transactionWave =
|
||||
transactionWaveRepository
|
||||
.findByIdOptional(dto.getTransactionWaveId())
|
||||
.findTransactionWaveById(dto.getTransactionWaveId())
|
||||
.orElseThrow(
|
||||
() ->
|
||||
new NotFoundException(
|
||||
|
||||
@@ -94,7 +94,7 @@ public class NotificationService {
|
||||
|
||||
Notification notification =
|
||||
notificationRepository
|
||||
.findByIdOptional(id)
|
||||
.findNotificationById(id)
|
||||
.orElseThrow(() -> new NotFoundException("Notification non trouvée avec l'ID: " + id));
|
||||
|
||||
notification.setStatut(StatutNotification.LUE);
|
||||
@@ -115,7 +115,7 @@ public class NotificationService {
|
||||
*/
|
||||
public NotificationDTO trouverNotificationParId(UUID id) {
|
||||
return notificationRepository
|
||||
.findByIdOptional(id)
|
||||
.findNotificationById(id)
|
||||
.map(this::convertToDTO)
|
||||
.orElseThrow(() -> new NotFoundException("Notification non trouvée avec l'ID: " + id));
|
||||
}
|
||||
@@ -284,7 +284,7 @@ public class NotificationService {
|
||||
if (dto.getTemplateId() != null) {
|
||||
TemplateNotification template =
|
||||
templateNotificationRepository
|
||||
.findByIdOptional(dto.getTemplateId())
|
||||
.findTemplateNotificationById(dto.getTemplateId())
|
||||
.orElseThrow(
|
||||
() ->
|
||||
new NotFoundException(
|
||||
|
||||
@@ -68,7 +68,7 @@ public class PaiementService {
|
||||
|
||||
Paiement paiement =
|
||||
paiementRepository
|
||||
.findByIdOptional(id)
|
||||
.findPaiementById(id)
|
||||
.orElseThrow(() -> new NotFoundException("Paiement non trouvé avec l'ID: " + id));
|
||||
|
||||
if (!paiement.peutEtreModifie()) {
|
||||
@@ -96,7 +96,7 @@ public class PaiementService {
|
||||
|
||||
Paiement paiement =
|
||||
paiementRepository
|
||||
.findByIdOptional(id)
|
||||
.findPaiementById(id)
|
||||
.orElseThrow(() -> new NotFoundException("Paiement non trouvé avec l'ID: " + id));
|
||||
|
||||
if (paiement.isValide()) {
|
||||
@@ -127,7 +127,7 @@ public class PaiementService {
|
||||
|
||||
Paiement paiement =
|
||||
paiementRepository
|
||||
.findByIdOptional(id)
|
||||
.findPaiementById(id)
|
||||
.orElseThrow(() -> new NotFoundException("Paiement non trouvé avec l'ID: " + id));
|
||||
|
||||
if (!paiement.peutEtreModifie()) {
|
||||
@@ -151,7 +151,7 @@ public class PaiementService {
|
||||
*/
|
||||
public PaiementDTO trouverParId(UUID id) {
|
||||
return paiementRepository
|
||||
.findByIdOptional(id)
|
||||
.findPaiementById(id)
|
||||
.map(this::convertToDTO)
|
||||
.orElseThrow(() -> new NotFoundException("Paiement non trouvé avec l'ID: " + id));
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ public class PermissionService {
|
||||
|
||||
Permission permission =
|
||||
permissionRepository
|
||||
.findByIdOptional(id)
|
||||
.findPermissionById(id)
|
||||
.orElseThrow(() -> new NotFoundException("Permission non trouvée avec l'ID: " + id));
|
||||
|
||||
// Mise à jour
|
||||
@@ -99,7 +99,7 @@ public class PermissionService {
|
||||
* @return Permission ou null
|
||||
*/
|
||||
public Permission trouverParId(UUID id) {
|
||||
return permissionRepository.findByIdOptional(id).orElse(null);
|
||||
return permissionRepository.findPermissionById(id).orElse(null);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -152,7 +152,7 @@ public class PermissionService {
|
||||
|
||||
Permission permission =
|
||||
permissionRepository
|
||||
.findByIdOptional(id)
|
||||
.findPermissionById(id)
|
||||
.orElseThrow(() -> new NotFoundException("Permission non trouvée avec l'ID: " + id));
|
||||
|
||||
permission.setActif(false);
|
||||
|
||||
@@ -69,7 +69,7 @@ public class RoleService {
|
||||
|
||||
Role role =
|
||||
roleRepository
|
||||
.findByIdOptional(id)
|
||||
.findRoleById(id)
|
||||
.orElseThrow(() -> new NotFoundException("Rôle non trouvé avec l'ID: " + id));
|
||||
|
||||
// Vérifier l'unicité du code si modifié
|
||||
@@ -101,7 +101,7 @@ public class RoleService {
|
||||
* @return Rôle ou null
|
||||
*/
|
||||
public Role trouverParId(UUID id) {
|
||||
return roleRepository.findByIdOptional(id).orElse(null);
|
||||
return roleRepository.findRoleById(id).orElse(null);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -153,7 +153,7 @@ public class RoleService {
|
||||
|
||||
Role role =
|
||||
roleRepository
|
||||
.findByIdOptional(id)
|
||||
.findRoleById(id)
|
||||
.orElseThrow(() -> new NotFoundException("Rôle non trouvé avec l'ID: " + id));
|
||||
|
||||
// Vérifier si c'est un rôle système
|
||||
|
||||
@@ -85,7 +85,7 @@ public class WaveService {
|
||||
|
||||
CompteWave compteWave =
|
||||
compteWaveRepository
|
||||
.findByIdOptional(id)
|
||||
.findCompteWaveById(id)
|
||||
.orElseThrow(() -> new NotFoundException("Compte Wave non trouvé avec l'ID: " + id));
|
||||
|
||||
updateFromDTO(compteWave, compteWaveDTO);
|
||||
@@ -109,7 +109,7 @@ public class WaveService {
|
||||
|
||||
CompteWave compteWave =
|
||||
compteWaveRepository
|
||||
.findByIdOptional(id)
|
||||
.findCompteWaveById(id)
|
||||
.orElseThrow(() -> new NotFoundException("Compte Wave non trouvé avec l'ID: " + id));
|
||||
|
||||
compteWave.setStatutCompte(StatutCompteWave.VERIFIE);
|
||||
@@ -130,7 +130,7 @@ public class WaveService {
|
||||
*/
|
||||
public CompteWaveDTO trouverCompteWaveParId(UUID id) {
|
||||
return compteWaveRepository
|
||||
.findByIdOptional(id)
|
||||
.findCompteWaveById(id)
|
||||
.map(this::convertToDTO)
|
||||
.orElseThrow(() -> new NotFoundException("Compte Wave non trouvé avec l'ID: " + id));
|
||||
}
|
||||
@@ -380,7 +380,7 @@ public class WaveService {
|
||||
if (dto.getCompteWaveId() != null) {
|
||||
CompteWave compteWave =
|
||||
compteWaveRepository
|
||||
.findByIdOptional(dto.getCompteWaveId())
|
||||
.findCompteWaveById(dto.getCompteWaveId())
|
||||
.orElseThrow(
|
||||
() ->
|
||||
new NotFoundException(
|
||||
|
||||
@@ -30,6 +30,8 @@ quarkus.hibernate-orm.database.generation=update
|
||||
quarkus.hibernate-orm.log.sql=false
|
||||
quarkus.hibernate-orm.jdbc.timezone=UTC
|
||||
quarkus.hibernate-orm.packages=dev.lions.unionflow.server.entity
|
||||
# Désactiver l'avertissement PanacheEntity (nous utilisons BaseEntity personnalisé)
|
||||
quarkus.hibernate-orm.metrics.enabled=false
|
||||
|
||||
# Configuration Hibernate pour développement
|
||||
%dev.quarkus.hibernate-orm.database.generation=drop-and-create
|
||||
|
||||
Reference in New Issue
Block a user