chore(quarkus-327): bump to Quarkus 3.27.3 LTS, rename deprecated config keys
Some checks failed
CI/CD Pipeline / pipeline (push) Failing after 4m9s
Some checks failed
CI/CD Pipeline / pipeline (push) Failing after 4m9s
This commit is contained in:
18
.gitignore
vendored
18
.gitignore
vendored
@@ -74,3 +74,21 @@ env.production.local
|
|||||||
backend-secret.txt
|
backend-secret.txt
|
||||||
keycloak-secret.txt
|
keycloak-secret.txt
|
||||||
db-password.txt
|
db-password.txt
|
||||||
|
*.jks
|
||||||
|
*.p12
|
||||||
|
*.keystore
|
||||||
|
application-local.properties
|
||||||
|
application-dev-override.properties
|
||||||
|
|
||||||
|
# Database files (dev/test)
|
||||||
|
*.db
|
||||||
|
*.sqlite
|
||||||
|
*.h2.db
|
||||||
|
|
||||||
|
# Docker
|
||||||
|
docker-compose.override.yml
|
||||||
|
|
||||||
|
# Eclipse specific
|
||||||
|
bin/
|
||||||
|
.apt_generated/
|
||||||
|
.metadata/
|
||||||
|
|||||||
@@ -1,238 +1,238 @@
|
|||||||
# 📋 STANDARDISATION API - BTPXPRESS
|
# 📋 STANDARDISATION API - BTPXPRESS
|
||||||
|
|
||||||
**Date** : 2025-01-30
|
**Date** : 2025-01-30
|
||||||
**Version** : 1.0
|
**Version** : 1.0
|
||||||
**Objectif** : Standardiser tous les endpoints REST avec format uniforme
|
**Objectif** : Standardiser tous les endpoints REST avec format uniforme
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## ✅ CE QUI A ÉTÉ FAIT
|
## ✅ CE QUI A ÉTÉ FAIT
|
||||||
|
|
||||||
### 1. Classes de base créées
|
### 1. Classes de base créées
|
||||||
|
|
||||||
✅ **ApiResponse<T>** - Wrapper pour réponses uniformes
|
✅ **ApiResponse<T>** - Wrapper pour réponses uniformes
|
||||||
- Format standard avec `data`, `success`, `message`, `timestamp`
|
- Format standard avec `data`, `success`, `message`, `timestamp`
|
||||||
- Méthodes factory pour succès et erreurs
|
- Méthodes factory pour succès et erreurs
|
||||||
- Support des codes d'erreur et détails
|
- Support des codes d'erreur et détails
|
||||||
|
|
||||||
✅ **PagedResponse<T>** - Wrapper pour réponses paginées
|
✅ **PagedResponse<T>** - Wrapper pour réponses paginées
|
||||||
- Format avec `data`, `pagination`, `success`, `timestamp`
|
- Format avec `data`, `pagination`, `success`, `timestamp`
|
||||||
- Métadonnées : `page`, `size`, `total`, `totalPages`, `hasNext`, `hasPrevious`
|
- Métadonnées : `page`, `size`, `total`, `totalPages`, `hasNext`, `hasPrevious`
|
||||||
|
|
||||||
✅ **ResponseHelper** - Classe utilitaire
|
✅ **ResponseHelper** - Classe utilitaire
|
||||||
- Méthodes statiques pour créer réponses standardisées
|
- Méthodes statiques pour créer réponses standardisées
|
||||||
- Support de tous les codes HTTP courants
|
- Support de tous les codes HTTP courants
|
||||||
- Gestion d'erreurs uniforme
|
- Gestion d'erreurs uniforme
|
||||||
|
|
||||||
### 2. Resources migrés (37/37) ✅ **COMPLET**
|
### 2. Resources migrés (37/37) ✅ **COMPLET**
|
||||||
|
|
||||||
✅ **ChantierResource** - Complètement migré
|
✅ **ChantierResource** - Complètement migré
|
||||||
- Tous les endpoints utilisent `ResponseHelper`
|
- Tous les endpoints utilisent `ResponseHelper`
|
||||||
- Format uniforme pour succès et erreurs
|
- Format uniforme pour succès et erreurs
|
||||||
- Messages descriptifs
|
- Messages descriptifs
|
||||||
|
|
||||||
✅ **ClientResource** - Complètement migré
|
✅ **ClientResource** - Complètement migré
|
||||||
- Tous les endpoints utilisent `ResponseHelper`
|
- Tous les endpoints utilisent `ResponseHelper`
|
||||||
- Support pagination avec `PagedResponse`
|
- Support pagination avec `PagedResponse`
|
||||||
- Format uniforme
|
- Format uniforme
|
||||||
|
|
||||||
✅ **DevisResource** - Complètement migré
|
✅ **DevisResource** - Complètement migré
|
||||||
✅ **FactureResource** - Complètement migré
|
✅ **FactureResource** - Complètement migré
|
||||||
✅ **BudgetResource** - Complètement migré
|
✅ **BudgetResource** - Complètement migré
|
||||||
✅ **EmployeResource** - Complètement migré
|
✅ **EmployeResource** - Complètement migré
|
||||||
✅ **MaterielResource** - Complètement migré
|
✅ **MaterielResource** - Complètement migré
|
||||||
✅ **PlanningResource** - Complètement migré
|
✅ **PlanningResource** - Complètement migré
|
||||||
✅ **StockResource** - Complètement migré
|
✅ **StockResource** - Complètement migré
|
||||||
✅ **BonCommandeResource** - Complètement migré
|
✅ **BonCommandeResource** - Complètement migré
|
||||||
✅ **PhaseChantierResource** - Complètement migré
|
✅ **PhaseChantierResource** - Complètement migré
|
||||||
✅ **EquipeResource** - Complètement migré
|
✅ **EquipeResource** - Complètement migré
|
||||||
✅ **FournisseurResource** - Complètement migré
|
✅ **FournisseurResource** - Complètement migré
|
||||||
✅ **DisponibiliteResource** - Complètement migré
|
✅ **DisponibiliteResource** - Complètement migré
|
||||||
✅ **MaintenanceResource** - Complètement migré
|
✅ **MaintenanceResource** - Complètement migré
|
||||||
✅ **DocumentResource** - Complètement migré
|
✅ **DocumentResource** - Complètement migré
|
||||||
✅ **MessageResource** - Complètement migré
|
✅ **MessageResource** - Complètement migré
|
||||||
✅ **NotificationResource** - Complètement migré
|
✅ **NotificationResource** - Complètement migré
|
||||||
✅ **ReservationMaterielResource** - Complètement migré
|
✅ **ReservationMaterielResource** - Complètement migré
|
||||||
✅ **LivraisonMaterielResource** - Complètement migré
|
✅ **LivraisonMaterielResource** - Complètement migré
|
||||||
✅ **PlanningMaterielResource** - Complètement migré
|
✅ **PlanningMaterielResource** - Complètement migré
|
||||||
✅ **UserResource** - Complètement migré
|
✅ **UserResource** - Complètement migré
|
||||||
✅ **AbonnementResource** - Complètement migré
|
✅ **AbonnementResource** - Complètement migré
|
||||||
✅ **EntrepriseProfileResource** - Complètement migré
|
✅ **EntrepriseProfileResource** - Complètement migré
|
||||||
✅ **DashboardResource** - Complètement migré
|
✅ **DashboardResource** - Complètement migré
|
||||||
✅ **PhotoResource** - Complètement migré
|
✅ **PhotoResource** - Complètement migré
|
||||||
✅ **HealthResource** - Complètement migré
|
✅ **HealthResource** - Complètement migré
|
||||||
✅ **AuthResource** - Complètement migré
|
✅ **AuthResource** - Complètement migré
|
||||||
✅ **TypeChantierResource** - Complètement migré
|
✅ **TypeChantierResource** - Complètement migré
|
||||||
✅ **PermissionResource** - Complètement migré
|
✅ **PermissionResource** - Complètement migré
|
||||||
✅ **ZoneClimatiqueResource** - Complètement migré
|
✅ **ZoneClimatiqueResource** - Complètement migré
|
||||||
✅ **ComparaisonFournisseurResource** - Complètement migré
|
✅ **ComparaisonFournisseurResource** - Complètement migré
|
||||||
✅ **PhaseTemplateResource** - Complètement migré
|
✅ **PhaseTemplateResource** - Complètement migré
|
||||||
✅ **SousPhaseTemplateResource** - Complètement migré
|
✅ **SousPhaseTemplateResource** - Complètement migré
|
||||||
✅ **TacheTemplateResource** - Complètement migré
|
✅ **TacheTemplateResource** - Complètement migré
|
||||||
✅ **CalculsTechniquesResource** - Complètement migré
|
✅ **CalculsTechniquesResource** - Complètement migré
|
||||||
✅ **ReportResource** - Complètement migré
|
✅ **ReportResource** - Complètement migré
|
||||||
✅ **DashboardResource** - Complètement migré
|
✅ **DashboardResource** - Complètement migré
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 📐 FORMAT DE RÉPONSE STANDARD
|
## 📐 FORMAT DE RÉPONSE STANDARD
|
||||||
|
|
||||||
### Réponse simple (ApiResponse)
|
### Réponse simple (ApiResponse)
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"data": {
|
"data": {
|
||||||
"id": "uuid",
|
"id": "uuid",
|
||||||
"nom": "...",
|
"nom": "...",
|
||||||
...
|
...
|
||||||
},
|
},
|
||||||
"success": true,
|
"success": true,
|
||||||
"message": "Opération réussie",
|
"message": "Opération réussie",
|
||||||
"timestamp": "2025-01-30T10:00:00"
|
"timestamp": "2025-01-30T10:00:00"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Réponse paginée (PagedResponse)
|
### Réponse paginée (PagedResponse)
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"data": [...],
|
"data": [...],
|
||||||
"pagination": {
|
"pagination": {
|
||||||
"page": 0,
|
"page": 0,
|
||||||
"size": 20,
|
"size": 20,
|
||||||
"total": 100,
|
"total": 100,
|
||||||
"totalPages": 5,
|
"totalPages": 5,
|
||||||
"hasNext": true,
|
"hasNext": true,
|
||||||
"hasPrevious": false
|
"hasPrevious": false
|
||||||
},
|
},
|
||||||
"success": true,
|
"success": true,
|
||||||
"timestamp": "2025-01-30T10:00:00"
|
"timestamp": "2025-01-30T10:00:00"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Réponse d'erreur
|
### Réponse d'erreur
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"data": null,
|
"data": null,
|
||||||
"success": false,
|
"success": false,
|
||||||
"errorCode": "BAD_REQUEST",
|
"errorCode": "BAD_REQUEST",
|
||||||
"message": "Données invalides: ...",
|
"message": "Données invalides: ...",
|
||||||
"errorDetails": {...},
|
"errorDetails": {...},
|
||||||
"timestamp": "2025-01-30T10:00:00"
|
"timestamp": "2025-01-30T10:00:00"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 🔧 UTILISATION
|
## 🔧 UTILISATION
|
||||||
|
|
||||||
### Exemple : Endpoint GET simple
|
### Exemple : Endpoint GET simple
|
||||||
|
|
||||||
```java
|
```java
|
||||||
@GET
|
@GET
|
||||||
@Path("/{id}")
|
@Path("/{id}")
|
||||||
public Response getById(@PathParam("id") UUID id) {
|
public Response getById(@PathParam("id") UUID id) {
|
||||||
try {
|
try {
|
||||||
Entity entity = service.findByIdRequired(id);
|
Entity entity = service.findByIdRequired(id);
|
||||||
EntityDTO dto = mapper.toResponseDTO(entity);
|
EntityDTO dto = mapper.toResponseDTO(entity);
|
||||||
return ResponseHelper.ok(dto);
|
return ResponseHelper.ok(dto);
|
||||||
} catch (NotFoundException e) {
|
} catch (NotFoundException e) {
|
||||||
return ResponseHelper.notFound("Entity", id);
|
return ResponseHelper.notFound("Entity", id);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("Erreur", e);
|
logger.error("Erreur", e);
|
||||||
return ResponseHelper.internalError("Erreur: " + e.getMessage());
|
return ResponseHelper.internalError("Erreur: " + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Exemple : Endpoint GET avec pagination
|
### Exemple : Endpoint GET avec pagination
|
||||||
|
|
||||||
```java
|
```java
|
||||||
@GET
|
@GET
|
||||||
public Response getAll(
|
public Response getAll(
|
||||||
@QueryParam("page") @DefaultValue("0") int page,
|
@QueryParam("page") @DefaultValue("0") int page,
|
||||||
@QueryParam("size") @DefaultValue("20") int size) {
|
@QueryParam("size") @DefaultValue("20") int size) {
|
||||||
|
|
||||||
List<Entity> entities = service.findAll(page, size);
|
List<Entity> entities = service.findAll(page, size);
|
||||||
long total = service.count();
|
long total = service.count();
|
||||||
|
|
||||||
List<EntityDTO> dtos = entities.stream()
|
List<EntityDTO> dtos = entities.stream()
|
||||||
.map(mapper::toResponseDTO)
|
.map(mapper::toResponseDTO)
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
return ResponseHelper.paginated(dtos, page, size, total);
|
return ResponseHelper.paginated(dtos, page, size, total);
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Exemple : Endpoint POST
|
### Exemple : Endpoint POST
|
||||||
|
|
||||||
```java
|
```java
|
||||||
@POST
|
@POST
|
||||||
public Response create(@Valid EntityCreateDTO dto) {
|
public Response create(@Valid EntityCreateDTO dto) {
|
||||||
try {
|
try {
|
||||||
Entity entity = service.create(dto);
|
Entity entity = service.create(dto);
|
||||||
EntityDTO responseDTO = mapper.toResponseDTO(entity);
|
EntityDTO responseDTO = mapper.toResponseDTO(entity);
|
||||||
return ResponseHelper.created(responseDTO, "Ressource créée avec succès");
|
return ResponseHelper.created(responseDTO, "Ressource créée avec succès");
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
return ResponseHelper.badRequest("Données invalides: " + e.getMessage());
|
return ResponseHelper.badRequest("Données invalides: " + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Exemple : Endpoint DELETE
|
### Exemple : Endpoint DELETE
|
||||||
|
|
||||||
```java
|
```java
|
||||||
@DELETE
|
@DELETE
|
||||||
@Path("/{id}")
|
@Path("/{id}")
|
||||||
public Response delete(@PathParam("id") UUID id) {
|
public Response delete(@PathParam("id") UUID id) {
|
||||||
try {
|
try {
|
||||||
service.delete(id);
|
service.delete(id);
|
||||||
return ResponseHelper.noContent("Ressource supprimée avec succès");
|
return ResponseHelper.noContent("Ressource supprimée avec succès");
|
||||||
} catch (NotFoundException e) {
|
} catch (NotFoundException e) {
|
||||||
return ResponseHelper.notFound("Entity", id);
|
return ResponseHelper.notFound("Entity", id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## ✅ MIGRATION TERMINÉE - TOUS LES RESOURCES SONT MIGRÉS (37/37)
|
## ✅ MIGRATION TERMINÉE - TOUS LES RESOURCES SONT MIGRÉS (37/37)
|
||||||
|
|
||||||
### ✅ Tous les Resources migrés
|
### ✅ Tous les Resources migrés
|
||||||
- ✅ 37/37 Resources utilisent `ResponseHelper` et DTOs/Mappers
|
- ✅ 37/37 Resources utilisent `ResponseHelper` et DTOs/Mappers
|
||||||
- ✅ Format de réponse standardisé
|
- ✅ Format de réponse standardisé
|
||||||
- ✅ Pagination implémentée où pertinent
|
- ✅ Pagination implémentée où pertinent
|
||||||
- ✅ Gestion d'erreurs uniforme
|
- ✅ Gestion d'erreurs uniforme
|
||||||
|
|
||||||
### ✅ DTOs et Mappers créés
|
### ✅ DTOs et Mappers créés
|
||||||
- ✅ 52 DTOs créés (CreateDTO + ResponseDTO pour tous les concepts)
|
- ✅ 52 DTOs créés (CreateDTO + ResponseDTO pour tous les concepts)
|
||||||
- ✅ 24 Mappers créés pour conversion Entity ↔ DTO
|
- ✅ 24 Mappers créés pour conversion Entity ↔ DTO
|
||||||
- ✅ Tous les endpoints utilisent les DTOs
|
- ✅ Tous les endpoints utilisent les DTOs
|
||||||
|
|
||||||
### ✅ Warnings corrigés
|
### ✅ Warnings corrigés
|
||||||
- ✅ Imports non utilisés supprimés
|
- ✅ Imports non utilisés supprimés
|
||||||
- ✅ Méthodes BigDecimal deprecated corrigées
|
- ✅ Méthodes BigDecimal deprecated corrigées
|
||||||
- ✅ Interfaces Serializable redondantes supprimées
|
- ✅ Interfaces Serializable redondantes supprimées
|
||||||
- ✅ Variables non utilisées corrigées
|
- ✅ Variables non utilisées corrigées
|
||||||
- ✅ Cases manquants dans switch statements ajoutés
|
- ✅ Cases manquants dans switch statements ajoutés
|
||||||
- ⚠️ 20 warnings non critiques restants (objets anonymes pour JSON - normal)
|
- ⚠️ 20 warnings non critiques restants (objets anonymes pour JSON - normal)
|
||||||
|
|
||||||
### ✅ TODOs corrigés
|
### ✅ TODOs corrigés
|
||||||
- ✅ TODO ChantiersView : clientId récupéré depuis les données API
|
- ✅ TODO ChantiersView : clientId récupéré depuis les données API
|
||||||
- ✅ TODO ClientResource : commentaire d'optimisation ajouté
|
- ✅ TODO ClientResource : commentaire d'optimisation ajouté
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 🎯 PROCHAINES ÉTAPES (Optionnel)
|
## 🎯 PROCHAINES ÉTAPES (Optionnel)
|
||||||
|
|
||||||
1. **Compléter OpenAPI** avec exemples détaillés
|
1. **Compléter OpenAPI** avec exemples détaillés
|
||||||
2. **Ajouter paramètres de tri standardisés** : `sort`, `direction`
|
2. **Ajouter paramètres de tri standardisés** : `sort`, `direction`
|
||||||
3. **Réactiver les tests** (bug Quarkus connu)
|
3. **Réactiver les tests** (bug Quarkus connu)
|
||||||
4. **Améliorer documentation** utilisateur
|
4. **Améliorer documentation** utilisateur
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**Dernière mise à jour** : 2025-01-30
|
**Dernière mise à jour** : 2025-01-30
|
||||||
**Statut** : ✅ **PROJET TERMINÉ - PRÊT POUR PRODUCTION**
|
**Statut** : ✅ **PROJET TERMINÉ - PRÊT POUR PRODUCTION**
|
||||||
|
|
||||||
|
|||||||
@@ -1,169 +1,169 @@
|
|||||||
package dev.lions.btpxpress.adapter.http.util;
|
package dev.lions.btpxpress.adapter.http.util;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.shared.dto.ApiResponse;
|
import dev.lions.btpxpress.domain.shared.dto.ApiResponse;
|
||||||
import dev.lions.btpxpress.domain.shared.dto.PagedResponse;
|
import dev.lions.btpxpress.domain.shared.dto.PagedResponse;
|
||||||
import jakarta.ws.rs.core.Response;
|
import jakarta.ws.rs.core.Response;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Classe utilitaire pour créer des réponses REST standardisées - Architecture 2025
|
* Classe utilitaire pour créer des réponses REST standardisées - Architecture 2025
|
||||||
*
|
*
|
||||||
* Simplifie la création de réponses uniformes pour tous les endpoints
|
* Simplifie la création de réponses uniformes pour tous les endpoints
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
public class ResponseHelper {
|
public class ResponseHelper {
|
||||||
|
|
||||||
// === RÉPONSES DE SUCCÈS ===
|
// === RÉPONSES DE SUCCÈS ===
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Crée une réponse 200 OK avec des données
|
* Crée une réponse 200 OK avec des données
|
||||||
*/
|
*/
|
||||||
public static <T> Response ok(T data) {
|
public static <T> Response ok(T data) {
|
||||||
return Response.ok(ApiResponse.success(data)).build();
|
return Response.ok(ApiResponse.success(data)).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Crée une réponse 200 OK avec des données et un message
|
* Crée une réponse 200 OK avec des données et un message
|
||||||
*/
|
*/
|
||||||
public static <T> Response ok(T data, String message) {
|
public static <T> Response ok(T data, String message) {
|
||||||
return Response.ok(ApiResponse.success(data, message)).build();
|
return Response.ok(ApiResponse.success(data, message)).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Crée une réponse 201 Created avec des données
|
* Crée une réponse 201 Created avec des données
|
||||||
*/
|
*/
|
||||||
public static <T> Response created(T data) {
|
public static <T> Response created(T data) {
|
||||||
return Response.status(Response.Status.CREATED)
|
return Response.status(Response.Status.CREATED)
|
||||||
.entity(ApiResponse.success(data, "Ressource créée avec succès"))
|
.entity(ApiResponse.success(data, "Ressource créée avec succès"))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Crée une réponse 201 Created avec des données et un message personnalisé
|
* Crée une réponse 201 Created avec des données et un message personnalisé
|
||||||
*/
|
*/
|
||||||
public static <T> Response created(T data, String message) {
|
public static <T> Response created(T data, String message) {
|
||||||
return Response.status(Response.Status.CREATED)
|
return Response.status(Response.Status.CREATED)
|
||||||
.entity(ApiResponse.success(data, message))
|
.entity(ApiResponse.success(data, message))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Crée une réponse 204 No Content (pour DELETE)
|
* Crée une réponse 204 No Content (pour DELETE)
|
||||||
*/
|
*/
|
||||||
public static Response noContent() {
|
public static Response noContent() {
|
||||||
return Response.noContent().build();
|
return Response.noContent().build();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Crée une réponse 204 No Content avec un message
|
* Crée une réponse 204 No Content avec un message
|
||||||
*/
|
*/
|
||||||
public static Response noContent(String message) {
|
public static Response noContent(String message) {
|
||||||
return Response.status(Response.Status.NO_CONTENT)
|
return Response.status(Response.Status.NO_CONTENT)
|
||||||
.entity(ApiResponse.success(message))
|
.entity(ApiResponse.success(message))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
// === RÉPONSES PAGINÉES ===
|
// === RÉPONSES PAGINÉES ===
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Crée une réponse 200 OK paginée
|
* Crée une réponse 200 OK paginée
|
||||||
*/
|
*/
|
||||||
public static <T> Response paginated(List<T> data, int page, int size, long total) {
|
public static <T> Response paginated(List<T> data, int page, int size, long total) {
|
||||||
return Response.ok(PagedResponse.of(data, page, size, total)).build();
|
return Response.ok(PagedResponse.of(data, page, size, total)).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Crée une réponse 200 OK paginée avec un message
|
* Crée une réponse 200 OK paginée avec un message
|
||||||
*/
|
*/
|
||||||
public static <T> Response paginated(List<T> data, int page, int size, long total, String message) {
|
public static <T> Response paginated(List<T> data, int page, int size, long total, String message) {
|
||||||
return Response.ok(PagedResponse.of(data, page, size, total, message)).build();
|
return Response.ok(PagedResponse.of(data, page, size, total, message)).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
// === RÉPONSES D'ERREUR ===
|
// === RÉPONSES D'ERREUR ===
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Crée une réponse 400 Bad Request
|
* Crée une réponse 400 Bad Request
|
||||||
*/
|
*/
|
||||||
public static Response badRequest(String message) {
|
public static Response badRequest(String message) {
|
||||||
return Response.status(Response.Status.BAD_REQUEST)
|
return Response.status(Response.Status.BAD_REQUEST)
|
||||||
.entity(ApiResponse.error("BAD_REQUEST", message))
|
.entity(ApiResponse.error("BAD_REQUEST", message))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Crée une réponse 400 Bad Request avec détails
|
* Crée une réponse 400 Bad Request avec détails
|
||||||
*/
|
*/
|
||||||
public static Response badRequest(String message, Object details) {
|
public static Response badRequest(String message, Object details) {
|
||||||
return Response.status(Response.Status.BAD_REQUEST)
|
return Response.status(Response.Status.BAD_REQUEST)
|
||||||
.entity(ApiResponse.error("BAD_REQUEST", message, details))
|
.entity(ApiResponse.error("BAD_REQUEST", message, details))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Crée une réponse 404 Not Found
|
* Crée une réponse 404 Not Found
|
||||||
*/
|
*/
|
||||||
public static Response notFound(String message) {
|
public static Response notFound(String message) {
|
||||||
return Response.status(Response.Status.NOT_FOUND)
|
return Response.status(Response.Status.NOT_FOUND)
|
||||||
.entity(ApiResponse.error("NOT_FOUND", message))
|
.entity(ApiResponse.error("NOT_FOUND", message))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Crée une réponse 404 Not Found avec le type de ressource
|
* Crée une réponse 404 Not Found avec le type de ressource
|
||||||
*/
|
*/
|
||||||
public static Response notFound(String resourceType, Object id) {
|
public static Response notFound(String resourceType, Object id) {
|
||||||
return Response.status(Response.Status.NOT_FOUND)
|
return Response.status(Response.Status.NOT_FOUND)
|
||||||
.entity(ApiResponse.error("NOT_FOUND",
|
.entity(ApiResponse.error("NOT_FOUND",
|
||||||
String.format("%s non trouvé avec l'ID: %s", resourceType, id)))
|
String.format("%s non trouvé avec l'ID: %s", resourceType, id)))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Crée une réponse 409 Conflict
|
* Crée une réponse 409 Conflict
|
||||||
*/
|
*/
|
||||||
public static Response conflict(String message) {
|
public static Response conflict(String message) {
|
||||||
return Response.status(Response.Status.CONFLICT)
|
return Response.status(Response.Status.CONFLICT)
|
||||||
.entity(ApiResponse.error("CONFLICT", message))
|
.entity(ApiResponse.error("CONFLICT", message))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Crée une réponse 500 Internal Server Error
|
* Crée une réponse 500 Internal Server Error
|
||||||
*/
|
*/
|
||||||
public static Response internalError(String message) {
|
public static Response internalError(String message) {
|
||||||
return Response.status(Response.Status.INTERNAL_SERVER_ERROR)
|
return Response.status(Response.Status.INTERNAL_SERVER_ERROR)
|
||||||
.entity(ApiResponse.error("INTERNAL_ERROR", message))
|
.entity(ApiResponse.error("INTERNAL_ERROR", message))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Crée une réponse 500 Internal Server Error avec détails (pour logging)
|
* Crée une réponse 500 Internal Server Error avec détails (pour logging)
|
||||||
*/
|
*/
|
||||||
public static Response internalError(String message, Object details) {
|
public static Response internalError(String message, Object details) {
|
||||||
return Response.status(Response.Status.INTERNAL_SERVER_ERROR)
|
return Response.status(Response.Status.INTERNAL_SERVER_ERROR)
|
||||||
.entity(ApiResponse.error("INTERNAL_ERROR", message, details))
|
.entity(ApiResponse.error("INTERNAL_ERROR", message, details))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Crée une réponse d'erreur personnalisée
|
* Crée une réponse d'erreur personnalisée
|
||||||
*/
|
*/
|
||||||
public static Response error(Response.Status status, String errorCode, String message) {
|
public static Response error(Response.Status status, String errorCode, String message) {
|
||||||
return Response.status(status)
|
return Response.status(status)
|
||||||
.entity(ApiResponse.error(errorCode, message))
|
.entity(ApiResponse.error(errorCode, message))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Crée une réponse d'erreur personnalisée avec détails
|
* Crée une réponse d'erreur personnalisée avec détails
|
||||||
*/
|
*/
|
||||||
public static Response error(Response.Status status, String errorCode, String message, Object details) {
|
public static Response error(Response.Status status, String errorCode, String message, Object details) {
|
||||||
return Response.status(status)
|
return Response.status(status)
|
||||||
.entity(ApiResponse.error(errorCode, message, details))
|
.entity(ApiResponse.error(errorCode, message, details))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,58 +1,58 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.StatutAbonnement;
|
import dev.lions.btpxpress.domain.core.entity.StatutAbonnement;
|
||||||
import dev.lions.btpxpress.domain.core.entity.TypeAbonnement;
|
import dev.lions.btpxpress.domain.core.entity.TypeAbonnement;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la création d'un abonnement - Architecture 2025
|
* DTO pour la création d'un abonnement - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class AbonnementCreateDTO {
|
public class AbonnementCreateDTO {
|
||||||
|
|
||||||
@NotNull(message = "L'entreprise est obligatoire")
|
@NotNull(message = "L'entreprise est obligatoire")
|
||||||
private UUID entrepriseId;
|
private UUID entrepriseId;
|
||||||
|
|
||||||
@NotNull(message = "Le type d'abonnement est obligatoire")
|
@NotNull(message = "Le type d'abonnement est obligatoire")
|
||||||
private TypeAbonnement typeAbonnement;
|
private TypeAbonnement typeAbonnement;
|
||||||
|
|
||||||
private StatutAbonnement statut;
|
private StatutAbonnement statut;
|
||||||
|
|
||||||
@NotNull(message = "La date de début est obligatoire")
|
@NotNull(message = "La date de début est obligatoire")
|
||||||
private LocalDate dateDebut;
|
private LocalDate dateDebut;
|
||||||
|
|
||||||
@NotNull(message = "La date de fin est obligatoire")
|
@NotNull(message = "La date de fin est obligatoire")
|
||||||
private LocalDate dateFin;
|
private LocalDate dateFin;
|
||||||
|
|
||||||
@NotNull(message = "Le prix payé est obligatoire")
|
@NotNull(message = "Le prix payé est obligatoire")
|
||||||
private BigDecimal prixPaye;
|
private BigDecimal prixPaye;
|
||||||
|
|
||||||
private String methodePaiement;
|
private String methodePaiement;
|
||||||
|
|
||||||
private Boolean autoRenouvellement;
|
private Boolean autoRenouvellement;
|
||||||
|
|
||||||
private String referencePaiement;
|
private String referencePaiement;
|
||||||
|
|
||||||
private LocalDate dateDerniereFacture;
|
private LocalDate dateDerniereFacture;
|
||||||
|
|
||||||
private LocalDate dateProchainPrelevement;
|
private LocalDate dateProchainPrelevement;
|
||||||
|
|
||||||
private Integer misesEnRelationUtilisees;
|
private Integer misesEnRelationUtilisees;
|
||||||
|
|
||||||
private String notes;
|
private String notes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,72 +1,72 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.StatutAbonnement;
|
import dev.lions.btpxpress.domain.core.entity.StatutAbonnement;
|
||||||
import dev.lions.btpxpress.domain.core.entity.TypeAbonnement;
|
import dev.lions.btpxpress.domain.core.entity.TypeAbonnement;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la réponse d'un abonnement - Architecture 2025
|
* DTO pour la réponse d'un abonnement - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class AbonnementResponseDTO {
|
public class AbonnementResponseDTO {
|
||||||
|
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
private TypeAbonnement typeAbonnement;
|
private TypeAbonnement typeAbonnement;
|
||||||
|
|
||||||
private StatutAbonnement statut;
|
private StatutAbonnement statut;
|
||||||
|
|
||||||
private LocalDate dateDebut;
|
private LocalDate dateDebut;
|
||||||
|
|
||||||
private LocalDate dateFin;
|
private LocalDate dateFin;
|
||||||
|
|
||||||
private BigDecimal prixPaye;
|
private BigDecimal prixPaye;
|
||||||
|
|
||||||
private String methodePaiement;
|
private String methodePaiement;
|
||||||
|
|
||||||
private Boolean autoRenouvellement;
|
private Boolean autoRenouvellement;
|
||||||
|
|
||||||
private String referencePaiement;
|
private String referencePaiement;
|
||||||
|
|
||||||
private LocalDate dateDerniereFacture;
|
private LocalDate dateDerniereFacture;
|
||||||
|
|
||||||
private LocalDate dateProchainPrelevement;
|
private LocalDate dateProchainPrelevement;
|
||||||
|
|
||||||
private Integer misesEnRelationUtilisees;
|
private Integer misesEnRelationUtilisees;
|
||||||
|
|
||||||
private LocalDateTime dateCreation;
|
private LocalDateTime dateCreation;
|
||||||
|
|
||||||
private LocalDateTime dateModification;
|
private LocalDateTime dateModification;
|
||||||
|
|
||||||
private String notes;
|
private String notes;
|
||||||
|
|
||||||
// Relations simplifiées
|
// Relations simplifiées
|
||||||
private UUID entrepriseId;
|
private UUID entrepriseId;
|
||||||
private String entrepriseNomCommercial;
|
private String entrepriseNomCommercial;
|
||||||
|
|
||||||
// Métadonnées calculées
|
// Métadonnées calculées
|
||||||
private Boolean estActif;
|
private Boolean estActif;
|
||||||
|
|
||||||
private Boolean estExpire;
|
private Boolean estExpire;
|
||||||
|
|
||||||
private Boolean bientotExpire;
|
private Boolean bientotExpire;
|
||||||
|
|
||||||
private Long joursRestants;
|
private Long joursRestants;
|
||||||
|
|
||||||
private Boolean limiteMisesEnRelationAtteinte;
|
private Boolean limiteMisesEnRelationAtteinte;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,138 +1,138 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wrapper standard pour toutes les réponses API - Architecture 2025
|
* Wrapper standard pour toutes les réponses API - Architecture 2025
|
||||||
*
|
*
|
||||||
* Format uniforme pour toutes les réponses REST :
|
* Format uniforme pour toutes les réponses REST :
|
||||||
* {
|
* {
|
||||||
* "data": {...},
|
* "data": {...},
|
||||||
* "success": true,
|
* "success": true,
|
||||||
* "message": "...",
|
* "message": "...",
|
||||||
* "timestamp": "2025-01-30T10:00:00"
|
* "timestamp": "2025-01-30T10:00:00"
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* @param <T> Le type de données retournées
|
* @param <T> Le type de données retournées
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
public class ApiResponse<T> {
|
public class ApiResponse<T> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Les données retournées (peut être null en cas d'erreur)
|
* Les données retournées (peut être null en cas d'erreur)
|
||||||
*/
|
*/
|
||||||
private T data;
|
private T data;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indique si l'opération a réussi
|
* Indique si l'opération a réussi
|
||||||
*/
|
*/
|
||||||
@Builder.Default
|
@Builder.Default
|
||||||
private Boolean success = true;
|
private Boolean success = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Message descriptif (optionnel, souvent utilisé pour les erreurs)
|
* Message descriptif (optionnel, souvent utilisé pour les erreurs)
|
||||||
*/
|
*/
|
||||||
private String message;
|
private String message;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Timestamp de la réponse
|
* Timestamp de la réponse
|
||||||
*/
|
*/
|
||||||
@Builder.Default
|
@Builder.Default
|
||||||
private LocalDateTime timestamp = LocalDateTime.now();
|
private LocalDateTime timestamp = LocalDateTime.now();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Code d'erreur (optionnel, utilisé uniquement en cas d'erreur)
|
* Code d'erreur (optionnel, utilisé uniquement en cas d'erreur)
|
||||||
*/
|
*/
|
||||||
private String errorCode;
|
private String errorCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Détails de l'erreur (optionnel, utilisé uniquement en cas d'erreur)
|
* Détails de l'erreur (optionnel, utilisé uniquement en cas d'erreur)
|
||||||
*/
|
*/
|
||||||
private Object errorDetails;
|
private Object errorDetails;
|
||||||
|
|
||||||
// === MÉTHODES STATIQUES DE FACTORY ===
|
// === MÉTHODES STATIQUES DE FACTORY ===
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Crée une réponse de succès avec des données
|
* Crée une réponse de succès avec des données
|
||||||
*/
|
*/
|
||||||
public static <T> ApiResponse<T> success(T data) {
|
public static <T> ApiResponse<T> success(T data) {
|
||||||
return ApiResponse.<T>builder()
|
return ApiResponse.<T>builder()
|
||||||
.data(data)
|
.data(data)
|
||||||
.success(true)
|
.success(true)
|
||||||
.timestamp(LocalDateTime.now())
|
.timestamp(LocalDateTime.now())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Crée une réponse de succès avec des données et un message
|
* Crée une réponse de succès avec des données et un message
|
||||||
*/
|
*/
|
||||||
public static <T> ApiResponse<T> success(T data, String message) {
|
public static <T> ApiResponse<T> success(T data, String message) {
|
||||||
return ApiResponse.<T>builder()
|
return ApiResponse.<T>builder()
|
||||||
.data(data)
|
.data(data)
|
||||||
.success(true)
|
.success(true)
|
||||||
.message(message)
|
.message(message)
|
||||||
.timestamp(LocalDateTime.now())
|
.timestamp(LocalDateTime.now())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Crée une réponse de succès sans données (pour DELETE, etc.)
|
* Crée une réponse de succès sans données (pour DELETE, etc.)
|
||||||
*/
|
*/
|
||||||
public static <T> ApiResponse<T> success(String message) {
|
public static <T> ApiResponse<T> success(String message) {
|
||||||
return ApiResponse.<T>builder()
|
return ApiResponse.<T>builder()
|
||||||
.success(true)
|
.success(true)
|
||||||
.message(message)
|
.message(message)
|
||||||
.timestamp(LocalDateTime.now())
|
.timestamp(LocalDateTime.now())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Crée une réponse d'erreur
|
* Crée une réponse d'erreur
|
||||||
*/
|
*/
|
||||||
public static <T> ApiResponse<T> error(String message) {
|
public static <T> ApiResponse<T> error(String message) {
|
||||||
return ApiResponse.<T>builder()
|
return ApiResponse.<T>builder()
|
||||||
.success(false)
|
.success(false)
|
||||||
.message(message)
|
.message(message)
|
||||||
.timestamp(LocalDateTime.now())
|
.timestamp(LocalDateTime.now())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Crée une réponse d'erreur avec code
|
* Crée une réponse d'erreur avec code
|
||||||
*/
|
*/
|
||||||
public static <T> ApiResponse<T> error(String errorCode, String message) {
|
public static <T> ApiResponse<T> error(String errorCode, String message) {
|
||||||
return ApiResponse.<T>builder()
|
return ApiResponse.<T>builder()
|
||||||
.success(false)
|
.success(false)
|
||||||
.errorCode(errorCode)
|
.errorCode(errorCode)
|
||||||
.message(message)
|
.message(message)
|
||||||
.timestamp(LocalDateTime.now())
|
.timestamp(LocalDateTime.now())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Crée une réponse d'erreur avec code et détails
|
* Crée une réponse d'erreur avec code et détails
|
||||||
*/
|
*/
|
||||||
public static <T> ApiResponse<T> error(String errorCode, String message, Object errorDetails) {
|
public static <T> ApiResponse<T> error(String errorCode, String message, Object errorDetails) {
|
||||||
return ApiResponse.<T>builder()
|
return ApiResponse.<T>builder()
|
||||||
.success(false)
|
.success(false)
|
||||||
.errorCode(errorCode)
|
.errorCode(errorCode)
|
||||||
.message(message)
|
.message(message)
|
||||||
.errorDetails(errorDetails)
|
.errorDetails(errorDetails)
|
||||||
.timestamp(LocalDateTime.now())
|
.timestamp(LocalDateTime.now())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,88 +1,88 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.PrioriteBonCommande;
|
import dev.lions.btpxpress.domain.core.entity.PrioriteBonCommande;
|
||||||
import dev.lions.btpxpress.domain.core.entity.TypeBonCommande;
|
import dev.lions.btpxpress.domain.core.entity.TypeBonCommande;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la création d'un bon de commande - Architecture 2025
|
* DTO pour la création d'un bon de commande - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class BonCommandeCreateDTO {
|
public class BonCommandeCreateDTO {
|
||||||
|
|
||||||
@NotBlank(message = "Le numéro est obligatoire")
|
@NotBlank(message = "Le numéro est obligatoire")
|
||||||
private String numero;
|
private String numero;
|
||||||
|
|
||||||
private String numeroInterne;
|
private String numeroInterne;
|
||||||
|
|
||||||
private String objet;
|
private String objet;
|
||||||
|
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
@NotNull(message = "Le fournisseur est obligatoire")
|
@NotNull(message = "Le fournisseur est obligatoire")
|
||||||
private UUID fournisseurId;
|
private UUID fournisseurId;
|
||||||
|
|
||||||
private UUID chantierId;
|
private UUID chantierId;
|
||||||
|
|
||||||
private UUID demandeurId;
|
private UUID demandeurId;
|
||||||
|
|
||||||
private PrioriteBonCommande priorite;
|
private PrioriteBonCommande priorite;
|
||||||
|
|
||||||
private TypeBonCommande typeCommande;
|
private TypeBonCommande typeCommande;
|
||||||
|
|
||||||
private LocalDate dateCommande;
|
private LocalDate dateCommande;
|
||||||
|
|
||||||
private LocalDate dateBesoin;
|
private LocalDate dateBesoin;
|
||||||
|
|
||||||
private LocalDate dateLivraisonPrevue;
|
private LocalDate dateLivraisonPrevue;
|
||||||
|
|
||||||
private BigDecimal montantHT;
|
private BigDecimal montantHT;
|
||||||
|
|
||||||
private BigDecimal remisePourcentage;
|
private BigDecimal remisePourcentage;
|
||||||
|
|
||||||
private BigDecimal remiseMontant;
|
private BigDecimal remiseMontant;
|
||||||
|
|
||||||
private BigDecimal fraisPort;
|
private BigDecimal fraisPort;
|
||||||
|
|
||||||
private String adresseLivraison;
|
private String adresseLivraison;
|
||||||
|
|
||||||
private String adresseFacturation;
|
private String adresseFacturation;
|
||||||
|
|
||||||
private String contactFournisseur;
|
private String contactFournisseur;
|
||||||
|
|
||||||
private String emailContact;
|
private String emailContact;
|
||||||
|
|
||||||
private String telephoneContact;
|
private String telephoneContact;
|
||||||
|
|
||||||
private String referenceFournisseur;
|
private String referenceFournisseur;
|
||||||
|
|
||||||
private String numeroDevis;
|
private String numeroDevis;
|
||||||
|
|
||||||
private Boolean livraisonPartielleAutorisee;
|
private Boolean livraisonPartielleAutorisee;
|
||||||
|
|
||||||
private Boolean controleReceptionRequis;
|
private Boolean controleReceptionRequis;
|
||||||
|
|
||||||
private Boolean urgente;
|
private Boolean urgente;
|
||||||
|
|
||||||
private Boolean confidentielle;
|
private Boolean confidentielle;
|
||||||
|
|
||||||
private String commentaires;
|
private String commentaires;
|
||||||
|
|
||||||
private String notesInternes;
|
private String notesInternes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,139 +1,139 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.PrioriteBonCommande;
|
import dev.lions.btpxpress.domain.core.entity.PrioriteBonCommande;
|
||||||
import dev.lions.btpxpress.domain.core.entity.StatutBonCommande;
|
import dev.lions.btpxpress.domain.core.entity.StatutBonCommande;
|
||||||
import dev.lions.btpxpress.domain.core.entity.TypeBonCommande;
|
import dev.lions.btpxpress.domain.core.entity.TypeBonCommande;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la réponse d'un bon de commande - Architecture 2025
|
* DTO pour la réponse d'un bon de commande - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class BonCommandeResponseDTO {
|
public class BonCommandeResponseDTO {
|
||||||
|
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
private String numero;
|
private String numero;
|
||||||
|
|
||||||
private String numeroInterne;
|
private String numeroInterne;
|
||||||
|
|
||||||
private String objet;
|
private String objet;
|
||||||
|
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
private StatutBonCommande statut;
|
private StatutBonCommande statut;
|
||||||
|
|
||||||
private PrioriteBonCommande priorite;
|
private PrioriteBonCommande priorite;
|
||||||
|
|
||||||
private TypeBonCommande typeCommande;
|
private TypeBonCommande typeCommande;
|
||||||
|
|
||||||
private LocalDate dateCommande;
|
private LocalDate dateCommande;
|
||||||
|
|
||||||
private LocalDate dateBesoin;
|
private LocalDate dateBesoin;
|
||||||
|
|
||||||
private LocalDate dateLivraisonPrevue;
|
private LocalDate dateLivraisonPrevue;
|
||||||
|
|
||||||
private LocalDate dateLivraisonReelle;
|
private LocalDate dateLivraisonReelle;
|
||||||
|
|
||||||
private LocalDate dateValidation;
|
private LocalDate dateValidation;
|
||||||
|
|
||||||
private LocalDate dateEnvoi;
|
private LocalDate dateEnvoi;
|
||||||
|
|
||||||
private LocalDate dateAccuseReception;
|
private LocalDate dateAccuseReception;
|
||||||
|
|
||||||
private BigDecimal montantHT;
|
private BigDecimal montantHT;
|
||||||
|
|
||||||
private BigDecimal montantTVA;
|
private BigDecimal montantTVA;
|
||||||
|
|
||||||
private BigDecimal montantTTC;
|
private BigDecimal montantTTC;
|
||||||
|
|
||||||
private BigDecimal remisePourcentage;
|
private BigDecimal remisePourcentage;
|
||||||
|
|
||||||
private BigDecimal remiseMontant;
|
private BigDecimal remiseMontant;
|
||||||
|
|
||||||
private BigDecimal fraisPort;
|
private BigDecimal fraisPort;
|
||||||
|
|
||||||
private BigDecimal autreFrais;
|
private BigDecimal autreFrais;
|
||||||
|
|
||||||
private String adresseLivraison;
|
private String adresseLivraison;
|
||||||
|
|
||||||
private String adresseFacturation;
|
private String adresseFacturation;
|
||||||
|
|
||||||
private String contactFournisseur;
|
private String contactFournisseur;
|
||||||
|
|
||||||
private String emailContact;
|
private String emailContact;
|
||||||
|
|
||||||
private String telephoneContact;
|
private String telephoneContact;
|
||||||
|
|
||||||
private String referenceFournisseur;
|
private String referenceFournisseur;
|
||||||
|
|
||||||
private String numeroDevis;
|
private String numeroDevis;
|
||||||
|
|
||||||
private String referenceMarche;
|
private String referenceMarche;
|
||||||
|
|
||||||
private Boolean livraisonPartielleAutorisee;
|
private Boolean livraisonPartielleAutorisee;
|
||||||
|
|
||||||
private Boolean controleReceptionRequis;
|
private Boolean controleReceptionRequis;
|
||||||
|
|
||||||
private Boolean urgente;
|
private Boolean urgente;
|
||||||
|
|
||||||
private Boolean confidentielle;
|
private Boolean confidentielle;
|
||||||
|
|
||||||
private Boolean factureRecue;
|
private Boolean factureRecue;
|
||||||
|
|
||||||
private LocalDate dateReceptionFacture;
|
private LocalDate dateReceptionFacture;
|
||||||
|
|
||||||
private String numeroFacture;
|
private String numeroFacture;
|
||||||
|
|
||||||
private String commentaires;
|
private String commentaires;
|
||||||
|
|
||||||
private String notesInternes;
|
private String notesInternes;
|
||||||
|
|
||||||
private String conditionsParticulieres;
|
private String conditionsParticulieres;
|
||||||
|
|
||||||
private String motifAnnulation;
|
private String motifAnnulation;
|
||||||
|
|
||||||
// Relations simplifiées
|
// Relations simplifiées
|
||||||
private UUID fournisseurId;
|
private UUID fournisseurId;
|
||||||
private String fournisseurNom;
|
private String fournisseurNom;
|
||||||
|
|
||||||
private UUID chantierId;
|
private UUID chantierId;
|
||||||
private String chantierNom;
|
private String chantierNom;
|
||||||
|
|
||||||
private UUID demandeurId;
|
private UUID demandeurId;
|
||||||
private String demandeurNom;
|
private String demandeurNom;
|
||||||
|
|
||||||
private UUID valideurId;
|
private UUID valideurId;
|
||||||
private String valideurNom;
|
private String valideurNom;
|
||||||
|
|
||||||
// Lignes de commande (simplifiées)
|
// Lignes de commande (simplifiées)
|
||||||
private Integer nombreLignes;
|
private Integer nombreLignes;
|
||||||
|
|
||||||
// Métadonnées
|
// Métadonnées
|
||||||
private LocalDateTime dateCreation;
|
private LocalDateTime dateCreation;
|
||||||
|
|
||||||
private LocalDateTime dateModification;
|
private LocalDateTime dateModification;
|
||||||
|
|
||||||
private String creePar;
|
private String creePar;
|
||||||
|
|
||||||
private String modifiePar;
|
private String modifiePar;
|
||||||
|
|
||||||
private String validePar;
|
private String validePar;
|
||||||
|
|
||||||
private String envoyePar;
|
private String envoyePar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,58 +1,58 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.Budget.StatutBudget;
|
import dev.lions.btpxpress.domain.core.entity.Budget.StatutBudget;
|
||||||
import jakarta.validation.constraints.DecimalMin;
|
import jakarta.validation.constraints.DecimalMin;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la création de budget - Architecture 2025
|
* DTO pour la création de budget - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class BudgetCreateDTO {
|
public class BudgetCreateDTO {
|
||||||
|
|
||||||
@NotNull(message = "Le chantier est obligatoire")
|
@NotNull(message = "Le chantier est obligatoire")
|
||||||
private UUID chantierId;
|
private UUID chantierId;
|
||||||
|
|
||||||
@NotNull(message = "Le budget total est obligatoire")
|
@NotNull(message = "Le budget total est obligatoire")
|
||||||
@DecimalMin(value = "0.0", inclusive = false, message = "Le budget total doit être positif")
|
@DecimalMin(value = "0.0", inclusive = false, message = "Le budget total doit être positif")
|
||||||
private BigDecimal budgetTotal;
|
private BigDecimal budgetTotal;
|
||||||
|
|
||||||
@Builder.Default
|
@Builder.Default
|
||||||
@DecimalMin(value = "0.0", message = "La dépense réelle doit être positive ou nulle")
|
@DecimalMin(value = "0.0", message = "La dépense réelle doit être positive ou nulle")
|
||||||
private BigDecimal depenseReelle = BigDecimal.ZERO;
|
private BigDecimal depenseReelle = BigDecimal.ZERO;
|
||||||
|
|
||||||
@DecimalMin(value = "0.0", message = "L'avancement doit être positif ou nul")
|
@DecimalMin(value = "0.0", message = "L'avancement doit être positif ou nul")
|
||||||
@DecimalMin(value = "100.0", message = "L'avancement ne peut pas dépasser 100%")
|
@DecimalMin(value = "100.0", message = "L'avancement ne peut pas dépasser 100%")
|
||||||
private BigDecimal avancementTravaux;
|
private BigDecimal avancementTravaux;
|
||||||
|
|
||||||
@NotNull(message = "Le statut est obligatoire")
|
@NotNull(message = "Le statut est obligatoire")
|
||||||
private StatutBudget statut;
|
private StatutBudget statut;
|
||||||
|
|
||||||
private String responsable;
|
private String responsable;
|
||||||
|
|
||||||
private String prochainJalon;
|
private String prochainJalon;
|
||||||
|
|
||||||
private LocalDate dateDerniereMiseAJour;
|
private LocalDate dateDerniereMiseAJour;
|
||||||
|
|
||||||
/** Méthode de conversion String vers UUID pour chantierId */
|
/** Méthode de conversion String vers UUID pour chantierId */
|
||||||
public void setChantierId(String chantierId) {
|
public void setChantierId(String chantierId) {
|
||||||
if (chantierId != null && !chantierId.trim().isEmpty()) {
|
if (chantierId != null && !chantierId.trim().isEmpty()) {
|
||||||
this.chantierId = UUID.fromString(chantierId);
|
this.chantierId = UUID.fromString(chantierId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,60 +1,60 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.Budget.StatutBudget;
|
import dev.lions.btpxpress.domain.core.entity.Budget.StatutBudget;
|
||||||
import dev.lions.btpxpress.domain.core.entity.Budget.TendanceBudget;
|
import dev.lions.btpxpress.domain.core.entity.Budget.TendanceBudget;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la réponse d'un budget - Architecture 2025
|
* DTO pour la réponse d'un budget - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class BudgetResponseDTO {
|
public class BudgetResponseDTO {
|
||||||
|
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
private UUID chantierId;
|
private UUID chantierId;
|
||||||
private String chantierNom;
|
private String chantierNom;
|
||||||
|
|
||||||
private BigDecimal budgetTotal;
|
private BigDecimal budgetTotal;
|
||||||
|
|
||||||
private BigDecimal depenseReelle;
|
private BigDecimal depenseReelle;
|
||||||
|
|
||||||
private BigDecimal ecart;
|
private BigDecimal ecart;
|
||||||
|
|
||||||
private BigDecimal ecartPourcentage;
|
private BigDecimal ecartPourcentage;
|
||||||
|
|
||||||
private BigDecimal avancementTravaux;
|
private BigDecimal avancementTravaux;
|
||||||
|
|
||||||
private StatutBudget statut;
|
private StatutBudget statut;
|
||||||
|
|
||||||
private TendanceBudget tendance;
|
private TendanceBudget tendance;
|
||||||
|
|
||||||
private String responsable;
|
private String responsable;
|
||||||
|
|
||||||
private Integer nombreAlertes;
|
private Integer nombreAlertes;
|
||||||
|
|
||||||
private String prochainJalon;
|
private String prochainJalon;
|
||||||
|
|
||||||
private LocalDate dateDerniereMiseAJour;
|
private LocalDate dateDerniereMiseAJour;
|
||||||
|
|
||||||
private Boolean actif;
|
private Boolean actif;
|
||||||
|
|
||||||
private LocalDateTime dateCreation;
|
private LocalDateTime dateCreation;
|
||||||
|
|
||||||
private LocalDateTime dateModification;
|
private LocalDateTime dateModification;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,73 +1,73 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.StatutChantier;
|
import dev.lions.btpxpress.domain.core.entity.StatutChantier;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la réponse d'un chantier - Architecture 2025
|
* DTO pour la réponse d'un chantier - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class ChantierResponseDTO {
|
public class ChantierResponseDTO {
|
||||||
|
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
private String nom;
|
private String nom;
|
||||||
|
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
private String adresse;
|
private String adresse;
|
||||||
|
|
||||||
private String codePostal;
|
private String codePostal;
|
||||||
|
|
||||||
private String ville;
|
private String ville;
|
||||||
|
|
||||||
private LocalDate dateDebut;
|
private LocalDate dateDebut;
|
||||||
|
|
||||||
private LocalDate dateFinPrevue;
|
private LocalDate dateFinPrevue;
|
||||||
|
|
||||||
private LocalDate dateFinReelle;
|
private LocalDate dateFinReelle;
|
||||||
|
|
||||||
private StatutChantier statut;
|
private StatutChantier statut;
|
||||||
|
|
||||||
private BigDecimal montantPrevu;
|
private BigDecimal montantPrevu;
|
||||||
|
|
||||||
private BigDecimal montantReel;
|
private BigDecimal montantReel;
|
||||||
|
|
||||||
private BigDecimal montantContrat;
|
private BigDecimal montantContrat;
|
||||||
|
|
||||||
private BigDecimal coutReel;
|
private BigDecimal coutReel;
|
||||||
|
|
||||||
private BigDecimal pourcentageAvancement;
|
private BigDecimal pourcentageAvancement;
|
||||||
|
|
||||||
private Boolean actif;
|
private Boolean actif;
|
||||||
|
|
||||||
private LocalDateTime dateCreation;
|
private LocalDateTime dateCreation;
|
||||||
|
|
||||||
private LocalDateTime dateModification;
|
private LocalDateTime dateModification;
|
||||||
|
|
||||||
// Relations simplifiées
|
// Relations simplifiées
|
||||||
private UUID clientId;
|
private UUID clientId;
|
||||||
private String clientNom;
|
private String clientNom;
|
||||||
private String clientRaisonSociale;
|
private String clientRaisonSociale;
|
||||||
|
|
||||||
private Integer nombrePhases;
|
private Integer nombrePhases;
|
||||||
|
|
||||||
private Integer nombreEmployes;
|
private Integer nombreEmployes;
|
||||||
|
|
||||||
private Integer nombreMateriels;
|
private Integer nombreMateriels;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,58 +1,58 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.StatutChantier;
|
import dev.lions.btpxpress.domain.core.entity.StatutChantier;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la mise à jour de chantier - Architecture 2025
|
* DTO pour la mise à jour de chantier - Architecture 2025
|
||||||
* Tous les champs sont optionnels sauf ceux marqués comme obligatoires
|
* Tous les champs sont optionnels sauf ceux marqués comme obligatoires
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class ChantierUpdateDTO {
|
public class ChantierUpdateDTO {
|
||||||
|
|
||||||
private String nom;
|
private String nom;
|
||||||
|
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
private String adresse;
|
private String adresse;
|
||||||
|
|
||||||
private String codePostal;
|
private String codePostal;
|
||||||
|
|
||||||
private String ville;
|
private String ville;
|
||||||
|
|
||||||
private LocalDate dateDebut;
|
private LocalDate dateDebut;
|
||||||
|
|
||||||
private LocalDate dateFinPrevue;
|
private LocalDate dateFinPrevue;
|
||||||
|
|
||||||
private LocalDate dateFinReelle;
|
private LocalDate dateFinReelle;
|
||||||
|
|
||||||
private StatutChantier statut;
|
private StatutChantier statut;
|
||||||
|
|
||||||
private Double montantPrevu;
|
private Double montantPrevu;
|
||||||
|
|
||||||
private Double montantReel;
|
private Double montantReel;
|
||||||
|
|
||||||
private Boolean actif;
|
private Boolean actif;
|
||||||
|
|
||||||
private UUID clientId;
|
private UUID clientId;
|
||||||
|
|
||||||
/** Méthode de conversion String vers UUID pour clientId */
|
/** Méthode de conversion String vers UUID pour clientId */
|
||||||
public void setClientId(String clientId) {
|
public void setClientId(String clientId) {
|
||||||
if (clientId != null && !clientId.trim().isEmpty()) {
|
if (clientId != null && !clientId.trim().isEmpty()) {
|
||||||
this.clientId = UUID.fromString(clientId);
|
this.clientId = UUID.fromString(clientId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,60 +1,60 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la réponse d'un client - Architecture 2025
|
* DTO pour la réponse d'un client - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class ClientResponseDTO {
|
public class ClientResponseDTO {
|
||||||
|
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
private String nom;
|
private String nom;
|
||||||
|
|
||||||
private String prenom;
|
private String prenom;
|
||||||
|
|
||||||
private String nomComplet;
|
private String nomComplet;
|
||||||
|
|
||||||
private String entreprise;
|
private String entreprise;
|
||||||
|
|
||||||
private String email;
|
private String email;
|
||||||
|
|
||||||
private String telephone;
|
private String telephone;
|
||||||
|
|
||||||
private String adresse;
|
private String adresse;
|
||||||
|
|
||||||
private String codePostal;
|
private String codePostal;
|
||||||
|
|
||||||
private String ville;
|
private String ville;
|
||||||
|
|
||||||
private String siret;
|
private String siret;
|
||||||
|
|
||||||
private String numeroTVA;
|
private String numeroTVA;
|
||||||
|
|
||||||
private Boolean actif;
|
private Boolean actif;
|
||||||
|
|
||||||
private LocalDateTime dateCreation;
|
private LocalDateTime dateCreation;
|
||||||
|
|
||||||
private LocalDateTime dateModification;
|
private LocalDateTime dateModification;
|
||||||
|
|
||||||
// Statistiques simplifiées
|
// Statistiques simplifiées
|
||||||
private Integer nombreChantiers;
|
private Integer nombreChantiers;
|
||||||
|
|
||||||
private Integer nombreDevis;
|
private Integer nombreDevis;
|
||||||
|
|
||||||
private Integer nombreFactures;
|
private Integer nombreFactures;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,46 +1,46 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import jakarta.validation.constraints.Email;
|
import jakarta.validation.constraints.Email;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la mise à jour de client - Architecture 2025
|
* DTO pour la mise à jour de client - Architecture 2025
|
||||||
* Tous les champs sont optionnels sauf ceux marqués comme obligatoires
|
* Tous les champs sont optionnels sauf ceux marqués comme obligatoires
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class ClientUpdateDTO {
|
public class ClientUpdateDTO {
|
||||||
|
|
||||||
private String nom;
|
private String nom;
|
||||||
|
|
||||||
private String prenom;
|
private String prenom;
|
||||||
|
|
||||||
private String entreprise;
|
private String entreprise;
|
||||||
|
|
||||||
@Email(message = "L'email doit être valide")
|
@Email(message = "L'email doit être valide")
|
||||||
private String email;
|
private String email;
|
||||||
|
|
||||||
private String telephone;
|
private String telephone;
|
||||||
|
|
||||||
private String adresse;
|
private String adresse;
|
||||||
|
|
||||||
private String codePostal;
|
private String codePostal;
|
||||||
|
|
||||||
private String ville;
|
private String ville;
|
||||||
|
|
||||||
private String siret;
|
private String siret;
|
||||||
|
|
||||||
private String numeroTVA;
|
private String numeroTVA;
|
||||||
|
|
||||||
private Boolean actif;
|
private Boolean actif;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,99 +1,99 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.StatutDevis;
|
import dev.lions.btpxpress.domain.core.entity.StatutDevis;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import jakarta.validation.constraints.Positive;
|
import jakarta.validation.constraints.Positive;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la création de devis - Architecture 2025
|
* DTO pour la création de devis - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class DevisCreateDTO {
|
public class DevisCreateDTO {
|
||||||
|
|
||||||
@NotBlank(message = "Le numéro de devis est obligatoire")
|
@NotBlank(message = "Le numéro de devis est obligatoire")
|
||||||
private String numero;
|
private String numero;
|
||||||
|
|
||||||
@NotBlank(message = "L'objet du devis est obligatoire")
|
@NotBlank(message = "L'objet du devis est obligatoire")
|
||||||
private String objet;
|
private String objet;
|
||||||
|
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
@NotNull(message = "La date d'émission est obligatoire")
|
@NotNull(message = "La date d'émission est obligatoire")
|
||||||
private LocalDate dateEmission;
|
private LocalDate dateEmission;
|
||||||
|
|
||||||
@NotNull(message = "La date de validité est obligatoire")
|
@NotNull(message = "La date de validité est obligatoire")
|
||||||
private LocalDate dateValidite;
|
private LocalDate dateValidite;
|
||||||
|
|
||||||
@Builder.Default
|
@Builder.Default
|
||||||
private StatutDevis statut = StatutDevis.BROUILLON;
|
private StatutDevis statut = StatutDevis.BROUILLON;
|
||||||
|
|
||||||
@Positive(message = "Le montant HT doit être positif")
|
@Positive(message = "Le montant HT doit être positif")
|
||||||
private BigDecimal montantHT;
|
private BigDecimal montantHT;
|
||||||
|
|
||||||
@Builder.Default
|
@Builder.Default
|
||||||
private BigDecimal tauxTVA = BigDecimal.valueOf(20.0);
|
private BigDecimal tauxTVA = BigDecimal.valueOf(20.0);
|
||||||
|
|
||||||
private String conditionsPaiement;
|
private String conditionsPaiement;
|
||||||
|
|
||||||
private Integer delaiExecution; // en jours
|
private Integer delaiExecution; // en jours
|
||||||
|
|
||||||
@NotNull(message = "Le client est obligatoire")
|
@NotNull(message = "Le client est obligatoire")
|
||||||
private UUID clientId;
|
private UUID clientId;
|
||||||
|
|
||||||
private UUID chantierId; // Optionnel
|
private UUID chantierId; // Optionnel
|
||||||
|
|
||||||
private List<LigneDevisCreateDTO> lignes;
|
private List<LigneDevisCreateDTO> lignes;
|
||||||
|
|
||||||
/** Méthode de conversion String vers UUID pour clientId */
|
/** Méthode de conversion String vers UUID pour clientId */
|
||||||
public void setClientId(String clientId) {
|
public void setClientId(String clientId) {
|
||||||
if (clientId != null && !clientId.trim().isEmpty()) {
|
if (clientId != null && !clientId.trim().isEmpty()) {
|
||||||
this.clientId = UUID.fromString(clientId);
|
this.clientId = UUID.fromString(clientId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Méthode de conversion String vers UUID pour chantierId */
|
/** Méthode de conversion String vers UUID pour chantierId */
|
||||||
public void setChantierId(String chantierId) {
|
public void setChantierId(String chantierId) {
|
||||||
if (chantierId != null && !chantierId.trim().isEmpty()) {
|
if (chantierId != null && !chantierId.trim().isEmpty()) {
|
||||||
this.chantierId = UUID.fromString(chantierId);
|
this.chantierId = UUID.fromString(chantierId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour une ligne de devis
|
* DTO pour une ligne de devis
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public static class LigneDevisCreateDTO {
|
public static class LigneDevisCreateDTO {
|
||||||
@NotBlank(message = "La description de la ligne est obligatoire")
|
@NotBlank(message = "La description de la ligne est obligatoire")
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
@Positive(message = "La quantité doit être positive")
|
@Positive(message = "La quantité doit être positive")
|
||||||
private BigDecimal quantite;
|
private BigDecimal quantite;
|
||||||
|
|
||||||
@Positive(message = "Le prix unitaire doit être positif")
|
@Positive(message = "Le prix unitaire doit être positif")
|
||||||
private BigDecimal prixUnitaire;
|
private BigDecimal prixUnitaire;
|
||||||
|
|
||||||
private BigDecimal tauxTVA;
|
private BigDecimal tauxTVA;
|
||||||
|
|
||||||
private String unite;
|
private String unite;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,89 +1,89 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.StatutDevis;
|
import dev.lions.btpxpress.domain.core.entity.StatutDevis;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la réponse d'un devis - Architecture 2025
|
* DTO pour la réponse d'un devis - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class DevisResponseDTO {
|
public class DevisResponseDTO {
|
||||||
|
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
private String numero;
|
private String numero;
|
||||||
|
|
||||||
private String objet;
|
private String objet;
|
||||||
|
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
private LocalDate dateEmission;
|
private LocalDate dateEmission;
|
||||||
|
|
||||||
private LocalDate dateValidite;
|
private LocalDate dateValidite;
|
||||||
|
|
||||||
private StatutDevis statut;
|
private StatutDevis statut;
|
||||||
|
|
||||||
private BigDecimal montantHT;
|
private BigDecimal montantHT;
|
||||||
|
|
||||||
private BigDecimal tauxTVA;
|
private BigDecimal tauxTVA;
|
||||||
|
|
||||||
private BigDecimal montantTVA;
|
private BigDecimal montantTVA;
|
||||||
|
|
||||||
private BigDecimal montantTTC;
|
private BigDecimal montantTTC;
|
||||||
|
|
||||||
private String conditionsPaiement;
|
private String conditionsPaiement;
|
||||||
|
|
||||||
private Integer delaiExecution;
|
private Integer delaiExecution;
|
||||||
|
|
||||||
private Boolean actif;
|
private Boolean actif;
|
||||||
|
|
||||||
private LocalDateTime dateCreation;
|
private LocalDateTime dateCreation;
|
||||||
|
|
||||||
private LocalDateTime dateModification;
|
private LocalDateTime dateModification;
|
||||||
|
|
||||||
// Relations simplifiées
|
// Relations simplifiées
|
||||||
private UUID clientId;
|
private UUID clientId;
|
||||||
private String clientNom;
|
private String clientNom;
|
||||||
private String clientRaisonSociale;
|
private String clientRaisonSociale;
|
||||||
|
|
||||||
private UUID chantierId;
|
private UUID chantierId;
|
||||||
private String chantierNom;
|
private String chantierNom;
|
||||||
|
|
||||||
private List<LigneDevisResponseDTO> lignes;
|
private List<LigneDevisResponseDTO> lignes;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour une ligne de devis en réponse
|
* DTO pour une ligne de devis en réponse
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public static class LigneDevisResponseDTO {
|
public static class LigneDevisResponseDTO {
|
||||||
private UUID id;
|
private UUID id;
|
||||||
private String description;
|
private String description;
|
||||||
private BigDecimal quantite;
|
private BigDecimal quantite;
|
||||||
private BigDecimal prixUnitaire;
|
private BigDecimal prixUnitaire;
|
||||||
private BigDecimal tauxTVA;
|
private BigDecimal tauxTVA;
|
||||||
private BigDecimal montantHT;
|
private BigDecimal montantHT;
|
||||||
private BigDecimal montantTVA;
|
private BigDecimal montantTVA;
|
||||||
private BigDecimal montantTTC;
|
private BigDecimal montantTTC;
|
||||||
private String unite;
|
private String unite;
|
||||||
private Integer ordre;
|
private Integer ordre;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,41 +1,41 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.TypeDisponibilite;
|
import dev.lions.btpxpress.domain.core.entity.TypeDisponibilite;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la création d'une disponibilité - Architecture 2025
|
* DTO pour la création d'une disponibilité - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class DisponibiliteCreateDTO {
|
public class DisponibiliteCreateDTO {
|
||||||
|
|
||||||
@NotNull(message = "L'employé est obligatoire")
|
@NotNull(message = "L'employé est obligatoire")
|
||||||
private UUID employeId;
|
private UUID employeId;
|
||||||
|
|
||||||
@NotNull(message = "La date de début est obligatoire")
|
@NotNull(message = "La date de début est obligatoire")
|
||||||
private LocalDateTime dateDebut;
|
private LocalDateTime dateDebut;
|
||||||
|
|
||||||
@NotNull(message = "La date de fin est obligatoire")
|
@NotNull(message = "La date de fin est obligatoire")
|
||||||
private LocalDateTime dateFin;
|
private LocalDateTime dateFin;
|
||||||
|
|
||||||
@NotNull(message = "Le type de disponibilité est obligatoire")
|
@NotNull(message = "Le type de disponibilité est obligatoire")
|
||||||
private TypeDisponibilite type;
|
private TypeDisponibilite type;
|
||||||
|
|
||||||
private String motif;
|
private String motif;
|
||||||
|
|
||||||
private Boolean approuvee;
|
private Boolean approuvee;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,50 +1,50 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.TypeDisponibilite;
|
import dev.lions.btpxpress.domain.core.entity.TypeDisponibilite;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la réponse d'une disponibilité - Architecture 2025
|
* DTO pour la réponse d'une disponibilité - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class DisponibiliteResponseDTO {
|
public class DisponibiliteResponseDTO {
|
||||||
|
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
private LocalDateTime dateDebut;
|
private LocalDateTime dateDebut;
|
||||||
|
|
||||||
private LocalDateTime dateFin;
|
private LocalDateTime dateFin;
|
||||||
|
|
||||||
private TypeDisponibilite type;
|
private TypeDisponibilite type;
|
||||||
|
|
||||||
private String motif;
|
private String motif;
|
||||||
|
|
||||||
private Boolean approuvee;
|
private Boolean approuvee;
|
||||||
|
|
||||||
private LocalDateTime dateCreation;
|
private LocalDateTime dateCreation;
|
||||||
|
|
||||||
private LocalDateTime dateModification;
|
private LocalDateTime dateModification;
|
||||||
|
|
||||||
// Relations simplifiées
|
// Relations simplifiées
|
||||||
private UUID employeId;
|
private UUID employeId;
|
||||||
private String employeNom;
|
private String employeNom;
|
||||||
private String employePrenom;
|
private String employePrenom;
|
||||||
|
|
||||||
// Métadonnées calculées
|
// Métadonnées calculées
|
||||||
private Long dureeEnHeures;
|
private Long dureeEnHeures;
|
||||||
|
|
||||||
private Boolean active;
|
private Boolean active;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,58 +1,58 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.TypeDocument;
|
import dev.lions.btpxpress.domain.core.entity.TypeDocument;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la création d'un document - Architecture 2025
|
* DTO pour la création d'un document - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class DocumentCreateDTO {
|
public class DocumentCreateDTO {
|
||||||
|
|
||||||
@NotBlank(message = "Le nom est obligatoire")
|
@NotBlank(message = "Le nom est obligatoire")
|
||||||
private String nom;
|
private String nom;
|
||||||
|
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
@NotBlank(message = "Le nom du fichier est obligatoire")
|
@NotBlank(message = "Le nom du fichier est obligatoire")
|
||||||
private String nomFichier;
|
private String nomFichier;
|
||||||
|
|
||||||
@NotBlank(message = "Le chemin du fichier est obligatoire")
|
@NotBlank(message = "Le chemin du fichier est obligatoire")
|
||||||
private String cheminFichier;
|
private String cheminFichier;
|
||||||
|
|
||||||
@NotBlank(message = "Le type MIME est obligatoire")
|
@NotBlank(message = "Le type MIME est obligatoire")
|
||||||
private String typeMime;
|
private String typeMime;
|
||||||
|
|
||||||
@NotNull(message = "La taille du fichier est obligatoire")
|
@NotNull(message = "La taille du fichier est obligatoire")
|
||||||
private Long tailleFichier;
|
private Long tailleFichier;
|
||||||
|
|
||||||
@NotNull(message = "Le type de document est obligatoire")
|
@NotNull(message = "Le type de document est obligatoire")
|
||||||
private TypeDocument typeDocument;
|
private TypeDocument typeDocument;
|
||||||
|
|
||||||
// Relations optionnelles
|
// Relations optionnelles
|
||||||
private UUID chantierId;
|
private UUID chantierId;
|
||||||
private UUID materielId;
|
private UUID materielId;
|
||||||
private UUID employeId;
|
private UUID employeId;
|
||||||
private UUID equipeId;
|
private UUID equipeId;
|
||||||
private UUID clientId;
|
private UUID clientId;
|
||||||
|
|
||||||
private String tags;
|
private String tags;
|
||||||
|
|
||||||
private Boolean estPublic;
|
private Boolean estPublic;
|
||||||
|
|
||||||
private Boolean actif;
|
private Boolean actif;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,79 +1,79 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.TypeDocument;
|
import dev.lions.btpxpress.domain.core.entity.TypeDocument;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la réponse d'un document - Architecture 2025
|
* DTO pour la réponse d'un document - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class DocumentResponseDTO {
|
public class DocumentResponseDTO {
|
||||||
|
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
private String nom;
|
private String nom;
|
||||||
|
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
private String nomFichier;
|
private String nomFichier;
|
||||||
|
|
||||||
private String cheminFichier;
|
private String cheminFichier;
|
||||||
|
|
||||||
private String typeMime;
|
private String typeMime;
|
||||||
|
|
||||||
private Long tailleFichier;
|
private Long tailleFichier;
|
||||||
|
|
||||||
private TypeDocument typeDocument;
|
private TypeDocument typeDocument;
|
||||||
|
|
||||||
private String tags;
|
private String tags;
|
||||||
|
|
||||||
private Boolean estPublic;
|
private Boolean estPublic;
|
||||||
|
|
||||||
private Boolean actif;
|
private Boolean actif;
|
||||||
|
|
||||||
private LocalDateTime dateCreation;
|
private LocalDateTime dateCreation;
|
||||||
|
|
||||||
private LocalDateTime dateModification;
|
private LocalDateTime dateModification;
|
||||||
|
|
||||||
// Relations simplifiées
|
// Relations simplifiées
|
||||||
private UUID chantierId;
|
private UUID chantierId;
|
||||||
private String chantierNom;
|
private String chantierNom;
|
||||||
|
|
||||||
private UUID materielId;
|
private UUID materielId;
|
||||||
private String materielNom;
|
private String materielNom;
|
||||||
|
|
||||||
private UUID employeId;
|
private UUID employeId;
|
||||||
private String employeNom;
|
private String employeNom;
|
||||||
private String employePrenom;
|
private String employePrenom;
|
||||||
|
|
||||||
private UUID equipeId;
|
private UUID equipeId;
|
||||||
private String equipeNom;
|
private String equipeNom;
|
||||||
|
|
||||||
private UUID clientId;
|
private UUID clientId;
|
||||||
private String clientNom;
|
private String clientNom;
|
||||||
|
|
||||||
private UUID creeParId;
|
private UUID creeParId;
|
||||||
private String creeParNom;
|
private String creeParNom;
|
||||||
|
|
||||||
// Métadonnées calculées
|
// Métadonnées calculées
|
||||||
private String extension;
|
private String extension;
|
||||||
|
|
||||||
private String tailleFormatee;
|
private String tailleFormatee;
|
||||||
|
|
||||||
private Boolean isImage;
|
private Boolean isImage;
|
||||||
|
|
||||||
private Boolean isPdf;
|
private Boolean isPdf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,69 +1,69 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.FonctionEmploye;
|
import dev.lions.btpxpress.domain.core.entity.FonctionEmploye;
|
||||||
import dev.lions.btpxpress.domain.core.entity.StatutEmploye;
|
import dev.lions.btpxpress.domain.core.entity.StatutEmploye;
|
||||||
import jakarta.validation.constraints.Email;
|
import jakarta.validation.constraints.Email;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import jakarta.validation.constraints.Pattern;
|
import jakarta.validation.constraints.Pattern;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la création d'employé - Architecture 2025
|
* DTO pour la création d'employé - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class EmployeCreateDTO {
|
public class EmployeCreateDTO {
|
||||||
|
|
||||||
@NotBlank(message = "Le nom est obligatoire")
|
@NotBlank(message = "Le nom est obligatoire")
|
||||||
private String nom;
|
private String nom;
|
||||||
|
|
||||||
@NotBlank(message = "Le prénom est obligatoire")
|
@NotBlank(message = "Le prénom est obligatoire")
|
||||||
private String prenom;
|
private String prenom;
|
||||||
|
|
||||||
@Email(message = "Email invalide")
|
@Email(message = "Email invalide")
|
||||||
private String email;
|
private String email;
|
||||||
|
|
||||||
@Pattern(
|
@Pattern(
|
||||||
regexp = "^(?:(?:\\+|00)33|0)\\s*[1-9](?:[\\s.-]*\\d{2}){4}$",
|
regexp = "^(?:(?:\\+|00)33|0)\\s*[1-9](?:[\\s.-]*\\d{2}){4}$",
|
||||||
message = "Numéro de téléphone invalide")
|
message = "Numéro de téléphone invalide")
|
||||||
private String telephone;
|
private String telephone;
|
||||||
|
|
||||||
@NotBlank(message = "Le poste est obligatoire")
|
@NotBlank(message = "Le poste est obligatoire")
|
||||||
private String poste;
|
private String poste;
|
||||||
|
|
||||||
private FonctionEmploye fonction;
|
private FonctionEmploye fonction;
|
||||||
|
|
||||||
private List<String> specialites;
|
private List<String> specialites;
|
||||||
|
|
||||||
private BigDecimal tauxHoraire;
|
private BigDecimal tauxHoraire;
|
||||||
|
|
||||||
@NotNull(message = "La date d'embauche est obligatoire")
|
@NotNull(message = "La date d'embauche est obligatoire")
|
||||||
private LocalDate dateEmbauche;
|
private LocalDate dateEmbauche;
|
||||||
|
|
||||||
@Builder.Default
|
@Builder.Default
|
||||||
private StatutEmploye statut = StatutEmploye.ACTIF;
|
private StatutEmploye statut = StatutEmploye.ACTIF;
|
||||||
|
|
||||||
private UUID equipeId;
|
private UUID equipeId;
|
||||||
|
|
||||||
/** Méthode de conversion String vers UUID pour equipeId */
|
/** Méthode de conversion String vers UUID pour equipeId */
|
||||||
public void setEquipeId(String equipeId) {
|
public void setEquipeId(String equipeId) {
|
||||||
if (equipeId != null && !equipeId.trim().isEmpty()) {
|
if (equipeId != null && !equipeId.trim().isEmpty()) {
|
||||||
this.equipeId = UUID.fromString(equipeId);
|
this.equipeId = UUID.fromString(equipeId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,66 +1,66 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.FonctionEmploye;
|
import dev.lions.btpxpress.domain.core.entity.FonctionEmploye;
|
||||||
import dev.lions.btpxpress.domain.core.entity.StatutEmploye;
|
import dev.lions.btpxpress.domain.core.entity.StatutEmploye;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la réponse d'un employé - Architecture 2025
|
* DTO pour la réponse d'un employé - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class EmployeResponseDTO {
|
public class EmployeResponseDTO {
|
||||||
|
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
private String nom;
|
private String nom;
|
||||||
|
|
||||||
private String prenom;
|
private String prenom;
|
||||||
|
|
||||||
private String nomComplet;
|
private String nomComplet;
|
||||||
|
|
||||||
private String email;
|
private String email;
|
||||||
|
|
||||||
private String telephone;
|
private String telephone;
|
||||||
|
|
||||||
private String poste;
|
private String poste;
|
||||||
|
|
||||||
private FonctionEmploye fonction;
|
private FonctionEmploye fonction;
|
||||||
|
|
||||||
private List<String> specialites;
|
private List<String> specialites;
|
||||||
|
|
||||||
private BigDecimal tauxHoraire;
|
private BigDecimal tauxHoraire;
|
||||||
|
|
||||||
private LocalDate dateEmbauche;
|
private LocalDate dateEmbauche;
|
||||||
|
|
||||||
private StatutEmploye statut;
|
private StatutEmploye statut;
|
||||||
|
|
||||||
private Boolean actif;
|
private Boolean actif;
|
||||||
|
|
||||||
private LocalDateTime dateCreation;
|
private LocalDateTime dateCreation;
|
||||||
|
|
||||||
private LocalDateTime dateModification;
|
private LocalDateTime dateModification;
|
||||||
|
|
||||||
// Relations simplifiées
|
// Relations simplifiées
|
||||||
private UUID equipeId;
|
private UUID equipeId;
|
||||||
private String equipeNom;
|
private String equipeNom;
|
||||||
|
|
||||||
private Integer nombreDisponibilites;
|
private Integer nombreDisponibilites;
|
||||||
|
|
||||||
private Integer nombreCompetences;
|
private Integer nombreCompetences;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,94 +1,94 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.TypeAbonnement;
|
import dev.lions.btpxpress.domain.core.entity.TypeAbonnement;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la création d'un profil d'entreprise - Architecture 2025
|
* DTO pour la création d'un profil d'entreprise - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class EntrepriseProfileCreateDTO {
|
public class EntrepriseProfileCreateDTO {
|
||||||
|
|
||||||
@NotNull(message = "Le propriétaire est obligatoire")
|
@NotNull(message = "Le propriétaire est obligatoire")
|
||||||
private UUID proprietaireId;
|
private UUID proprietaireId;
|
||||||
|
|
||||||
@NotBlank(message = "Le nom commercial est obligatoire")
|
@NotBlank(message = "Le nom commercial est obligatoire")
|
||||||
private String nomCommercial;
|
private String nomCommercial;
|
||||||
|
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
private String slogan;
|
private String slogan;
|
||||||
|
|
||||||
private List<String> specialites;
|
private List<String> specialites;
|
||||||
|
|
||||||
private List<String> certifications;
|
private List<String> certifications;
|
||||||
|
|
||||||
private String adresseComplete;
|
private String adresseComplete;
|
||||||
|
|
||||||
private String codePostal;
|
private String codePostal;
|
||||||
|
|
||||||
private String ville;
|
private String ville;
|
||||||
|
|
||||||
private String departement;
|
private String departement;
|
||||||
|
|
||||||
private String region;
|
private String region;
|
||||||
|
|
||||||
private List<String> zonesIntervention;
|
private List<String> zonesIntervention;
|
||||||
|
|
||||||
private String siteWeb;
|
private String siteWeb;
|
||||||
|
|
||||||
private String emailContact;
|
private String emailContact;
|
||||||
|
|
||||||
private String telephoneCommercial;
|
private String telephoneCommercial;
|
||||||
|
|
||||||
private String logoUrl;
|
private String logoUrl;
|
||||||
|
|
||||||
private List<String> photosRealisations;
|
private List<String> photosRealisations;
|
||||||
|
|
||||||
private BigDecimal noteGlobale;
|
private BigDecimal noteGlobale;
|
||||||
|
|
||||||
private Integer nombreAvis;
|
private Integer nombreAvis;
|
||||||
|
|
||||||
private Integer nombreProjetsRealises;
|
private Integer nombreProjetsRealises;
|
||||||
|
|
||||||
private Integer nombreClientsServis;
|
private Integer nombreClientsServis;
|
||||||
|
|
||||||
private Boolean visible;
|
private Boolean visible;
|
||||||
|
|
||||||
private Boolean certifie;
|
private Boolean certifie;
|
||||||
|
|
||||||
private TypeAbonnement typeAbonnement;
|
private TypeAbonnement typeAbonnement;
|
||||||
|
|
||||||
private LocalDateTime finAbonnement;
|
private LocalDateTime finAbonnement;
|
||||||
|
|
||||||
private BigDecimal budgetMinProjet;
|
private BigDecimal budgetMinProjet;
|
||||||
|
|
||||||
private BigDecimal budgetMaxProjet;
|
private BigDecimal budgetMaxProjet;
|
||||||
|
|
||||||
private Boolean accepteUrgences;
|
private Boolean accepteUrgences;
|
||||||
|
|
||||||
private Boolean accepteWeekends;
|
private Boolean accepteWeekends;
|
||||||
|
|
||||||
private Integer delaiMoyenIntervention;
|
private Integer delaiMoyenIntervention;
|
||||||
|
|
||||||
private BigDecimal chiffresAffairesAnnuel;
|
private BigDecimal chiffresAffairesAnnuel;
|
||||||
|
|
||||||
private String garantiesProposees;
|
private String garantiesProposees;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,112 +1,112 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.TypeAbonnement;
|
import dev.lions.btpxpress.domain.core.entity.TypeAbonnement;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la réponse d'un profil d'entreprise - Architecture 2025
|
* DTO pour la réponse d'un profil d'entreprise - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class EntrepriseProfileResponseDTO {
|
public class EntrepriseProfileResponseDTO {
|
||||||
|
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
private String nomCommercial;
|
private String nomCommercial;
|
||||||
|
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
private String slogan;
|
private String slogan;
|
||||||
|
|
||||||
private List<String> specialites;
|
private List<String> specialites;
|
||||||
|
|
||||||
private List<String> certifications;
|
private List<String> certifications;
|
||||||
|
|
||||||
private String adresseComplete;
|
private String adresseComplete;
|
||||||
|
|
||||||
private String codePostal;
|
private String codePostal;
|
||||||
|
|
||||||
private String ville;
|
private String ville;
|
||||||
|
|
||||||
private String departement;
|
private String departement;
|
||||||
|
|
||||||
private String region;
|
private String region;
|
||||||
|
|
||||||
private List<String> zonesIntervention;
|
private List<String> zonesIntervention;
|
||||||
|
|
||||||
private String siteWeb;
|
private String siteWeb;
|
||||||
|
|
||||||
private String emailContact;
|
private String emailContact;
|
||||||
|
|
||||||
private String telephoneCommercial;
|
private String telephoneCommercial;
|
||||||
|
|
||||||
private String logoUrl;
|
private String logoUrl;
|
||||||
|
|
||||||
private List<String> photosRealisations;
|
private List<String> photosRealisations;
|
||||||
|
|
||||||
private BigDecimal noteGlobale;
|
private BigDecimal noteGlobale;
|
||||||
|
|
||||||
private Integer nombreAvis;
|
private Integer nombreAvis;
|
||||||
|
|
||||||
private Integer nombreProjetsRealises;
|
private Integer nombreProjetsRealises;
|
||||||
|
|
||||||
private Integer nombreClientsServis;
|
private Integer nombreClientsServis;
|
||||||
|
|
||||||
private Boolean visible;
|
private Boolean visible;
|
||||||
|
|
||||||
private Boolean certifie;
|
private Boolean certifie;
|
||||||
|
|
||||||
private TypeAbonnement typeAbonnement;
|
private TypeAbonnement typeAbonnement;
|
||||||
|
|
||||||
private LocalDateTime finAbonnement;
|
private LocalDateTime finAbonnement;
|
||||||
|
|
||||||
private BigDecimal budgetMinProjet;
|
private BigDecimal budgetMinProjet;
|
||||||
|
|
||||||
private BigDecimal budgetMaxProjet;
|
private BigDecimal budgetMaxProjet;
|
||||||
|
|
||||||
private Boolean accepteUrgences;
|
private Boolean accepteUrgences;
|
||||||
|
|
||||||
private Boolean accepteWeekends;
|
private Boolean accepteWeekends;
|
||||||
|
|
||||||
private Integer delaiMoyenIntervention;
|
private Integer delaiMoyenIntervention;
|
||||||
|
|
||||||
private BigDecimal chiffresAffairesAnnuel;
|
private BigDecimal chiffresAffairesAnnuel;
|
||||||
|
|
||||||
private String garantiesProposees;
|
private String garantiesProposees;
|
||||||
|
|
||||||
private LocalDateTime dateCreation;
|
private LocalDateTime dateCreation;
|
||||||
|
|
||||||
private LocalDateTime dateModification;
|
private LocalDateTime dateModification;
|
||||||
|
|
||||||
private LocalDateTime derniereMiseAJour;
|
private LocalDateTime derniereMiseAJour;
|
||||||
|
|
||||||
private LocalDateTime derniereActivite;
|
private LocalDateTime derniereActivite;
|
||||||
|
|
||||||
// Relations simplifiées
|
// Relations simplifiées
|
||||||
private UUID proprietaireId;
|
private UUID proprietaireId;
|
||||||
private String proprietaireNom;
|
private String proprietaireNom;
|
||||||
private String proprietaireEmail;
|
private String proprietaireEmail;
|
||||||
|
|
||||||
// Métadonnées calculées
|
// Métadonnées calculées
|
||||||
private Boolean isAbonnementActif;
|
private Boolean isAbonnementActif;
|
||||||
|
|
||||||
private Boolean isPremium;
|
private Boolean isPremium;
|
||||||
|
|
||||||
private Boolean isEnterprise;
|
private Boolean isEnterprise;
|
||||||
|
|
||||||
private Double scoreVisibilite;
|
private Double scoreVisibilite;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,42 +1,42 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.StatutEquipe;
|
import dev.lions.btpxpress.domain.core.entity.StatutEquipe;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la création d'une équipe - Architecture 2025
|
* DTO pour la création d'une équipe - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class EquipeCreateDTO {
|
public class EquipeCreateDTO {
|
||||||
|
|
||||||
@NotBlank(message = "Le nom est obligatoire")
|
@NotBlank(message = "Le nom est obligatoire")
|
||||||
private String nom;
|
private String nom;
|
||||||
|
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
@NotNull(message = "Le chef d'équipe est obligatoire")
|
@NotNull(message = "Le chef d'équipe est obligatoire")
|
||||||
private UUID chefId;
|
private UUID chefId;
|
||||||
|
|
||||||
private String specialite;
|
private String specialite;
|
||||||
|
|
||||||
private List<String> specialites;
|
private List<String> specialites;
|
||||||
|
|
||||||
private StatutEquipe statut;
|
private StatutEquipe statut;
|
||||||
|
|
||||||
private Boolean actif;
|
private Boolean actif;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,56 +1,56 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.StatutEquipe;
|
import dev.lions.btpxpress.domain.core.entity.StatutEquipe;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la réponse d'une équipe - Architecture 2025
|
* DTO pour la réponse d'une équipe - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class EquipeResponseDTO {
|
public class EquipeResponseDTO {
|
||||||
|
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
private String nom;
|
private String nom;
|
||||||
|
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
private StatutEquipe statut;
|
private StatutEquipe statut;
|
||||||
|
|
||||||
private String specialite;
|
private String specialite;
|
||||||
|
|
||||||
private List<String> specialites;
|
private List<String> specialites;
|
||||||
|
|
||||||
private Boolean actif;
|
private Boolean actif;
|
||||||
|
|
||||||
private LocalDateTime dateCreation;
|
private LocalDateTime dateCreation;
|
||||||
|
|
||||||
private LocalDateTime dateModification;
|
private LocalDateTime dateModification;
|
||||||
|
|
||||||
// Relations simplifiées
|
// Relations simplifiées
|
||||||
private UUID chefId;
|
private UUID chefId;
|
||||||
private String chefNom;
|
private String chefNom;
|
||||||
private String chefPrenom;
|
private String chefPrenom;
|
||||||
|
|
||||||
private Integer nombreMembres;
|
private Integer nombreMembres;
|
||||||
|
|
||||||
private List<UUID> membreIds;
|
private List<UUID> membreIds;
|
||||||
|
|
||||||
private Integer nombreChantiers;
|
private Integer nombreChantiers;
|
||||||
|
|
||||||
private List<UUID> chantierIds;
|
private List<UUID> chantierIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,114 +1,114 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.Facture.StatutFacture;
|
import dev.lions.btpxpress.domain.core.entity.Facture.StatutFacture;
|
||||||
import dev.lions.btpxpress.domain.core.entity.Facture.TypeFacture;
|
import dev.lions.btpxpress.domain.core.entity.Facture.TypeFacture;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import jakarta.validation.constraints.Positive;
|
import jakarta.validation.constraints.Positive;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la création de facture - Architecture 2025
|
* DTO pour la création de facture - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class FactureCreateDTO {
|
public class FactureCreateDTO {
|
||||||
|
|
||||||
@NotBlank(message = "Le numéro de facture est obligatoire")
|
@NotBlank(message = "Le numéro de facture est obligatoire")
|
||||||
private String numero;
|
private String numero;
|
||||||
|
|
||||||
@NotBlank(message = "L'objet de la facture est obligatoire")
|
@NotBlank(message = "L'objet de la facture est obligatoire")
|
||||||
private String objet;
|
private String objet;
|
||||||
|
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
@NotNull(message = "La date d'émission est obligatoire")
|
@NotNull(message = "La date d'émission est obligatoire")
|
||||||
private LocalDate dateEmission;
|
private LocalDate dateEmission;
|
||||||
|
|
||||||
@NotNull(message = "La date d'échéance est obligatoire")
|
@NotNull(message = "La date d'échéance est obligatoire")
|
||||||
private LocalDate dateEcheance;
|
private LocalDate dateEcheance;
|
||||||
|
|
||||||
private LocalDate datePaiement;
|
private LocalDate datePaiement;
|
||||||
|
|
||||||
@Builder.Default
|
@Builder.Default
|
||||||
private StatutFacture statut = StatutFacture.BROUILLON;
|
private StatutFacture statut = StatutFacture.BROUILLON;
|
||||||
|
|
||||||
@Positive(message = "Le montant HT doit être positif")
|
@Positive(message = "Le montant HT doit être positif")
|
||||||
private BigDecimal montantHT;
|
private BigDecimal montantHT;
|
||||||
|
|
||||||
@Builder.Default
|
@Builder.Default
|
||||||
private BigDecimal tauxTVA = BigDecimal.valueOf(20.0);
|
private BigDecimal tauxTVA = BigDecimal.valueOf(20.0);
|
||||||
|
|
||||||
private BigDecimal montantPaye;
|
private BigDecimal montantPaye;
|
||||||
|
|
||||||
private String conditionsPaiement;
|
private String conditionsPaiement;
|
||||||
|
|
||||||
@Builder.Default
|
@Builder.Default
|
||||||
private TypeFacture typeFacture = TypeFacture.FACTURE;
|
private TypeFacture typeFacture = TypeFacture.FACTURE;
|
||||||
|
|
||||||
@NotNull(message = "Le client est obligatoire")
|
@NotNull(message = "Le client est obligatoire")
|
||||||
private UUID clientId;
|
private UUID clientId;
|
||||||
|
|
||||||
private UUID chantierId; // Optionnel
|
private UUID chantierId; // Optionnel
|
||||||
|
|
||||||
private UUID devisId; // Optionnel (si facture issue d'un devis)
|
private UUID devisId; // Optionnel (si facture issue d'un devis)
|
||||||
|
|
||||||
private List<LigneFactureCreateDTO> lignes;
|
private List<LigneFactureCreateDTO> lignes;
|
||||||
|
|
||||||
/** Méthode de conversion String vers UUID pour clientId */
|
/** Méthode de conversion String vers UUID pour clientId */
|
||||||
public void setClientId(String clientId) {
|
public void setClientId(String clientId) {
|
||||||
if (clientId != null && !clientId.trim().isEmpty()) {
|
if (clientId != null && !clientId.trim().isEmpty()) {
|
||||||
this.clientId = UUID.fromString(clientId);
|
this.clientId = UUID.fromString(clientId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Méthode de conversion String vers UUID pour chantierId */
|
/** Méthode de conversion String vers UUID pour chantierId */
|
||||||
public void setChantierId(String chantierId) {
|
public void setChantierId(String chantierId) {
|
||||||
if (chantierId != null && !chantierId.trim().isEmpty()) {
|
if (chantierId != null && !chantierId.trim().isEmpty()) {
|
||||||
this.chantierId = UUID.fromString(chantierId);
|
this.chantierId = UUID.fromString(chantierId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Méthode de conversion String vers UUID pour devisId */
|
/** Méthode de conversion String vers UUID pour devisId */
|
||||||
public void setDevisId(String devisId) {
|
public void setDevisId(String devisId) {
|
||||||
if (devisId != null && !devisId.trim().isEmpty()) {
|
if (devisId != null && !devisId.trim().isEmpty()) {
|
||||||
this.devisId = UUID.fromString(devisId);
|
this.devisId = UUID.fromString(devisId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour une ligne de facture
|
* DTO pour une ligne de facture
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public static class LigneFactureCreateDTO {
|
public static class LigneFactureCreateDTO {
|
||||||
@NotBlank(message = "La description de la ligne est obligatoire")
|
@NotBlank(message = "La description de la ligne est obligatoire")
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
@Positive(message = "La quantité doit être positive")
|
@Positive(message = "La quantité doit être positive")
|
||||||
private BigDecimal quantite;
|
private BigDecimal quantite;
|
||||||
|
|
||||||
@Positive(message = "Le prix unitaire doit être positif")
|
@Positive(message = "Le prix unitaire doit être positif")
|
||||||
private BigDecimal prixUnitaire;
|
private BigDecimal prixUnitaire;
|
||||||
|
|
||||||
private BigDecimal tauxTVA;
|
private BigDecimal tauxTVA;
|
||||||
|
|
||||||
private String unite;
|
private String unite;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,99 +1,99 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.Facture.StatutFacture;
|
import dev.lions.btpxpress.domain.core.entity.Facture.StatutFacture;
|
||||||
import dev.lions.btpxpress.domain.core.entity.Facture.TypeFacture;
|
import dev.lions.btpxpress.domain.core.entity.Facture.TypeFacture;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la réponse d'une facture - Architecture 2025
|
* DTO pour la réponse d'une facture - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class FactureResponseDTO {
|
public class FactureResponseDTO {
|
||||||
|
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
private String numero;
|
private String numero;
|
||||||
|
|
||||||
private String objet;
|
private String objet;
|
||||||
|
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
private LocalDate dateEmission;
|
private LocalDate dateEmission;
|
||||||
|
|
||||||
private LocalDate dateEcheance;
|
private LocalDate dateEcheance;
|
||||||
|
|
||||||
private LocalDate datePaiement;
|
private LocalDate datePaiement;
|
||||||
|
|
||||||
private StatutFacture statut;
|
private StatutFacture statut;
|
||||||
|
|
||||||
private BigDecimal montantHT;
|
private BigDecimal montantHT;
|
||||||
|
|
||||||
private BigDecimal tauxTVA;
|
private BigDecimal tauxTVA;
|
||||||
|
|
||||||
private BigDecimal montantTVA;
|
private BigDecimal montantTVA;
|
||||||
|
|
||||||
private BigDecimal montantTTC;
|
private BigDecimal montantTTC;
|
||||||
|
|
||||||
private BigDecimal montantPaye;
|
private BigDecimal montantPaye;
|
||||||
|
|
||||||
private BigDecimal montantRestant;
|
private BigDecimal montantRestant;
|
||||||
|
|
||||||
private String conditionsPaiement;
|
private String conditionsPaiement;
|
||||||
|
|
||||||
private TypeFacture typeFacture;
|
private TypeFacture typeFacture;
|
||||||
|
|
||||||
private Boolean actif;
|
private Boolean actif;
|
||||||
|
|
||||||
private LocalDateTime dateCreation;
|
private LocalDateTime dateCreation;
|
||||||
|
|
||||||
private LocalDateTime dateModification;
|
private LocalDateTime dateModification;
|
||||||
|
|
||||||
// Relations simplifiées
|
// Relations simplifiées
|
||||||
private UUID clientId;
|
private UUID clientId;
|
||||||
private String clientNom;
|
private String clientNom;
|
||||||
private String clientRaisonSociale;
|
private String clientRaisonSociale;
|
||||||
|
|
||||||
private UUID chantierId;
|
private UUID chantierId;
|
||||||
private String chantierNom;
|
private String chantierNom;
|
||||||
|
|
||||||
private UUID devisId;
|
private UUID devisId;
|
||||||
private String devisNumero;
|
private String devisNumero;
|
||||||
|
|
||||||
private List<LigneFactureResponseDTO> lignes;
|
private List<LigneFactureResponseDTO> lignes;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour une ligne de facture en réponse
|
* DTO pour une ligne de facture en réponse
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public static class LigneFactureResponseDTO {
|
public static class LigneFactureResponseDTO {
|
||||||
private UUID id;
|
private UUID id;
|
||||||
private String description;
|
private String description;
|
||||||
private BigDecimal quantite;
|
private BigDecimal quantite;
|
||||||
private BigDecimal prixUnitaire;
|
private BigDecimal prixUnitaire;
|
||||||
private BigDecimal tauxTVA;
|
private BigDecimal tauxTVA;
|
||||||
private BigDecimal montantHT;
|
private BigDecimal montantHT;
|
||||||
private BigDecimal montantTVA;
|
private BigDecimal montantTVA;
|
||||||
private BigDecimal montantTTC;
|
private BigDecimal montantTTC;
|
||||||
private String unite;
|
private String unite;
|
||||||
private Integer ordre;
|
private Integer ordre;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,68 +1,68 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import jakarta.validation.constraints.Email;
|
import jakarta.validation.constraints.Email;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.Size;
|
import jakarta.validation.constraints.Size;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la création d'un fournisseur - Architecture 2025
|
* DTO pour la création d'un fournisseur - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class FournisseurCreateDTO {
|
public class FournisseurCreateDTO {
|
||||||
|
|
||||||
@NotBlank(message = "Le nom est obligatoire")
|
@NotBlank(message = "Le nom est obligatoire")
|
||||||
@Size(max = 255)
|
@Size(max = 255)
|
||||||
private String nom;
|
private String nom;
|
||||||
|
|
||||||
@NotBlank(message = "Le contact est obligatoire")
|
@NotBlank(message = "Le contact est obligatoire")
|
||||||
@Size(max = 255)
|
@Size(max = 255)
|
||||||
private String contact;
|
private String contact;
|
||||||
|
|
||||||
@Size(max = 20)
|
@Size(max = 20)
|
||||||
private String telephone;
|
private String telephone;
|
||||||
|
|
||||||
@NotBlank(message = "L'email est obligatoire")
|
@NotBlank(message = "L'email est obligatoire")
|
||||||
@Email
|
@Email
|
||||||
@Size(max = 255)
|
@Size(max = 255)
|
||||||
private String email;
|
private String email;
|
||||||
|
|
||||||
@Size(max = 500)
|
@Size(max = 500)
|
||||||
private String adresse;
|
private String adresse;
|
||||||
|
|
||||||
@Size(max = 100)
|
@Size(max = 100)
|
||||||
private String ville;
|
private String ville;
|
||||||
|
|
||||||
@Size(max = 10)
|
@Size(max = 10)
|
||||||
private String codePostal;
|
private String codePostal;
|
||||||
|
|
||||||
@Size(max = 100)
|
@Size(max = 100)
|
||||||
private String pays;
|
private String pays;
|
||||||
|
|
||||||
@Size(max = 14)
|
@Size(max = 14)
|
||||||
private String siret;
|
private String siret;
|
||||||
|
|
||||||
@Size(max = 20)
|
@Size(max = 20)
|
||||||
private String tva;
|
private String tva;
|
||||||
|
|
||||||
@Size(max = 100)
|
@Size(max = 100)
|
||||||
private String conditionsPaiement;
|
private String conditionsPaiement;
|
||||||
|
|
||||||
private Integer delaiLivraison;
|
private Integer delaiLivraison;
|
||||||
|
|
||||||
@Size(max = 1000)
|
@Size(max = 1000)
|
||||||
private String note;
|
private String note;
|
||||||
|
|
||||||
private Boolean actif;
|
private Boolean actif;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,62 +1,62 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la réponse d'un fournisseur - Architecture 2025
|
* DTO pour la réponse d'un fournisseur - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class FournisseurResponseDTO {
|
public class FournisseurResponseDTO {
|
||||||
|
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
private String nom;
|
private String nom;
|
||||||
|
|
||||||
private String contact;
|
private String contact;
|
||||||
|
|
||||||
private String telephone;
|
private String telephone;
|
||||||
|
|
||||||
private String email;
|
private String email;
|
||||||
|
|
||||||
private String adresse;
|
private String adresse;
|
||||||
|
|
||||||
private String ville;
|
private String ville;
|
||||||
|
|
||||||
private String codePostal;
|
private String codePostal;
|
||||||
|
|
||||||
private String pays;
|
private String pays;
|
||||||
|
|
||||||
private String siret;
|
private String siret;
|
||||||
|
|
||||||
private String tva;
|
private String tva;
|
||||||
|
|
||||||
private String conditionsPaiement;
|
private String conditionsPaiement;
|
||||||
|
|
||||||
private Integer delaiLivraison;
|
private Integer delaiLivraison;
|
||||||
|
|
||||||
private String note;
|
private String note;
|
||||||
|
|
||||||
private Boolean actif;
|
private Boolean actif;
|
||||||
|
|
||||||
private LocalDateTime dateCreation;
|
private LocalDateTime dateCreation;
|
||||||
|
|
||||||
private LocalDateTime dateModification;
|
private LocalDateTime dateModification;
|
||||||
|
|
||||||
// Métadonnées calculées
|
// Métadonnées calculées
|
||||||
private String resume;
|
private String resume;
|
||||||
|
|
||||||
private Boolean complet;
|
private Boolean complet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,91 +1,91 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.StatutLivraison;
|
import dev.lions.btpxpress.domain.core.entity.StatutLivraison;
|
||||||
import dev.lions.btpxpress.domain.core.entity.TypeTransport;
|
import dev.lions.btpxpress.domain.core.entity.TypeTransport;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalTime;
|
import java.time.LocalTime;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la création d'une livraison de matériel - Architecture 2025
|
* DTO pour la création d'une livraison de matériel - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class LivraisonMaterielCreateDTO {
|
public class LivraisonMaterielCreateDTO {
|
||||||
|
|
||||||
@NotNull(message = "La réservation est obligatoire")
|
@NotNull(message = "La réservation est obligatoire")
|
||||||
private UUID reservationId;
|
private UUID reservationId;
|
||||||
|
|
||||||
private UUID chantierDestinationId;
|
private UUID chantierDestinationId;
|
||||||
|
|
||||||
@NotBlank(message = "Le numéro de livraison est obligatoire")
|
@NotBlank(message = "Le numéro de livraison est obligatoire")
|
||||||
private String numeroLivraison;
|
private String numeroLivraison;
|
||||||
|
|
||||||
private String referenceCommande;
|
private String referenceCommande;
|
||||||
|
|
||||||
@NotNull(message = "Le type de transport est obligatoire")
|
@NotNull(message = "Le type de transport est obligatoire")
|
||||||
private TypeTransport typeTransport;
|
private TypeTransport typeTransport;
|
||||||
|
|
||||||
private StatutLivraison statut;
|
private StatutLivraison statut;
|
||||||
|
|
||||||
@NotNull(message = "La date de livraison prévue est obligatoire")
|
@NotNull(message = "La date de livraison prévue est obligatoire")
|
||||||
private LocalDate dateLivraisonPrevue;
|
private LocalDate dateLivraisonPrevue;
|
||||||
|
|
||||||
private LocalTime heureLivraisonPrevue;
|
private LocalTime heureLivraisonPrevue;
|
||||||
|
|
||||||
private Integer dureePrevueMinutes;
|
private Integer dureePrevueMinutes;
|
||||||
|
|
||||||
private String transporteur;
|
private String transporteur;
|
||||||
|
|
||||||
private String chauffeur;
|
private String chauffeur;
|
||||||
|
|
||||||
private String telephoneChauffeur;
|
private String telephoneChauffeur;
|
||||||
|
|
||||||
private String immatriculation;
|
private String immatriculation;
|
||||||
|
|
||||||
private BigDecimal poidsChargeKg;
|
private BigDecimal poidsChargeKg;
|
||||||
|
|
||||||
private BigDecimal volumeChargeM3;
|
private BigDecimal volumeChargeM3;
|
||||||
|
|
||||||
private String adresseDepart;
|
private String adresseDepart;
|
||||||
|
|
||||||
private BigDecimal latitudeDepart;
|
private BigDecimal latitudeDepart;
|
||||||
|
|
||||||
private BigDecimal longitudeDepart;
|
private BigDecimal longitudeDepart;
|
||||||
|
|
||||||
private String adresseDestination;
|
private String adresseDestination;
|
||||||
|
|
||||||
private BigDecimal latitudeDestination;
|
private BigDecimal latitudeDestination;
|
||||||
|
|
||||||
private BigDecimal longitudeDestination;
|
private BigDecimal longitudeDestination;
|
||||||
|
|
||||||
private BigDecimal distanceKm;
|
private BigDecimal distanceKm;
|
||||||
|
|
||||||
private Integer dureeTrajetPrevueMinutes;
|
private Integer dureeTrajetPrevueMinutes;
|
||||||
|
|
||||||
private String contactReception;
|
private String contactReception;
|
||||||
|
|
||||||
private String telephoneContact;
|
private String telephoneContact;
|
||||||
|
|
||||||
private String instructionsSpeciales;
|
private String instructionsSpeciales;
|
||||||
|
|
||||||
private String accesChantier;
|
private String accesChantier;
|
||||||
|
|
||||||
private LocalTime heureDepartPrevue;
|
private LocalTime heureDepartPrevue;
|
||||||
|
|
||||||
private LocalTime heureArriveePrevue;
|
private LocalTime heureArriveePrevue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,188 +1,188 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.StatutLivraison;
|
import dev.lions.btpxpress.domain.core.entity.StatutLivraison;
|
||||||
import dev.lions.btpxpress.domain.core.entity.TypeTransport;
|
import dev.lions.btpxpress.domain.core.entity.TypeTransport;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.LocalTime;
|
import java.time.LocalTime;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la réponse d'une livraison de matériel - Architecture 2025
|
* DTO pour la réponse d'une livraison de matériel - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class LivraisonMaterielResponseDTO {
|
public class LivraisonMaterielResponseDTO {
|
||||||
|
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
private String numeroLivraison;
|
private String numeroLivraison;
|
||||||
|
|
||||||
private String referenceCommande;
|
private String referenceCommande;
|
||||||
|
|
||||||
private TypeTransport typeTransport;
|
private TypeTransport typeTransport;
|
||||||
|
|
||||||
private StatutLivraison statut;
|
private StatutLivraison statut;
|
||||||
|
|
||||||
private LocalDate dateLivraisonPrevue;
|
private LocalDate dateLivraisonPrevue;
|
||||||
|
|
||||||
private LocalTime heureLivraisonPrevue;
|
private LocalTime heureLivraisonPrevue;
|
||||||
|
|
||||||
private LocalDate dateLivraisonReelle;
|
private LocalDate dateLivraisonReelle;
|
||||||
|
|
||||||
private LocalTime heureLivraisonReelle;
|
private LocalTime heureLivraisonReelle;
|
||||||
|
|
||||||
private Integer dureePrevueMinutes;
|
private Integer dureePrevueMinutes;
|
||||||
|
|
||||||
private Integer dureeReelleMinutes;
|
private Integer dureeReelleMinutes;
|
||||||
|
|
||||||
private String transporteur;
|
private String transporteur;
|
||||||
|
|
||||||
private String chauffeur;
|
private String chauffeur;
|
||||||
|
|
||||||
private String telephoneChauffeur;
|
private String telephoneChauffeur;
|
||||||
|
|
||||||
private String immatriculation;
|
private String immatriculation;
|
||||||
|
|
||||||
private BigDecimal poidsChargeKg;
|
private BigDecimal poidsChargeKg;
|
||||||
|
|
||||||
private BigDecimal volumeChargeM3;
|
private BigDecimal volumeChargeM3;
|
||||||
|
|
||||||
private String adresseDepart;
|
private String adresseDepart;
|
||||||
|
|
||||||
private BigDecimal latitudeDepart;
|
private BigDecimal latitudeDepart;
|
||||||
|
|
||||||
private BigDecimal longitudeDepart;
|
private BigDecimal longitudeDepart;
|
||||||
|
|
||||||
private String adresseDestination;
|
private String adresseDestination;
|
||||||
|
|
||||||
private BigDecimal latitudeDestination;
|
private BigDecimal latitudeDestination;
|
||||||
|
|
||||||
private BigDecimal longitudeDestination;
|
private BigDecimal longitudeDestination;
|
||||||
|
|
||||||
private BigDecimal distanceKm;
|
private BigDecimal distanceKm;
|
||||||
|
|
||||||
private Integer dureeTrajetPrevueMinutes;
|
private Integer dureeTrajetPrevueMinutes;
|
||||||
|
|
||||||
private Integer dureeTrajetReelleMinutes;
|
private Integer dureeTrajetReelleMinutes;
|
||||||
|
|
||||||
private String contactReception;
|
private String contactReception;
|
||||||
|
|
||||||
private String telephoneContact;
|
private String telephoneContact;
|
||||||
|
|
||||||
private String instructionsSpeciales;
|
private String instructionsSpeciales;
|
||||||
|
|
||||||
private String accesChantier;
|
private String accesChantier;
|
||||||
|
|
||||||
private LocalTime heureDepartPrevue;
|
private LocalTime heureDepartPrevue;
|
||||||
|
|
||||||
private LocalTime heureDepartReelle;
|
private LocalTime heureDepartReelle;
|
||||||
|
|
||||||
private LocalTime heureArriveePrevue;
|
private LocalTime heureArriveePrevue;
|
||||||
|
|
||||||
private LocalTime heureArriveeReelle;
|
private LocalTime heureArriveeReelle;
|
||||||
|
|
||||||
private Integer tempsChargementMinutes;
|
private Integer tempsChargementMinutes;
|
||||||
|
|
||||||
private Integer tempsDechargementMinutes;
|
private Integer tempsDechargementMinutes;
|
||||||
|
|
||||||
private String etatMaterielDepart;
|
private String etatMaterielDepart;
|
||||||
|
|
||||||
private String etatMaterielArrivee;
|
private String etatMaterielArrivee;
|
||||||
|
|
||||||
private BigDecimal quantiteLivree;
|
private BigDecimal quantiteLivree;
|
||||||
|
|
||||||
private BigDecimal quantiteCommandee;
|
private BigDecimal quantiteCommandee;
|
||||||
|
|
||||||
private Boolean conformiteLivraison;
|
private Boolean conformiteLivraison;
|
||||||
|
|
||||||
private String observationsChauffeur;
|
private String observationsChauffeur;
|
||||||
|
|
||||||
private String observationsReceptionnaire;
|
private String observationsReceptionnaire;
|
||||||
|
|
||||||
private String signatureReceptionnaire;
|
private String signatureReceptionnaire;
|
||||||
|
|
||||||
private String photoLivraison;
|
private String photoLivraison;
|
||||||
|
|
||||||
private BigDecimal coutTransport;
|
private BigDecimal coutTransport;
|
||||||
|
|
||||||
private BigDecimal coutCarburant;
|
private BigDecimal coutCarburant;
|
||||||
|
|
||||||
private BigDecimal coutPeages;
|
private BigDecimal coutPeages;
|
||||||
|
|
||||||
private BigDecimal coutTotal;
|
private BigDecimal coutTotal;
|
||||||
|
|
||||||
private String facture;
|
private String facture;
|
||||||
|
|
||||||
private Boolean incidentDetecte;
|
private Boolean incidentDetecte;
|
||||||
|
|
||||||
private String typeIncident;
|
private String typeIncident;
|
||||||
|
|
||||||
private String descriptionIncident;
|
private String descriptionIncident;
|
||||||
|
|
||||||
private String impactIncident;
|
private String impactIncident;
|
||||||
|
|
||||||
private String actionsCorrectives;
|
private String actionsCorrectives;
|
||||||
|
|
||||||
private Boolean trackingActive;
|
private Boolean trackingActive;
|
||||||
|
|
||||||
private BigDecimal dernierePositionLat;
|
private BigDecimal dernierePositionLat;
|
||||||
|
|
||||||
private BigDecimal dernierePositionLng;
|
private BigDecimal dernierePositionLng;
|
||||||
|
|
||||||
private LocalDateTime derniereMiseAJourGps;
|
private LocalDateTime derniereMiseAJourGps;
|
||||||
|
|
||||||
private Integer vitesseActuelleKmh;
|
private Integer vitesseActuelleKmh;
|
||||||
|
|
||||||
private LocalDateTime dateCreation;
|
private LocalDateTime dateCreation;
|
||||||
|
|
||||||
private LocalDateTime dateModification;
|
private LocalDateTime dateModification;
|
||||||
|
|
||||||
private String planificateur;
|
private String planificateur;
|
||||||
|
|
||||||
private String derniereModificationPar;
|
private String derniereModificationPar;
|
||||||
|
|
||||||
private Boolean actif;
|
private Boolean actif;
|
||||||
|
|
||||||
// Relations simplifiées
|
// Relations simplifiées
|
||||||
private UUID reservationId;
|
private UUID reservationId;
|
||||||
private String reservationReference;
|
private String reservationReference;
|
||||||
|
|
||||||
private UUID chantierDestinationId;
|
private UUID chantierDestinationId;
|
||||||
private String chantierDestinationNom;
|
private String chantierDestinationNom;
|
||||||
|
|
||||||
// Métadonnées calculées
|
// Métadonnées calculées
|
||||||
private Integer dureeTotalePrevueMinutes;
|
private Integer dureeTotalePrevueMinutes;
|
||||||
|
|
||||||
private Integer dureeTotaleReelleMinutes;
|
private Integer dureeTotaleReelleMinutes;
|
||||||
|
|
||||||
private Integer retardMinutes;
|
private Integer retardMinutes;
|
||||||
|
|
||||||
private Boolean estEnRetard;
|
private Boolean estEnRetard;
|
||||||
|
|
||||||
private Boolean estConforme;
|
private Boolean estConforme;
|
||||||
|
|
||||||
private Double vitesseMoyenneKmh;
|
private Double vitesseMoyenneKmh;
|
||||||
|
|
||||||
private Boolean isTrackingDisponible;
|
private Boolean isTrackingDisponible;
|
||||||
|
|
||||||
private Double distanceVersDestination;
|
private Double distanceVersDestination;
|
||||||
|
|
||||||
private LocalTime heureArriveeEstimee;
|
private LocalTime heureArriveeEstimee;
|
||||||
|
|
||||||
private Boolean necessiteManutention;
|
private Boolean necessiteManutention;
|
||||||
|
|
||||||
private Integer priorite;
|
private Integer priorite;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,52 +1,52 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.StatutMaintenance;
|
import dev.lions.btpxpress.domain.core.entity.StatutMaintenance;
|
||||||
import dev.lions.btpxpress.domain.core.entity.TypeMaintenance;
|
import dev.lions.btpxpress.domain.core.entity.TypeMaintenance;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la création d'une maintenance - Architecture 2025
|
* DTO pour la création d'une maintenance - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class MaintenanceCreateDTO {
|
public class MaintenanceCreateDTO {
|
||||||
|
|
||||||
@NotNull(message = "Le matériel est obligatoire")
|
@NotNull(message = "Le matériel est obligatoire")
|
||||||
private UUID materielId;
|
private UUID materielId;
|
||||||
|
|
||||||
@NotNull(message = "Le type de maintenance est obligatoire")
|
@NotNull(message = "Le type de maintenance est obligatoire")
|
||||||
private TypeMaintenance type;
|
private TypeMaintenance type;
|
||||||
|
|
||||||
@NotBlank(message = "La description est obligatoire")
|
@NotBlank(message = "La description est obligatoire")
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
@NotNull(message = "La date prévue est obligatoire")
|
@NotNull(message = "La date prévue est obligatoire")
|
||||||
private LocalDate datePrevue;
|
private LocalDate datePrevue;
|
||||||
|
|
||||||
private LocalDate dateRealisee;
|
private LocalDate dateRealisee;
|
||||||
|
|
||||||
private BigDecimal cout;
|
private BigDecimal cout;
|
||||||
|
|
||||||
private StatutMaintenance statut;
|
private StatutMaintenance statut;
|
||||||
|
|
||||||
private String technicien;
|
private String technicien;
|
||||||
|
|
||||||
private String notes;
|
private String notes;
|
||||||
|
|
||||||
private LocalDate prochaineMaintenance;
|
private LocalDate prochaineMaintenance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,61 +1,61 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.StatutMaintenance;
|
import dev.lions.btpxpress.domain.core.entity.StatutMaintenance;
|
||||||
import dev.lions.btpxpress.domain.core.entity.TypeMaintenance;
|
import dev.lions.btpxpress.domain.core.entity.TypeMaintenance;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la réponse d'une maintenance - Architecture 2025
|
* DTO pour la réponse d'une maintenance - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class MaintenanceResponseDTO {
|
public class MaintenanceResponseDTO {
|
||||||
|
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
private TypeMaintenance type;
|
private TypeMaintenance type;
|
||||||
|
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
private LocalDate datePrevue;
|
private LocalDate datePrevue;
|
||||||
|
|
||||||
private LocalDate dateRealisee;
|
private LocalDate dateRealisee;
|
||||||
|
|
||||||
private BigDecimal cout;
|
private BigDecimal cout;
|
||||||
|
|
||||||
private StatutMaintenance statut;
|
private StatutMaintenance statut;
|
||||||
|
|
||||||
private String technicien;
|
private String technicien;
|
||||||
|
|
||||||
private String notes;
|
private String notes;
|
||||||
|
|
||||||
private LocalDate prochaineMaintenance;
|
private LocalDate prochaineMaintenance;
|
||||||
|
|
||||||
private LocalDateTime dateCreation;
|
private LocalDateTime dateCreation;
|
||||||
|
|
||||||
private LocalDateTime dateModification;
|
private LocalDateTime dateModification;
|
||||||
|
|
||||||
// Relations simplifiées
|
// Relations simplifiées
|
||||||
private UUID materielId;
|
private UUID materielId;
|
||||||
private String materielNom;
|
private String materielNom;
|
||||||
private String materielReference;
|
private String materielReference;
|
||||||
|
|
||||||
// Métadonnées calculées
|
// Métadonnées calculées
|
||||||
private Boolean enRetard;
|
private Boolean enRetard;
|
||||||
|
|
||||||
private Boolean terminee;
|
private Boolean terminee;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,64 +1,64 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.MaterielBTP.CategorieMateriel;
|
import dev.lions.btpxpress.domain.core.entity.MaterielBTP.CategorieMateriel;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la création de matériel - Architecture 2025
|
* DTO pour la création de matériel - Architecture 2025
|
||||||
* Version simplifiée pour les opérations CRUD de base
|
* Version simplifiée pour les opérations CRUD de base
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class MaterielCreateDTO {
|
public class MaterielCreateDTO {
|
||||||
|
|
||||||
@NotBlank(message = "Le code du matériel est obligatoire")
|
@NotBlank(message = "Le code du matériel est obligatoire")
|
||||||
private String code;
|
private String code;
|
||||||
|
|
||||||
@NotBlank(message = "Le nom du matériel est obligatoire")
|
@NotBlank(message = "Le nom du matériel est obligatoire")
|
||||||
private String nom;
|
private String nom;
|
||||||
|
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
@NotNull(message = "La catégorie est obligatoire")
|
@NotNull(message = "La catégorie est obligatoire")
|
||||||
private CategorieMateriel categorie;
|
private CategorieMateriel categorie;
|
||||||
|
|
||||||
private String sousCategorie;
|
private String sousCategorie;
|
||||||
|
|
||||||
private BigDecimal prixUnitaire;
|
private BigDecimal prixUnitaire;
|
||||||
|
|
||||||
private String unite;
|
private String unite;
|
||||||
|
|
||||||
private Integer stockDisponible;
|
private Integer stockDisponible;
|
||||||
|
|
||||||
private Integer stockMinimum;
|
private Integer stockMinimum;
|
||||||
|
|
||||||
private String fournisseur;
|
private String fournisseur;
|
||||||
|
|
||||||
private UUID fournisseurId;
|
private UUID fournisseurId;
|
||||||
|
|
||||||
private String localisation;
|
private String localisation;
|
||||||
|
|
||||||
@Builder.Default
|
@Builder.Default
|
||||||
private Boolean actif = true;
|
private Boolean actif = true;
|
||||||
|
|
||||||
/** Méthode de conversion String vers UUID pour fournisseurId */
|
/** Méthode de conversion String vers UUID pour fournisseurId */
|
||||||
public void setFournisseurId(String fournisseurId) {
|
public void setFournisseurId(String fournisseurId) {
|
||||||
if (fournisseurId != null && !fournisseurId.trim().isEmpty()) {
|
if (fournisseurId != null && !fournisseurId.trim().isEmpty()) {
|
||||||
this.fournisseurId = UUID.fromString(fournisseurId);
|
this.fournisseurId = UUID.fromString(fournisseurId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,62 +1,62 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.MaterielBTP.CategorieMateriel;
|
import dev.lions.btpxpress.domain.core.entity.MaterielBTP.CategorieMateriel;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la réponse d'un matériel - Architecture 2025
|
* DTO pour la réponse d'un matériel - Architecture 2025
|
||||||
* Version simplifiée pour les opérations CRUD de base
|
* Version simplifiée pour les opérations CRUD de base
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class MaterielResponseDTO {
|
public class MaterielResponseDTO {
|
||||||
|
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
private String code;
|
private String code;
|
||||||
|
|
||||||
private String nom;
|
private String nom;
|
||||||
|
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
private CategorieMateriel categorie;
|
private CategorieMateriel categorie;
|
||||||
|
|
||||||
private String sousCategorie;
|
private String sousCategorie;
|
||||||
|
|
||||||
private BigDecimal prixUnitaire;
|
private BigDecimal prixUnitaire;
|
||||||
|
|
||||||
private String unite;
|
private String unite;
|
||||||
|
|
||||||
private Integer stockDisponible;
|
private Integer stockDisponible;
|
||||||
|
|
||||||
private Integer stockMinimum;
|
private Integer stockMinimum;
|
||||||
|
|
||||||
private String localisation;
|
private String localisation;
|
||||||
|
|
||||||
private Boolean actif;
|
private Boolean actif;
|
||||||
|
|
||||||
private LocalDateTime dateCreation;
|
private LocalDateTime dateCreation;
|
||||||
|
|
||||||
private LocalDateTime dateModification;
|
private LocalDateTime dateModification;
|
||||||
|
|
||||||
// Relations simplifiées
|
// Relations simplifiées
|
||||||
private UUID fournisseurId;
|
private UUID fournisseurId;
|
||||||
private String fournisseurNom;
|
private String fournisseurNom;
|
||||||
|
|
||||||
private Integer nombreReservations;
|
private Integer nombreReservations;
|
||||||
|
|
||||||
private Integer nombreMaintenances;
|
private Integer nombreMaintenances;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,52 +1,52 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.PrioriteMessage;
|
import dev.lions.btpxpress.domain.core.entity.PrioriteMessage;
|
||||||
import dev.lions.btpxpress.domain.core.entity.TypeMessage;
|
import dev.lions.btpxpress.domain.core.entity.TypeMessage;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la création d'un message - Architecture 2025
|
* DTO pour la création d'un message - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class MessageCreateDTO {
|
public class MessageCreateDTO {
|
||||||
|
|
||||||
@NotBlank(message = "Le sujet est obligatoire")
|
@NotBlank(message = "Le sujet est obligatoire")
|
||||||
private String sujet;
|
private String sujet;
|
||||||
|
|
||||||
@NotBlank(message = "Le contenu est obligatoire")
|
@NotBlank(message = "Le contenu est obligatoire")
|
||||||
private String contenu;
|
private String contenu;
|
||||||
|
|
||||||
@NotNull(message = "L'expéditeur est obligatoire")
|
@NotNull(message = "L'expéditeur est obligatoire")
|
||||||
private UUID expediteurId;
|
private UUID expediteurId;
|
||||||
|
|
||||||
@NotNull(message = "Le destinataire est obligatoire")
|
@NotNull(message = "Le destinataire est obligatoire")
|
||||||
private UUID destinataireId;
|
private UUID destinataireId;
|
||||||
|
|
||||||
private TypeMessage type;
|
private TypeMessage type;
|
||||||
|
|
||||||
private PrioriteMessage priorite;
|
private PrioriteMessage priorite;
|
||||||
|
|
||||||
private Boolean important;
|
private Boolean important;
|
||||||
|
|
||||||
private String fichiersJoints; // JSON array des IDs de documents
|
private String fichiersJoints; // JSON array des IDs de documents
|
||||||
|
|
||||||
private UUID messageParentId; // Pour les réponses
|
private UUID messageParentId; // Pour les réponses
|
||||||
|
|
||||||
private UUID chantierId;
|
private UUID chantierId;
|
||||||
|
|
||||||
private UUID equipeId;
|
private UUID equipeId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,85 +1,85 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.PrioriteMessage;
|
import dev.lions.btpxpress.domain.core.entity.PrioriteMessage;
|
||||||
import dev.lions.btpxpress.domain.core.entity.TypeMessage;
|
import dev.lions.btpxpress.domain.core.entity.TypeMessage;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la réponse d'un message - Architecture 2025
|
* DTO pour la réponse d'un message - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class MessageResponseDTO {
|
public class MessageResponseDTO {
|
||||||
|
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
private String sujet;
|
private String sujet;
|
||||||
|
|
||||||
private String contenu;
|
private String contenu;
|
||||||
|
|
||||||
private TypeMessage type;
|
private TypeMessage type;
|
||||||
|
|
||||||
private PrioriteMessage priorite;
|
private PrioriteMessage priorite;
|
||||||
|
|
||||||
private Boolean lu;
|
private Boolean lu;
|
||||||
|
|
||||||
private LocalDateTime dateLecture;
|
private LocalDateTime dateLecture;
|
||||||
|
|
||||||
private Boolean important;
|
private Boolean important;
|
||||||
|
|
||||||
private Boolean archive;
|
private Boolean archive;
|
||||||
|
|
||||||
private LocalDateTime dateArchivage;
|
private LocalDateTime dateArchivage;
|
||||||
|
|
||||||
private String fichiersJoints;
|
private String fichiersJoints;
|
||||||
|
|
||||||
private LocalDateTime dateCreation;
|
private LocalDateTime dateCreation;
|
||||||
|
|
||||||
private LocalDateTime dateModification;
|
private LocalDateTime dateModification;
|
||||||
|
|
||||||
private Boolean actif;
|
private Boolean actif;
|
||||||
|
|
||||||
// Relations simplifiées
|
// Relations simplifiées
|
||||||
private UUID expediteurId;
|
private UUID expediteurId;
|
||||||
private String expediteurNom;
|
private String expediteurNom;
|
||||||
private String expediteurPrenom;
|
private String expediteurPrenom;
|
||||||
private String expediteurEmail;
|
private String expediteurEmail;
|
||||||
|
|
||||||
private UUID destinataireId;
|
private UUID destinataireId;
|
||||||
private String destinataireNom;
|
private String destinataireNom;
|
||||||
private String destinatairePrenom;
|
private String destinatairePrenom;
|
||||||
private String destinataireEmail;
|
private String destinataireEmail;
|
||||||
|
|
||||||
private UUID messageParentId;
|
private UUID messageParentId;
|
||||||
|
|
||||||
private UUID chantierId;
|
private UUID chantierId;
|
||||||
private String chantierNom;
|
private String chantierNom;
|
||||||
|
|
||||||
private UUID equipeId;
|
private UUID equipeId;
|
||||||
private String equipeNom;
|
private String equipeNom;
|
||||||
|
|
||||||
// Métadonnées calculées
|
// Métadonnées calculées
|
||||||
private Integer nombreReponses;
|
private Integer nombreReponses;
|
||||||
|
|
||||||
private Boolean estReponse;
|
private Boolean estReponse;
|
||||||
|
|
||||||
private Boolean aDesReponses;
|
private Boolean aDesReponses;
|
||||||
|
|
||||||
private Boolean estCritique;
|
private Boolean estCritique;
|
||||||
|
|
||||||
private Boolean estHautePriorite;
|
private Boolean estHautePriorite;
|
||||||
|
|
||||||
private Boolean estRecent;
|
private Boolean estRecent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,52 +1,52 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.PrioriteNotification;
|
import dev.lions.btpxpress.domain.core.entity.PrioriteNotification;
|
||||||
import dev.lions.btpxpress.domain.core.entity.TypeNotification;
|
import dev.lions.btpxpress.domain.core.entity.TypeNotification;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la création d'une notification - Architecture 2025
|
* DTO pour la création d'une notification - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class NotificationCreateDTO {
|
public class NotificationCreateDTO {
|
||||||
|
|
||||||
@NotBlank(message = "Le titre est obligatoire")
|
@NotBlank(message = "Le titre est obligatoire")
|
||||||
private String titre;
|
private String titre;
|
||||||
|
|
||||||
@NotBlank(message = "Le message est obligatoire")
|
@NotBlank(message = "Le message est obligatoire")
|
||||||
private String message;
|
private String message;
|
||||||
|
|
||||||
@NotNull(message = "Le type est obligatoire")
|
@NotNull(message = "Le type est obligatoire")
|
||||||
private TypeNotification type;
|
private TypeNotification type;
|
||||||
|
|
||||||
@NotNull(message = "L'utilisateur destinataire est obligatoire")
|
@NotNull(message = "L'utilisateur destinataire est obligatoire")
|
||||||
private UUID userId;
|
private UUID userId;
|
||||||
|
|
||||||
private PrioriteNotification priorite;
|
private PrioriteNotification priorite;
|
||||||
|
|
||||||
private String lienAction;
|
private String lienAction;
|
||||||
|
|
||||||
private String donnees;
|
private String donnees;
|
||||||
|
|
||||||
private UUID chantierId;
|
private UUID chantierId;
|
||||||
|
|
||||||
private UUID materielId;
|
private UUID materielId;
|
||||||
|
|
||||||
private UUID maintenanceId;
|
private UUID maintenanceId;
|
||||||
|
|
||||||
private UUID creeeParId;
|
private UUID creeeParId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,78 +1,78 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.PrioriteNotification;
|
import dev.lions.btpxpress.domain.core.entity.PrioriteNotification;
|
||||||
import dev.lions.btpxpress.domain.core.entity.TypeNotification;
|
import dev.lions.btpxpress.domain.core.entity.TypeNotification;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la réponse d'une notification - Architecture 2025
|
* DTO pour la réponse d'une notification - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class NotificationResponseDTO {
|
public class NotificationResponseDTO {
|
||||||
|
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
private String titre;
|
private String titre;
|
||||||
|
|
||||||
private String message;
|
private String message;
|
||||||
|
|
||||||
private TypeNotification type;
|
private TypeNotification type;
|
||||||
|
|
||||||
private PrioriteNotification priorite;
|
private PrioriteNotification priorite;
|
||||||
|
|
||||||
private Boolean lue;
|
private Boolean lue;
|
||||||
|
|
||||||
private LocalDateTime dateLecture;
|
private LocalDateTime dateLecture;
|
||||||
|
|
||||||
private String lienAction;
|
private String lienAction;
|
||||||
|
|
||||||
private String donnees;
|
private String donnees;
|
||||||
|
|
||||||
private LocalDateTime dateCreation;
|
private LocalDateTime dateCreation;
|
||||||
|
|
||||||
private LocalDateTime dateModification;
|
private LocalDateTime dateModification;
|
||||||
|
|
||||||
private Boolean actif;
|
private Boolean actif;
|
||||||
|
|
||||||
// Relations simplifiées
|
// Relations simplifiées
|
||||||
private UUID userId;
|
private UUID userId;
|
||||||
private String userNom;
|
private String userNom;
|
||||||
private String userPrenom;
|
private String userPrenom;
|
||||||
private String userEmail;
|
private String userEmail;
|
||||||
|
|
||||||
private UUID chantierId;
|
private UUID chantierId;
|
||||||
private String chantierNom;
|
private String chantierNom;
|
||||||
|
|
||||||
private UUID materielId;
|
private UUID materielId;
|
||||||
private String materielNom;
|
private String materielNom;
|
||||||
|
|
||||||
private UUID maintenanceId;
|
private UUID maintenanceId;
|
||||||
|
|
||||||
private UUID creeeParId;
|
private UUID creeeParId;
|
||||||
private String creeeParNom;
|
private String creeeParNom;
|
||||||
private String creeeParEmail;
|
private String creeeParEmail;
|
||||||
|
|
||||||
// Métadonnées calculées
|
// Métadonnées calculées
|
||||||
private Boolean estCritique;
|
private Boolean estCritique;
|
||||||
|
|
||||||
private Boolean estHautePriorite;
|
private Boolean estHautePriorite;
|
||||||
|
|
||||||
private Boolean estRecente;
|
private Boolean estRecente;
|
||||||
|
|
||||||
private Boolean hasLienAction;
|
private Boolean hasLienAction;
|
||||||
|
|
||||||
private Boolean hasDonnees;
|
private Boolean hasDonnees;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,148 +1,148 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wrapper pour les réponses paginées - Architecture 2025
|
* Wrapper pour les réponses paginées - Architecture 2025
|
||||||
*
|
*
|
||||||
* Format pour les réponses avec pagination :
|
* Format pour les réponses avec pagination :
|
||||||
* {
|
* {
|
||||||
* "data": [...],
|
* "data": [...],
|
||||||
* "pagination": {
|
* "pagination": {
|
||||||
* "page": 0,
|
* "page": 0,
|
||||||
* "size": 20,
|
* "size": 20,
|
||||||
* "total": 100,
|
* "total": 100,
|
||||||
* "totalPages": 5,
|
* "totalPages": 5,
|
||||||
* "hasNext": true,
|
* "hasNext": true,
|
||||||
* "hasPrevious": false
|
* "hasPrevious": false
|
||||||
* },
|
* },
|
||||||
* "success": true,
|
* "success": true,
|
||||||
* "timestamp": "2025-01-30T10:00:00"
|
* "timestamp": "2025-01-30T10:00:00"
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* @param <T> Le type d'éléments dans la liste
|
* @param <T> Le type d'éléments dans la liste
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
public class PagedResponse<T> {
|
public class PagedResponse<T> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Les données paginées
|
* Les données paginées
|
||||||
*/
|
*/
|
||||||
private List<T> data;
|
private List<T> data;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Métadonnées de pagination
|
* Métadonnées de pagination
|
||||||
*/
|
*/
|
||||||
private PaginationInfo pagination;
|
private PaginationInfo pagination;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indique si l'opération a réussi
|
* Indique si l'opération a réussi
|
||||||
*/
|
*/
|
||||||
@Builder.Default
|
@Builder.Default
|
||||||
private Boolean success = true;
|
private Boolean success = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Message descriptif (optionnel)
|
* Message descriptif (optionnel)
|
||||||
*/
|
*/
|
||||||
private String message;
|
private String message;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Timestamp de la réponse
|
* Timestamp de la réponse
|
||||||
*/
|
*/
|
||||||
@Builder.Default
|
@Builder.Default
|
||||||
private LocalDateTime timestamp = LocalDateTime.now();
|
private LocalDateTime timestamp = LocalDateTime.now();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Informations de pagination
|
* Informations de pagination
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
public static class PaginationInfo {
|
public static class PaginationInfo {
|
||||||
/**
|
/**
|
||||||
* Numéro de page (0-based)
|
* Numéro de page (0-based)
|
||||||
*/
|
*/
|
||||||
private Integer page;
|
private Integer page;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Taille de la page
|
* Taille de la page
|
||||||
*/
|
*/
|
||||||
private Integer size;
|
private Integer size;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Nombre total d'éléments
|
* Nombre total d'éléments
|
||||||
*/
|
*/
|
||||||
private Long total;
|
private Long total;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Nombre total de pages
|
* Nombre total de pages
|
||||||
*/
|
*/
|
||||||
private Integer totalPages;
|
private Integer totalPages;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indique s'il y a une page suivante
|
* Indique s'il y a une page suivante
|
||||||
*/
|
*/
|
||||||
private Boolean hasNext;
|
private Boolean hasNext;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indique s'il y a une page précédente
|
* Indique s'il y a une page précédente
|
||||||
*/
|
*/
|
||||||
private Boolean hasPrevious;
|
private Boolean hasPrevious;
|
||||||
}
|
}
|
||||||
|
|
||||||
// === MÉTHODES STATIQUES DE FACTORY ===
|
// === MÉTHODES STATIQUES DE FACTORY ===
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Crée une réponse paginée
|
* Crée une réponse paginée
|
||||||
*
|
*
|
||||||
* @param data Les données de la page
|
* @param data Les données de la page
|
||||||
* @param page Le numéro de page (0-based)
|
* @param page Le numéro de page (0-based)
|
||||||
* @param size La taille de la page
|
* @param size La taille de la page
|
||||||
* @param total Le nombre total d'éléments
|
* @param total Le nombre total d'éléments
|
||||||
*/
|
*/
|
||||||
public static <T> PagedResponse<T> of(List<T> data, int page, int size, long total) {
|
public static <T> PagedResponse<T> of(List<T> data, int page, int size, long total) {
|
||||||
int totalPages = size > 0 ? (int) Math.ceil((double) total / size) : 0;
|
int totalPages = size > 0 ? (int) Math.ceil((double) total / size) : 0;
|
||||||
|
|
||||||
PaginationInfo pagination = PaginationInfo.builder()
|
PaginationInfo pagination = PaginationInfo.builder()
|
||||||
.page(page)
|
.page(page)
|
||||||
.size(size)
|
.size(size)
|
||||||
.total(total)
|
.total(total)
|
||||||
.totalPages(totalPages)
|
.totalPages(totalPages)
|
||||||
.hasNext(page < totalPages - 1)
|
.hasNext(page < totalPages - 1)
|
||||||
.hasPrevious(page > 0)
|
.hasPrevious(page > 0)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
return PagedResponse.<T>builder()
|
return PagedResponse.<T>builder()
|
||||||
.data(data)
|
.data(data)
|
||||||
.pagination(pagination)
|
.pagination(pagination)
|
||||||
.success(true)
|
.success(true)
|
||||||
.timestamp(LocalDateTime.now())
|
.timestamp(LocalDateTime.now())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Crée une réponse paginée avec un message
|
* Crée une réponse paginée avec un message
|
||||||
*/
|
*/
|
||||||
public static <T> PagedResponse<T> of(List<T> data, int page, int size, long total, String message) {
|
public static <T> PagedResponse<T> of(List<T> data, int page, int size, long total, String message) {
|
||||||
PagedResponse<T> response = of(data, page, size, total);
|
PagedResponse<T> response = of(data, page, size, total);
|
||||||
response.setMessage(message);
|
response.setMessage(message);
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,81 +1,81 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.PrioritePhase;
|
import dev.lions.btpxpress.domain.core.entity.PrioritePhase;
|
||||||
import dev.lions.btpxpress.domain.core.entity.TypePhaseChantier;
|
import dev.lions.btpxpress.domain.core.entity.TypePhaseChantier;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la création d'une phase de chantier - Architecture 2025
|
* DTO pour la création d'une phase de chantier - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class PhaseChantierCreateDTO {
|
public class PhaseChantierCreateDTO {
|
||||||
|
|
||||||
@NotBlank(message = "Le nom est obligatoire")
|
@NotBlank(message = "Le nom est obligatoire")
|
||||||
private String nom;
|
private String nom;
|
||||||
|
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
@NotNull(message = "Le chantier est obligatoire")
|
@NotNull(message = "Le chantier est obligatoire")
|
||||||
private UUID chantierId;
|
private UUID chantierId;
|
||||||
|
|
||||||
private TypePhaseChantier type;
|
private TypePhaseChantier type;
|
||||||
|
|
||||||
@NotNull(message = "L'ordre d'exécution est obligatoire")
|
@NotNull(message = "L'ordre d'exécution est obligatoire")
|
||||||
private Integer ordreExecution;
|
private Integer ordreExecution;
|
||||||
|
|
||||||
private LocalDate dateDebutPrevue;
|
private LocalDate dateDebutPrevue;
|
||||||
|
|
||||||
private LocalDate dateFinPrevue;
|
private LocalDate dateFinPrevue;
|
||||||
|
|
||||||
private BigDecimal budgetPrevu;
|
private BigDecimal budgetPrevu;
|
||||||
|
|
||||||
private String equipeResponsableNom;
|
private String equipeResponsableNom;
|
||||||
|
|
||||||
private String chefEquipeNom;
|
private String chefEquipeNom;
|
||||||
|
|
||||||
private Integer dureePrevueJours;
|
private Integer dureePrevueJours;
|
||||||
|
|
||||||
private PrioritePhase priorite;
|
private PrioritePhase priorite;
|
||||||
|
|
||||||
private String prerequis;
|
private String prerequis;
|
||||||
|
|
||||||
private String livrablesAttendus;
|
private String livrablesAttendus;
|
||||||
|
|
||||||
private String commentaires;
|
private String commentaires;
|
||||||
|
|
||||||
private String risquesIdentifies;
|
private String risquesIdentifies;
|
||||||
|
|
||||||
private String mesuresSecurite;
|
private String mesuresSecurite;
|
||||||
|
|
||||||
private String materielRequis;
|
private String materielRequis;
|
||||||
|
|
||||||
private String competencesRequises;
|
private String competencesRequises;
|
||||||
|
|
||||||
private Boolean bloquante;
|
private Boolean bloquante;
|
||||||
|
|
||||||
private Boolean facturable;
|
private Boolean facturable;
|
||||||
|
|
||||||
private String code;
|
private String code;
|
||||||
|
|
||||||
private String categorie;
|
private String categorie;
|
||||||
|
|
||||||
private String objectifs;
|
private String objectifs;
|
||||||
|
|
||||||
private UUID phaseParentId;
|
private UUID phaseParentId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,115 +1,115 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.PrioritePhase;
|
import dev.lions.btpxpress.domain.core.entity.PrioritePhase;
|
||||||
import dev.lions.btpxpress.domain.core.entity.StatutPhaseChantier;
|
import dev.lions.btpxpress.domain.core.entity.StatutPhaseChantier;
|
||||||
import dev.lions.btpxpress.domain.core.entity.TypePhaseChantier;
|
import dev.lions.btpxpress.domain.core.entity.TypePhaseChantier;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la réponse d'une phase de chantier - Architecture 2025
|
* DTO pour la réponse d'une phase de chantier - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class PhaseChantierResponseDTO {
|
public class PhaseChantierResponseDTO {
|
||||||
|
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
private String nom;
|
private String nom;
|
||||||
|
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
private StatutPhaseChantier statut;
|
private StatutPhaseChantier statut;
|
||||||
|
|
||||||
private TypePhaseChantier type;
|
private TypePhaseChantier type;
|
||||||
|
|
||||||
private Integer ordreExecution;
|
private Integer ordreExecution;
|
||||||
|
|
||||||
private LocalDate dateDebutPrevue;
|
private LocalDate dateDebutPrevue;
|
||||||
|
|
||||||
private LocalDate dateFinPrevue;
|
private LocalDate dateFinPrevue;
|
||||||
|
|
||||||
private LocalDate dateDebutReelle;
|
private LocalDate dateDebutReelle;
|
||||||
|
|
||||||
private LocalDate dateFinReelle;
|
private LocalDate dateFinReelle;
|
||||||
|
|
||||||
private BigDecimal pourcentageAvancement;
|
private BigDecimal pourcentageAvancement;
|
||||||
|
|
||||||
private BigDecimal budgetPrevu;
|
private BigDecimal budgetPrevu;
|
||||||
|
|
||||||
private BigDecimal coutReel;
|
private BigDecimal coutReel;
|
||||||
|
|
||||||
private String equipeResponsableNom;
|
private String equipeResponsableNom;
|
||||||
|
|
||||||
private String chefEquipeNom;
|
private String chefEquipeNom;
|
||||||
|
|
||||||
private Integer dureePrevueJours;
|
private Integer dureePrevueJours;
|
||||||
|
|
||||||
private Integer dureeReelleJours;
|
private Integer dureeReelleJours;
|
||||||
|
|
||||||
private PrioritePhase priorite;
|
private PrioritePhase priorite;
|
||||||
|
|
||||||
private String prerequis;
|
private String prerequis;
|
||||||
|
|
||||||
private String livrablesAttendus;
|
private String livrablesAttendus;
|
||||||
|
|
||||||
private String commentaires;
|
private String commentaires;
|
||||||
|
|
||||||
private String risquesIdentifies;
|
private String risquesIdentifies;
|
||||||
|
|
||||||
private String mesuresSecurite;
|
private String mesuresSecurite;
|
||||||
|
|
||||||
private String materielRequis;
|
private String materielRequis;
|
||||||
|
|
||||||
private String competencesRequises;
|
private String competencesRequises;
|
||||||
|
|
||||||
private Boolean bloquante;
|
private Boolean bloquante;
|
||||||
|
|
||||||
private Boolean facturable;
|
private Boolean facturable;
|
||||||
|
|
||||||
private Boolean actif;
|
private Boolean actif;
|
||||||
|
|
||||||
private String code;
|
private String code;
|
||||||
|
|
||||||
private String categorie;
|
private String categorie;
|
||||||
|
|
||||||
private String objectifs;
|
private String objectifs;
|
||||||
|
|
||||||
// Relations simplifiées
|
// Relations simplifiées
|
||||||
private UUID chantierId;
|
private UUID chantierId;
|
||||||
private String chantierNom;
|
private String chantierNom;
|
||||||
|
|
||||||
private UUID phaseParentId;
|
private UUID phaseParentId;
|
||||||
private String phaseParentNom;
|
private String phaseParentNom;
|
||||||
|
|
||||||
private Integer nombreSousPhases;
|
private Integer nombreSousPhases;
|
||||||
|
|
||||||
// Métadonnées
|
// Métadonnées
|
||||||
private LocalDateTime dateCreation;
|
private LocalDateTime dateCreation;
|
||||||
|
|
||||||
private LocalDateTime dateModification;
|
private LocalDateTime dateModification;
|
||||||
|
|
||||||
private String creePar;
|
private String creePar;
|
||||||
|
|
||||||
private String modifiePar;
|
private String modifiePar;
|
||||||
|
|
||||||
// Calculs
|
// Calculs
|
||||||
private Boolean enRetard;
|
private Boolean enRetard;
|
||||||
|
|
||||||
private Boolean enCours;
|
private Boolean enCours;
|
||||||
|
|
||||||
private Boolean terminee;
|
private Boolean terminee;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,57 +1,57 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.PrioritePlanningEvent;
|
import dev.lions.btpxpress.domain.core.entity.PrioritePlanningEvent;
|
||||||
import dev.lions.btpxpress.domain.core.entity.TypePlanningEvent;
|
import dev.lions.btpxpress.domain.core.entity.TypePlanningEvent;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la création d'un événement de planning - Architecture 2025
|
* DTO pour la création d'un événement de planning - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class PlanningEventCreateDTO {
|
public class PlanningEventCreateDTO {
|
||||||
|
|
||||||
@NotBlank(message = "Le titre est obligatoire")
|
@NotBlank(message = "Le titre est obligatoire")
|
||||||
private String titre;
|
private String titre;
|
||||||
|
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
@NotNull(message = "La date de début est obligatoire")
|
@NotNull(message = "La date de début est obligatoire")
|
||||||
private LocalDateTime dateDebut;
|
private LocalDateTime dateDebut;
|
||||||
|
|
||||||
@NotNull(message = "La date de fin est obligatoire")
|
@NotNull(message = "La date de fin est obligatoire")
|
||||||
private LocalDateTime dateFin;
|
private LocalDateTime dateFin;
|
||||||
|
|
||||||
@NotNull(message = "Le type d'événement est obligatoire")
|
@NotNull(message = "Le type d'événement est obligatoire")
|
||||||
private TypePlanningEvent type;
|
private TypePlanningEvent type;
|
||||||
|
|
||||||
private PrioritePlanningEvent priorite;
|
private PrioritePlanningEvent priorite;
|
||||||
|
|
||||||
private String notes;
|
private String notes;
|
||||||
|
|
||||||
private String couleur;
|
private String couleur;
|
||||||
|
|
||||||
// Relations
|
// Relations
|
||||||
private UUID chantierId;
|
private UUID chantierId;
|
||||||
|
|
||||||
private UUID equipeId;
|
private UUID equipeId;
|
||||||
|
|
||||||
private List<UUID> employeIds;
|
private List<UUID> employeIds;
|
||||||
|
|
||||||
private List<UUID> materielIds;
|
private List<UUID> materielIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,75 +1,75 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.PrioritePlanningEvent;
|
import dev.lions.btpxpress.domain.core.entity.PrioritePlanningEvent;
|
||||||
import dev.lions.btpxpress.domain.core.entity.StatutPlanningEvent;
|
import dev.lions.btpxpress.domain.core.entity.StatutPlanningEvent;
|
||||||
import dev.lions.btpxpress.domain.core.entity.TypePlanningEvent;
|
import dev.lions.btpxpress.domain.core.entity.TypePlanningEvent;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la réponse d'un événement de planning - Architecture 2025
|
* DTO pour la réponse d'un événement de planning - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class PlanningEventResponseDTO {
|
public class PlanningEventResponseDTO {
|
||||||
|
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
private String titre;
|
private String titre;
|
||||||
|
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
private LocalDateTime dateDebut;
|
private LocalDateTime dateDebut;
|
||||||
|
|
||||||
private LocalDateTime dateFin;
|
private LocalDateTime dateFin;
|
||||||
|
|
||||||
private TypePlanningEvent type;
|
private TypePlanningEvent type;
|
||||||
|
|
||||||
private StatutPlanningEvent statut;
|
private StatutPlanningEvent statut;
|
||||||
|
|
||||||
private PrioritePlanningEvent priorite;
|
private PrioritePlanningEvent priorite;
|
||||||
|
|
||||||
private String notes;
|
private String notes;
|
||||||
|
|
||||||
private String couleur;
|
private String couleur;
|
||||||
|
|
||||||
private LocalDateTime dateCreation;
|
private LocalDateTime dateCreation;
|
||||||
|
|
||||||
private LocalDateTime dateModification;
|
private LocalDateTime dateModification;
|
||||||
|
|
||||||
private Boolean actif;
|
private Boolean actif;
|
||||||
|
|
||||||
// Relations simplifiées
|
// Relations simplifiées
|
||||||
private UUID chantierId;
|
private UUID chantierId;
|
||||||
private String chantierNom;
|
private String chantierNom;
|
||||||
|
|
||||||
private UUID equipeId;
|
private UUID equipeId;
|
||||||
private String equipeNom;
|
private String equipeNom;
|
||||||
|
|
||||||
private List<UUID> employeIds;
|
private List<UUID> employeIds;
|
||||||
private Integer nombreEmployes;
|
private Integer nombreEmployes;
|
||||||
|
|
||||||
private List<UUID> materielIds;
|
private List<UUID> materielIds;
|
||||||
private Integer nombreMateriels;
|
private Integer nombreMateriels;
|
||||||
|
|
||||||
// Métadonnées calculées
|
// Métadonnées calculées
|
||||||
private Long dureeEnHeures;
|
private Long dureeEnHeures;
|
||||||
|
|
||||||
private Boolean enCours;
|
private Boolean enCours;
|
||||||
|
|
||||||
private Boolean termine;
|
private Boolean termine;
|
||||||
|
|
||||||
private Boolean enRetard;
|
private Boolean enRetard;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,87 +1,87 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.StatutPlanning;
|
import dev.lions.btpxpress.domain.core.entity.StatutPlanning;
|
||||||
import dev.lions.btpxpress.domain.core.entity.TypePlanning;
|
import dev.lions.btpxpress.domain.core.entity.TypePlanning;
|
||||||
import dev.lions.btpxpress.domain.core.entity.VuePlanning;
|
import dev.lions.btpxpress.domain.core.entity.VuePlanning;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la création d'un planning de matériel - Architecture 2025
|
* DTO pour la création d'un planning de matériel - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class PlanningMaterielCreateDTO {
|
public class PlanningMaterielCreateDTO {
|
||||||
|
|
||||||
@NotNull(message = "Le matériel est obligatoire")
|
@NotNull(message = "Le matériel est obligatoire")
|
||||||
private UUID materielId;
|
private UUID materielId;
|
||||||
|
|
||||||
@NotBlank(message = "Le nom du planning est obligatoire")
|
@NotBlank(message = "Le nom du planning est obligatoire")
|
||||||
private String nomPlanning;
|
private String nomPlanning;
|
||||||
|
|
||||||
private String descriptionPlanning;
|
private String descriptionPlanning;
|
||||||
|
|
||||||
@NotNull(message = "La date de début est obligatoire")
|
@NotNull(message = "La date de début est obligatoire")
|
||||||
private LocalDate dateDebut;
|
private LocalDate dateDebut;
|
||||||
|
|
||||||
@NotNull(message = "La date de fin est obligatoire")
|
@NotNull(message = "La date de fin est obligatoire")
|
||||||
private LocalDate dateFin;
|
private LocalDate dateFin;
|
||||||
|
|
||||||
@NotNull(message = "Le type de planning est obligatoire")
|
@NotNull(message = "Le type de planning est obligatoire")
|
||||||
private TypePlanning typePlanning;
|
private TypePlanning typePlanning;
|
||||||
|
|
||||||
private StatutPlanning statutPlanning;
|
private StatutPlanning statutPlanning;
|
||||||
|
|
||||||
private Integer versionPlanning;
|
private Integer versionPlanning;
|
||||||
|
|
||||||
private UUID planningParentId;
|
private UUID planningParentId;
|
||||||
|
|
||||||
private String planificateur;
|
private String planificateur;
|
||||||
|
|
||||||
private String valideur;
|
private String valideur;
|
||||||
|
|
||||||
private String commentairesValidation;
|
private String commentairesValidation;
|
||||||
|
|
||||||
private Boolean conflitsDetectes;
|
private Boolean conflitsDetectes;
|
||||||
|
|
||||||
private Integer nombreConflits;
|
private Integer nombreConflits;
|
||||||
|
|
||||||
private Boolean resolutionConflitsAuto;
|
private Boolean resolutionConflitsAuto;
|
||||||
|
|
||||||
private Double tauxUtilisationPrevu;
|
private Double tauxUtilisationPrevu;
|
||||||
|
|
||||||
private Double scoreOptimisation;
|
private Double scoreOptimisation;
|
||||||
|
|
||||||
private Boolean optimiseAutomatiquement;
|
private Boolean optimiseAutomatiquement;
|
||||||
|
|
||||||
private Boolean notificationsActivees;
|
private Boolean notificationsActivees;
|
||||||
|
|
||||||
private Boolean alerteConflits;
|
private Boolean alerteConflits;
|
||||||
|
|
||||||
private Boolean alerteSurcharge;
|
private Boolean alerteSurcharge;
|
||||||
|
|
||||||
private Double seuilAlerteUtilisation;
|
private Double seuilAlerteUtilisation;
|
||||||
|
|
||||||
private String couleurPlanning;
|
private String couleurPlanning;
|
||||||
|
|
||||||
private VuePlanning vueParDefaut;
|
private VuePlanning vueParDefaut;
|
||||||
|
|
||||||
private String granulariteAffichage;
|
private String granulariteAffichage;
|
||||||
|
|
||||||
private String optionsAffichage; // JSON
|
private String optionsAffichage; // JSON
|
||||||
|
|
||||||
private String reglesPlanification; // JSON
|
private String reglesPlanification; // JSON
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,118 +1,118 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.StatutPlanning;
|
import dev.lions.btpxpress.domain.core.entity.StatutPlanning;
|
||||||
import dev.lions.btpxpress.domain.core.entity.TypePlanning;
|
import dev.lions.btpxpress.domain.core.entity.TypePlanning;
|
||||||
import dev.lions.btpxpress.domain.core.entity.VuePlanning;
|
import dev.lions.btpxpress.domain.core.entity.VuePlanning;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la réponse d'un planning de matériel - Architecture 2025
|
* DTO pour la réponse d'un planning de matériel - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class PlanningMaterielResponseDTO {
|
public class PlanningMaterielResponseDTO {
|
||||||
|
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
private String nomPlanning;
|
private String nomPlanning;
|
||||||
|
|
||||||
private String descriptionPlanning;
|
private String descriptionPlanning;
|
||||||
|
|
||||||
private LocalDate dateDebut;
|
private LocalDate dateDebut;
|
||||||
|
|
||||||
private LocalDate dateFin;
|
private LocalDate dateFin;
|
||||||
|
|
||||||
private TypePlanning typePlanning;
|
private TypePlanning typePlanning;
|
||||||
|
|
||||||
private StatutPlanning statutPlanning;
|
private StatutPlanning statutPlanning;
|
||||||
|
|
||||||
private Integer versionPlanning;
|
private Integer versionPlanning;
|
||||||
|
|
||||||
private UUID planningParentId;
|
private UUID planningParentId;
|
||||||
|
|
||||||
private String planificateur;
|
private String planificateur;
|
||||||
|
|
||||||
private String valideur;
|
private String valideur;
|
||||||
|
|
||||||
private LocalDateTime dateValidation;
|
private LocalDateTime dateValidation;
|
||||||
|
|
||||||
private String commentairesValidation;
|
private String commentairesValidation;
|
||||||
|
|
||||||
private Boolean conflitsDetectes;
|
private Boolean conflitsDetectes;
|
||||||
|
|
||||||
private Integer nombreConflits;
|
private Integer nombreConflits;
|
||||||
|
|
||||||
private LocalDateTime derniereVerificationConflits;
|
private LocalDateTime derniereVerificationConflits;
|
||||||
|
|
||||||
private Boolean resolutionConflitsAuto;
|
private Boolean resolutionConflitsAuto;
|
||||||
|
|
||||||
private Double tauxUtilisationPrevu;
|
private Double tauxUtilisationPrevu;
|
||||||
|
|
||||||
private Double scoreOptimisation;
|
private Double scoreOptimisation;
|
||||||
|
|
||||||
private Boolean optimiseAutomatiquement;
|
private Boolean optimiseAutomatiquement;
|
||||||
|
|
||||||
private LocalDateTime derniereOptimisation;
|
private LocalDateTime derniereOptimisation;
|
||||||
|
|
||||||
private Boolean notificationsActivees;
|
private Boolean notificationsActivees;
|
||||||
|
|
||||||
private Boolean alerteConflits;
|
private Boolean alerteConflits;
|
||||||
|
|
||||||
private Boolean alerteSurcharge;
|
private Boolean alerteSurcharge;
|
||||||
|
|
||||||
private Double seuilAlerteUtilisation;
|
private Double seuilAlerteUtilisation;
|
||||||
|
|
||||||
private String couleurPlanning;
|
private String couleurPlanning;
|
||||||
|
|
||||||
private VuePlanning vueParDefaut;
|
private VuePlanning vueParDefaut;
|
||||||
|
|
||||||
private String granulariteAffichage;
|
private String granulariteAffichage;
|
||||||
|
|
||||||
private String optionsAffichage;
|
private String optionsAffichage;
|
||||||
|
|
||||||
private String reglesPlanification;
|
private String reglesPlanification;
|
||||||
|
|
||||||
private LocalDateTime dateCreation;
|
private LocalDateTime dateCreation;
|
||||||
|
|
||||||
private LocalDateTime dateModification;
|
private LocalDateTime dateModification;
|
||||||
|
|
||||||
private String creePar;
|
private String creePar;
|
||||||
|
|
||||||
private String modifiePar;
|
private String modifiePar;
|
||||||
|
|
||||||
private Boolean actif;
|
private Boolean actif;
|
||||||
|
|
||||||
// Relations simplifiées
|
// Relations simplifiées
|
||||||
private UUID materielId;
|
private UUID materielId;
|
||||||
private String materielNom;
|
private String materielNom;
|
||||||
|
|
||||||
private Integer nombreReservations;
|
private Integer nombreReservations;
|
||||||
|
|
||||||
// Métadonnées calculées
|
// Métadonnées calculées
|
||||||
private Long dureePlanningJours;
|
private Long dureePlanningJours;
|
||||||
|
|
||||||
private Boolean estValide;
|
private Boolean estValide;
|
||||||
|
|
||||||
private Boolean peutEtreModifie;
|
private Boolean peutEtreModifie;
|
||||||
|
|
||||||
private Boolean necessiteAttention;
|
private Boolean necessiteAttention;
|
||||||
|
|
||||||
private String couleurAffichage;
|
private String couleurAffichage;
|
||||||
|
|
||||||
private String iconeTypePlanning;
|
private String iconeTypePlanning;
|
||||||
|
|
||||||
private Double pourcentageAvancement;
|
private Double pourcentageAvancement;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,76 +1,76 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.PrioriteReservation;
|
import dev.lions.btpxpress.domain.core.entity.PrioriteReservation;
|
||||||
import dev.lions.btpxpress.domain.core.entity.StatutReservationMateriel;
|
import dev.lions.btpxpress.domain.core.entity.StatutReservationMateriel;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la création d'une réservation de matériel - Architecture 2025
|
* DTO pour la création d'une réservation de matériel - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class ReservationMaterielCreateDTO {
|
public class ReservationMaterielCreateDTO {
|
||||||
|
|
||||||
@NotNull(message = "Le matériel est obligatoire")
|
@NotNull(message = "Le matériel est obligatoire")
|
||||||
private UUID materielId;
|
private UUID materielId;
|
||||||
|
|
||||||
@NotNull(message = "Le chantier est obligatoire")
|
@NotNull(message = "Le chantier est obligatoire")
|
||||||
private UUID chantierId;
|
private UUID chantierId;
|
||||||
|
|
||||||
private UUID phaseId;
|
private UUID phaseId;
|
||||||
|
|
||||||
private UUID planningMaterielId;
|
private UUID planningMaterielId;
|
||||||
|
|
||||||
@NotNull(message = "La date de début est obligatoire")
|
@NotNull(message = "La date de début est obligatoire")
|
||||||
private LocalDate dateDebut;
|
private LocalDate dateDebut;
|
||||||
|
|
||||||
@NotNull(message = "La date de fin est obligatoire")
|
@NotNull(message = "La date de fin est obligatoire")
|
||||||
private LocalDate dateFin;
|
private LocalDate dateFin;
|
||||||
|
|
||||||
private Integer heureDebut;
|
private Integer heureDebut;
|
||||||
|
|
||||||
private Integer heureFin;
|
private Integer heureFin;
|
||||||
|
|
||||||
@NotNull(message = "La quantité est obligatoire")
|
@NotNull(message = "La quantité est obligatoire")
|
||||||
private BigDecimal quantite;
|
private BigDecimal quantite;
|
||||||
|
|
||||||
private String unite;
|
private String unite;
|
||||||
|
|
||||||
private BigDecimal prixUnitairePrevisionnel;
|
private BigDecimal prixUnitairePrevisionnel;
|
||||||
|
|
||||||
private BigDecimal prixTotalPrevisionnel;
|
private BigDecimal prixTotalPrevisionnel;
|
||||||
|
|
||||||
private StatutReservationMateriel statut;
|
private StatutReservationMateriel statut;
|
||||||
|
|
||||||
private PrioriteReservation priorite;
|
private PrioriteReservation priorite;
|
||||||
|
|
||||||
private String lieuLivraison;
|
private String lieuLivraison;
|
||||||
|
|
||||||
private String instructionsLivraison;
|
private String instructionsLivraison;
|
||||||
|
|
||||||
private String responsableReception;
|
private String responsableReception;
|
||||||
|
|
||||||
private String telephoneContact;
|
private String telephoneContact;
|
||||||
|
|
||||||
private LocalDate dateLivraisonPrevue;
|
private LocalDate dateLivraisonPrevue;
|
||||||
|
|
||||||
private LocalDate dateRetourPrevue;
|
private LocalDate dateRetourPrevue;
|
||||||
|
|
||||||
private String demandeur;
|
private String demandeur;
|
||||||
|
|
||||||
private String valideur;
|
private String valideur;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,127 +1,127 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.PrioriteReservation;
|
import dev.lions.btpxpress.domain.core.entity.PrioriteReservation;
|
||||||
import dev.lions.btpxpress.domain.core.entity.StatutReservationMateriel;
|
import dev.lions.btpxpress.domain.core.entity.StatutReservationMateriel;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la réponse d'une réservation de matériel - Architecture 2025
|
* DTO pour la réponse d'une réservation de matériel - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class ReservationMaterielResponseDTO {
|
public class ReservationMaterielResponseDTO {
|
||||||
|
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
private LocalDate dateDebut;
|
private LocalDate dateDebut;
|
||||||
|
|
||||||
private LocalDate dateFin;
|
private LocalDate dateFin;
|
||||||
|
|
||||||
private Integer heureDebut;
|
private Integer heureDebut;
|
||||||
|
|
||||||
private Integer heureFin;
|
private Integer heureFin;
|
||||||
|
|
||||||
private BigDecimal quantite;
|
private BigDecimal quantite;
|
||||||
|
|
||||||
private String unite;
|
private String unite;
|
||||||
|
|
||||||
private BigDecimal prixUnitairePrevisionnel;
|
private BigDecimal prixUnitairePrevisionnel;
|
||||||
|
|
||||||
private BigDecimal prixTotalPrevisionnel;
|
private BigDecimal prixTotalPrevisionnel;
|
||||||
|
|
||||||
private BigDecimal prixUnitaireReel;
|
private BigDecimal prixUnitaireReel;
|
||||||
|
|
||||||
private BigDecimal prixTotalReel;
|
private BigDecimal prixTotalReel;
|
||||||
|
|
||||||
private StatutReservationMateriel statut;
|
private StatutReservationMateriel statut;
|
||||||
|
|
||||||
private PrioriteReservation priorite;
|
private PrioriteReservation priorite;
|
||||||
|
|
||||||
private String referenceReservation;
|
private String referenceReservation;
|
||||||
|
|
||||||
private String lieuLivraison;
|
private String lieuLivraison;
|
||||||
|
|
||||||
private String instructionsLivraison;
|
private String instructionsLivraison;
|
||||||
|
|
||||||
private String responsableReception;
|
private String responsableReception;
|
||||||
|
|
||||||
private String telephoneContact;
|
private String telephoneContact;
|
||||||
|
|
||||||
private LocalDate dateLivraisonPrevue;
|
private LocalDate dateLivraisonPrevue;
|
||||||
|
|
||||||
private LocalDate dateLivraisonReelle;
|
private LocalDate dateLivraisonReelle;
|
||||||
|
|
||||||
private LocalDate dateRetourPrevue;
|
private LocalDate dateRetourPrevue;
|
||||||
|
|
||||||
private LocalDate dateRetourReelle;
|
private LocalDate dateRetourReelle;
|
||||||
|
|
||||||
private String observationsLivraison;
|
private String observationsLivraison;
|
||||||
|
|
||||||
private String observationsRetour;
|
private String observationsRetour;
|
||||||
|
|
||||||
private String etatMaterielLivraison;
|
private String etatMaterielLivraison;
|
||||||
|
|
||||||
private String etatMaterielRetour;
|
private String etatMaterielRetour;
|
||||||
|
|
||||||
private Integer kilometrageDebut;
|
private Integer kilometrageDebut;
|
||||||
|
|
||||||
private Integer kilometrageFin;
|
private Integer kilometrageFin;
|
||||||
|
|
||||||
private String demandeur;
|
private String demandeur;
|
||||||
|
|
||||||
private String valideur;
|
private String valideur;
|
||||||
|
|
||||||
private LocalDateTime dateValidation;
|
private LocalDateTime dateValidation;
|
||||||
|
|
||||||
private String motifRefus;
|
private String motifRefus;
|
||||||
|
|
||||||
private String numeroFactureFournisseur;
|
private String numeroFactureFournisseur;
|
||||||
|
|
||||||
private LocalDate dateFactureFournisseur;
|
private LocalDate dateFactureFournisseur;
|
||||||
|
|
||||||
private Boolean factureTraitee;
|
private Boolean factureTraitee;
|
||||||
|
|
||||||
private LocalDateTime dateCreation;
|
private LocalDateTime dateCreation;
|
||||||
|
|
||||||
private LocalDateTime dateModification;
|
private LocalDateTime dateModification;
|
||||||
|
|
||||||
private String creePar;
|
private String creePar;
|
||||||
|
|
||||||
private String modifiePar;
|
private String modifiePar;
|
||||||
|
|
||||||
private Boolean actif;
|
private Boolean actif;
|
||||||
|
|
||||||
// Relations simplifiées
|
// Relations simplifiées
|
||||||
private UUID materielId;
|
private UUID materielId;
|
||||||
private String materielNom;
|
private String materielNom;
|
||||||
private String materielReference;
|
private String materielReference;
|
||||||
|
|
||||||
private UUID chantierId;
|
private UUID chantierId;
|
||||||
private String chantierNom;
|
private String chantierNom;
|
||||||
|
|
||||||
private UUID phaseId;
|
private UUID phaseId;
|
||||||
private String phaseNom;
|
private String phaseNom;
|
||||||
|
|
||||||
private UUID planningMaterielId;
|
private UUID planningMaterielId;
|
||||||
|
|
||||||
// Métadonnées calculées
|
// Métadonnées calculées
|
||||||
private Long dureeReservationJours;
|
private Long dureeReservationJours;
|
||||||
|
|
||||||
private Boolean estEnCours;
|
private Boolean estEnCours;
|
||||||
|
|
||||||
private Boolean estEnRetard;
|
private Boolean estEnRetard;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,78 +1,78 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.CategorieStock;
|
import dev.lions.btpxpress.domain.core.entity.CategorieStock;
|
||||||
import dev.lions.btpxpress.domain.core.entity.SousCategorieStock;
|
import dev.lions.btpxpress.domain.core.entity.SousCategorieStock;
|
||||||
import dev.lions.btpxpress.domain.core.entity.UniteMesure;
|
import dev.lions.btpxpress.domain.core.entity.UniteMesure;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la création d'un stock - Architecture 2025
|
* DTO pour la création d'un stock - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class StockCreateDTO {
|
public class StockCreateDTO {
|
||||||
|
|
||||||
@NotBlank(message = "La référence est obligatoire")
|
@NotBlank(message = "La référence est obligatoire")
|
||||||
private String reference;
|
private String reference;
|
||||||
|
|
||||||
@NotBlank(message = "La désignation est obligatoire")
|
@NotBlank(message = "La désignation est obligatoire")
|
||||||
private String designation;
|
private String designation;
|
||||||
|
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
@NotNull(message = "La catégorie est obligatoire")
|
@NotNull(message = "La catégorie est obligatoire")
|
||||||
private CategorieStock categorie;
|
private CategorieStock categorie;
|
||||||
|
|
||||||
private SousCategorieStock sousCategorie;
|
private SousCategorieStock sousCategorie;
|
||||||
|
|
||||||
@NotNull(message = "L'unité de mesure est obligatoire")
|
@NotNull(message = "L'unité de mesure est obligatoire")
|
||||||
private UniteMesure uniteMesure;
|
private UniteMesure uniteMesure;
|
||||||
|
|
||||||
private BigDecimal quantiteStock;
|
private BigDecimal quantiteStock;
|
||||||
|
|
||||||
private BigDecimal quantiteMinimum;
|
private BigDecimal quantiteMinimum;
|
||||||
|
|
||||||
private BigDecimal quantiteMaximum;
|
private BigDecimal quantiteMaximum;
|
||||||
|
|
||||||
private BigDecimal prixUnitaireHT;
|
private BigDecimal prixUnitaireHT;
|
||||||
|
|
||||||
private BigDecimal tauxTVA;
|
private BigDecimal tauxTVA;
|
||||||
|
|
||||||
private String emplacementStockage;
|
private String emplacementStockage;
|
||||||
|
|
||||||
private String codeZone;
|
private String codeZone;
|
||||||
|
|
||||||
private String codeAllee;
|
private String codeAllee;
|
||||||
|
|
||||||
private String codeEtagere;
|
private String codeEtagere;
|
||||||
|
|
||||||
// Relations
|
// Relations
|
||||||
private UUID fournisseurPrincipalId;
|
private UUID fournisseurPrincipalId;
|
||||||
|
|
||||||
private UUID chantierId;
|
private UUID chantierId;
|
||||||
|
|
||||||
// Informations techniques
|
// Informations techniques
|
||||||
private String marque;
|
private String marque;
|
||||||
|
|
||||||
private String modele;
|
private String modele;
|
||||||
|
|
||||||
private String referenceFournisseur;
|
private String referenceFournisseur;
|
||||||
|
|
||||||
private String codeBarre;
|
private String codeBarre;
|
||||||
|
|
||||||
private String codeEAN;
|
private String codeEAN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,116 +1,116 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.CategorieStock;
|
import dev.lions.btpxpress.domain.core.entity.CategorieStock;
|
||||||
import dev.lions.btpxpress.domain.core.entity.SousCategorieStock;
|
import dev.lions.btpxpress.domain.core.entity.SousCategorieStock;
|
||||||
import dev.lions.btpxpress.domain.core.entity.StatutStock;
|
import dev.lions.btpxpress.domain.core.entity.StatutStock;
|
||||||
import dev.lions.btpxpress.domain.core.entity.UniteMesure;
|
import dev.lions.btpxpress.domain.core.entity.UniteMesure;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la réponse d'un stock - Architecture 2025
|
* DTO pour la réponse d'un stock - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class StockResponseDTO {
|
public class StockResponseDTO {
|
||||||
|
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
private String reference;
|
private String reference;
|
||||||
|
|
||||||
private String designation;
|
private String designation;
|
||||||
|
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
private CategorieStock categorie;
|
private CategorieStock categorie;
|
||||||
|
|
||||||
private SousCategorieStock sousCategorie;
|
private SousCategorieStock sousCategorie;
|
||||||
|
|
||||||
private UniteMesure uniteMesure;
|
private UniteMesure uniteMesure;
|
||||||
|
|
||||||
private BigDecimal quantiteStock;
|
private BigDecimal quantiteStock;
|
||||||
|
|
||||||
private BigDecimal quantiteMinimum;
|
private BigDecimal quantiteMinimum;
|
||||||
|
|
||||||
private BigDecimal quantiteMaximum;
|
private BigDecimal quantiteMaximum;
|
||||||
|
|
||||||
private BigDecimal quantiteSecurite;
|
private BigDecimal quantiteSecurite;
|
||||||
|
|
||||||
private BigDecimal quantiteReservee;
|
private BigDecimal quantiteReservee;
|
||||||
|
|
||||||
private BigDecimal quantiteEnCommande;
|
private BigDecimal quantiteEnCommande;
|
||||||
|
|
||||||
private BigDecimal prixUnitaireHT;
|
private BigDecimal prixUnitaireHT;
|
||||||
|
|
||||||
private BigDecimal coutMoyenPondere;
|
private BigDecimal coutMoyenPondere;
|
||||||
|
|
||||||
private BigDecimal coutDerniereEntree;
|
private BigDecimal coutDerniereEntree;
|
||||||
|
|
||||||
private BigDecimal tauxTVA;
|
private BigDecimal tauxTVA;
|
||||||
|
|
||||||
private String emplacementStockage;
|
private String emplacementStockage;
|
||||||
|
|
||||||
private String codeZone;
|
private String codeZone;
|
||||||
|
|
||||||
private String codeAllee;
|
private String codeAllee;
|
||||||
|
|
||||||
private String codeEtagere;
|
private String codeEtagere;
|
||||||
|
|
||||||
private StatutStock statut;
|
private StatutStock statut;
|
||||||
|
|
||||||
private Boolean gestionParLot;
|
private Boolean gestionParLot;
|
||||||
|
|
||||||
private Boolean traçabiliteRequise;
|
private Boolean traçabiliteRequise;
|
||||||
|
|
||||||
private Boolean articlePerissable;
|
private Boolean articlePerissable;
|
||||||
|
|
||||||
private Boolean controleQualiteRequis;
|
private Boolean controleQualiteRequis;
|
||||||
|
|
||||||
private Boolean articleDangereux;
|
private Boolean articleDangereux;
|
||||||
|
|
||||||
private String classeDanger;
|
private String classeDanger;
|
||||||
|
|
||||||
// Relations simplifiées
|
// Relations simplifiées
|
||||||
private UUID fournisseurPrincipalId;
|
private UUID fournisseurPrincipalId;
|
||||||
private String fournisseurPrincipalNom;
|
private String fournisseurPrincipalNom;
|
||||||
|
|
||||||
private UUID chantierId;
|
private UUID chantierId;
|
||||||
private String chantierNom;
|
private String chantierNom;
|
||||||
|
|
||||||
// Informations techniques
|
// Informations techniques
|
||||||
private String marque;
|
private String marque;
|
||||||
|
|
||||||
private String modele;
|
private String modele;
|
||||||
|
|
||||||
private String referenceFournisseur;
|
private String referenceFournisseur;
|
||||||
|
|
||||||
private String codeBarre;
|
private String codeBarre;
|
||||||
|
|
||||||
private String codeEAN;
|
private String codeEAN;
|
||||||
|
|
||||||
// Métadonnées
|
// Métadonnées
|
||||||
private LocalDateTime dateCreation;
|
private LocalDateTime dateCreation;
|
||||||
|
|
||||||
private LocalDateTime dateModification;
|
private LocalDateTime dateModification;
|
||||||
|
|
||||||
private String creePar;
|
private String creePar;
|
||||||
|
|
||||||
private String modifiePar;
|
private String modifiePar;
|
||||||
|
|
||||||
// Calculs
|
// Calculs
|
||||||
private BigDecimal valeurStock;
|
private BigDecimal valeurStock;
|
||||||
|
|
||||||
private Boolean enRupture;
|
private Boolean enRupture;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,62 +1,62 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.UserRole;
|
import dev.lions.btpxpress.domain.core.entity.UserRole;
|
||||||
import dev.lions.btpxpress.domain.core.entity.UserStatus;
|
import dev.lions.btpxpress.domain.core.entity.UserStatus;
|
||||||
import jakarta.validation.constraints.Email;
|
import jakarta.validation.constraints.Email;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la création d'un utilisateur - Architecture 2025
|
* DTO pour la création d'un utilisateur - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class UserCreateDTO {
|
public class UserCreateDTO {
|
||||||
|
|
||||||
@NotBlank(message = "L'email est obligatoire")
|
@NotBlank(message = "L'email est obligatoire")
|
||||||
@Email(message = "Email invalide")
|
@Email(message = "Email invalide")
|
||||||
private String email;
|
private String email;
|
||||||
|
|
||||||
@NotBlank(message = "Le nom est obligatoire")
|
@NotBlank(message = "Le nom est obligatoire")
|
||||||
private String nom;
|
private String nom;
|
||||||
|
|
||||||
@NotBlank(message = "Le prénom est obligatoire")
|
@NotBlank(message = "Le prénom est obligatoire")
|
||||||
private String prenom;
|
private String prenom;
|
||||||
|
|
||||||
@NotBlank(message = "Le mot de passe est obligatoire")
|
@NotBlank(message = "Le mot de passe est obligatoire")
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
private UserRole role;
|
private UserRole role;
|
||||||
|
|
||||||
private Boolean actif;
|
private Boolean actif;
|
||||||
|
|
||||||
private UserStatus status;
|
private UserStatus status;
|
||||||
|
|
||||||
private String telephone;
|
private String telephone;
|
||||||
|
|
||||||
private String adresse;
|
private String adresse;
|
||||||
|
|
||||||
private String codePostal;
|
private String codePostal;
|
||||||
|
|
||||||
private String ville;
|
private String ville;
|
||||||
|
|
||||||
private String entreprise;
|
private String entreprise;
|
||||||
|
|
||||||
private String siret;
|
private String siret;
|
||||||
|
|
||||||
private String secteurActivite;
|
private String secteurActivite;
|
||||||
|
|
||||||
private Integer effectif;
|
private Integer effectif;
|
||||||
|
|
||||||
private String commentaireAdmin;
|
private String commentaireAdmin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,67 +1,67 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.dto;
|
package dev.lions.btpxpress.domain.shared.dto;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.UserRole;
|
import dev.lions.btpxpress.domain.core.entity.UserRole;
|
||||||
import dev.lions.btpxpress.domain.core.entity.UserStatus;
|
import dev.lions.btpxpress.domain.core.entity.UserStatus;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DTO pour la réponse d'un utilisateur - Architecture 2025
|
* DTO pour la réponse d'un utilisateur - Architecture 2025
|
||||||
* Note: Le mot de passe n'est jamais inclus dans ce DTO pour des raisons de sécurité
|
* Note: Le mot de passe n'est jamais inclus dans ce DTO pour des raisons de sécurité
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class UserResponseDTO {
|
public class UserResponseDTO {
|
||||||
|
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
private String email;
|
private String email;
|
||||||
|
|
||||||
private String nom;
|
private String nom;
|
||||||
|
|
||||||
private String prenom;
|
private String prenom;
|
||||||
|
|
||||||
private UserRole role;
|
private UserRole role;
|
||||||
|
|
||||||
private Boolean actif;
|
private Boolean actif;
|
||||||
|
|
||||||
private UserStatus status;
|
private UserStatus status;
|
||||||
|
|
||||||
private String telephone;
|
private String telephone;
|
||||||
|
|
||||||
private String adresse;
|
private String adresse;
|
||||||
|
|
||||||
private String codePostal;
|
private String codePostal;
|
||||||
|
|
||||||
private String ville;
|
private String ville;
|
||||||
|
|
||||||
private String entreprise;
|
private String entreprise;
|
||||||
|
|
||||||
private String siret;
|
private String siret;
|
||||||
|
|
||||||
private String secteurActivite;
|
private String secteurActivite;
|
||||||
|
|
||||||
private Integer effectif;
|
private Integer effectif;
|
||||||
|
|
||||||
private String commentaireAdmin;
|
private String commentaireAdmin;
|
||||||
|
|
||||||
private LocalDateTime dateCreation;
|
private LocalDateTime dateCreation;
|
||||||
|
|
||||||
private LocalDateTime dateModification;
|
private LocalDateTime dateModification;
|
||||||
|
|
||||||
private LocalDateTime derniereConnexion;
|
private LocalDateTime derniereConnexion;
|
||||||
|
|
||||||
// Métadonnées calculées
|
// Métadonnées calculées
|
||||||
private Boolean canLogin;
|
private Boolean canLogin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,94 +1,94 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.mapper;
|
package dev.lions.btpxpress.domain.shared.mapper;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.Abonnement;
|
import dev.lions.btpxpress.domain.core.entity.Abonnement;
|
||||||
import dev.lions.btpxpress.domain.core.entity.EntrepriseProfile;
|
import dev.lions.btpxpress.domain.core.entity.EntrepriseProfile;
|
||||||
import dev.lions.btpxpress.domain.shared.dto.AbonnementCreateDTO;
|
import dev.lions.btpxpress.domain.shared.dto.AbonnementCreateDTO;
|
||||||
import dev.lions.btpxpress.domain.shared.dto.AbonnementResponseDTO;
|
import dev.lions.btpxpress.domain.shared.dto.AbonnementResponseDTO;
|
||||||
import jakarta.enterprise.context.ApplicationScoped;
|
import jakarta.enterprise.context.ApplicationScoped;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapper pour les abonnements - Architecture 2025
|
* Mapper pour les abonnements - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@ApplicationScoped
|
@ApplicationScoped
|
||||||
public class AbonnementMapper {
|
public class AbonnementMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion DTO vers entité
|
* Conversion DTO vers entité
|
||||||
*/
|
*/
|
||||||
public Abonnement toEntity(AbonnementCreateDTO dto) {
|
public Abonnement toEntity(AbonnementCreateDTO dto) {
|
||||||
if (dto == null) {
|
if (dto == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Abonnement abonnement = new Abonnement();
|
Abonnement abonnement = new Abonnement();
|
||||||
|
|
||||||
// Créer une EntrepriseProfile avec juste l'ID (le service chargera l'entité complète)
|
// Créer une EntrepriseProfile avec juste l'ID (le service chargera l'entité complète)
|
||||||
if (dto.getEntrepriseId() != null) {
|
if (dto.getEntrepriseId() != null) {
|
||||||
EntrepriseProfile entreprise = new EntrepriseProfile();
|
EntrepriseProfile entreprise = new EntrepriseProfile();
|
||||||
entreprise.setId(dto.getEntrepriseId());
|
entreprise.setId(dto.getEntrepriseId());
|
||||||
abonnement.setEntreprise(entreprise);
|
abonnement.setEntreprise(entreprise);
|
||||||
}
|
}
|
||||||
|
|
||||||
abonnement.setTypeAbonnement(dto.getTypeAbonnement());
|
abonnement.setTypeAbonnement(dto.getTypeAbonnement());
|
||||||
abonnement.setStatut(dto.getStatut() != null ? dto.getStatut() : dev.lions.btpxpress.domain.core.entity.StatutAbonnement.ACTIF);
|
abonnement.setStatut(dto.getStatut() != null ? dto.getStatut() : dev.lions.btpxpress.domain.core.entity.StatutAbonnement.ACTIF);
|
||||||
abonnement.setDateDebut(dto.getDateDebut());
|
abonnement.setDateDebut(dto.getDateDebut());
|
||||||
abonnement.setDateFin(dto.getDateFin());
|
abonnement.setDateFin(dto.getDateFin());
|
||||||
abonnement.setPrixPaye(dto.getPrixPaye());
|
abonnement.setPrixPaye(dto.getPrixPaye());
|
||||||
abonnement.setMethodePaiement(dto.getMethodePaiement());
|
abonnement.setMethodePaiement(dto.getMethodePaiement());
|
||||||
abonnement.setAutoRenouvellement(dto.getAutoRenouvellement() != null ? dto.getAutoRenouvellement() : true);
|
abonnement.setAutoRenouvellement(dto.getAutoRenouvellement() != null ? dto.getAutoRenouvellement() : true);
|
||||||
abonnement.setReferencePaiement(dto.getReferencePaiement());
|
abonnement.setReferencePaiement(dto.getReferencePaiement());
|
||||||
abonnement.setDateDerniereFacture(dto.getDateDerniereFacture());
|
abonnement.setDateDerniereFacture(dto.getDateDerniereFacture());
|
||||||
abonnement.setDateProchainPrelevement(dto.getDateProchainPrelevement());
|
abonnement.setDateProchainPrelevement(dto.getDateProchainPrelevement());
|
||||||
abonnement.setMisesEnRelationUtilisees(dto.getMisesEnRelationUtilisees() != null ? dto.getMisesEnRelationUtilisees() : 0);
|
abonnement.setMisesEnRelationUtilisees(dto.getMisesEnRelationUtilisees() != null ? dto.getMisesEnRelationUtilisees() : 0);
|
||||||
abonnement.setNotes(dto.getNotes());
|
abonnement.setNotes(dto.getNotes());
|
||||||
|
|
||||||
return abonnement;
|
return abonnement;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion entité vers ResponseDTO
|
* Conversion entité vers ResponseDTO
|
||||||
*/
|
*/
|
||||||
public AbonnementResponseDTO toResponseDTO(Abonnement abonnement) {
|
public AbonnementResponseDTO toResponseDTO(Abonnement abonnement) {
|
||||||
if (abonnement == null) {
|
if (abonnement == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
AbonnementResponseDTO dto = AbonnementResponseDTO.builder()
|
AbonnementResponseDTO dto = AbonnementResponseDTO.builder()
|
||||||
.id(abonnement.getId())
|
.id(abonnement.getId())
|
||||||
.typeAbonnement(abonnement.getTypeAbonnement())
|
.typeAbonnement(abonnement.getTypeAbonnement())
|
||||||
.statut(abonnement.getStatut())
|
.statut(abonnement.getStatut())
|
||||||
.dateDebut(abonnement.getDateDebut())
|
.dateDebut(abonnement.getDateDebut())
|
||||||
.dateFin(abonnement.getDateFin())
|
.dateFin(abonnement.getDateFin())
|
||||||
.prixPaye(abonnement.getPrixPaye())
|
.prixPaye(abonnement.getPrixPaye())
|
||||||
.methodePaiement(abonnement.getMethodePaiement())
|
.methodePaiement(abonnement.getMethodePaiement())
|
||||||
.autoRenouvellement(abonnement.isAutoRenouvellement())
|
.autoRenouvellement(abonnement.isAutoRenouvellement())
|
||||||
.referencePaiement(abonnement.getReferencePaiement())
|
.referencePaiement(abonnement.getReferencePaiement())
|
||||||
.dateDerniereFacture(abonnement.getDateDerniereFacture())
|
.dateDerniereFacture(abonnement.getDateDerniereFacture())
|
||||||
.dateProchainPrelevement(abonnement.getDateProchainPrelevement())
|
.dateProchainPrelevement(abonnement.getDateProchainPrelevement())
|
||||||
.misesEnRelationUtilisees(abonnement.getMisesEnRelationUtilisees())
|
.misesEnRelationUtilisees(abonnement.getMisesEnRelationUtilisees())
|
||||||
.dateCreation(abonnement.getDateCreation())
|
.dateCreation(abonnement.getDateCreation())
|
||||||
.dateModification(abonnement.getDateModification())
|
.dateModification(abonnement.getDateModification())
|
||||||
.notes(abonnement.getNotes())
|
.notes(abonnement.getNotes())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// Relations simplifiées
|
// Relations simplifiées
|
||||||
if (abonnement.getEntreprise() != null) {
|
if (abonnement.getEntreprise() != null) {
|
||||||
dto.setEntrepriseId(abonnement.getEntreprise().getId());
|
dto.setEntrepriseId(abonnement.getEntreprise().getId());
|
||||||
dto.setEntrepriseNomCommercial(abonnement.getEntreprise().getNomCommercial());
|
dto.setEntrepriseNomCommercial(abonnement.getEntreprise().getNomCommercial());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Métadonnées calculées
|
// Métadonnées calculées
|
||||||
dto.setEstActif(abonnement.estActif());
|
dto.setEstActif(abonnement.estActif());
|
||||||
dto.setEstExpire(abonnement.estExpire());
|
dto.setEstExpire(abonnement.estExpire());
|
||||||
dto.setBientotExpire(abonnement.bientotExpire());
|
dto.setBientotExpire(abonnement.bientotExpire());
|
||||||
dto.setJoursRestants(abonnement.joursRestants());
|
dto.setJoursRestants(abonnement.joursRestants());
|
||||||
dto.setLimiteMisesEnRelationAtteinte(abonnement.limiteMisesEnRelationAtteinte());
|
dto.setLimiteMisesEnRelationAtteinte(abonnement.limiteMisesEnRelationAtteinte());
|
||||||
|
|
||||||
return dto;
|
return dto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,146 +1,146 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.mapper;
|
package dev.lions.btpxpress.domain.shared.mapper;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.BonCommande;
|
import dev.lions.btpxpress.domain.core.entity.BonCommande;
|
||||||
import dev.lions.btpxpress.domain.shared.dto.BonCommandeCreateDTO;
|
import dev.lions.btpxpress.domain.shared.dto.BonCommandeCreateDTO;
|
||||||
import dev.lions.btpxpress.domain.shared.dto.BonCommandeResponseDTO;
|
import dev.lions.btpxpress.domain.shared.dto.BonCommandeResponseDTO;
|
||||||
import jakarta.enterprise.context.ApplicationScoped;
|
import jakarta.enterprise.context.ApplicationScoped;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapper pour les bons de commande - Architecture 2025
|
* Mapper pour les bons de commande - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@ApplicationScoped
|
@ApplicationScoped
|
||||||
public class BonCommandeMapper {
|
public class BonCommandeMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion DTO vers entité
|
* Conversion DTO vers entité
|
||||||
*/
|
*/
|
||||||
public BonCommande toEntity(BonCommandeCreateDTO dto) {
|
public BonCommande toEntity(BonCommandeCreateDTO dto) {
|
||||||
if (dto == null) {
|
if (dto == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
BonCommande bonCommande = new BonCommande();
|
BonCommande bonCommande = new BonCommande();
|
||||||
bonCommande.setNumero(dto.getNumero());
|
bonCommande.setNumero(dto.getNumero());
|
||||||
bonCommande.setNumeroInterne(dto.getNumeroInterne());
|
bonCommande.setNumeroInterne(dto.getNumeroInterne());
|
||||||
bonCommande.setObjet(dto.getObjet());
|
bonCommande.setObjet(dto.getObjet());
|
||||||
bonCommande.setDescription(dto.getDescription());
|
bonCommande.setDescription(dto.getDescription());
|
||||||
bonCommande.setPriorite(dto.getPriorite() != null ? dto.getPriorite() : dev.lions.btpxpress.domain.core.entity.PrioriteBonCommande.NORMALE);
|
bonCommande.setPriorite(dto.getPriorite() != null ? dto.getPriorite() : dev.lions.btpxpress.domain.core.entity.PrioriteBonCommande.NORMALE);
|
||||||
bonCommande.setTypeCommande(dto.getTypeCommande() != null ? dto.getTypeCommande() : dev.lions.btpxpress.domain.core.entity.TypeBonCommande.ACHAT);
|
bonCommande.setTypeCommande(dto.getTypeCommande() != null ? dto.getTypeCommande() : dev.lions.btpxpress.domain.core.entity.TypeBonCommande.ACHAT);
|
||||||
bonCommande.setDateCommande(dto.getDateCommande());
|
bonCommande.setDateCommande(dto.getDateCommande());
|
||||||
bonCommande.setDateBesoin(dto.getDateBesoin());
|
bonCommande.setDateBesoin(dto.getDateBesoin());
|
||||||
bonCommande.setDateLivraisonPrevue(dto.getDateLivraisonPrevue());
|
bonCommande.setDateLivraisonPrevue(dto.getDateLivraisonPrevue());
|
||||||
bonCommande.setMontantHT(dto.getMontantHT());
|
bonCommande.setMontantHT(dto.getMontantHT());
|
||||||
bonCommande.setRemisePourcentage(dto.getRemisePourcentage());
|
bonCommande.setRemisePourcentage(dto.getRemisePourcentage());
|
||||||
bonCommande.setRemiseMontant(dto.getRemiseMontant());
|
bonCommande.setRemiseMontant(dto.getRemiseMontant());
|
||||||
bonCommande.setFraisPort(dto.getFraisPort());
|
bonCommande.setFraisPort(dto.getFraisPort());
|
||||||
bonCommande.setAdresseLivraison(dto.getAdresseLivraison());
|
bonCommande.setAdresseLivraison(dto.getAdresseLivraison());
|
||||||
bonCommande.setAdresseFacturation(dto.getAdresseFacturation());
|
bonCommande.setAdresseFacturation(dto.getAdresseFacturation());
|
||||||
bonCommande.setContactFournisseur(dto.getContactFournisseur());
|
bonCommande.setContactFournisseur(dto.getContactFournisseur());
|
||||||
bonCommande.setEmailContact(dto.getEmailContact());
|
bonCommande.setEmailContact(dto.getEmailContact());
|
||||||
bonCommande.setTelephoneContact(dto.getTelephoneContact());
|
bonCommande.setTelephoneContact(dto.getTelephoneContact());
|
||||||
bonCommande.setReferenceFournisseur(dto.getReferenceFournisseur());
|
bonCommande.setReferenceFournisseur(dto.getReferenceFournisseur());
|
||||||
bonCommande.setNumeroDevis(dto.getNumeroDevis());
|
bonCommande.setNumeroDevis(dto.getNumeroDevis());
|
||||||
bonCommande.setLivraisonPartielleAutorisee(dto.getLivraisonPartielleAutorisee() != null ? dto.getLivraisonPartielleAutorisee() : true);
|
bonCommande.setLivraisonPartielleAutorisee(dto.getLivraisonPartielleAutorisee() != null ? dto.getLivraisonPartielleAutorisee() : true);
|
||||||
bonCommande.setControleReceptionRequis(dto.getControleReceptionRequis() != null ? dto.getControleReceptionRequis() : false);
|
bonCommande.setControleReceptionRequis(dto.getControleReceptionRequis() != null ? dto.getControleReceptionRequis() : false);
|
||||||
bonCommande.setUrgente(dto.getUrgente() != null ? dto.getUrgente() : false);
|
bonCommande.setUrgente(dto.getUrgente() != null ? dto.getUrgente() : false);
|
||||||
bonCommande.setConfidentielle(dto.getConfidentielle() != null ? dto.getConfidentielle() : false);
|
bonCommande.setConfidentielle(dto.getConfidentielle() != null ? dto.getConfidentielle() : false);
|
||||||
bonCommande.setCommentaires(dto.getCommentaires());
|
bonCommande.setCommentaires(dto.getCommentaires());
|
||||||
bonCommande.setNotesInternes(dto.getNotesInternes());
|
bonCommande.setNotesInternes(dto.getNotesInternes());
|
||||||
|
|
||||||
return bonCommande;
|
return bonCommande;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion entité vers ResponseDTO
|
* Conversion entité vers ResponseDTO
|
||||||
*/
|
*/
|
||||||
public BonCommandeResponseDTO toResponseDTO(BonCommande bonCommande) {
|
public BonCommandeResponseDTO toResponseDTO(BonCommande bonCommande) {
|
||||||
if (bonCommande == null) {
|
if (bonCommande == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
BonCommandeResponseDTO dto = BonCommandeResponseDTO.builder()
|
BonCommandeResponseDTO dto = BonCommandeResponseDTO.builder()
|
||||||
.id(bonCommande.getId())
|
.id(bonCommande.getId())
|
||||||
.numero(bonCommande.getNumero())
|
.numero(bonCommande.getNumero())
|
||||||
.numeroInterne(bonCommande.getNumeroInterne())
|
.numeroInterne(bonCommande.getNumeroInterne())
|
||||||
.objet(bonCommande.getObjet())
|
.objet(bonCommande.getObjet())
|
||||||
.description(bonCommande.getDescription())
|
.description(bonCommande.getDescription())
|
||||||
.statut(bonCommande.getStatut())
|
.statut(bonCommande.getStatut())
|
||||||
.priorite(bonCommande.getPriorite())
|
.priorite(bonCommande.getPriorite())
|
||||||
.typeCommande(bonCommande.getTypeCommande())
|
.typeCommande(bonCommande.getTypeCommande())
|
||||||
.dateCommande(bonCommande.getDateCommande())
|
.dateCommande(bonCommande.getDateCommande())
|
||||||
.dateBesoin(bonCommande.getDateBesoin())
|
.dateBesoin(bonCommande.getDateBesoin())
|
||||||
.dateLivraisonPrevue(bonCommande.getDateLivraisonPrevue())
|
.dateLivraisonPrevue(bonCommande.getDateLivraisonPrevue())
|
||||||
.dateLivraisonReelle(bonCommande.getDateLivraisonReelle())
|
.dateLivraisonReelle(bonCommande.getDateLivraisonReelle())
|
||||||
.dateValidation(bonCommande.getDateValidation())
|
.dateValidation(bonCommande.getDateValidation())
|
||||||
.dateEnvoi(bonCommande.getDateEnvoi())
|
.dateEnvoi(bonCommande.getDateEnvoi())
|
||||||
.dateAccuseReception(bonCommande.getDateAccuseReception())
|
.dateAccuseReception(bonCommande.getDateAccuseReception())
|
||||||
.montantHT(bonCommande.getMontantHT())
|
.montantHT(bonCommande.getMontantHT())
|
||||||
.montantTVA(bonCommande.getMontantTVA())
|
.montantTVA(bonCommande.getMontantTVA())
|
||||||
.montantTTC(bonCommande.getMontantTTC())
|
.montantTTC(bonCommande.getMontantTTC())
|
||||||
.remisePourcentage(bonCommande.getRemisePourcentage())
|
.remisePourcentage(bonCommande.getRemisePourcentage())
|
||||||
.remiseMontant(bonCommande.getRemiseMontant())
|
.remiseMontant(bonCommande.getRemiseMontant())
|
||||||
.fraisPort(bonCommande.getFraisPort())
|
.fraisPort(bonCommande.getFraisPort())
|
||||||
.autreFrais(bonCommande.getAutreFrais())
|
.autreFrais(bonCommande.getAutreFrais())
|
||||||
.adresseLivraison(bonCommande.getAdresseLivraison())
|
.adresseLivraison(bonCommande.getAdresseLivraison())
|
||||||
.adresseFacturation(bonCommande.getAdresseFacturation())
|
.adresseFacturation(bonCommande.getAdresseFacturation())
|
||||||
.contactFournisseur(bonCommande.getContactFournisseur())
|
.contactFournisseur(bonCommande.getContactFournisseur())
|
||||||
.emailContact(bonCommande.getEmailContact())
|
.emailContact(bonCommande.getEmailContact())
|
||||||
.telephoneContact(bonCommande.getTelephoneContact())
|
.telephoneContact(bonCommande.getTelephoneContact())
|
||||||
.referenceFournisseur(bonCommande.getReferenceFournisseur())
|
.referenceFournisseur(bonCommande.getReferenceFournisseur())
|
||||||
.numeroDevis(bonCommande.getNumeroDevis())
|
.numeroDevis(bonCommande.getNumeroDevis())
|
||||||
.referenceMarche(bonCommande.getReferenceMarche())
|
.referenceMarche(bonCommande.getReferenceMarche())
|
||||||
.livraisonPartielleAutorisee(bonCommande.getLivraisonPartielleAutorisee())
|
.livraisonPartielleAutorisee(bonCommande.getLivraisonPartielleAutorisee())
|
||||||
.controleReceptionRequis(bonCommande.getControleReceptionRequis())
|
.controleReceptionRequis(bonCommande.getControleReceptionRequis())
|
||||||
.urgente(bonCommande.getUrgente())
|
.urgente(bonCommande.getUrgente())
|
||||||
.confidentielle(bonCommande.getConfidentielle())
|
.confidentielle(bonCommande.getConfidentielle())
|
||||||
.factureRecue(bonCommande.getFactureRecue())
|
.factureRecue(bonCommande.getFactureRecue())
|
||||||
.dateReceptionFacture(bonCommande.getDateReceptionFacture())
|
.dateReceptionFacture(bonCommande.getDateReceptionFacture())
|
||||||
.numeroFacture(bonCommande.getNumeroFacture())
|
.numeroFacture(bonCommande.getNumeroFacture())
|
||||||
.commentaires(bonCommande.getCommentaires())
|
.commentaires(bonCommande.getCommentaires())
|
||||||
.notesInternes(bonCommande.getNotesInternes())
|
.notesInternes(bonCommande.getNotesInternes())
|
||||||
.conditionsParticulieres(bonCommande.getConditionsParticulieres())
|
.conditionsParticulieres(bonCommande.getConditionsParticulieres())
|
||||||
.motifAnnulation(bonCommande.getMotifAnnulation())
|
.motifAnnulation(bonCommande.getMotifAnnulation())
|
||||||
.dateCreation(bonCommande.getDateCreation())
|
.dateCreation(bonCommande.getDateCreation())
|
||||||
.dateModification(bonCommande.getDateModification())
|
.dateModification(bonCommande.getDateModification())
|
||||||
.creePar(bonCommande.getCreePar())
|
.creePar(bonCommande.getCreePar())
|
||||||
.modifiePar(bonCommande.getModifiePar())
|
.modifiePar(bonCommande.getModifiePar())
|
||||||
.validePar(bonCommande.getValidePar())
|
.validePar(bonCommande.getValidePar())
|
||||||
.envoyePar(bonCommande.getEnvoyePar())
|
.envoyePar(bonCommande.getEnvoyePar())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// Relations simplifiées
|
// Relations simplifiées
|
||||||
if (bonCommande.getFournisseur() != null) {
|
if (bonCommande.getFournisseur() != null) {
|
||||||
dto.setFournisseurId(bonCommande.getFournisseur().getId());
|
dto.setFournisseurId(bonCommande.getFournisseur().getId());
|
||||||
dto.setFournisseurNom(bonCommande.getFournisseur().getNom());
|
dto.setFournisseurNom(bonCommande.getFournisseur().getNom());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bonCommande.getChantier() != null) {
|
if (bonCommande.getChantier() != null) {
|
||||||
dto.setChantierId(bonCommande.getChantier().getId());
|
dto.setChantierId(bonCommande.getChantier().getId());
|
||||||
dto.setChantierNom(bonCommande.getChantier().getNom());
|
dto.setChantierNom(bonCommande.getChantier().getNom());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bonCommande.getDemandeur() != null) {
|
if (bonCommande.getDemandeur() != null) {
|
||||||
dto.setDemandeurId(bonCommande.getDemandeur().getId());
|
dto.setDemandeurId(bonCommande.getDemandeur().getId());
|
||||||
dto.setDemandeurNom(bonCommande.getDemandeur().getNomComplet());
|
dto.setDemandeurNom(bonCommande.getDemandeur().getNomComplet());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bonCommande.getValideur() != null) {
|
if (bonCommande.getValideur() != null) {
|
||||||
dto.setValideurId(bonCommande.getValideur().getId());
|
dto.setValideurId(bonCommande.getValideur().getId());
|
||||||
dto.setValideurNom(bonCommande.getValideur().getNomComplet());
|
dto.setValideurNom(bonCommande.getValideur().getNomComplet());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compter les lignes
|
// Compter les lignes
|
||||||
if (bonCommande.getLignes() != null) {
|
if (bonCommande.getLignes() != null) {
|
||||||
dto.setNombreLignes(bonCommande.getLignes().size());
|
dto.setNombreLignes(bonCommande.getLignes().size());
|
||||||
} else {
|
} else {
|
||||||
dto.setNombreLignes(0);
|
dto.setNombreLignes(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return dto;
|
return dto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,121 +1,121 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.mapper;
|
package dev.lions.btpxpress.domain.shared.mapper;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.*;
|
import dev.lions.btpxpress.domain.core.entity.*;
|
||||||
import dev.lions.btpxpress.domain.shared.dto.*;
|
import dev.lions.btpxpress.domain.shared.dto.*;
|
||||||
import jakarta.enterprise.context.ApplicationScoped;
|
import jakarta.enterprise.context.ApplicationScoped;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapper pour les budgets - Architecture 2025
|
* Mapper pour les budgets - Architecture 2025
|
||||||
* Suit le même pattern que ChantierMapper et ClientMapper
|
* Suit le même pattern que ChantierMapper et ClientMapper
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@ApplicationScoped
|
@ApplicationScoped
|
||||||
public class BudgetMapper {
|
public class BudgetMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion DTO vers entité
|
* Conversion DTO vers entité
|
||||||
*
|
*
|
||||||
* @param dto Le DTO de création
|
* @param dto Le DTO de création
|
||||||
* @param chantier Le chantier associé (chargé depuis le repository)
|
* @param chantier Le chantier associé (chargé depuis le repository)
|
||||||
* @return L'entité Budget créée
|
* @return L'entité Budget créée
|
||||||
*/
|
*/
|
||||||
public Budget toEntity(BudgetCreateDTO dto, Chantier chantier) {
|
public Budget toEntity(BudgetCreateDTO dto, Chantier chantier) {
|
||||||
if (dto == null) {
|
if (dto == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Budget budget = new Budget();
|
Budget budget = new Budget();
|
||||||
budget.setChantier(chantier);
|
budget.setChantier(chantier);
|
||||||
budget.setBudgetTotal(dto.getBudgetTotal());
|
budget.setBudgetTotal(dto.getBudgetTotal());
|
||||||
budget.setDepenseReelle(dto.getDepenseReelle() != null ? dto.getDepenseReelle() : java.math.BigDecimal.ZERO);
|
budget.setDepenseReelle(dto.getDepenseReelle() != null ? dto.getDepenseReelle() : java.math.BigDecimal.ZERO);
|
||||||
budget.setAvancementTravaux(dto.getAvancementTravaux());
|
budget.setAvancementTravaux(dto.getAvancementTravaux());
|
||||||
budget.setStatut(dto.getStatut());
|
budget.setStatut(dto.getStatut());
|
||||||
budget.setResponsable(dto.getResponsable());
|
budget.setResponsable(dto.getResponsable());
|
||||||
budget.setProchainJalon(dto.getProchainJalon());
|
budget.setProchainJalon(dto.getProchainJalon());
|
||||||
budget.setDateDerniereMiseAJour(dto.getDateDerniereMiseAJour());
|
budget.setDateDerniereMiseAJour(dto.getDateDerniereMiseAJour());
|
||||||
budget.setActif(true);
|
budget.setActif(true);
|
||||||
|
|
||||||
// Calculer l'écart (la méthode calculerEcart() sera appelée automatiquement par @PrePersist)
|
// Calculer l'écart (la méthode calculerEcart() sera appelée automatiquement par @PrePersist)
|
||||||
return budget;
|
return budget;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mise à jour d'entité depuis DTO
|
* Mise à jour d'entité depuis DTO
|
||||||
*
|
*
|
||||||
* @param budget L'entité à mettre à jour
|
* @param budget L'entité à mettre à jour
|
||||||
* @param dto Le DTO contenant les nouvelles valeurs
|
* @param dto Le DTO contenant les nouvelles valeurs
|
||||||
* @param chantier Le chantier associé (peut être null si non modifié)
|
* @param chantier Le chantier associé (peut être null si non modifié)
|
||||||
*/
|
*/
|
||||||
public void updateEntity(Budget budget, BudgetCreateDTO dto, Chantier chantier) {
|
public void updateEntity(Budget budget, BudgetCreateDTO dto, Chantier chantier) {
|
||||||
if (budget == null || dto == null) {
|
if (budget == null || dto == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dto.getBudgetTotal() != null) {
|
if (dto.getBudgetTotal() != null) {
|
||||||
budget.setBudgetTotal(dto.getBudgetTotal());
|
budget.setBudgetTotal(dto.getBudgetTotal());
|
||||||
}
|
}
|
||||||
if (dto.getDepenseReelle() != null) {
|
if (dto.getDepenseReelle() != null) {
|
||||||
budget.setDepenseReelle(dto.getDepenseReelle());
|
budget.setDepenseReelle(dto.getDepenseReelle());
|
||||||
}
|
}
|
||||||
if (dto.getAvancementTravaux() != null) {
|
if (dto.getAvancementTravaux() != null) {
|
||||||
budget.setAvancementTravaux(dto.getAvancementTravaux());
|
budget.setAvancementTravaux(dto.getAvancementTravaux());
|
||||||
}
|
}
|
||||||
if (dto.getStatut() != null) {
|
if (dto.getStatut() != null) {
|
||||||
budget.setStatut(dto.getStatut());
|
budget.setStatut(dto.getStatut());
|
||||||
}
|
}
|
||||||
if (dto.getResponsable() != null) {
|
if (dto.getResponsable() != null) {
|
||||||
budget.setResponsable(dto.getResponsable());
|
budget.setResponsable(dto.getResponsable());
|
||||||
}
|
}
|
||||||
if (dto.getProchainJalon() != null) {
|
if (dto.getProchainJalon() != null) {
|
||||||
budget.setProchainJalon(dto.getProchainJalon());
|
budget.setProchainJalon(dto.getProchainJalon());
|
||||||
}
|
}
|
||||||
if (dto.getDateDerniereMiseAJour() != null) {
|
if (dto.getDateDerniereMiseAJour() != null) {
|
||||||
budget.setDateDerniereMiseAJour(dto.getDateDerniereMiseAJour());
|
budget.setDateDerniereMiseAJour(dto.getDateDerniereMiseAJour());
|
||||||
}
|
}
|
||||||
if (chantier != null) {
|
if (chantier != null) {
|
||||||
budget.setChantier(chantier);
|
budget.setChantier(chantier);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion entité vers ResponseDTO
|
* Conversion entité vers ResponseDTO
|
||||||
*
|
*
|
||||||
* @param budget L'entité Budget
|
* @param budget L'entité Budget
|
||||||
* @return Le DTO de réponse
|
* @return Le DTO de réponse
|
||||||
*/
|
*/
|
||||||
public BudgetResponseDTO toResponseDTO(Budget budget) {
|
public BudgetResponseDTO toResponseDTO(Budget budget) {
|
||||||
if (budget == null) {
|
if (budget == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
BudgetResponseDTO dto = BudgetResponseDTO.builder()
|
BudgetResponseDTO dto = BudgetResponseDTO.builder()
|
||||||
.id(budget.getId())
|
.id(budget.getId())
|
||||||
.budgetTotal(budget.getBudgetTotal())
|
.budgetTotal(budget.getBudgetTotal())
|
||||||
.depenseReelle(budget.getDepenseReelle())
|
.depenseReelle(budget.getDepenseReelle())
|
||||||
.ecart(budget.getEcart())
|
.ecart(budget.getEcart())
|
||||||
.ecartPourcentage(budget.getEcartPourcentage())
|
.ecartPourcentage(budget.getEcartPourcentage())
|
||||||
.avancementTravaux(budget.getAvancementTravaux())
|
.avancementTravaux(budget.getAvancementTravaux())
|
||||||
.statut(budget.getStatut())
|
.statut(budget.getStatut())
|
||||||
.tendance(budget.getTendance())
|
.tendance(budget.getTendance())
|
||||||
.responsable(budget.getResponsable())
|
.responsable(budget.getResponsable())
|
||||||
.nombreAlertes(budget.getNombreAlertes())
|
.nombreAlertes(budget.getNombreAlertes())
|
||||||
.prochainJalon(budget.getProchainJalon())
|
.prochainJalon(budget.getProchainJalon())
|
||||||
.dateDerniereMiseAJour(budget.getDateDerniereMiseAJour())
|
.dateDerniereMiseAJour(budget.getDateDerniereMiseAJour())
|
||||||
.actif(budget.getActif())
|
.actif(budget.getActif())
|
||||||
.dateCreation(budget.getDateCreation())
|
.dateCreation(budget.getDateCreation())
|
||||||
.dateModification(budget.getDateModification())
|
.dateModification(budget.getDateModification())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// Relations simplifiées
|
// Relations simplifiées
|
||||||
if (budget.getChantier() != null) {
|
if (budget.getChantier() != null) {
|
||||||
dto.setChantierId(budget.getChantier().getId());
|
dto.setChantierId(budget.getChantier().getId());
|
||||||
dto.setChantierNom(budget.getChantier().getNom());
|
dto.setChantierNom(budget.getChantier().getNom());
|
||||||
}
|
}
|
||||||
|
|
||||||
return dto;
|
return dto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,193 +1,193 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.mapper;
|
package dev.lions.btpxpress.domain.shared.mapper;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.*;
|
import dev.lions.btpxpress.domain.core.entity.*;
|
||||||
import dev.lions.btpxpress.domain.shared.dto.*;
|
import dev.lions.btpxpress.domain.shared.dto.*;
|
||||||
import jakarta.enterprise.context.ApplicationScoped;
|
import jakarta.enterprise.context.ApplicationScoped;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapper pour les devis - Architecture 2025
|
* Mapper pour les devis - Architecture 2025
|
||||||
* Suit le même pattern que ChantierMapper et ClientMapper
|
* Suit le même pattern que ChantierMapper et ClientMapper
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@ApplicationScoped
|
@ApplicationScoped
|
||||||
public class DevisMapper {
|
public class DevisMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion DTO vers entité
|
* Conversion DTO vers entité
|
||||||
*
|
*
|
||||||
* @param dto Le DTO de création
|
* @param dto Le DTO de création
|
||||||
* @param client Le client associé (chargé depuis le repository)
|
* @param client Le client associé (chargé depuis le repository)
|
||||||
* @param chantier Le chantier associé (optionnel, peut être null)
|
* @param chantier Le chantier associé (optionnel, peut être null)
|
||||||
* @return L'entité Devis créée
|
* @return L'entité Devis créée
|
||||||
*/
|
*/
|
||||||
public Devis toEntity(DevisCreateDTO dto, Client client, Chantier chantier) {
|
public Devis toEntity(DevisCreateDTO dto, Client client, Chantier chantier) {
|
||||||
if (dto == null) {
|
if (dto == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Devis devis = new Devis();
|
Devis devis = new Devis();
|
||||||
devis.setNumero(dto.getNumero());
|
devis.setNumero(dto.getNumero());
|
||||||
devis.setObjet(dto.getObjet());
|
devis.setObjet(dto.getObjet());
|
||||||
devis.setDescription(dto.getDescription());
|
devis.setDescription(dto.getDescription());
|
||||||
devis.setDateEmission(dto.getDateEmission());
|
devis.setDateEmission(dto.getDateEmission());
|
||||||
devis.setDateValidite(dto.getDateValidite());
|
devis.setDateValidite(dto.getDateValidite());
|
||||||
devis.setStatut(dto.getStatut() != null ? dto.getStatut() : StatutDevis.BROUILLON);
|
devis.setStatut(dto.getStatut() != null ? dto.getStatut() : StatutDevis.BROUILLON);
|
||||||
devis.setMontantHT(dto.getMontantHT());
|
devis.setMontantHT(dto.getMontantHT());
|
||||||
devis.setTauxTVA(dto.getTauxTVA() != null ? dto.getTauxTVA() : BigDecimal.valueOf(20.0));
|
devis.setTauxTVA(dto.getTauxTVA() != null ? dto.getTauxTVA() : BigDecimal.valueOf(20.0));
|
||||||
devis.setConditionsPaiement(dto.getConditionsPaiement());
|
devis.setConditionsPaiement(dto.getConditionsPaiement());
|
||||||
devis.setDelaiExecution(dto.getDelaiExecution());
|
devis.setDelaiExecution(dto.getDelaiExecution());
|
||||||
devis.setActif(true);
|
devis.setActif(true);
|
||||||
devis.setClient(client);
|
devis.setClient(client);
|
||||||
devis.setChantier(chantier);
|
devis.setChantier(chantier);
|
||||||
|
|
||||||
// Créer les lignes de devis si présentes
|
// Créer les lignes de devis si présentes
|
||||||
if (dto.getLignes() != null && !dto.getLignes().isEmpty()) {
|
if (dto.getLignes() != null && !dto.getLignes().isEmpty()) {
|
||||||
List<LigneDevis> lignes = new ArrayList<>();
|
List<LigneDevis> lignes = new ArrayList<>();
|
||||||
int ordre = 1;
|
int ordre = 1;
|
||||||
for (DevisCreateDTO.LigneDevisCreateDTO ligneDTO : dto.getLignes()) {
|
for (DevisCreateDTO.LigneDevisCreateDTO ligneDTO : dto.getLignes()) {
|
||||||
LigneDevis ligne = new LigneDevis();
|
LigneDevis ligne = new LigneDevis();
|
||||||
ligne.setDesignation(ligneDTO.getDescription()); // designation = description dans le DTO
|
ligne.setDesignation(ligneDTO.getDescription()); // designation = description dans le DTO
|
||||||
ligne.setDescription(ligneDTO.getDescription()); // description optionnelle
|
ligne.setDescription(ligneDTO.getDescription()); // description optionnelle
|
||||||
ligne.setQuantite(ligneDTO.getQuantite());
|
ligne.setQuantite(ligneDTO.getQuantite());
|
||||||
ligne.setPrixUnitaire(ligneDTO.getPrixUnitaire());
|
ligne.setPrixUnitaire(ligneDTO.getPrixUnitaire());
|
||||||
ligne.setUnite(ligneDTO.getUnite() != null ? ligneDTO.getUnite() : "unité");
|
ligne.setUnite(ligneDTO.getUnite() != null ? ligneDTO.getUnite() : "unité");
|
||||||
ligne.setOrdre(ordre++);
|
ligne.setOrdre(ordre++);
|
||||||
ligne.setDevis(devis);
|
ligne.setDevis(devis);
|
||||||
lignes.add(ligne);
|
lignes.add(ligne);
|
||||||
}
|
}
|
||||||
devis.setLignes(lignes);
|
devis.setLignes(lignes);
|
||||||
}
|
}
|
||||||
|
|
||||||
return devis;
|
return devis;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mise à jour d'entité depuis DTO
|
* Mise à jour d'entité depuis DTO
|
||||||
*
|
*
|
||||||
* @param devis L'entité à mettre à jour
|
* @param devis L'entité à mettre à jour
|
||||||
* @param dto Le DTO contenant les nouvelles valeurs
|
* @param dto Le DTO contenant les nouvelles valeurs
|
||||||
* @param client Le client associé (peut être null si non modifié)
|
* @param client Le client associé (peut être null si non modifié)
|
||||||
* @param chantier Le chantier associé (peut être null si non modifié)
|
* @param chantier Le chantier associé (peut être null si non modifié)
|
||||||
*/
|
*/
|
||||||
public void updateEntity(Devis devis, DevisCreateDTO dto, Client client, Chantier chantier) {
|
public void updateEntity(Devis devis, DevisCreateDTO dto, Client client, Chantier chantier) {
|
||||||
if (devis == null || dto == null) {
|
if (devis == null || dto == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
devis.setNumero(dto.getNumero());
|
devis.setNumero(dto.getNumero());
|
||||||
devis.setObjet(dto.getObjet());
|
devis.setObjet(dto.getObjet());
|
||||||
devis.setDescription(dto.getDescription());
|
devis.setDescription(dto.getDescription());
|
||||||
devis.setDateEmission(dto.getDateEmission());
|
devis.setDateEmission(dto.getDateEmission());
|
||||||
devis.setDateValidite(dto.getDateValidite());
|
devis.setDateValidite(dto.getDateValidite());
|
||||||
if (dto.getStatut() != null) {
|
if (dto.getStatut() != null) {
|
||||||
devis.setStatut(dto.getStatut());
|
devis.setStatut(dto.getStatut());
|
||||||
}
|
}
|
||||||
devis.setMontantHT(dto.getMontantHT());
|
devis.setMontantHT(dto.getMontantHT());
|
||||||
if (dto.getTauxTVA() != null) {
|
if (dto.getTauxTVA() != null) {
|
||||||
devis.setTauxTVA(dto.getTauxTVA());
|
devis.setTauxTVA(dto.getTauxTVA());
|
||||||
}
|
}
|
||||||
devis.setConditionsPaiement(dto.getConditionsPaiement());
|
devis.setConditionsPaiement(dto.getConditionsPaiement());
|
||||||
devis.setDelaiExecution(dto.getDelaiExecution());
|
devis.setDelaiExecution(dto.getDelaiExecution());
|
||||||
if (client != null) {
|
if (client != null) {
|
||||||
devis.setClient(client);
|
devis.setClient(client);
|
||||||
}
|
}
|
||||||
if (chantier != null) {
|
if (chantier != null) {
|
||||||
devis.setChantier(chantier);
|
devis.setChantier(chantier);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion entité vers ResponseDTO
|
* Conversion entité vers ResponseDTO
|
||||||
*
|
*
|
||||||
* @param devis L'entité Devis
|
* @param devis L'entité Devis
|
||||||
* @return Le DTO de réponse
|
* @return Le DTO de réponse
|
||||||
*/
|
*/
|
||||||
public DevisResponseDTO toResponseDTO(Devis devis) {
|
public DevisResponseDTO toResponseDTO(Devis devis) {
|
||||||
if (devis == null) {
|
if (devis == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
DevisResponseDTO dto = DevisResponseDTO.builder()
|
DevisResponseDTO dto = DevisResponseDTO.builder()
|
||||||
.id(devis.getId())
|
.id(devis.getId())
|
||||||
.numero(devis.getNumero())
|
.numero(devis.getNumero())
|
||||||
.objet(devis.getObjet())
|
.objet(devis.getObjet())
|
||||||
.description(devis.getDescription())
|
.description(devis.getDescription())
|
||||||
.dateEmission(devis.getDateEmission())
|
.dateEmission(devis.getDateEmission())
|
||||||
.dateValidite(devis.getDateValidite())
|
.dateValidite(devis.getDateValidite())
|
||||||
.statut(devis.getStatut())
|
.statut(devis.getStatut())
|
||||||
.montantHT(devis.getMontantHT())
|
.montantHT(devis.getMontantHT())
|
||||||
.tauxTVA(devis.getTauxTVA())
|
.tauxTVA(devis.getTauxTVA())
|
||||||
.montantTVA(devis.getMontantTVA())
|
.montantTVA(devis.getMontantTVA())
|
||||||
.montantTTC(devis.getMontantTTC())
|
.montantTTC(devis.getMontantTTC())
|
||||||
.conditionsPaiement(devis.getConditionsPaiement())
|
.conditionsPaiement(devis.getConditionsPaiement())
|
||||||
.delaiExecution(devis.getDelaiExecution())
|
.delaiExecution(devis.getDelaiExecution())
|
||||||
.actif(devis.getActif())
|
.actif(devis.getActif())
|
||||||
.dateCreation(devis.getDateCreation())
|
.dateCreation(devis.getDateCreation())
|
||||||
.dateModification(devis.getDateModification())
|
.dateModification(devis.getDateModification())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// Relations simplifiées
|
// Relations simplifiées
|
||||||
if (devis.getClient() != null) {
|
if (devis.getClient() != null) {
|
||||||
dto.setClientId(devis.getClient().getId());
|
dto.setClientId(devis.getClient().getId());
|
||||||
dto.setClientNom(devis.getClient().getNomComplet());
|
dto.setClientNom(devis.getClient().getNomComplet());
|
||||||
dto.setClientRaisonSociale(devis.getClient().getEntreprise());
|
dto.setClientRaisonSociale(devis.getClient().getEntreprise());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (devis.getChantier() != null) {
|
if (devis.getChantier() != null) {
|
||||||
dto.setChantierId(devis.getChantier().getId());
|
dto.setChantierId(devis.getChantier().getId());
|
||||||
dto.setChantierNom(devis.getChantier().getNom());
|
dto.setChantierNom(devis.getChantier().getNom());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convertir les lignes
|
// Convertir les lignes
|
||||||
if (devis.getLignes() != null && !devis.getLignes().isEmpty()) {
|
if (devis.getLignes() != null && !devis.getLignes().isEmpty()) {
|
||||||
List<DevisResponseDTO.LigneDevisResponseDTO> lignesDTO = devis.getLignes().stream()
|
List<DevisResponseDTO.LigneDevisResponseDTO> lignesDTO = devis.getLignes().stream()
|
||||||
.map(this::toLigneResponseDTO)
|
.map(this::toLigneResponseDTO)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
dto.setLignes(lignesDTO);
|
dto.setLignes(lignesDTO);
|
||||||
}
|
}
|
||||||
|
|
||||||
return dto;
|
return dto;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion d'une ligne de devis vers ResponseDTO
|
* Conversion d'une ligne de devis vers ResponseDTO
|
||||||
*/
|
*/
|
||||||
private DevisResponseDTO.LigneDevisResponseDTO toLigneResponseDTO(LigneDevis ligne) {
|
private DevisResponseDTO.LigneDevisResponseDTO toLigneResponseDTO(LigneDevis ligne) {
|
||||||
if (ligne == null) {
|
if (ligne == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculer les montants HT, TVA, TTC à partir du montantLigne et du tauxTVA du devis
|
// Calculer les montants HT, TVA, TTC à partir du montantLigne et du tauxTVA du devis
|
||||||
BigDecimal montantHT = ligne.getMontantLigne();
|
BigDecimal montantHT = ligne.getMontantLigne();
|
||||||
BigDecimal tauxTVA = ligne.getDevis() != null && ligne.getDevis().getTauxTVA() != null
|
BigDecimal tauxTVA = ligne.getDevis() != null && ligne.getDevis().getTauxTVA() != null
|
||||||
? ligne.getDevis().getTauxTVA()
|
? ligne.getDevis().getTauxTVA()
|
||||||
: BigDecimal.valueOf(20.0);
|
: BigDecimal.valueOf(20.0);
|
||||||
BigDecimal montantTVA = montantHT != null
|
BigDecimal montantTVA = montantHT != null
|
||||||
? montantHT.multiply(tauxTVA).divide(BigDecimal.valueOf(100), 2, java.math.RoundingMode.HALF_UP)
|
? montantHT.multiply(tauxTVA).divide(BigDecimal.valueOf(100), 2, java.math.RoundingMode.HALF_UP)
|
||||||
: null;
|
: null;
|
||||||
BigDecimal montantTTC = montantHT != null && montantTVA != null
|
BigDecimal montantTTC = montantHT != null && montantTVA != null
|
||||||
? montantHT.add(montantTVA)
|
? montantHT.add(montantTVA)
|
||||||
: montantHT;
|
: montantHT;
|
||||||
|
|
||||||
return DevisResponseDTO.LigneDevisResponseDTO.builder()
|
return DevisResponseDTO.LigneDevisResponseDTO.builder()
|
||||||
.id(ligne.getId())
|
.id(ligne.getId())
|
||||||
.description(ligne.getDesignation() != null ? ligne.getDesignation() : ligne.getDescription())
|
.description(ligne.getDesignation() != null ? ligne.getDesignation() : ligne.getDescription())
|
||||||
.quantite(ligne.getQuantite())
|
.quantite(ligne.getQuantite())
|
||||||
.prixUnitaire(ligne.getPrixUnitaire())
|
.prixUnitaire(ligne.getPrixUnitaire())
|
||||||
.tauxTVA(tauxTVA)
|
.tauxTVA(tauxTVA)
|
||||||
.montantHT(montantHT)
|
.montantHT(montantHT)
|
||||||
.montantTVA(montantTVA)
|
.montantTVA(montantTVA)
|
||||||
.montantTTC(montantTTC)
|
.montantTTC(montantTTC)
|
||||||
.unite(ligne.getUnite())
|
.unite(ligne.getUnite())
|
||||||
.ordre(ligne.getOrdre())
|
.ordre(ligne.getOrdre())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,70 +1,70 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.mapper;
|
package dev.lions.btpxpress.domain.shared.mapper;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.Disponibilite;
|
import dev.lions.btpxpress.domain.core.entity.Disponibilite;
|
||||||
import dev.lions.btpxpress.domain.shared.dto.DisponibiliteCreateDTO;
|
import dev.lions.btpxpress.domain.shared.dto.DisponibiliteCreateDTO;
|
||||||
import dev.lions.btpxpress.domain.shared.dto.DisponibiliteResponseDTO;
|
import dev.lions.btpxpress.domain.shared.dto.DisponibiliteResponseDTO;
|
||||||
import jakarta.enterprise.context.ApplicationScoped;
|
import jakarta.enterprise.context.ApplicationScoped;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapper pour les disponibilités - Architecture 2025
|
* Mapper pour les disponibilités - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@ApplicationScoped
|
@ApplicationScoped
|
||||||
public class DisponibiliteMapper {
|
public class DisponibiliteMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion DTO vers entité
|
* Conversion DTO vers entité
|
||||||
*/
|
*/
|
||||||
public Disponibilite toEntity(DisponibiliteCreateDTO dto) {
|
public Disponibilite toEntity(DisponibiliteCreateDTO dto) {
|
||||||
if (dto == null) {
|
if (dto == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Disponibilite disponibilite = Disponibilite.builder()
|
Disponibilite disponibilite = Disponibilite.builder()
|
||||||
.dateDebut(dto.getDateDebut())
|
.dateDebut(dto.getDateDebut())
|
||||||
.dateFin(dto.getDateFin())
|
.dateFin(dto.getDateFin())
|
||||||
.type(dto.getType())
|
.type(dto.getType())
|
||||||
.motif(dto.getMotif())
|
.motif(dto.getMotif())
|
||||||
.approuvee(dto.getApprouvee() != null ? dto.getApprouvee() : false)
|
.approuvee(dto.getApprouvee() != null ? dto.getApprouvee() : false)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
return disponibilite;
|
return disponibilite;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion entité vers ResponseDTO
|
* Conversion entité vers ResponseDTO
|
||||||
*/
|
*/
|
||||||
public DisponibiliteResponseDTO toResponseDTO(Disponibilite disponibilite) {
|
public DisponibiliteResponseDTO toResponseDTO(Disponibilite disponibilite) {
|
||||||
if (disponibilite == null) {
|
if (disponibilite == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
DisponibiliteResponseDTO dto = DisponibiliteResponseDTO.builder()
|
DisponibiliteResponseDTO dto = DisponibiliteResponseDTO.builder()
|
||||||
.id(disponibilite.getId())
|
.id(disponibilite.getId())
|
||||||
.dateDebut(disponibilite.getDateDebut())
|
.dateDebut(disponibilite.getDateDebut())
|
||||||
.dateFin(disponibilite.getDateFin())
|
.dateFin(disponibilite.getDateFin())
|
||||||
.type(disponibilite.getType())
|
.type(disponibilite.getType())
|
||||||
.motif(disponibilite.getMotif())
|
.motif(disponibilite.getMotif())
|
||||||
.approuvee(disponibilite.getApprouvee())
|
.approuvee(disponibilite.getApprouvee())
|
||||||
.dateCreation(disponibilite.getDateCreation())
|
.dateCreation(disponibilite.getDateCreation())
|
||||||
.dateModification(disponibilite.getDateModification())
|
.dateModification(disponibilite.getDateModification())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// Relations simplifiées
|
// Relations simplifiées
|
||||||
if (disponibilite.getEmploye() != null) {
|
if (disponibilite.getEmploye() != null) {
|
||||||
dto.setEmployeId(disponibilite.getEmploye().getId());
|
dto.setEmployeId(disponibilite.getEmploye().getId());
|
||||||
dto.setEmployeNom(disponibilite.getEmploye().getNom());
|
dto.setEmployeNom(disponibilite.getEmploye().getNom());
|
||||||
dto.setEmployePrenom(disponibilite.getEmploye().getPrenom());
|
dto.setEmployePrenom(disponibilite.getEmploye().getPrenom());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Métadonnées calculées
|
// Métadonnées calculées
|
||||||
dto.setDureeEnHeures(disponibilite.getDureeEnHeures());
|
dto.setDureeEnHeures(disponibilite.getDureeEnHeures());
|
||||||
dto.setActive(disponibilite.isActive());
|
dto.setActive(disponibilite.isActive());
|
||||||
|
|
||||||
return dto;
|
return dto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,107 +1,107 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.mapper;
|
package dev.lions.btpxpress.domain.shared.mapper;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.Document;
|
import dev.lions.btpxpress.domain.core.entity.Document;
|
||||||
import dev.lions.btpxpress.domain.shared.dto.DocumentCreateDTO;
|
import dev.lions.btpxpress.domain.shared.dto.DocumentCreateDTO;
|
||||||
import dev.lions.btpxpress.domain.shared.dto.DocumentResponseDTO;
|
import dev.lions.btpxpress.domain.shared.dto.DocumentResponseDTO;
|
||||||
import jakarta.enterprise.context.ApplicationScoped;
|
import jakarta.enterprise.context.ApplicationScoped;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapper pour les documents - Architecture 2025
|
* Mapper pour les documents - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@ApplicationScoped
|
@ApplicationScoped
|
||||||
public class DocumentMapper {
|
public class DocumentMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion DTO vers entité
|
* Conversion DTO vers entité
|
||||||
*/
|
*/
|
||||||
public Document toEntity(DocumentCreateDTO dto) {
|
public Document toEntity(DocumentCreateDTO dto) {
|
||||||
if (dto == null) {
|
if (dto == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Document document = Document.builder()
|
Document document = Document.builder()
|
||||||
.nom(dto.getNom())
|
.nom(dto.getNom())
|
||||||
.description(dto.getDescription())
|
.description(dto.getDescription())
|
||||||
.nomFichier(dto.getNomFichier())
|
.nomFichier(dto.getNomFichier())
|
||||||
.cheminFichier(dto.getCheminFichier())
|
.cheminFichier(dto.getCheminFichier())
|
||||||
.typeMime(dto.getTypeMime())
|
.typeMime(dto.getTypeMime())
|
||||||
.tailleFichier(dto.getTailleFichier())
|
.tailleFichier(dto.getTailleFichier())
|
||||||
.typeDocument(dto.getTypeDocument())
|
.typeDocument(dto.getTypeDocument())
|
||||||
.tags(dto.getTags())
|
.tags(dto.getTags())
|
||||||
.estPublic(dto.getEstPublic() != null ? dto.getEstPublic() : false)
|
.estPublic(dto.getEstPublic() != null ? dto.getEstPublic() : false)
|
||||||
.actif(dto.getActif() != null ? dto.getActif() : true)
|
.actif(dto.getActif() != null ? dto.getActif() : true)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
return document;
|
return document;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion entité vers ResponseDTO
|
* Conversion entité vers ResponseDTO
|
||||||
*/
|
*/
|
||||||
public DocumentResponseDTO toResponseDTO(Document document) {
|
public DocumentResponseDTO toResponseDTO(Document document) {
|
||||||
if (document == null) {
|
if (document == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
DocumentResponseDTO dto = DocumentResponseDTO.builder()
|
DocumentResponseDTO dto = DocumentResponseDTO.builder()
|
||||||
.id(document.getId())
|
.id(document.getId())
|
||||||
.nom(document.getNom())
|
.nom(document.getNom())
|
||||||
.description(document.getDescription())
|
.description(document.getDescription())
|
||||||
.nomFichier(document.getNomFichier())
|
.nomFichier(document.getNomFichier())
|
||||||
.cheminFichier(document.getCheminFichier())
|
.cheminFichier(document.getCheminFichier())
|
||||||
.typeMime(document.getTypeMime())
|
.typeMime(document.getTypeMime())
|
||||||
.tailleFichier(document.getTailleFichier())
|
.tailleFichier(document.getTailleFichier())
|
||||||
.typeDocument(document.getTypeDocument())
|
.typeDocument(document.getTypeDocument())
|
||||||
.tags(document.getTags())
|
.tags(document.getTags())
|
||||||
.estPublic(document.getEstPublic())
|
.estPublic(document.getEstPublic())
|
||||||
.actif(document.getActif())
|
.actif(document.getActif())
|
||||||
.dateCreation(document.getDateCreation())
|
.dateCreation(document.getDateCreation())
|
||||||
.dateModification(document.getDateModification())
|
.dateModification(document.getDateModification())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// Relations simplifiées
|
// Relations simplifiées
|
||||||
if (document.getChantier() != null) {
|
if (document.getChantier() != null) {
|
||||||
dto.setChantierId(document.getChantier().getId());
|
dto.setChantierId(document.getChantier().getId());
|
||||||
dto.setChantierNom(document.getChantier().getNom());
|
dto.setChantierNom(document.getChantier().getNom());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (document.getMateriel() != null) {
|
if (document.getMateriel() != null) {
|
||||||
dto.setMaterielId(document.getMateriel().getId());
|
dto.setMaterielId(document.getMateriel().getId());
|
||||||
dto.setMaterielNom(document.getMateriel().getNom());
|
dto.setMaterielNom(document.getMateriel().getNom());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (document.getEmploye() != null) {
|
if (document.getEmploye() != null) {
|
||||||
dto.setEmployeId(document.getEmploye().getId());
|
dto.setEmployeId(document.getEmploye().getId());
|
||||||
dto.setEmployeNom(document.getEmploye().getNom());
|
dto.setEmployeNom(document.getEmploye().getNom());
|
||||||
dto.setEmployePrenom(document.getEmploye().getPrenom());
|
dto.setEmployePrenom(document.getEmploye().getPrenom());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (document.getEquipe() != null) {
|
if (document.getEquipe() != null) {
|
||||||
dto.setEquipeId(document.getEquipe().getId());
|
dto.setEquipeId(document.getEquipe().getId());
|
||||||
dto.setEquipeNom(document.getEquipe().getNom());
|
dto.setEquipeNom(document.getEquipe().getNom());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (document.getClient() != null) {
|
if (document.getClient() != null) {
|
||||||
dto.setClientId(document.getClient().getId());
|
dto.setClientId(document.getClient().getId());
|
||||||
dto.setClientNom(document.getClient().getNom());
|
dto.setClientNom(document.getClient().getNom());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (document.getCreePar() != null) {
|
if (document.getCreePar() != null) {
|
||||||
dto.setCreeParId(document.getCreePar().getId());
|
dto.setCreeParId(document.getCreePar().getId());
|
||||||
dto.setCreeParNom(document.getCreePar().getEmail());
|
dto.setCreeParNom(document.getCreePar().getEmail());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Métadonnées calculées
|
// Métadonnées calculées
|
||||||
dto.setExtension(document.getExtension());
|
dto.setExtension(document.getExtension());
|
||||||
dto.setTailleFormatee(document.getTailleFormatee());
|
dto.setTailleFormatee(document.getTailleFormatee());
|
||||||
dto.setIsImage(document.isImage());
|
dto.setIsImage(document.isImage());
|
||||||
dto.setIsPdf(document.isPdf());
|
dto.setIsPdf(document.isPdf());
|
||||||
|
|
||||||
return dto;
|
return dto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,127 +1,127 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.mapper;
|
package dev.lions.btpxpress.domain.shared.mapper;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.*;
|
import dev.lions.btpxpress.domain.core.entity.*;
|
||||||
import dev.lions.btpxpress.domain.shared.dto.*;
|
import dev.lions.btpxpress.domain.shared.dto.*;
|
||||||
import jakarta.enterprise.context.ApplicationScoped;
|
import jakarta.enterprise.context.ApplicationScoped;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapper pour les employés - Architecture 2025
|
* Mapper pour les employés - Architecture 2025
|
||||||
* Suit le même pattern que ChantierMapper et ClientMapper
|
* Suit le même pattern que ChantierMapper et ClientMapper
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@ApplicationScoped
|
@ApplicationScoped
|
||||||
public class EmployeMapper {
|
public class EmployeMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion DTO vers entité
|
* Conversion DTO vers entité
|
||||||
*
|
*
|
||||||
* @param dto Le DTO de création
|
* @param dto Le DTO de création
|
||||||
* @param equipe L'équipe associée (optionnel, peut être null)
|
* @param equipe L'équipe associée (optionnel, peut être null)
|
||||||
* @return L'entité Employe créée
|
* @return L'entité Employe créée
|
||||||
*/
|
*/
|
||||||
public Employe toEntity(EmployeCreateDTO dto, Equipe equipe) {
|
public Employe toEntity(EmployeCreateDTO dto, Equipe equipe) {
|
||||||
if (dto == null) {
|
if (dto == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Employe employe = new Employe();
|
Employe employe = new Employe();
|
||||||
employe.setNom(dto.getNom());
|
employe.setNom(dto.getNom());
|
||||||
employe.setPrenom(dto.getPrenom());
|
employe.setPrenom(dto.getPrenom());
|
||||||
employe.setEmail(dto.getEmail());
|
employe.setEmail(dto.getEmail());
|
||||||
employe.setTelephone(dto.getTelephone());
|
employe.setTelephone(dto.getTelephone());
|
||||||
employe.setPoste(dto.getPoste());
|
employe.setPoste(dto.getPoste());
|
||||||
employe.setFonction(dto.getFonction());
|
employe.setFonction(dto.getFonction());
|
||||||
employe.setSpecialites(dto.getSpecialites());
|
employe.setSpecialites(dto.getSpecialites());
|
||||||
employe.setTauxHoraire(dto.getTauxHoraire());
|
employe.setTauxHoraire(dto.getTauxHoraire());
|
||||||
employe.setDateEmbauche(dto.getDateEmbauche());
|
employe.setDateEmbauche(dto.getDateEmbauche());
|
||||||
employe.setStatut(dto.getStatut() != null ? dto.getStatut() : StatutEmploye.ACTIF);
|
employe.setStatut(dto.getStatut() != null ? dto.getStatut() : StatutEmploye.ACTIF);
|
||||||
employe.setActif(true);
|
employe.setActif(true);
|
||||||
employe.setEquipe(equipe);
|
employe.setEquipe(equipe);
|
||||||
|
|
||||||
return employe;
|
return employe;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mise à jour d'entité depuis DTO
|
* Mise à jour d'entité depuis DTO
|
||||||
*
|
*
|
||||||
* @param employe L'entité à mettre à jour
|
* @param employe L'entité à mettre à jour
|
||||||
* @param dto Le DTO contenant les nouvelles valeurs
|
* @param dto Le DTO contenant les nouvelles valeurs
|
||||||
* @param equipe L'équipe associée (peut être null si non modifiée)
|
* @param equipe L'équipe associée (peut être null si non modifiée)
|
||||||
*/
|
*/
|
||||||
public void updateEntity(Employe employe, EmployeCreateDTO dto, Equipe equipe) {
|
public void updateEntity(Employe employe, EmployeCreateDTO dto, Equipe equipe) {
|
||||||
if (employe == null || dto == null) {
|
if (employe == null || dto == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
employe.setNom(dto.getNom());
|
employe.setNom(dto.getNom());
|
||||||
employe.setPrenom(dto.getPrenom());
|
employe.setPrenom(dto.getPrenom());
|
||||||
employe.setEmail(dto.getEmail());
|
employe.setEmail(dto.getEmail());
|
||||||
employe.setTelephone(dto.getTelephone());
|
employe.setTelephone(dto.getTelephone());
|
||||||
employe.setPoste(dto.getPoste());
|
employe.setPoste(dto.getPoste());
|
||||||
employe.setFonction(dto.getFonction());
|
employe.setFonction(dto.getFonction());
|
||||||
employe.setSpecialites(dto.getSpecialites());
|
employe.setSpecialites(dto.getSpecialites());
|
||||||
employe.setTauxHoraire(dto.getTauxHoraire());
|
employe.setTauxHoraire(dto.getTauxHoraire());
|
||||||
employe.setDateEmbauche(dto.getDateEmbauche());
|
employe.setDateEmbauche(dto.getDateEmbauche());
|
||||||
if (dto.getStatut() != null) {
|
if (dto.getStatut() != null) {
|
||||||
employe.setStatut(dto.getStatut());
|
employe.setStatut(dto.getStatut());
|
||||||
}
|
}
|
||||||
if (equipe != null) {
|
if (equipe != null) {
|
||||||
employe.setEquipe(equipe);
|
employe.setEquipe(equipe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion entité vers ResponseDTO
|
* Conversion entité vers ResponseDTO
|
||||||
*
|
*
|
||||||
* @param employe L'entité Employe
|
* @param employe L'entité Employe
|
||||||
* @return Le DTO de réponse
|
* @return Le DTO de réponse
|
||||||
*/
|
*/
|
||||||
public EmployeResponseDTO toResponseDTO(Employe employe) {
|
public EmployeResponseDTO toResponseDTO(Employe employe) {
|
||||||
if (employe == null) {
|
if (employe == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
EmployeResponseDTO dto = EmployeResponseDTO.builder()
|
EmployeResponseDTO dto = EmployeResponseDTO.builder()
|
||||||
.id(employe.getId())
|
.id(employe.getId())
|
||||||
.nom(employe.getNom())
|
.nom(employe.getNom())
|
||||||
.prenom(employe.getPrenom())
|
.prenom(employe.getPrenom())
|
||||||
.nomComplet(employe.getNomComplet())
|
.nomComplet(employe.getNomComplet())
|
||||||
.email(employe.getEmail())
|
.email(employe.getEmail())
|
||||||
.telephone(employe.getTelephone())
|
.telephone(employe.getTelephone())
|
||||||
.poste(employe.getPoste())
|
.poste(employe.getPoste())
|
||||||
.fonction(employe.getFonction())
|
.fonction(employe.getFonction())
|
||||||
.specialites(employe.getSpecialites())
|
.specialites(employe.getSpecialites())
|
||||||
.tauxHoraire(employe.getTauxHoraire())
|
.tauxHoraire(employe.getTauxHoraire())
|
||||||
.dateEmbauche(employe.getDateEmbauche())
|
.dateEmbauche(employe.getDateEmbauche())
|
||||||
.statut(employe.getStatut())
|
.statut(employe.getStatut())
|
||||||
.actif(employe.getActif())
|
.actif(employe.getActif())
|
||||||
.dateCreation(employe.getDateCreation())
|
.dateCreation(employe.getDateCreation())
|
||||||
.dateModification(employe.getDateModification())
|
.dateModification(employe.getDateModification())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// Relations simplifiées
|
// Relations simplifiées
|
||||||
if (employe.getEquipe() != null) {
|
if (employe.getEquipe() != null) {
|
||||||
dto.setEquipeId(employe.getEquipe().getId());
|
dto.setEquipeId(employe.getEquipe().getId());
|
||||||
dto.setEquipeNom(employe.getEquipe().getNom());
|
dto.setEquipeNom(employe.getEquipe().getNom());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compter les disponibilités et compétences
|
// Compter les disponibilités et compétences
|
||||||
if (employe.getDisponibilites() != null) {
|
if (employe.getDisponibilites() != null) {
|
||||||
dto.setNombreDisponibilites(employe.getDisponibilites().size());
|
dto.setNombreDisponibilites(employe.getDisponibilites().size());
|
||||||
} else {
|
} else {
|
||||||
dto.setNombreDisponibilites(0);
|
dto.setNombreDisponibilites(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (employe.getCompetences() != null) {
|
if (employe.getCompetences() != null) {
|
||||||
dto.setNombreCompetences(employe.getCompetences().size());
|
dto.setNombreCompetences(employe.getCompetences().size());
|
||||||
} else {
|
} else {
|
||||||
dto.setNombreCompetences(0);
|
dto.setNombreCompetences(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return dto;
|
return dto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,134 +1,134 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.mapper;
|
package dev.lions.btpxpress.domain.shared.mapper;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.EntrepriseProfile;
|
import dev.lions.btpxpress.domain.core.entity.EntrepriseProfile;
|
||||||
import dev.lions.btpxpress.domain.core.entity.User;
|
import dev.lions.btpxpress.domain.core.entity.User;
|
||||||
import dev.lions.btpxpress.domain.shared.dto.EntrepriseProfileCreateDTO;
|
import dev.lions.btpxpress.domain.shared.dto.EntrepriseProfileCreateDTO;
|
||||||
import dev.lions.btpxpress.domain.shared.dto.EntrepriseProfileResponseDTO;
|
import dev.lions.btpxpress.domain.shared.dto.EntrepriseProfileResponseDTO;
|
||||||
import jakarta.enterprise.context.ApplicationScoped;
|
import jakarta.enterprise.context.ApplicationScoped;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapper pour les profils d'entreprise - Architecture 2025
|
* Mapper pour les profils d'entreprise - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@ApplicationScoped
|
@ApplicationScoped
|
||||||
public class EntrepriseProfileMapper {
|
public class EntrepriseProfileMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion DTO vers entité
|
* Conversion DTO vers entité
|
||||||
*/
|
*/
|
||||||
public EntrepriseProfile toEntity(EntrepriseProfileCreateDTO dto) {
|
public EntrepriseProfile toEntity(EntrepriseProfileCreateDTO dto) {
|
||||||
if (dto == null) {
|
if (dto == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
EntrepriseProfile profile = new EntrepriseProfile();
|
EntrepriseProfile profile = new EntrepriseProfile();
|
||||||
|
|
||||||
// Créer un User avec juste l'ID (le service chargera l'entité complète)
|
// Créer un User avec juste l'ID (le service chargera l'entité complète)
|
||||||
if (dto.getProprietaireId() != null) {
|
if (dto.getProprietaireId() != null) {
|
||||||
User proprietaire = new User();
|
User proprietaire = new User();
|
||||||
proprietaire.setId(dto.getProprietaireId());
|
proprietaire.setId(dto.getProprietaireId());
|
||||||
profile.setProprietaire(proprietaire);
|
profile.setProprietaire(proprietaire);
|
||||||
}
|
}
|
||||||
|
|
||||||
profile.setNomCommercial(dto.getNomCommercial());
|
profile.setNomCommercial(dto.getNomCommercial());
|
||||||
profile.setDescription(dto.getDescription());
|
profile.setDescription(dto.getDescription());
|
||||||
profile.setSlogan(dto.getSlogan());
|
profile.setSlogan(dto.getSlogan());
|
||||||
profile.setSpecialites(dto.getSpecialites());
|
profile.setSpecialites(dto.getSpecialites());
|
||||||
profile.setCertifications(dto.getCertifications());
|
profile.setCertifications(dto.getCertifications());
|
||||||
profile.setAdresseComplete(dto.getAdresseComplete());
|
profile.setAdresseComplete(dto.getAdresseComplete());
|
||||||
profile.setCodePostal(dto.getCodePostal());
|
profile.setCodePostal(dto.getCodePostal());
|
||||||
profile.setVille(dto.getVille());
|
profile.setVille(dto.getVille());
|
||||||
profile.setDepartement(dto.getDepartement());
|
profile.setDepartement(dto.getDepartement());
|
||||||
profile.setRegion(dto.getRegion());
|
profile.setRegion(dto.getRegion());
|
||||||
profile.setZonesIntervention(dto.getZonesIntervention());
|
profile.setZonesIntervention(dto.getZonesIntervention());
|
||||||
profile.setSiteWeb(dto.getSiteWeb());
|
profile.setSiteWeb(dto.getSiteWeb());
|
||||||
profile.setEmailContact(dto.getEmailContact());
|
profile.setEmailContact(dto.getEmailContact());
|
||||||
profile.setTelephoneCommercial(dto.getTelephoneCommercial());
|
profile.setTelephoneCommercial(dto.getTelephoneCommercial());
|
||||||
profile.setLogoUrl(dto.getLogoUrl());
|
profile.setLogoUrl(dto.getLogoUrl());
|
||||||
profile.setPhotosRealisations(dto.getPhotosRealisations());
|
profile.setPhotosRealisations(dto.getPhotosRealisations());
|
||||||
profile.setNoteGlobale(dto.getNoteGlobale() != null ? dto.getNoteGlobale() : java.math.BigDecimal.ZERO);
|
profile.setNoteGlobale(dto.getNoteGlobale() != null ? dto.getNoteGlobale() : java.math.BigDecimal.ZERO);
|
||||||
profile.setNombreAvis(dto.getNombreAvis() != null ? dto.getNombreAvis() : 0);
|
profile.setNombreAvis(dto.getNombreAvis() != null ? dto.getNombreAvis() : 0);
|
||||||
profile.setNombreProjetsRealises(dto.getNombreProjetsRealises() != null ? dto.getNombreProjetsRealises() : 0);
|
profile.setNombreProjetsRealises(dto.getNombreProjetsRealises() != null ? dto.getNombreProjetsRealises() : 0);
|
||||||
profile.setNombreClientsServis(dto.getNombreClientsServis() != null ? dto.getNombreClientsServis() : 0);
|
profile.setNombreClientsServis(dto.getNombreClientsServis() != null ? dto.getNombreClientsServis() : 0);
|
||||||
profile.setVisible(dto.getVisible() != null ? dto.getVisible() : true);
|
profile.setVisible(dto.getVisible() != null ? dto.getVisible() : true);
|
||||||
profile.setCertifie(dto.getCertifie() != null ? dto.getCertifie() : false);
|
profile.setCertifie(dto.getCertifie() != null ? dto.getCertifie() : false);
|
||||||
profile.setTypeAbonnement(dto.getTypeAbonnement() != null ? dto.getTypeAbonnement() : dev.lions.btpxpress.domain.core.entity.TypeAbonnement.GRATUIT);
|
profile.setTypeAbonnement(dto.getTypeAbonnement() != null ? dto.getTypeAbonnement() : dev.lions.btpxpress.domain.core.entity.TypeAbonnement.GRATUIT);
|
||||||
profile.setFinAbonnement(dto.getFinAbonnement());
|
profile.setFinAbonnement(dto.getFinAbonnement());
|
||||||
profile.setBudgetMinProjet(dto.getBudgetMinProjet());
|
profile.setBudgetMinProjet(dto.getBudgetMinProjet());
|
||||||
profile.setBudgetMaxProjet(dto.getBudgetMaxProjet());
|
profile.setBudgetMaxProjet(dto.getBudgetMaxProjet());
|
||||||
profile.setAccepteUrgences(dto.getAccepteUrgences() != null ? dto.getAccepteUrgences() : true);
|
profile.setAccepteUrgences(dto.getAccepteUrgences() != null ? dto.getAccepteUrgences() : true);
|
||||||
profile.setAccepteWeekends(dto.getAccepteWeekends() != null ? dto.getAccepteWeekends() : false);
|
profile.setAccepteWeekends(dto.getAccepteWeekends() != null ? dto.getAccepteWeekends() : false);
|
||||||
profile.setDelaiMoyenIntervention(dto.getDelaiMoyenIntervention());
|
profile.setDelaiMoyenIntervention(dto.getDelaiMoyenIntervention());
|
||||||
profile.setChiffresAffairesAnnuel(dto.getChiffresAffairesAnnuel());
|
profile.setChiffresAffairesAnnuel(dto.getChiffresAffairesAnnuel());
|
||||||
profile.setGarantiesProposees(dto.getGarantiesProposees());
|
profile.setGarantiesProposees(dto.getGarantiesProposees());
|
||||||
|
|
||||||
return profile;
|
return profile;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion entité vers ResponseDTO
|
* Conversion entité vers ResponseDTO
|
||||||
*/
|
*/
|
||||||
public EntrepriseProfileResponseDTO toResponseDTO(EntrepriseProfile profile) {
|
public EntrepriseProfileResponseDTO toResponseDTO(EntrepriseProfile profile) {
|
||||||
if (profile == null) {
|
if (profile == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
EntrepriseProfileResponseDTO dto = EntrepriseProfileResponseDTO.builder()
|
EntrepriseProfileResponseDTO dto = EntrepriseProfileResponseDTO.builder()
|
||||||
.id(profile.getId())
|
.id(profile.getId())
|
||||||
.nomCommercial(profile.getNomCommercial())
|
.nomCommercial(profile.getNomCommercial())
|
||||||
.description(profile.getDescription())
|
.description(profile.getDescription())
|
||||||
.slogan(profile.getSlogan())
|
.slogan(profile.getSlogan())
|
||||||
.specialites(profile.getSpecialites())
|
.specialites(profile.getSpecialites())
|
||||||
.certifications(profile.getCertifications())
|
.certifications(profile.getCertifications())
|
||||||
.adresseComplete(profile.getAdresseComplete())
|
.adresseComplete(profile.getAdresseComplete())
|
||||||
.codePostal(profile.getCodePostal())
|
.codePostal(profile.getCodePostal())
|
||||||
.ville(profile.getVille())
|
.ville(profile.getVille())
|
||||||
.departement(profile.getDepartement())
|
.departement(profile.getDepartement())
|
||||||
.region(profile.getRegion())
|
.region(profile.getRegion())
|
||||||
.zonesIntervention(profile.getZonesIntervention())
|
.zonesIntervention(profile.getZonesIntervention())
|
||||||
.siteWeb(profile.getSiteWeb())
|
.siteWeb(profile.getSiteWeb())
|
||||||
.emailContact(profile.getEmailContact())
|
.emailContact(profile.getEmailContact())
|
||||||
.telephoneCommercial(profile.getTelephoneCommercial())
|
.telephoneCommercial(profile.getTelephoneCommercial())
|
||||||
.logoUrl(profile.getLogoUrl())
|
.logoUrl(profile.getLogoUrl())
|
||||||
.photosRealisations(profile.getPhotosRealisations())
|
.photosRealisations(profile.getPhotosRealisations())
|
||||||
.noteGlobale(profile.getNoteGlobale())
|
.noteGlobale(profile.getNoteGlobale())
|
||||||
.nombreAvis(profile.getNombreAvis())
|
.nombreAvis(profile.getNombreAvis())
|
||||||
.nombreProjetsRealises(profile.getNombreProjetsRealises())
|
.nombreProjetsRealises(profile.getNombreProjetsRealises())
|
||||||
.nombreClientsServis(profile.getNombreClientsServis())
|
.nombreClientsServis(profile.getNombreClientsServis())
|
||||||
.visible(profile.getVisible())
|
.visible(profile.getVisible())
|
||||||
.certifie(profile.getCertifie())
|
.certifie(profile.getCertifie())
|
||||||
.typeAbonnement(profile.getTypeAbonnement())
|
.typeAbonnement(profile.getTypeAbonnement())
|
||||||
.finAbonnement(profile.getFinAbonnement())
|
.finAbonnement(profile.getFinAbonnement())
|
||||||
.budgetMinProjet(profile.getBudgetMinProjet())
|
.budgetMinProjet(profile.getBudgetMinProjet())
|
||||||
.budgetMaxProjet(profile.getBudgetMaxProjet())
|
.budgetMaxProjet(profile.getBudgetMaxProjet())
|
||||||
.accepteUrgences(profile.getAccepteUrgences())
|
.accepteUrgences(profile.getAccepteUrgences())
|
||||||
.accepteWeekends(profile.getAccepteWeekends())
|
.accepteWeekends(profile.getAccepteWeekends())
|
||||||
.delaiMoyenIntervention(profile.getDelaiMoyenIntervention())
|
.delaiMoyenIntervention(profile.getDelaiMoyenIntervention())
|
||||||
.chiffresAffairesAnnuel(profile.getChiffresAffairesAnnuel())
|
.chiffresAffairesAnnuel(profile.getChiffresAffairesAnnuel())
|
||||||
.garantiesProposees(profile.getGarantiesProposees())
|
.garantiesProposees(profile.getGarantiesProposees())
|
||||||
.dateCreation(profile.getDateCreation())
|
.dateCreation(profile.getDateCreation())
|
||||||
.dateModification(profile.getDateModification())
|
.dateModification(profile.getDateModification())
|
||||||
.derniereMiseAJour(profile.getDerniereMiseAJour())
|
.derniereMiseAJour(profile.getDerniereMiseAJour())
|
||||||
.derniereActivite(profile.getDerniereActivite())
|
.derniereActivite(profile.getDerniereActivite())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// Relations simplifiées
|
// Relations simplifiées
|
||||||
if (profile.getProprietaire() != null) {
|
if (profile.getProprietaire() != null) {
|
||||||
dto.setProprietaireId(profile.getProprietaire().getId());
|
dto.setProprietaireId(profile.getProprietaire().getId());
|
||||||
dto.setProprietaireNom(profile.getProprietaire().getNom() + " " + profile.getProprietaire().getPrenom());
|
dto.setProprietaireNom(profile.getProprietaire().getNom() + " " + profile.getProprietaire().getPrenom());
|
||||||
dto.setProprietaireEmail(profile.getProprietaire().getEmail());
|
dto.setProprietaireEmail(profile.getProprietaire().getEmail());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Métadonnées calculées
|
// Métadonnées calculées
|
||||||
dto.setIsAbonnementActif(profile.isAbonnementActif());
|
dto.setIsAbonnementActif(profile.isAbonnementActif());
|
||||||
dto.setIsPremium(profile.isPremium());
|
dto.setIsPremium(profile.isPremium());
|
||||||
dto.setIsEnterprise(profile.isEnterprise());
|
dto.setIsEnterprise(profile.isEnterprise());
|
||||||
dto.setScoreVisibilite(profile.getScoreVisibilite());
|
dto.setScoreVisibilite(profile.getScoreVisibilite());
|
||||||
|
|
||||||
return dto;
|
return dto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,98 +1,98 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.mapper;
|
package dev.lions.btpxpress.domain.shared.mapper;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.Equipe;
|
import dev.lions.btpxpress.domain.core.entity.Equipe;
|
||||||
import dev.lions.btpxpress.domain.shared.dto.EquipeCreateDTO;
|
import dev.lions.btpxpress.domain.shared.dto.EquipeCreateDTO;
|
||||||
import dev.lions.btpxpress.domain.shared.dto.EquipeResponseDTO;
|
import dev.lions.btpxpress.domain.shared.dto.EquipeResponseDTO;
|
||||||
import jakarta.enterprise.context.ApplicationScoped;
|
import jakarta.enterprise.context.ApplicationScoped;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapper pour les équipes - Architecture 2025
|
* Mapper pour les équipes - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@ApplicationScoped
|
@ApplicationScoped
|
||||||
public class EquipeMapper {
|
public class EquipeMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion DTO vers entité
|
* Conversion DTO vers entité
|
||||||
*/
|
*/
|
||||||
public Equipe toEntity(EquipeCreateDTO dto) {
|
public Equipe toEntity(EquipeCreateDTO dto) {
|
||||||
if (dto == null) {
|
if (dto == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Equipe equipe = Equipe.builder()
|
Equipe equipe = Equipe.builder()
|
||||||
.nom(dto.getNom())
|
.nom(dto.getNom())
|
||||||
.description(dto.getDescription())
|
.description(dto.getDescription())
|
||||||
.specialite(dto.getSpecialite())
|
.specialite(dto.getSpecialite())
|
||||||
.statut(dto.getStatut() != null ? dto.getStatut() : dev.lions.btpxpress.domain.core.entity.StatutEquipe.ACTIVE)
|
.statut(dto.getStatut() != null ? dto.getStatut() : dev.lions.btpxpress.domain.core.entity.StatutEquipe.ACTIVE)
|
||||||
.actif(dto.getActif() != null ? dto.getActif() : true)
|
.actif(dto.getActif() != null ? dto.getActif() : true)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// Gérer les spécialités
|
// Gérer les spécialités
|
||||||
if (dto.getSpecialites() != null && !dto.getSpecialites().isEmpty()) {
|
if (dto.getSpecialites() != null && !dto.getSpecialites().isEmpty()) {
|
||||||
equipe.setSpecialites(dto.getSpecialites());
|
equipe.setSpecialites(dto.getSpecialites());
|
||||||
}
|
}
|
||||||
|
|
||||||
return equipe;
|
return equipe;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion entité vers ResponseDTO
|
* Conversion entité vers ResponseDTO
|
||||||
*/
|
*/
|
||||||
public EquipeResponseDTO toResponseDTO(Equipe equipe) {
|
public EquipeResponseDTO toResponseDTO(Equipe equipe) {
|
||||||
if (equipe == null) {
|
if (equipe == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
EquipeResponseDTO dto = EquipeResponseDTO.builder()
|
EquipeResponseDTO dto = EquipeResponseDTO.builder()
|
||||||
.id(equipe.getId())
|
.id(equipe.getId())
|
||||||
.nom(equipe.getNom())
|
.nom(equipe.getNom())
|
||||||
.description(equipe.getDescription())
|
.description(equipe.getDescription())
|
||||||
.statut(equipe.getStatut())
|
.statut(equipe.getStatut())
|
||||||
.specialite(equipe.getSpecialite())
|
.specialite(equipe.getSpecialite())
|
||||||
.actif(equipe.getActif())
|
.actif(equipe.getActif())
|
||||||
.dateCreation(equipe.getDateCreation())
|
.dateCreation(equipe.getDateCreation())
|
||||||
.dateModification(equipe.getDateModification())
|
.dateModification(equipe.getDateModification())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// Gérer les spécialités
|
// Gérer les spécialités
|
||||||
dto.setSpecialites(equipe.getSpecialites());
|
dto.setSpecialites(equipe.getSpecialites());
|
||||||
|
|
||||||
// Relations simplifiées
|
// Relations simplifiées
|
||||||
if (equipe.getChef() != null) {
|
if (equipe.getChef() != null) {
|
||||||
dto.setChefId(equipe.getChef().getId());
|
dto.setChefId(equipe.getChef().getId());
|
||||||
dto.setChefNom(equipe.getChef().getNom());
|
dto.setChefNom(equipe.getChef().getNom());
|
||||||
dto.setChefPrenom(equipe.getChef().getPrenom());
|
dto.setChefPrenom(equipe.getChef().getPrenom());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Membres
|
// Membres
|
||||||
if (equipe.getMembres() != null) {
|
if (equipe.getMembres() != null) {
|
||||||
dto.setMembreIds(equipe.getMembres().stream()
|
dto.setMembreIds(equipe.getMembres().stream()
|
||||||
.map(emp -> emp.getId())
|
.map(emp -> emp.getId())
|
||||||
.collect(Collectors.toList()));
|
.collect(Collectors.toList()));
|
||||||
dto.setNombreMembres(equipe.getNombreMembres());
|
dto.setNombreMembres(equipe.getNombreMembres());
|
||||||
} else {
|
} else {
|
||||||
dto.setMembreIds(new ArrayList<>());
|
dto.setMembreIds(new ArrayList<>());
|
||||||
dto.setNombreMembres(0);
|
dto.setNombreMembres(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Chantiers
|
// Chantiers
|
||||||
if (equipe.getChantiers() != null) {
|
if (equipe.getChantiers() != null) {
|
||||||
dto.setChantierIds(equipe.getChantiers().stream()
|
dto.setChantierIds(equipe.getChantiers().stream()
|
||||||
.map(chantier -> chantier.getId())
|
.map(chantier -> chantier.getId())
|
||||||
.collect(Collectors.toList()));
|
.collect(Collectors.toList()));
|
||||||
dto.setNombreChantiers(equipe.getChantiers().size());
|
dto.setNombreChantiers(equipe.getChantiers().size());
|
||||||
} else {
|
} else {
|
||||||
dto.setChantierIds(new ArrayList<>());
|
dto.setChantierIds(new ArrayList<>());
|
||||||
dto.setNombreChantiers(0);
|
dto.setNombreChantiers(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return dto;
|
return dto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,213 +1,213 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.mapper;
|
package dev.lions.btpxpress.domain.shared.mapper;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.*;
|
import dev.lions.btpxpress.domain.core.entity.*;
|
||||||
import dev.lions.btpxpress.domain.shared.dto.*;
|
import dev.lions.btpxpress.domain.shared.dto.*;
|
||||||
import jakarta.enterprise.context.ApplicationScoped;
|
import jakarta.enterprise.context.ApplicationScoped;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapper pour les factures - Architecture 2025
|
* Mapper pour les factures - Architecture 2025
|
||||||
* Suit le même pattern que ChantierMapper et ClientMapper
|
* Suit le même pattern que ChantierMapper et ClientMapper
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@ApplicationScoped
|
@ApplicationScoped
|
||||||
public class FactureMapper {
|
public class FactureMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion DTO vers entité
|
* Conversion DTO vers entité
|
||||||
*
|
*
|
||||||
* @param dto Le DTO de création
|
* @param dto Le DTO de création
|
||||||
* @param client Le client associé (chargé depuis le repository)
|
* @param client Le client associé (chargé depuis le repository)
|
||||||
* @param chantier Le chantier associé (optionnel, peut être null)
|
* @param chantier Le chantier associé (optionnel, peut être null)
|
||||||
* @param devis Le devis associé (optionnel, peut être null)
|
* @param devis Le devis associé (optionnel, peut être null)
|
||||||
* @return L'entité Facture créée
|
* @return L'entité Facture créée
|
||||||
*/
|
*/
|
||||||
public Facture toEntity(FactureCreateDTO dto, Client client, Chantier chantier, Devis devis) {
|
public Facture toEntity(FactureCreateDTO dto, Client client, Chantier chantier, Devis devis) {
|
||||||
if (dto == null) {
|
if (dto == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Facture facture = new Facture();
|
Facture facture = new Facture();
|
||||||
facture.setNumero(dto.getNumero());
|
facture.setNumero(dto.getNumero());
|
||||||
facture.setObjet(dto.getObjet());
|
facture.setObjet(dto.getObjet());
|
||||||
facture.setDescription(dto.getDescription());
|
facture.setDescription(dto.getDescription());
|
||||||
facture.setDateEmission(dto.getDateEmission());
|
facture.setDateEmission(dto.getDateEmission());
|
||||||
facture.setDateEcheance(dto.getDateEcheance());
|
facture.setDateEcheance(dto.getDateEcheance());
|
||||||
facture.setDatePaiement(dto.getDatePaiement());
|
facture.setDatePaiement(dto.getDatePaiement());
|
||||||
facture.setStatut(dto.getStatut() != null ? dto.getStatut() : Facture.StatutFacture.BROUILLON);
|
facture.setStatut(dto.getStatut() != null ? dto.getStatut() : Facture.StatutFacture.BROUILLON);
|
||||||
facture.setMontantHT(dto.getMontantHT());
|
facture.setMontantHT(dto.getMontantHT());
|
||||||
facture.setTauxTVA(dto.getTauxTVA() != null ? dto.getTauxTVA() : BigDecimal.valueOf(20.0));
|
facture.setTauxTVA(dto.getTauxTVA() != null ? dto.getTauxTVA() : BigDecimal.valueOf(20.0));
|
||||||
facture.setMontantPaye(dto.getMontantPaye());
|
facture.setMontantPaye(dto.getMontantPaye());
|
||||||
facture.setConditionsPaiement(dto.getConditionsPaiement());
|
facture.setConditionsPaiement(dto.getConditionsPaiement());
|
||||||
facture.setTypeFacture(dto.getTypeFacture() != null ? dto.getTypeFacture() : Facture.TypeFacture.FACTURE);
|
facture.setTypeFacture(dto.getTypeFacture() != null ? dto.getTypeFacture() : Facture.TypeFacture.FACTURE);
|
||||||
facture.setActif(true);
|
facture.setActif(true);
|
||||||
facture.setClient(client);
|
facture.setClient(client);
|
||||||
facture.setChantier(chantier);
|
facture.setChantier(chantier);
|
||||||
facture.setDevis(devis);
|
facture.setDevis(devis);
|
||||||
|
|
||||||
// Créer les lignes de facture si présentes
|
// Créer les lignes de facture si présentes
|
||||||
if (dto.getLignes() != null && !dto.getLignes().isEmpty()) {
|
if (dto.getLignes() != null && !dto.getLignes().isEmpty()) {
|
||||||
List<LigneFacture> lignes = new ArrayList<>();
|
List<LigneFacture> lignes = new ArrayList<>();
|
||||||
int ordre = 1;
|
int ordre = 1;
|
||||||
for (FactureCreateDTO.LigneFactureCreateDTO ligneDTO : dto.getLignes()) {
|
for (FactureCreateDTO.LigneFactureCreateDTO ligneDTO : dto.getLignes()) {
|
||||||
LigneFacture ligne = new LigneFacture();
|
LigneFacture ligne = new LigneFacture();
|
||||||
ligne.setDesignation(ligneDTO.getDescription()); // designation = description dans le DTO
|
ligne.setDesignation(ligneDTO.getDescription()); // designation = description dans le DTO
|
||||||
ligne.setDescription(ligneDTO.getDescription()); // description optionnelle
|
ligne.setDescription(ligneDTO.getDescription()); // description optionnelle
|
||||||
ligne.setQuantite(ligneDTO.getQuantite());
|
ligne.setQuantite(ligneDTO.getQuantite());
|
||||||
ligne.setPrixUnitaire(ligneDTO.getPrixUnitaire());
|
ligne.setPrixUnitaire(ligneDTO.getPrixUnitaire());
|
||||||
ligne.setUnite(ligneDTO.getUnite() != null ? ligneDTO.getUnite() : "unité");
|
ligne.setUnite(ligneDTO.getUnite() != null ? ligneDTO.getUnite() : "unité");
|
||||||
ligne.setOrdre(ordre++);
|
ligne.setOrdre(ordre++);
|
||||||
ligne.setFacture(facture);
|
ligne.setFacture(facture);
|
||||||
lignes.add(ligne);
|
lignes.add(ligne);
|
||||||
}
|
}
|
||||||
facture.setLignes(lignes);
|
facture.setLignes(lignes);
|
||||||
}
|
}
|
||||||
|
|
||||||
return facture;
|
return facture;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mise à jour d'entité depuis DTO
|
* Mise à jour d'entité depuis DTO
|
||||||
*
|
*
|
||||||
* @param facture L'entité à mettre à jour
|
* @param facture L'entité à mettre à jour
|
||||||
* @param dto Le DTO contenant les nouvelles valeurs
|
* @param dto Le DTO contenant les nouvelles valeurs
|
||||||
* @param client Le client associé (peut être null si non modifié)
|
* @param client Le client associé (peut être null si non modifié)
|
||||||
* @param chantier Le chantier associé (peut être null si non modifié)
|
* @param chantier Le chantier associé (peut être null si non modifié)
|
||||||
* @param devis Le devis associé (peut être null si non modifié)
|
* @param devis Le devis associé (peut être null si non modifié)
|
||||||
*/
|
*/
|
||||||
public void updateEntity(Facture facture, FactureCreateDTO dto, Client client, Chantier chantier, Devis devis) {
|
public void updateEntity(Facture facture, FactureCreateDTO dto, Client client, Chantier chantier, Devis devis) {
|
||||||
if (facture == null || dto == null) {
|
if (facture == null || dto == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
facture.setNumero(dto.getNumero());
|
facture.setNumero(dto.getNumero());
|
||||||
facture.setObjet(dto.getObjet());
|
facture.setObjet(dto.getObjet());
|
||||||
facture.setDescription(dto.getDescription());
|
facture.setDescription(dto.getDescription());
|
||||||
facture.setDateEmission(dto.getDateEmission());
|
facture.setDateEmission(dto.getDateEmission());
|
||||||
facture.setDateEcheance(dto.getDateEcheance());
|
facture.setDateEcheance(dto.getDateEcheance());
|
||||||
facture.setDatePaiement(dto.getDatePaiement());
|
facture.setDatePaiement(dto.getDatePaiement());
|
||||||
if (dto.getStatut() != null) {
|
if (dto.getStatut() != null) {
|
||||||
facture.setStatut(dto.getStatut());
|
facture.setStatut(dto.getStatut());
|
||||||
}
|
}
|
||||||
facture.setMontantHT(dto.getMontantHT());
|
facture.setMontantHT(dto.getMontantHT());
|
||||||
if (dto.getTauxTVA() != null) {
|
if (dto.getTauxTVA() != null) {
|
||||||
facture.setTauxTVA(dto.getTauxTVA());
|
facture.setTauxTVA(dto.getTauxTVA());
|
||||||
}
|
}
|
||||||
facture.setMontantPaye(dto.getMontantPaye());
|
facture.setMontantPaye(dto.getMontantPaye());
|
||||||
facture.setConditionsPaiement(dto.getConditionsPaiement());
|
facture.setConditionsPaiement(dto.getConditionsPaiement());
|
||||||
if (dto.getTypeFacture() != null) {
|
if (dto.getTypeFacture() != null) {
|
||||||
facture.setTypeFacture(dto.getTypeFacture());
|
facture.setTypeFacture(dto.getTypeFacture());
|
||||||
}
|
}
|
||||||
if (client != null) {
|
if (client != null) {
|
||||||
facture.setClient(client);
|
facture.setClient(client);
|
||||||
}
|
}
|
||||||
if (chantier != null) {
|
if (chantier != null) {
|
||||||
facture.setChantier(chantier);
|
facture.setChantier(chantier);
|
||||||
}
|
}
|
||||||
if (devis != null) {
|
if (devis != null) {
|
||||||
facture.setDevis(devis);
|
facture.setDevis(devis);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion entité vers ResponseDTO
|
* Conversion entité vers ResponseDTO
|
||||||
*
|
*
|
||||||
* @param facture L'entité Facture
|
* @param facture L'entité Facture
|
||||||
* @return Le DTO de réponse
|
* @return Le DTO de réponse
|
||||||
*/
|
*/
|
||||||
public FactureResponseDTO toResponseDTO(Facture facture) {
|
public FactureResponseDTO toResponseDTO(Facture facture) {
|
||||||
if (facture == null) {
|
if (facture == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
FactureResponseDTO dto = FactureResponseDTO.builder()
|
FactureResponseDTO dto = FactureResponseDTO.builder()
|
||||||
.id(facture.getId())
|
.id(facture.getId())
|
||||||
.numero(facture.getNumero())
|
.numero(facture.getNumero())
|
||||||
.objet(facture.getObjet())
|
.objet(facture.getObjet())
|
||||||
.description(facture.getDescription())
|
.description(facture.getDescription())
|
||||||
.dateEmission(facture.getDateEmission())
|
.dateEmission(facture.getDateEmission())
|
||||||
.dateEcheance(facture.getDateEcheance())
|
.dateEcheance(facture.getDateEcheance())
|
||||||
.datePaiement(facture.getDatePaiement())
|
.datePaiement(facture.getDatePaiement())
|
||||||
.statut(facture.getStatut())
|
.statut(facture.getStatut())
|
||||||
.montantHT(facture.getMontantHT())
|
.montantHT(facture.getMontantHT())
|
||||||
.tauxTVA(facture.getTauxTVA())
|
.tauxTVA(facture.getTauxTVA())
|
||||||
.montantTVA(facture.getMontantTVA())
|
.montantTVA(facture.getMontantTVA())
|
||||||
.montantTTC(facture.getMontantTTC())
|
.montantTTC(facture.getMontantTTC())
|
||||||
.montantPaye(facture.getMontantPaye())
|
.montantPaye(facture.getMontantPaye())
|
||||||
.montantRestant(facture.getMontantRestant())
|
.montantRestant(facture.getMontantRestant())
|
||||||
.conditionsPaiement(facture.getConditionsPaiement())
|
.conditionsPaiement(facture.getConditionsPaiement())
|
||||||
.typeFacture(facture.getTypeFacture())
|
.typeFacture(facture.getTypeFacture())
|
||||||
.actif(facture.getActif())
|
.actif(facture.getActif())
|
||||||
.dateCreation(facture.getDateCreation())
|
.dateCreation(facture.getDateCreation())
|
||||||
.dateModification(facture.getDateModification())
|
.dateModification(facture.getDateModification())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// Relations simplifiées
|
// Relations simplifiées
|
||||||
if (facture.getClient() != null) {
|
if (facture.getClient() != null) {
|
||||||
dto.setClientId(facture.getClient().getId());
|
dto.setClientId(facture.getClient().getId());
|
||||||
dto.setClientNom(facture.getClient().getNomComplet());
|
dto.setClientNom(facture.getClient().getNomComplet());
|
||||||
dto.setClientRaisonSociale(facture.getClient().getEntreprise());
|
dto.setClientRaisonSociale(facture.getClient().getEntreprise());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (facture.getChantier() != null) {
|
if (facture.getChantier() != null) {
|
||||||
dto.setChantierId(facture.getChantier().getId());
|
dto.setChantierId(facture.getChantier().getId());
|
||||||
dto.setChantierNom(facture.getChantier().getNom());
|
dto.setChantierNom(facture.getChantier().getNom());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (facture.getDevis() != null) {
|
if (facture.getDevis() != null) {
|
||||||
dto.setDevisId(facture.getDevis().getId());
|
dto.setDevisId(facture.getDevis().getId());
|
||||||
dto.setDevisNumero(facture.getDevis().getNumero());
|
dto.setDevisNumero(facture.getDevis().getNumero());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convertir les lignes
|
// Convertir les lignes
|
||||||
if (facture.getLignes() != null && !facture.getLignes().isEmpty()) {
|
if (facture.getLignes() != null && !facture.getLignes().isEmpty()) {
|
||||||
List<FactureResponseDTO.LigneFactureResponseDTO> lignesDTO = facture.getLignes().stream()
|
List<FactureResponseDTO.LigneFactureResponseDTO> lignesDTO = facture.getLignes().stream()
|
||||||
.map(this::toLigneResponseDTO)
|
.map(this::toLigneResponseDTO)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
dto.setLignes(lignesDTO);
|
dto.setLignes(lignesDTO);
|
||||||
}
|
}
|
||||||
|
|
||||||
return dto;
|
return dto;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion d'une ligne de facture vers ResponseDTO
|
* Conversion d'une ligne de facture vers ResponseDTO
|
||||||
*/
|
*/
|
||||||
private FactureResponseDTO.LigneFactureResponseDTO toLigneResponseDTO(LigneFacture ligne) {
|
private FactureResponseDTO.LigneFactureResponseDTO toLigneResponseDTO(LigneFacture ligne) {
|
||||||
if (ligne == null) {
|
if (ligne == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculer les montants HT, TVA, TTC à partir du montantLigne et du tauxTVA de la facture
|
// Calculer les montants HT, TVA, TTC à partir du montantLigne et du tauxTVA de la facture
|
||||||
BigDecimal montantHT = ligne.getMontantLigne();
|
BigDecimal montantHT = ligne.getMontantLigne();
|
||||||
BigDecimal tauxTVA = ligne.getFacture() != null && ligne.getFacture().getTauxTVA() != null
|
BigDecimal tauxTVA = ligne.getFacture() != null && ligne.getFacture().getTauxTVA() != null
|
||||||
? ligne.getFacture().getTauxTVA()
|
? ligne.getFacture().getTauxTVA()
|
||||||
: BigDecimal.valueOf(20.0);
|
: BigDecimal.valueOf(20.0);
|
||||||
BigDecimal montantTVA = montantHT != null
|
BigDecimal montantTVA = montantHT != null
|
||||||
? montantHT.multiply(tauxTVA).divide(BigDecimal.valueOf(100), 2, java.math.RoundingMode.HALF_UP)
|
? montantHT.multiply(tauxTVA).divide(BigDecimal.valueOf(100), 2, java.math.RoundingMode.HALF_UP)
|
||||||
: null;
|
: null;
|
||||||
BigDecimal montantTTC = montantHT != null && montantTVA != null
|
BigDecimal montantTTC = montantHT != null && montantTVA != null
|
||||||
? montantHT.add(montantTVA)
|
? montantHT.add(montantTVA)
|
||||||
: montantHT;
|
: montantHT;
|
||||||
|
|
||||||
return FactureResponseDTO.LigneFactureResponseDTO.builder()
|
return FactureResponseDTO.LigneFactureResponseDTO.builder()
|
||||||
.id(ligne.getId())
|
.id(ligne.getId())
|
||||||
.description(ligne.getDesignation() != null ? ligne.getDesignation() : ligne.getDescription())
|
.description(ligne.getDesignation() != null ? ligne.getDesignation() : ligne.getDescription())
|
||||||
.quantite(ligne.getQuantite())
|
.quantite(ligne.getQuantite())
|
||||||
.prixUnitaire(ligne.getPrixUnitaire())
|
.prixUnitaire(ligne.getPrixUnitaire())
|
||||||
.tauxTVA(tauxTVA)
|
.tauxTVA(tauxTVA)
|
||||||
.montantHT(montantHT)
|
.montantHT(montantHT)
|
||||||
.montantTVA(montantTVA)
|
.montantTVA(montantTVA)
|
||||||
.montantTTC(montantTTC)
|
.montantTTC(montantTTC)
|
||||||
.unite(ligne.getUnite())
|
.unite(ligne.getUnite())
|
||||||
.ordre(ligne.getOrdre())
|
.ordre(ligne.getOrdre())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,81 +1,81 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.mapper;
|
package dev.lions.btpxpress.domain.shared.mapper;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.Fournisseur;
|
import dev.lions.btpxpress.domain.core.entity.Fournisseur;
|
||||||
import dev.lions.btpxpress.domain.shared.dto.FournisseurCreateDTO;
|
import dev.lions.btpxpress.domain.shared.dto.FournisseurCreateDTO;
|
||||||
import dev.lions.btpxpress.domain.shared.dto.FournisseurResponseDTO;
|
import dev.lions.btpxpress.domain.shared.dto.FournisseurResponseDTO;
|
||||||
import jakarta.enterprise.context.ApplicationScoped;
|
import jakarta.enterprise.context.ApplicationScoped;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapper pour les fournisseurs - Architecture 2025
|
* Mapper pour les fournisseurs - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@ApplicationScoped
|
@ApplicationScoped
|
||||||
public class FournisseurMapper {
|
public class FournisseurMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion DTO vers entité
|
* Conversion DTO vers entité
|
||||||
*/
|
*/
|
||||||
public Fournisseur toEntity(FournisseurCreateDTO dto) {
|
public Fournisseur toEntity(FournisseurCreateDTO dto) {
|
||||||
if (dto == null) {
|
if (dto == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Fournisseur fournisseur = Fournisseur.builder()
|
Fournisseur fournisseur = Fournisseur.builder()
|
||||||
.nom(dto.getNom())
|
.nom(dto.getNom())
|
||||||
.contact(dto.getContact())
|
.contact(dto.getContact())
|
||||||
.telephone(dto.getTelephone())
|
.telephone(dto.getTelephone())
|
||||||
.email(dto.getEmail())
|
.email(dto.getEmail())
|
||||||
.adresse(dto.getAdresse())
|
.adresse(dto.getAdresse())
|
||||||
.ville(dto.getVille())
|
.ville(dto.getVille())
|
||||||
.codePostal(dto.getCodePostal())
|
.codePostal(dto.getCodePostal())
|
||||||
.pays(dto.getPays())
|
.pays(dto.getPays())
|
||||||
.siret(dto.getSiret())
|
.siret(dto.getSiret())
|
||||||
.tva(dto.getTva())
|
.tva(dto.getTva())
|
||||||
.conditionsPaiement(dto.getConditionsPaiement())
|
.conditionsPaiement(dto.getConditionsPaiement())
|
||||||
.delaiLivraison(dto.getDelaiLivraison())
|
.delaiLivraison(dto.getDelaiLivraison())
|
||||||
.note(dto.getNote())
|
.note(dto.getNote())
|
||||||
.actif(dto.getActif() != null ? dto.getActif() : true)
|
.actif(dto.getActif() != null ? dto.getActif() : true)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
return fournisseur;
|
return fournisseur;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion entité vers ResponseDTO
|
* Conversion entité vers ResponseDTO
|
||||||
*/
|
*/
|
||||||
public FournisseurResponseDTO toResponseDTO(Fournisseur fournisseur) {
|
public FournisseurResponseDTO toResponseDTO(Fournisseur fournisseur) {
|
||||||
if (fournisseur == null) {
|
if (fournisseur == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
FournisseurResponseDTO dto = FournisseurResponseDTO.builder()
|
FournisseurResponseDTO dto = FournisseurResponseDTO.builder()
|
||||||
.id(fournisseur.getId())
|
.id(fournisseur.getId())
|
||||||
.nom(fournisseur.getNom())
|
.nom(fournisseur.getNom())
|
||||||
.contact(fournisseur.getContact())
|
.contact(fournisseur.getContact())
|
||||||
.telephone(fournisseur.getTelephone())
|
.telephone(fournisseur.getTelephone())
|
||||||
.email(fournisseur.getEmail())
|
.email(fournisseur.getEmail())
|
||||||
.adresse(fournisseur.getAdresse())
|
.adresse(fournisseur.getAdresse())
|
||||||
.ville(fournisseur.getVille())
|
.ville(fournisseur.getVille())
|
||||||
.codePostal(fournisseur.getCodePostal())
|
.codePostal(fournisseur.getCodePostal())
|
||||||
.pays(fournisseur.getPays())
|
.pays(fournisseur.getPays())
|
||||||
.siret(fournisseur.getSiret())
|
.siret(fournisseur.getSiret())
|
||||||
.tva(fournisseur.getTva())
|
.tva(fournisseur.getTva())
|
||||||
.conditionsPaiement(fournisseur.getConditionsPaiement())
|
.conditionsPaiement(fournisseur.getConditionsPaiement())
|
||||||
.delaiLivraison(fournisseur.getDelaiLivraison())
|
.delaiLivraison(fournisseur.getDelaiLivraison())
|
||||||
.note(fournisseur.getNote())
|
.note(fournisseur.getNote())
|
||||||
.actif(fournisseur.getActif())
|
.actif(fournisseur.getActif())
|
||||||
.dateCreation(fournisseur.getDateCreation())
|
.dateCreation(fournisseur.getDateCreation())
|
||||||
.dateModification(fournisseur.getDateModification())
|
.dateModification(fournisseur.getDateModification())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// Métadonnées calculées
|
// Métadonnées calculées
|
||||||
dto.setResume(fournisseur.getResume());
|
dto.setResume(fournisseur.getResume());
|
||||||
dto.setComplet(fournisseur.isComplet());
|
dto.setComplet(fournisseur.isComplet());
|
||||||
|
|
||||||
return dto;
|
return dto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,162 +1,162 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.mapper;
|
package dev.lions.btpxpress.domain.shared.mapper;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.LivraisonMateriel;
|
import dev.lions.btpxpress.domain.core.entity.LivraisonMateriel;
|
||||||
import dev.lions.btpxpress.domain.shared.dto.LivraisonMaterielCreateDTO;
|
import dev.lions.btpxpress.domain.shared.dto.LivraisonMaterielCreateDTO;
|
||||||
import dev.lions.btpxpress.domain.shared.dto.LivraisonMaterielResponseDTO;
|
import dev.lions.btpxpress.domain.shared.dto.LivraisonMaterielResponseDTO;
|
||||||
import jakarta.enterprise.context.ApplicationScoped;
|
import jakarta.enterprise.context.ApplicationScoped;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapper pour les livraisons de matériel - Architecture 2025
|
* Mapper pour les livraisons de matériel - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@ApplicationScoped
|
@ApplicationScoped
|
||||||
public class LivraisonMaterielMapper {
|
public class LivraisonMaterielMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion DTO vers entité
|
* Conversion DTO vers entité
|
||||||
*/
|
*/
|
||||||
public LivraisonMateriel toEntity(LivraisonMaterielCreateDTO dto) {
|
public LivraisonMateriel toEntity(LivraisonMaterielCreateDTO dto) {
|
||||||
if (dto == null) {
|
if (dto == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
LivraisonMateriel livraison = LivraisonMateriel.builder()
|
LivraisonMateriel livraison = LivraisonMateriel.builder()
|
||||||
.numeroLivraison(dto.getNumeroLivraison())
|
.numeroLivraison(dto.getNumeroLivraison())
|
||||||
.referenceCommande(dto.getReferenceCommande())
|
.referenceCommande(dto.getReferenceCommande())
|
||||||
.typeTransport(dto.getTypeTransport())
|
.typeTransport(dto.getTypeTransport())
|
||||||
.statut(dto.getStatut() != null ? dto.getStatut() : dev.lions.btpxpress.domain.core.entity.StatutLivraison.PLANIFIEE)
|
.statut(dto.getStatut() != null ? dto.getStatut() : dev.lions.btpxpress.domain.core.entity.StatutLivraison.PLANIFIEE)
|
||||||
.dateLivraisonPrevue(dto.getDateLivraisonPrevue())
|
.dateLivraisonPrevue(dto.getDateLivraisonPrevue())
|
||||||
.heureLivraisonPrevue(dto.getHeureLivraisonPrevue())
|
.heureLivraisonPrevue(dto.getHeureLivraisonPrevue())
|
||||||
.dureePrevueMinutes(dto.getDureePrevueMinutes())
|
.dureePrevueMinutes(dto.getDureePrevueMinutes())
|
||||||
.transporteur(dto.getTransporteur())
|
.transporteur(dto.getTransporteur())
|
||||||
.chauffeur(dto.getChauffeur())
|
.chauffeur(dto.getChauffeur())
|
||||||
.telephoneChauffeur(dto.getTelephoneChauffeur())
|
.telephoneChauffeur(dto.getTelephoneChauffeur())
|
||||||
.immatriculation(dto.getImmatriculation())
|
.immatriculation(dto.getImmatriculation())
|
||||||
.poidsChargeKg(dto.getPoidsChargeKg())
|
.poidsChargeKg(dto.getPoidsChargeKg())
|
||||||
.volumeChargeM3(dto.getVolumeChargeM3())
|
.volumeChargeM3(dto.getVolumeChargeM3())
|
||||||
.adresseDepart(dto.getAdresseDepart())
|
.adresseDepart(dto.getAdresseDepart())
|
||||||
.latitudeDepart(dto.getLatitudeDepart())
|
.latitudeDepart(dto.getLatitudeDepart())
|
||||||
.longitudeDepart(dto.getLongitudeDepart())
|
.longitudeDepart(dto.getLongitudeDepart())
|
||||||
.adresseDestination(dto.getAdresseDestination())
|
.adresseDestination(dto.getAdresseDestination())
|
||||||
.latitudeDestination(dto.getLatitudeDestination())
|
.latitudeDestination(dto.getLatitudeDestination())
|
||||||
.longitudeDestination(dto.getLongitudeDestination())
|
.longitudeDestination(dto.getLongitudeDestination())
|
||||||
.distanceKm(dto.getDistanceKm())
|
.distanceKm(dto.getDistanceKm())
|
||||||
.dureeTrajetPrevueMinutes(dto.getDureeTrajetPrevueMinutes())
|
.dureeTrajetPrevueMinutes(dto.getDureeTrajetPrevueMinutes())
|
||||||
.contactReception(dto.getContactReception())
|
.contactReception(dto.getContactReception())
|
||||||
.telephoneContact(dto.getTelephoneContact())
|
.telephoneContact(dto.getTelephoneContact())
|
||||||
.instructionsSpeciales(dto.getInstructionsSpeciales())
|
.instructionsSpeciales(dto.getInstructionsSpeciales())
|
||||||
.accesChantier(dto.getAccesChantier())
|
.accesChantier(dto.getAccesChantier())
|
||||||
.heureDepartPrevue(dto.getHeureDepartPrevue())
|
.heureDepartPrevue(dto.getHeureDepartPrevue())
|
||||||
.heureArriveePrevue(dto.getHeureArriveePrevue())
|
.heureArriveePrevue(dto.getHeureArriveePrevue())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
return livraison;
|
return livraison;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion entité vers ResponseDTO
|
* Conversion entité vers ResponseDTO
|
||||||
*/
|
*/
|
||||||
public LivraisonMaterielResponseDTO toResponseDTO(LivraisonMateriel livraison) {
|
public LivraisonMaterielResponseDTO toResponseDTO(LivraisonMateriel livraison) {
|
||||||
if (livraison == null) {
|
if (livraison == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
LivraisonMaterielResponseDTO dto = LivraisonMaterielResponseDTO.builder()
|
LivraisonMaterielResponseDTO dto = LivraisonMaterielResponseDTO.builder()
|
||||||
.id(livraison.getId())
|
.id(livraison.getId())
|
||||||
.numeroLivraison(livraison.getNumeroLivraison())
|
.numeroLivraison(livraison.getNumeroLivraison())
|
||||||
.referenceCommande(livraison.getReferenceCommande())
|
.referenceCommande(livraison.getReferenceCommande())
|
||||||
.typeTransport(livraison.getTypeTransport())
|
.typeTransport(livraison.getTypeTransport())
|
||||||
.statut(livraison.getStatut())
|
.statut(livraison.getStatut())
|
||||||
.dateLivraisonPrevue(livraison.getDateLivraisonPrevue())
|
.dateLivraisonPrevue(livraison.getDateLivraisonPrevue())
|
||||||
.heureLivraisonPrevue(livraison.getHeureLivraisonPrevue())
|
.heureLivraisonPrevue(livraison.getHeureLivraisonPrevue())
|
||||||
.dateLivraisonReelle(livraison.getDateLivraisonReelle())
|
.dateLivraisonReelle(livraison.getDateLivraisonReelle())
|
||||||
.heureLivraisonReelle(livraison.getHeureLivraisonReelle())
|
.heureLivraisonReelle(livraison.getHeureLivraisonReelle())
|
||||||
.dureePrevueMinutes(livraison.getDureePrevueMinutes())
|
.dureePrevueMinutes(livraison.getDureePrevueMinutes())
|
||||||
.dureeReelleMinutes(livraison.getDureeReelleMinutes())
|
.dureeReelleMinutes(livraison.getDureeReelleMinutes())
|
||||||
.transporteur(livraison.getTransporteur())
|
.transporteur(livraison.getTransporteur())
|
||||||
.chauffeur(livraison.getChauffeur())
|
.chauffeur(livraison.getChauffeur())
|
||||||
.telephoneChauffeur(livraison.getTelephoneChauffeur())
|
.telephoneChauffeur(livraison.getTelephoneChauffeur())
|
||||||
.immatriculation(livraison.getImmatriculation())
|
.immatriculation(livraison.getImmatriculation())
|
||||||
.poidsChargeKg(livraison.getPoidsChargeKg())
|
.poidsChargeKg(livraison.getPoidsChargeKg())
|
||||||
.volumeChargeM3(livraison.getVolumeChargeM3())
|
.volumeChargeM3(livraison.getVolumeChargeM3())
|
||||||
.adresseDepart(livraison.getAdresseDepart())
|
.adresseDepart(livraison.getAdresseDepart())
|
||||||
.latitudeDepart(livraison.getLatitudeDepart())
|
.latitudeDepart(livraison.getLatitudeDepart())
|
||||||
.longitudeDepart(livraison.getLongitudeDepart())
|
.longitudeDepart(livraison.getLongitudeDepart())
|
||||||
.adresseDestination(livraison.getAdresseDestination())
|
.adresseDestination(livraison.getAdresseDestination())
|
||||||
.latitudeDestination(livraison.getLatitudeDestination())
|
.latitudeDestination(livraison.getLatitudeDestination())
|
||||||
.longitudeDestination(livraison.getLongitudeDestination())
|
.longitudeDestination(livraison.getLongitudeDestination())
|
||||||
.distanceKm(livraison.getDistanceKm())
|
.distanceKm(livraison.getDistanceKm())
|
||||||
.dureeTrajetPrevueMinutes(livraison.getDureeTrajetPrevueMinutes())
|
.dureeTrajetPrevueMinutes(livraison.getDureeTrajetPrevueMinutes())
|
||||||
.dureeTrajetReelleMinutes(livraison.getDureeTrajetReelleMinutes())
|
.dureeTrajetReelleMinutes(livraison.getDureeTrajetReelleMinutes())
|
||||||
.contactReception(livraison.getContactReception())
|
.contactReception(livraison.getContactReception())
|
||||||
.telephoneContact(livraison.getTelephoneContact())
|
.telephoneContact(livraison.getTelephoneContact())
|
||||||
.instructionsSpeciales(livraison.getInstructionsSpeciales())
|
.instructionsSpeciales(livraison.getInstructionsSpeciales())
|
||||||
.accesChantier(livraison.getAccesChantier())
|
.accesChantier(livraison.getAccesChantier())
|
||||||
.heureDepartPrevue(livraison.getHeureDepartPrevue())
|
.heureDepartPrevue(livraison.getHeureDepartPrevue())
|
||||||
.heureDepartReelle(livraison.getHeureDepartReelle())
|
.heureDepartReelle(livraison.getHeureDepartReelle())
|
||||||
.heureArriveePrevue(livraison.getHeureArriveePrevue())
|
.heureArriveePrevue(livraison.getHeureArriveePrevue())
|
||||||
.heureArriveeReelle(livraison.getHeureArriveeReelle())
|
.heureArriveeReelle(livraison.getHeureArriveeReelle())
|
||||||
.tempsChargementMinutes(livraison.getTempsChargementMinutes())
|
.tempsChargementMinutes(livraison.getTempsChargementMinutes())
|
||||||
.tempsDechargementMinutes(livraison.getTempsDechargementMinutes())
|
.tempsDechargementMinutes(livraison.getTempsDechargementMinutes())
|
||||||
.etatMaterielDepart(livraison.getEtatMaterielDepart())
|
.etatMaterielDepart(livraison.getEtatMaterielDepart())
|
||||||
.etatMaterielArrivee(livraison.getEtatMaterielArrivee())
|
.etatMaterielArrivee(livraison.getEtatMaterielArrivee())
|
||||||
.quantiteLivree(livraison.getQuantiteLivree())
|
.quantiteLivree(livraison.getQuantiteLivree())
|
||||||
.quantiteCommandee(livraison.getQuantiteCommandee())
|
.quantiteCommandee(livraison.getQuantiteCommandee())
|
||||||
.conformiteLivraison(livraison.getConformiteLivraison())
|
.conformiteLivraison(livraison.getConformiteLivraison())
|
||||||
.observationsChauffeur(livraison.getObservationsChauffeur())
|
.observationsChauffeur(livraison.getObservationsChauffeur())
|
||||||
.observationsReceptionnaire(livraison.getObservationsReceptionnaire())
|
.observationsReceptionnaire(livraison.getObservationsReceptionnaire())
|
||||||
.signatureReceptionnaire(livraison.getSignatureReceptionnaire())
|
.signatureReceptionnaire(livraison.getSignatureReceptionnaire())
|
||||||
.photoLivraison(livraison.getPhotoLivraison())
|
.photoLivraison(livraison.getPhotoLivraison())
|
||||||
.coutTransport(livraison.getCoutTransport())
|
.coutTransport(livraison.getCoutTransport())
|
||||||
.coutCarburant(livraison.getCoutCarburant())
|
.coutCarburant(livraison.getCoutCarburant())
|
||||||
.coutPeages(livraison.getCoutPeages())
|
.coutPeages(livraison.getCoutPeages())
|
||||||
.coutTotal(livraison.getCoutTotal())
|
.coutTotal(livraison.getCoutTotal())
|
||||||
.facture(livraison.getFacture())
|
.facture(livraison.getFacture())
|
||||||
.incidentDetecte(livraison.getIncidentDetecte())
|
.incidentDetecte(livraison.getIncidentDetecte())
|
||||||
.typeIncident(livraison.getTypeIncident())
|
.typeIncident(livraison.getTypeIncident())
|
||||||
.descriptionIncident(livraison.getDescriptionIncident())
|
.descriptionIncident(livraison.getDescriptionIncident())
|
||||||
.impactIncident(livraison.getImpactIncident())
|
.impactIncident(livraison.getImpactIncident())
|
||||||
.actionsCorrectives(livraison.getActionsCorrectives())
|
.actionsCorrectives(livraison.getActionsCorrectives())
|
||||||
.trackingActive(livraison.getTrackingActive())
|
.trackingActive(livraison.getTrackingActive())
|
||||||
.dernierePositionLat(livraison.getDernierePositionLat())
|
.dernierePositionLat(livraison.getDernierePositionLat())
|
||||||
.dernierePositionLng(livraison.getDernierePositionLng())
|
.dernierePositionLng(livraison.getDernierePositionLng())
|
||||||
.derniereMiseAJourGps(livraison.getDerniereMiseAJourGps())
|
.derniereMiseAJourGps(livraison.getDerniereMiseAJourGps())
|
||||||
.vitesseActuelleKmh(livraison.getVitesseActuelleKmh())
|
.vitesseActuelleKmh(livraison.getVitesseActuelleKmh())
|
||||||
.dateCreation(livraison.getDateCreation())
|
.dateCreation(livraison.getDateCreation())
|
||||||
.dateModification(livraison.getDateModification())
|
.dateModification(livraison.getDateModification())
|
||||||
.planificateur(livraison.getPlanificateur())
|
.planificateur(livraison.getPlanificateur())
|
||||||
.derniereModificationPar(livraison.getDerniereModificationPar())
|
.derniereModificationPar(livraison.getDerniereModificationPar())
|
||||||
.actif(livraison.getActif())
|
.actif(livraison.getActif())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// Relations simplifiées
|
// Relations simplifiées
|
||||||
if (livraison.getReservation() != null) {
|
if (livraison.getReservation() != null) {
|
||||||
dto.setReservationId(livraison.getReservation().getId());
|
dto.setReservationId(livraison.getReservation().getId());
|
||||||
dto.setReservationReference(livraison.getReservation().getReferenceReservation());
|
dto.setReservationReference(livraison.getReservation().getReferenceReservation());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (livraison.getChantierDestination() != null) {
|
if (livraison.getChantierDestination() != null) {
|
||||||
dto.setChantierDestinationId(livraison.getChantierDestination().getId());
|
dto.setChantierDestinationId(livraison.getChantierDestination().getId());
|
||||||
dto.setChantierDestinationNom(livraison.getChantierDestination().getNom());
|
dto.setChantierDestinationNom(livraison.getChantierDestination().getNom());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Métadonnées calculées
|
// Métadonnées calculées
|
||||||
dto.setDureeTotalePrevueMinutes(livraison.getDureeTotalePrevueMinutes());
|
dto.setDureeTotalePrevueMinutes(livraison.getDureeTotalePrevueMinutes());
|
||||||
dto.setDureeTotaleReelleMinutes(livraison.getDureeTotaleReelleMinutes());
|
dto.setDureeTotaleReelleMinutes(livraison.getDureeTotaleReelleMinutes());
|
||||||
dto.setRetardMinutes(livraison.getRetardMinutes());
|
dto.setRetardMinutes(livraison.getRetardMinutes());
|
||||||
dto.setEstEnRetard(livraison.estEnRetard());
|
dto.setEstEnRetard(livraison.estEnRetard());
|
||||||
dto.setEstConforme(livraison.estConforme());
|
dto.setEstConforme(livraison.estConforme());
|
||||||
dto.setVitesseMoyenneKmh(livraison.getVitesseMoyenneKmh());
|
dto.setVitesseMoyenneKmh(livraison.getVitesseMoyenneKmh());
|
||||||
dto.setIsTrackingDisponible(livraison.isTrackingDisponible());
|
dto.setIsTrackingDisponible(livraison.isTrackingDisponible());
|
||||||
dto.setDistanceVersDestination(livraison.getDistanceVersDestination());
|
dto.setDistanceVersDestination(livraison.getDistanceVersDestination());
|
||||||
dto.setHeureArriveeEstimee(livraison.getHeureArriveeEstimee());
|
dto.setHeureArriveeEstimee(livraison.getHeureArriveeEstimee());
|
||||||
dto.setNecessiteManutention(livraison.necessiteManutention());
|
dto.setNecessiteManutention(livraison.necessiteManutention());
|
||||||
dto.setPriorite(livraison.getPriorite());
|
dto.setPriorite(livraison.getPriorite());
|
||||||
|
|
||||||
return dto;
|
return dto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,78 +1,78 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.mapper;
|
package dev.lions.btpxpress.domain.shared.mapper;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.MaintenanceMateriel;
|
import dev.lions.btpxpress.domain.core.entity.MaintenanceMateriel;
|
||||||
import dev.lions.btpxpress.domain.shared.dto.MaintenanceCreateDTO;
|
import dev.lions.btpxpress.domain.shared.dto.MaintenanceCreateDTO;
|
||||||
import dev.lions.btpxpress.domain.shared.dto.MaintenanceResponseDTO;
|
import dev.lions.btpxpress.domain.shared.dto.MaintenanceResponseDTO;
|
||||||
import jakarta.enterprise.context.ApplicationScoped;
|
import jakarta.enterprise.context.ApplicationScoped;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapper pour les maintenances - Architecture 2025
|
* Mapper pour les maintenances - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@ApplicationScoped
|
@ApplicationScoped
|
||||||
public class MaintenanceMapper {
|
public class MaintenanceMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion DTO vers entité
|
* Conversion DTO vers entité
|
||||||
*/
|
*/
|
||||||
public MaintenanceMateriel toEntity(MaintenanceCreateDTO dto) {
|
public MaintenanceMateriel toEntity(MaintenanceCreateDTO dto) {
|
||||||
if (dto == null) {
|
if (dto == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
MaintenanceMateriel maintenance = MaintenanceMateriel.builder()
|
MaintenanceMateriel maintenance = MaintenanceMateriel.builder()
|
||||||
.type(dto.getType())
|
.type(dto.getType())
|
||||||
.description(dto.getDescription())
|
.description(dto.getDescription())
|
||||||
.datePrevue(dto.getDatePrevue())
|
.datePrevue(dto.getDatePrevue())
|
||||||
.dateRealisee(dto.getDateRealisee())
|
.dateRealisee(dto.getDateRealisee())
|
||||||
.cout(dto.getCout())
|
.cout(dto.getCout())
|
||||||
.statut(dto.getStatut() != null ? dto.getStatut() : dev.lions.btpxpress.domain.core.entity.StatutMaintenance.PLANIFIEE)
|
.statut(dto.getStatut() != null ? dto.getStatut() : dev.lions.btpxpress.domain.core.entity.StatutMaintenance.PLANIFIEE)
|
||||||
.technicien(dto.getTechnicien())
|
.technicien(dto.getTechnicien())
|
||||||
.notes(dto.getNotes())
|
.notes(dto.getNotes())
|
||||||
.prochaineMaintenance(dto.getProchaineMaintenance())
|
.prochaineMaintenance(dto.getProchaineMaintenance())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
return maintenance;
|
return maintenance;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion entité vers ResponseDTO
|
* Conversion entité vers ResponseDTO
|
||||||
*/
|
*/
|
||||||
public MaintenanceResponseDTO toResponseDTO(MaintenanceMateriel maintenance) {
|
public MaintenanceResponseDTO toResponseDTO(MaintenanceMateriel maintenance) {
|
||||||
if (maintenance == null) {
|
if (maintenance == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
MaintenanceResponseDTO dto = MaintenanceResponseDTO.builder()
|
MaintenanceResponseDTO dto = MaintenanceResponseDTO.builder()
|
||||||
.id(maintenance.getId())
|
.id(maintenance.getId())
|
||||||
.type(maintenance.getType())
|
.type(maintenance.getType())
|
||||||
.description(maintenance.getDescription())
|
.description(maintenance.getDescription())
|
||||||
.datePrevue(maintenance.getDatePrevue())
|
.datePrevue(maintenance.getDatePrevue())
|
||||||
.dateRealisee(maintenance.getDateRealisee())
|
.dateRealisee(maintenance.getDateRealisee())
|
||||||
.cout(maintenance.getCout())
|
.cout(maintenance.getCout())
|
||||||
.statut(maintenance.getStatut())
|
.statut(maintenance.getStatut())
|
||||||
.technicien(maintenance.getTechnicien())
|
.technicien(maintenance.getTechnicien())
|
||||||
.notes(maintenance.getNotes())
|
.notes(maintenance.getNotes())
|
||||||
.prochaineMaintenance(maintenance.getProchaineMaintenance())
|
.prochaineMaintenance(maintenance.getProchaineMaintenance())
|
||||||
.dateCreation(maintenance.getDateCreation())
|
.dateCreation(maintenance.getDateCreation())
|
||||||
.dateModification(maintenance.getDateModification())
|
.dateModification(maintenance.getDateModification())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// Relations simplifiées
|
// Relations simplifiées
|
||||||
if (maintenance.getMateriel() != null) {
|
if (maintenance.getMateriel() != null) {
|
||||||
dto.setMaterielId(maintenance.getMateriel().getId());
|
dto.setMaterielId(maintenance.getMateriel().getId());
|
||||||
dto.setMaterielNom(maintenance.getMateriel().getNom());
|
dto.setMaterielNom(maintenance.getMateriel().getNom());
|
||||||
dto.setMaterielReference(maintenance.getMateriel().getNumeroSerie());
|
dto.setMaterielReference(maintenance.getMateriel().getNumeroSerie());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Métadonnées calculées
|
// Métadonnées calculées
|
||||||
dto.setEnRetard(maintenance.isEnRetard());
|
dto.setEnRetard(maintenance.isEnRetard());
|
||||||
dto.setTerminee(maintenance.isTerminee());
|
dto.setTerminee(maintenance.isTerminee());
|
||||||
|
|
||||||
return dto;
|
return dto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,192 +1,192 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.mapper;
|
package dev.lions.btpxpress.domain.shared.mapper;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.*;
|
import dev.lions.btpxpress.domain.core.entity.*;
|
||||||
import dev.lions.btpxpress.domain.shared.dto.*;
|
import dev.lions.btpxpress.domain.shared.dto.*;
|
||||||
import jakarta.enterprise.context.ApplicationScoped;
|
import jakarta.enterprise.context.ApplicationScoped;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapper pour les matériels - Architecture 2025
|
* Mapper pour les matériels - Architecture 2025
|
||||||
* Suit le même pattern que ChantierMapper et ClientMapper
|
* Suit le même pattern que ChantierMapper et ClientMapper
|
||||||
*
|
*
|
||||||
* Note: Ce mapper gère Materiel (entité principale), pas MaterielBTP (entité technique détaillée)
|
* Note: Ce mapper gère Materiel (entité principale), pas MaterielBTP (entité technique détaillée)
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@ApplicationScoped
|
@ApplicationScoped
|
||||||
public class MaterielMapper {
|
public class MaterielMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion DTO vers entité
|
* Conversion DTO vers entité
|
||||||
*
|
*
|
||||||
* @param dto Le DTO de création
|
* @param dto Le DTO de création
|
||||||
* @return L'entité Materiel créée
|
* @return L'entité Materiel créée
|
||||||
*/
|
*/
|
||||||
public Materiel toEntity(MaterielCreateDTO dto) {
|
public Materiel toEntity(MaterielCreateDTO dto) {
|
||||||
if (dto == null) {
|
if (dto == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Materiel materiel = new Materiel();
|
Materiel materiel = new Materiel();
|
||||||
materiel.setNom(dto.getNom());
|
materiel.setNom(dto.getNom());
|
||||||
materiel.setDescription(dto.getDescription());
|
materiel.setDescription(dto.getDescription());
|
||||||
materiel.setNumeroSerie(dto.getCode()); // Utiliser code comme numeroSerie
|
materiel.setNumeroSerie(dto.getCode()); // Utiliser code comme numeroSerie
|
||||||
// Type sera déterminé par défaut ou laissé à null (sera requis par validation)
|
// Type sera déterminé par défaut ou laissé à null (sera requis par validation)
|
||||||
materiel.setType(determineTypeMateriel(dto.getCategorie()));
|
materiel.setType(determineTypeMateriel(dto.getCategorie()));
|
||||||
materiel.setLocalisation(dto.getLocalisation());
|
materiel.setLocalisation(dto.getLocalisation());
|
||||||
materiel.setActif(dto.getActif() != null ? dto.getActif() : true);
|
materiel.setActif(dto.getActif() != null ? dto.getActif() : true);
|
||||||
|
|
||||||
// Gestion du stock
|
// Gestion du stock
|
||||||
if (dto.getStockDisponible() != null) {
|
if (dto.getStockDisponible() != null) {
|
||||||
materiel.setQuantiteStock(BigDecimal.valueOf(dto.getStockDisponible()));
|
materiel.setQuantiteStock(BigDecimal.valueOf(dto.getStockDisponible()));
|
||||||
}
|
}
|
||||||
if (dto.getStockMinimum() != null) {
|
if (dto.getStockMinimum() != null) {
|
||||||
materiel.setSeuilMinimum(BigDecimal.valueOf(dto.getStockMinimum()));
|
materiel.setSeuilMinimum(BigDecimal.valueOf(dto.getStockMinimum()));
|
||||||
}
|
}
|
||||||
materiel.setUnite(dto.getUnite());
|
materiel.setUnite(dto.getUnite());
|
||||||
|
|
||||||
return materiel;
|
return materiel;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mise à jour d'entité depuis DTO
|
* Mise à jour d'entité depuis DTO
|
||||||
*
|
*
|
||||||
* @param materiel L'entité à mettre à jour
|
* @param materiel L'entité à mettre à jour
|
||||||
* @param dto Le DTO contenant les nouvelles valeurs
|
* @param dto Le DTO contenant les nouvelles valeurs
|
||||||
*/
|
*/
|
||||||
public void updateEntity(Materiel materiel, MaterielCreateDTO dto) {
|
public void updateEntity(Materiel materiel, MaterielCreateDTO dto) {
|
||||||
if (materiel == null || dto == null) {
|
if (materiel == null || dto == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
materiel.setNom(dto.getNom());
|
materiel.setNom(dto.getNom());
|
||||||
materiel.setDescription(dto.getDescription());
|
materiel.setDescription(dto.getDescription());
|
||||||
if (dto.getCode() != null) {
|
if (dto.getCode() != null) {
|
||||||
materiel.setNumeroSerie(dto.getCode());
|
materiel.setNumeroSerie(dto.getCode());
|
||||||
}
|
}
|
||||||
if (dto.getCategorie() != null) {
|
if (dto.getCategorie() != null) {
|
||||||
materiel.setType(determineTypeMateriel(dto.getCategorie()));
|
materiel.setType(determineTypeMateriel(dto.getCategorie()));
|
||||||
}
|
}
|
||||||
materiel.setLocalisation(dto.getLocalisation());
|
materiel.setLocalisation(dto.getLocalisation());
|
||||||
if (dto.getActif() != null) {
|
if (dto.getActif() != null) {
|
||||||
materiel.setActif(dto.getActif());
|
materiel.setActif(dto.getActif());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Gestion du stock
|
// Gestion du stock
|
||||||
if (dto.getStockDisponible() != null) {
|
if (dto.getStockDisponible() != null) {
|
||||||
materiel.setQuantiteStock(BigDecimal.valueOf(dto.getStockDisponible()));
|
materiel.setQuantiteStock(BigDecimal.valueOf(dto.getStockDisponible()));
|
||||||
}
|
}
|
||||||
if (dto.getStockMinimum() != null) {
|
if (dto.getStockMinimum() != null) {
|
||||||
materiel.setSeuilMinimum(BigDecimal.valueOf(dto.getStockMinimum()));
|
materiel.setSeuilMinimum(BigDecimal.valueOf(dto.getStockMinimum()));
|
||||||
}
|
}
|
||||||
if (dto.getUnite() != null) {
|
if (dto.getUnite() != null) {
|
||||||
materiel.setUnite(dto.getUnite());
|
materiel.setUnite(dto.getUnite());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion entité vers ResponseDTO
|
* Conversion entité vers ResponseDTO
|
||||||
*
|
*
|
||||||
* @param materiel L'entité Materiel
|
* @param materiel L'entité Materiel
|
||||||
* @return Le DTO de réponse
|
* @return Le DTO de réponse
|
||||||
*/
|
*/
|
||||||
public MaterielResponseDTO toResponseDTO(Materiel materiel) {
|
public MaterielResponseDTO toResponseDTO(Materiel materiel) {
|
||||||
if (materiel == null) {
|
if (materiel == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
MaterielResponseDTO dto = MaterielResponseDTO.builder()
|
MaterielResponseDTO dto = MaterielResponseDTO.builder()
|
||||||
.id(materiel.getId())
|
.id(materiel.getId())
|
||||||
.code(materiel.getCode()) // Utiliser la méthode getCode() qui gère la génération
|
.code(materiel.getCode()) // Utiliser la méthode getCode() qui gère la génération
|
||||||
.nom(materiel.getNom())
|
.nom(materiel.getNom())
|
||||||
.description(materiel.getDescription())
|
.description(materiel.getDescription())
|
||||||
.categorie(determineCategorieMateriel(materiel.getType()))
|
.categorie(determineCategorieMateriel(materiel.getType()))
|
||||||
.sousCategorie(null) // Pas de sous-catégorie dans Materiel
|
.sousCategorie(null) // Pas de sous-catégorie dans Materiel
|
||||||
.prixUnitaire(materiel.getValeurActuelle()) // Utiliser valeurActuelle comme prixUnitaire
|
.prixUnitaire(materiel.getValeurActuelle()) // Utiliser valeurActuelle comme prixUnitaire
|
||||||
.unite(materiel.getUnite())
|
.unite(materiel.getUnite())
|
||||||
.stockDisponible(materiel.getQuantiteStock() != null ? materiel.getQuantiteStock().intValue() : 0)
|
.stockDisponible(materiel.getQuantiteStock() != null ? materiel.getQuantiteStock().intValue() : 0)
|
||||||
.stockMinimum(materiel.getSeuilMinimum() != null ? materiel.getSeuilMinimum().intValue() : 0)
|
.stockMinimum(materiel.getSeuilMinimum() != null ? materiel.getSeuilMinimum().intValue() : 0)
|
||||||
.localisation(materiel.getLocalisation())
|
.localisation(materiel.getLocalisation())
|
||||||
.actif(materiel.getActif())
|
.actif(materiel.getActif())
|
||||||
.dateCreation(materiel.getDateCreation())
|
.dateCreation(materiel.getDateCreation())
|
||||||
.dateModification(materiel.getDateModification())
|
.dateModification(materiel.getDateModification())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// Relations simplifiées - Materiel n'a pas de relation directe avec Fournisseur
|
// Relations simplifiées - Materiel n'a pas de relation directe avec Fournisseur
|
||||||
// Le fournisseur est géré via CatalogueFournisseur
|
// Le fournisseur est géré via CatalogueFournisseur
|
||||||
dto.setFournisseurId(null);
|
dto.setFournisseurId(null);
|
||||||
dto.setFournisseurNom(null);
|
dto.setFournisseurNom(null);
|
||||||
|
|
||||||
// Compter les réservations et maintenances (si les relations sont chargées)
|
// Compter les réservations et maintenances (si les relations sont chargées)
|
||||||
if (materiel.getReservations() != null) {
|
if (materiel.getReservations() != null) {
|
||||||
dto.setNombreReservations(materiel.getReservations().size());
|
dto.setNombreReservations(materiel.getReservations().size());
|
||||||
} else {
|
} else {
|
||||||
dto.setNombreReservations(0);
|
dto.setNombreReservations(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (materiel.getMaintenances() != null) {
|
if (materiel.getMaintenances() != null) {
|
||||||
dto.setNombreMaintenances(materiel.getMaintenances().size());
|
dto.setNombreMaintenances(materiel.getMaintenances().size());
|
||||||
} else {
|
} else {
|
||||||
dto.setNombreMaintenances(0);
|
dto.setNombreMaintenances(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return dto;
|
return dto;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convertit CategorieMateriel (MaterielBTP) en TypeMateriel (Materiel)
|
* Convertit CategorieMateriel (MaterielBTP) en TypeMateriel (Materiel)
|
||||||
* Mapping simplifié - peut être amélioré selon les besoins métier
|
* Mapping simplifié - peut être amélioré selon les besoins métier
|
||||||
*/
|
*/
|
||||||
private TypeMateriel determineTypeMateriel(MaterielBTP.CategorieMateriel categorie) {
|
private TypeMateriel determineTypeMateriel(MaterielBTP.CategorieMateriel categorie) {
|
||||||
if (categorie == null) {
|
if (categorie == null) {
|
||||||
return TypeMateriel.OUTILLAGE;
|
return TypeMateriel.OUTILLAGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mapping basique - à adapter selon les catégories réelles
|
// Mapping basique - à adapter selon les catégories réelles
|
||||||
try {
|
try {
|
||||||
String categorieName = categorie.name();
|
String categorieName = categorie.name();
|
||||||
if (categorieName.contains("BETON") || categorieName.contains("CIMENT") || categorieName.contains("MORTIER")) {
|
if (categorieName.contains("BETON") || categorieName.contains("CIMENT") || categorieName.contains("MORTIER")) {
|
||||||
return TypeMateriel.MATERIAUX_CONSTRUCTION;
|
return TypeMateriel.MATERIAUX_CONSTRUCTION;
|
||||||
} else if (categorieName.contains("OUTIL")) {
|
} else if (categorieName.contains("OUTIL")) {
|
||||||
return TypeMateriel.OUTILLAGE;
|
return TypeMateriel.OUTILLAGE;
|
||||||
} else if (categorieName.contains("EQUIPEMENT") || categorieName.contains("SECURITE")) {
|
} else if (categorieName.contains("EQUIPEMENT") || categorieName.contains("SECURITE")) {
|
||||||
return TypeMateriel.EQUIPEMENT_SECURITE;
|
return TypeMateriel.EQUIPEMENT_SECURITE;
|
||||||
} else if (categorieName.contains("VEHICULE") || categorieName.contains("ENGIN")) {
|
} else if (categorieName.contains("VEHICULE") || categorieName.contains("ENGIN")) {
|
||||||
return TypeMateriel.ENGIN_CHANTIER;
|
return TypeMateriel.ENGIN_CHANTIER;
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// En cas d'erreur, retourner OUTILLAGE par défaut
|
// En cas d'erreur, retourner OUTILLAGE par défaut
|
||||||
}
|
}
|
||||||
return TypeMateriel.OUTILLAGE;
|
return TypeMateriel.OUTILLAGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convertit TypeMateriel (Materiel) en CategorieMateriel (MaterielBTP)
|
* Convertit TypeMateriel (Materiel) en CategorieMateriel (MaterielBTP)
|
||||||
* Mapping simplifié - peut être amélioré selon les besoins métier
|
* Mapping simplifié - peut être amélioré selon les besoins métier
|
||||||
*/
|
*/
|
||||||
private MaterielBTP.CategorieMateriel determineCategorieMateriel(TypeMateriel type) {
|
private MaterielBTP.CategorieMateriel determineCategorieMateriel(TypeMateriel type) {
|
||||||
if (type == null) {
|
if (type == null) {
|
||||||
return MaterielBTP.CategorieMateriel.OUTILLAGE;
|
return MaterielBTP.CategorieMateriel.OUTILLAGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mapping basique - à adapter selon les types réels
|
// Mapping basique - à adapter selon les types réels
|
||||||
try {
|
try {
|
||||||
String typeName = type.name();
|
String typeName = type.name();
|
||||||
if (typeName.contains("MATERIAUX") || typeName.contains("CONSTRUCTION")) {
|
if (typeName.contains("MATERIAUX") || typeName.contains("CONSTRUCTION")) {
|
||||||
return MaterielBTP.CategorieMateriel.GROS_OEUVRE;
|
return MaterielBTP.CategorieMateriel.GROS_OEUVRE;
|
||||||
} else if (typeName.contains("OUTIL") || typeName.contains("OUTILLAGE")) {
|
} else if (typeName.contains("OUTIL") || typeName.contains("OUTILLAGE")) {
|
||||||
return MaterielBTP.CategorieMateriel.OUTILLAGE;
|
return MaterielBTP.CategorieMateriel.OUTILLAGE;
|
||||||
} else if (typeName.contains("EQUIPEMENT") || typeName.contains("SECURITE")) {
|
} else if (typeName.contains("EQUIPEMENT") || typeName.contains("SECURITE")) {
|
||||||
return MaterielBTP.CategorieMateriel.EQUIPEMENTS;
|
return MaterielBTP.CategorieMateriel.EQUIPEMENTS;
|
||||||
} else if (typeName.contains("VEHICULE") || typeName.contains("ENGIN")) {
|
} else if (typeName.contains("VEHICULE") || typeName.contains("ENGIN")) {
|
||||||
return MaterielBTP.CategorieMateriel.EQUIPEMENTS;
|
return MaterielBTP.CategorieMateriel.EQUIPEMENTS;
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// En cas d'erreur, retourner OUTILLAGE par défaut
|
// En cas d'erreur, retourner OUTILLAGE par défaut
|
||||||
}
|
}
|
||||||
return MaterielBTP.CategorieMateriel.OUTILLAGE;
|
return MaterielBTP.CategorieMateriel.OUTILLAGE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,103 +1,103 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.mapper;
|
package dev.lions.btpxpress.domain.shared.mapper;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.Message;
|
import dev.lions.btpxpress.domain.core.entity.Message;
|
||||||
import dev.lions.btpxpress.domain.shared.dto.MessageCreateDTO;
|
import dev.lions.btpxpress.domain.shared.dto.MessageCreateDTO;
|
||||||
import dev.lions.btpxpress.domain.shared.dto.MessageResponseDTO;
|
import dev.lions.btpxpress.domain.shared.dto.MessageResponseDTO;
|
||||||
import jakarta.enterprise.context.ApplicationScoped;
|
import jakarta.enterprise.context.ApplicationScoped;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapper pour les messages - Architecture 2025
|
* Mapper pour les messages - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@ApplicationScoped
|
@ApplicationScoped
|
||||||
public class MessageMapper {
|
public class MessageMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion DTO vers entité
|
* Conversion DTO vers entité
|
||||||
*/
|
*/
|
||||||
public Message toEntity(MessageCreateDTO dto) {
|
public Message toEntity(MessageCreateDTO dto) {
|
||||||
if (dto == null) {
|
if (dto == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Message message = Message.builder()
|
Message message = Message.builder()
|
||||||
.sujet(dto.getSujet())
|
.sujet(dto.getSujet())
|
||||||
.contenu(dto.getContenu())
|
.contenu(dto.getContenu())
|
||||||
.type(dto.getType() != null ? dto.getType() : dev.lions.btpxpress.domain.core.entity.TypeMessage.NORMAL)
|
.type(dto.getType() != null ? dto.getType() : dev.lions.btpxpress.domain.core.entity.TypeMessage.NORMAL)
|
||||||
.priorite(dto.getPriorite() != null ? dto.getPriorite() : dev.lions.btpxpress.domain.core.entity.PrioriteMessage.NORMALE)
|
.priorite(dto.getPriorite() != null ? dto.getPriorite() : dev.lions.btpxpress.domain.core.entity.PrioriteMessage.NORMALE)
|
||||||
.important(dto.getImportant() != null ? dto.getImportant() : false)
|
.important(dto.getImportant() != null ? dto.getImportant() : false)
|
||||||
.fichiersJoints(dto.getFichiersJoints())
|
.fichiersJoints(dto.getFichiersJoints())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion entité vers ResponseDTO
|
* Conversion entité vers ResponseDTO
|
||||||
*/
|
*/
|
||||||
public MessageResponseDTO toResponseDTO(Message message) {
|
public MessageResponseDTO toResponseDTO(Message message) {
|
||||||
if (message == null) {
|
if (message == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
MessageResponseDTO dto = MessageResponseDTO.builder()
|
MessageResponseDTO dto = MessageResponseDTO.builder()
|
||||||
.id(message.getId())
|
.id(message.getId())
|
||||||
.sujet(message.getSujet())
|
.sujet(message.getSujet())
|
||||||
.contenu(message.getContenu())
|
.contenu(message.getContenu())
|
||||||
.type(message.getType())
|
.type(message.getType())
|
||||||
.priorite(message.getPriorite())
|
.priorite(message.getPriorite())
|
||||||
.lu(message.getLu())
|
.lu(message.getLu())
|
||||||
.dateLecture(message.getDateLecture())
|
.dateLecture(message.getDateLecture())
|
||||||
.important(message.getImportant())
|
.important(message.getImportant())
|
||||||
.archive(message.getArchive())
|
.archive(message.getArchive())
|
||||||
.dateArchivage(message.getDateArchivage())
|
.dateArchivage(message.getDateArchivage())
|
||||||
.fichiersJoints(message.getFichiersJoints())
|
.fichiersJoints(message.getFichiersJoints())
|
||||||
.dateCreation(message.getDateCreation())
|
.dateCreation(message.getDateCreation())
|
||||||
.dateModification(message.getDateModification())
|
.dateModification(message.getDateModification())
|
||||||
.actif(message.getActif())
|
.actif(message.getActif())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// Relations simplifiées
|
// Relations simplifiées
|
||||||
if (message.getExpediteur() != null) {
|
if (message.getExpediteur() != null) {
|
||||||
dto.setExpediteurId(message.getExpediteur().getId());
|
dto.setExpediteurId(message.getExpediteur().getId());
|
||||||
dto.setExpediteurNom(message.getExpediteur().getNom());
|
dto.setExpediteurNom(message.getExpediteur().getNom());
|
||||||
dto.setExpediteurPrenom(message.getExpediteur().getPrenom());
|
dto.setExpediteurPrenom(message.getExpediteur().getPrenom());
|
||||||
dto.setExpediteurEmail(message.getExpediteur().getEmail());
|
dto.setExpediteurEmail(message.getExpediteur().getEmail());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (message.getDestinataire() != null) {
|
if (message.getDestinataire() != null) {
|
||||||
dto.setDestinataireId(message.getDestinataire().getId());
|
dto.setDestinataireId(message.getDestinataire().getId());
|
||||||
dto.setDestinataireNom(message.getDestinataire().getNom());
|
dto.setDestinataireNom(message.getDestinataire().getNom());
|
||||||
dto.setDestinatairePrenom(message.getDestinataire().getPrenom());
|
dto.setDestinatairePrenom(message.getDestinataire().getPrenom());
|
||||||
dto.setDestinataireEmail(message.getDestinataire().getEmail());
|
dto.setDestinataireEmail(message.getDestinataire().getEmail());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (message.getMessageParent() != null) {
|
if (message.getMessageParent() != null) {
|
||||||
dto.setMessageParentId(message.getMessageParent().getId());
|
dto.setMessageParentId(message.getMessageParent().getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (message.getChantier() != null) {
|
if (message.getChantier() != null) {
|
||||||
dto.setChantierId(message.getChantier().getId());
|
dto.setChantierId(message.getChantier().getId());
|
||||||
dto.setChantierNom(message.getChantier().getNom());
|
dto.setChantierNom(message.getChantier().getNom());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (message.getEquipe() != null) {
|
if (message.getEquipe() != null) {
|
||||||
dto.setEquipeId(message.getEquipe().getId());
|
dto.setEquipeId(message.getEquipe().getId());
|
||||||
dto.setEquipeNom(message.getEquipe().getNom());
|
dto.setEquipeNom(message.getEquipe().getNom());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Métadonnées calculées
|
// Métadonnées calculées
|
||||||
dto.setNombreReponses(message.getNombreReponses());
|
dto.setNombreReponses(message.getNombreReponses());
|
||||||
dto.setEstReponse(message.estReponse());
|
dto.setEstReponse(message.estReponse());
|
||||||
dto.setADesReponses(message.aDesReponses());
|
dto.setADesReponses(message.aDesReponses());
|
||||||
dto.setEstCritique(message.estCritique());
|
dto.setEstCritique(message.estCritique());
|
||||||
dto.setEstHautePriorite(message.estHautePriorite());
|
dto.setEstHautePriorite(message.estHautePriorite());
|
||||||
dto.setEstRecent(message.estRecent());
|
dto.setEstRecent(message.estRecent());
|
||||||
|
|
||||||
return dto;
|
return dto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,99 +1,99 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.mapper;
|
package dev.lions.btpxpress.domain.shared.mapper;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.Notification;
|
import dev.lions.btpxpress.domain.core.entity.Notification;
|
||||||
import dev.lions.btpxpress.domain.shared.dto.NotificationCreateDTO;
|
import dev.lions.btpxpress.domain.shared.dto.NotificationCreateDTO;
|
||||||
import dev.lions.btpxpress.domain.shared.dto.NotificationResponseDTO;
|
import dev.lions.btpxpress.domain.shared.dto.NotificationResponseDTO;
|
||||||
import jakarta.enterprise.context.ApplicationScoped;
|
import jakarta.enterprise.context.ApplicationScoped;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapper pour les notifications - Architecture 2025
|
* Mapper pour les notifications - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@ApplicationScoped
|
@ApplicationScoped
|
||||||
public class NotificationMapper {
|
public class NotificationMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion DTO vers entité
|
* Conversion DTO vers entité
|
||||||
*/
|
*/
|
||||||
public Notification toEntity(NotificationCreateDTO dto) {
|
public Notification toEntity(NotificationCreateDTO dto) {
|
||||||
if (dto == null) {
|
if (dto == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Notification notification = Notification.builder()
|
Notification notification = Notification.builder()
|
||||||
.titre(dto.getTitre())
|
.titre(dto.getTitre())
|
||||||
.message(dto.getMessage())
|
.message(dto.getMessage())
|
||||||
.type(dto.getType())
|
.type(dto.getType())
|
||||||
.priorite(dto.getPriorite() != null ? dto.getPriorite() : dev.lions.btpxpress.domain.core.entity.PrioriteNotification.NORMALE)
|
.priorite(dto.getPriorite() != null ? dto.getPriorite() : dev.lions.btpxpress.domain.core.entity.PrioriteNotification.NORMALE)
|
||||||
.lienAction(dto.getLienAction())
|
.lienAction(dto.getLienAction())
|
||||||
.donnees(dto.getDonnees())
|
.donnees(dto.getDonnees())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
return notification;
|
return notification;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion entité vers ResponseDTO
|
* Conversion entité vers ResponseDTO
|
||||||
*/
|
*/
|
||||||
public NotificationResponseDTO toResponseDTO(Notification notification) {
|
public NotificationResponseDTO toResponseDTO(Notification notification) {
|
||||||
if (notification == null) {
|
if (notification == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
NotificationResponseDTO dto = NotificationResponseDTO.builder()
|
NotificationResponseDTO dto = NotificationResponseDTO.builder()
|
||||||
.id(notification.getId())
|
.id(notification.getId())
|
||||||
.titre(notification.getTitre())
|
.titre(notification.getTitre())
|
||||||
.message(notification.getMessage())
|
.message(notification.getMessage())
|
||||||
.type(notification.getType())
|
.type(notification.getType())
|
||||||
.priorite(notification.getPriorite())
|
.priorite(notification.getPriorite())
|
||||||
.lue(notification.getLue())
|
.lue(notification.getLue())
|
||||||
.dateLecture(notification.getDateLecture())
|
.dateLecture(notification.getDateLecture())
|
||||||
.lienAction(notification.getLienAction())
|
.lienAction(notification.getLienAction())
|
||||||
.donnees(notification.getDonnees())
|
.donnees(notification.getDonnees())
|
||||||
.dateCreation(notification.getDateCreation())
|
.dateCreation(notification.getDateCreation())
|
||||||
.dateModification(notification.getDateModification())
|
.dateModification(notification.getDateModification())
|
||||||
.actif(notification.getActif())
|
.actif(notification.getActif())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// Relations simplifiées
|
// Relations simplifiées
|
||||||
if (notification.getUser() != null) {
|
if (notification.getUser() != null) {
|
||||||
dto.setUserId(notification.getUser().getId());
|
dto.setUserId(notification.getUser().getId());
|
||||||
dto.setUserNom(notification.getUser().getNom());
|
dto.setUserNom(notification.getUser().getNom());
|
||||||
dto.setUserPrenom(notification.getUser().getPrenom());
|
dto.setUserPrenom(notification.getUser().getPrenom());
|
||||||
dto.setUserEmail(notification.getUser().getEmail());
|
dto.setUserEmail(notification.getUser().getEmail());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (notification.getChantier() != null) {
|
if (notification.getChantier() != null) {
|
||||||
dto.setChantierId(notification.getChantier().getId());
|
dto.setChantierId(notification.getChantier().getId());
|
||||||
dto.setChantierNom(notification.getChantier().getNom());
|
dto.setChantierNom(notification.getChantier().getNom());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (notification.getMateriel() != null) {
|
if (notification.getMateriel() != null) {
|
||||||
dto.setMaterielId(notification.getMateriel().getId());
|
dto.setMaterielId(notification.getMateriel().getId());
|
||||||
dto.setMaterielNom(notification.getMateriel().getNom());
|
dto.setMaterielNom(notification.getMateriel().getNom());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (notification.getMaintenance() != null) {
|
if (notification.getMaintenance() != null) {
|
||||||
dto.setMaintenanceId(notification.getMaintenance().getId());
|
dto.setMaintenanceId(notification.getMaintenance().getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (notification.getCreeePar() != null) {
|
if (notification.getCreeePar() != null) {
|
||||||
dto.setCreeeParId(notification.getCreeePar().getId());
|
dto.setCreeeParId(notification.getCreeePar().getId());
|
||||||
dto.setCreeeParNom(notification.getCreeePar().getNom());
|
dto.setCreeeParNom(notification.getCreeePar().getNom());
|
||||||
dto.setCreeeParEmail(notification.getCreeePar().getEmail());
|
dto.setCreeeParEmail(notification.getCreeePar().getEmail());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Métadonnées calculées
|
// Métadonnées calculées
|
||||||
dto.setEstCritique(notification.estCritique());
|
dto.setEstCritique(notification.estCritique());
|
||||||
dto.setEstHautePriorite(notification.estHautePriorite());
|
dto.setEstHautePriorite(notification.estHautePriorite());
|
||||||
dto.setEstRecente(notification.estRecente());
|
dto.setEstRecente(notification.estRecente());
|
||||||
dto.setHasLienAction(notification.hasLienAction());
|
dto.setHasLienAction(notification.hasLienAction());
|
||||||
dto.setHasDonnees(notification.hasDonnees());
|
dto.setHasDonnees(notification.hasDonnees());
|
||||||
|
|
||||||
return dto;
|
return dto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,146 +1,146 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.mapper;
|
package dev.lions.btpxpress.domain.shared.mapper;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.PhaseChantier;
|
import dev.lions.btpxpress.domain.core.entity.PhaseChantier;
|
||||||
import dev.lions.btpxpress.domain.shared.dto.PhaseChantierCreateDTO;
|
import dev.lions.btpxpress.domain.shared.dto.PhaseChantierCreateDTO;
|
||||||
import dev.lions.btpxpress.domain.shared.dto.PhaseChantierResponseDTO;
|
import dev.lions.btpxpress.domain.shared.dto.PhaseChantierResponseDTO;
|
||||||
import jakarta.enterprise.context.ApplicationScoped;
|
import jakarta.enterprise.context.ApplicationScoped;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapper pour les phases de chantier - Architecture 2025
|
* Mapper pour les phases de chantier - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@ApplicationScoped
|
@ApplicationScoped
|
||||||
public class PhaseChantierMapper {
|
public class PhaseChantierMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion DTO vers entité
|
* Conversion DTO vers entité
|
||||||
*/
|
*/
|
||||||
public PhaseChantier toEntity(PhaseChantierCreateDTO dto) {
|
public PhaseChantier toEntity(PhaseChantierCreateDTO dto) {
|
||||||
if (dto == null) {
|
if (dto == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
PhaseChantier phase = new PhaseChantier();
|
PhaseChantier phase = new PhaseChantier();
|
||||||
phase.setNom(dto.getNom());
|
phase.setNom(dto.getNom());
|
||||||
phase.setDescription(dto.getDescription());
|
phase.setDescription(dto.getDescription());
|
||||||
phase.setType(dto.getType());
|
phase.setType(dto.getType());
|
||||||
phase.setOrdreExecution(dto.getOrdreExecution());
|
phase.setOrdreExecution(dto.getOrdreExecution());
|
||||||
phase.setDateDebutPrevue(dto.getDateDebutPrevue());
|
phase.setDateDebutPrevue(dto.getDateDebutPrevue());
|
||||||
phase.setDateFinPrevue(dto.getDateFinPrevue());
|
phase.setDateFinPrevue(dto.getDateFinPrevue());
|
||||||
phase.setBudgetPrevu(dto.getBudgetPrevu());
|
phase.setBudgetPrevu(dto.getBudgetPrevu());
|
||||||
phase.setEquipeResponsableNom(dto.getEquipeResponsableNom());
|
phase.setEquipeResponsableNom(dto.getEquipeResponsableNom());
|
||||||
phase.setChefEquipeNom(dto.getChefEquipeNom());
|
phase.setChefEquipeNom(dto.getChefEquipeNom());
|
||||||
phase.setDureePrevueJours(dto.getDureePrevueJours());
|
phase.setDureePrevueJours(dto.getDureePrevueJours());
|
||||||
phase.setPriorite(dto.getPriorite() != null ? dto.getPriorite() : dev.lions.btpxpress.domain.core.entity.PrioritePhase.NORMALE);
|
phase.setPriorite(dto.getPriorite() != null ? dto.getPriorite() : dev.lions.btpxpress.domain.core.entity.PrioritePhase.NORMALE);
|
||||||
phase.setPrerequis(dto.getPrerequis());
|
phase.setPrerequis(dto.getPrerequis());
|
||||||
phase.setLivrablesAttendus(dto.getLivrablesAttendus());
|
phase.setLivrablesAttendus(dto.getLivrablesAttendus());
|
||||||
phase.setCommentaires(dto.getCommentaires());
|
phase.setCommentaires(dto.getCommentaires());
|
||||||
phase.setRisquesIdentifies(dto.getRisquesIdentifies());
|
phase.setRisquesIdentifies(dto.getRisquesIdentifies());
|
||||||
phase.setMesuresSecurite(dto.getMesuresSecurite());
|
phase.setMesuresSecurite(dto.getMesuresSecurite());
|
||||||
phase.setMaterielRequis(dto.getMaterielRequis());
|
phase.setMaterielRequis(dto.getMaterielRequis());
|
||||||
phase.setCompetencesRequises(dto.getCompetencesRequises());
|
phase.setCompetencesRequises(dto.getCompetencesRequises());
|
||||||
phase.setBloquante(dto.getBloquante() != null ? dto.getBloquante() : false);
|
phase.setBloquante(dto.getBloquante() != null ? dto.getBloquante() : false);
|
||||||
phase.setFacturable(dto.getFacturable() != null ? dto.getFacturable() : true);
|
phase.setFacturable(dto.getFacturable() != null ? dto.getFacturable() : true);
|
||||||
phase.setCode(dto.getCode());
|
phase.setCode(dto.getCode());
|
||||||
phase.setCategorie(dto.getCategorie());
|
phase.setCategorie(dto.getCategorie());
|
||||||
phase.setObjectifs(dto.getObjectifs());
|
phase.setObjectifs(dto.getObjectifs());
|
||||||
|
|
||||||
return phase;
|
return phase;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion entité vers ResponseDTO
|
* Conversion entité vers ResponseDTO
|
||||||
*/
|
*/
|
||||||
public PhaseChantierResponseDTO toResponseDTO(PhaseChantier phase) {
|
public PhaseChantierResponseDTO toResponseDTO(PhaseChantier phase) {
|
||||||
if (phase == null) {
|
if (phase == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
PhaseChantierResponseDTO dto = PhaseChantierResponseDTO.builder()
|
PhaseChantierResponseDTO dto = PhaseChantierResponseDTO.builder()
|
||||||
.id(phase.getId())
|
.id(phase.getId())
|
||||||
.nom(phase.getNom())
|
.nom(phase.getNom())
|
||||||
.description(phase.getDescription())
|
.description(phase.getDescription())
|
||||||
.statut(phase.getStatut())
|
.statut(phase.getStatut())
|
||||||
.type(phase.getType())
|
.type(phase.getType())
|
||||||
.ordreExecution(phase.getOrdreExecution())
|
.ordreExecution(phase.getOrdreExecution())
|
||||||
.dateDebutPrevue(phase.getDateDebutPrevue())
|
.dateDebutPrevue(phase.getDateDebutPrevue())
|
||||||
.dateFinPrevue(phase.getDateFinPrevue())
|
.dateFinPrevue(phase.getDateFinPrevue())
|
||||||
.dateDebutReelle(phase.getDateDebutReelle())
|
.dateDebutReelle(phase.getDateDebutReelle())
|
||||||
.dateFinReelle(phase.getDateFinReelle())
|
.dateFinReelle(phase.getDateFinReelle())
|
||||||
.pourcentageAvancement(phase.getPourcentageAvancement())
|
.pourcentageAvancement(phase.getPourcentageAvancement())
|
||||||
.budgetPrevu(phase.getBudgetPrevu())
|
.budgetPrevu(phase.getBudgetPrevu())
|
||||||
.coutReel(phase.getCoutReel())
|
.coutReel(phase.getCoutReel())
|
||||||
.equipeResponsableNom(phase.getEquipeResponsableNom())
|
.equipeResponsableNom(phase.getEquipeResponsableNom())
|
||||||
.chefEquipeNom(phase.getChefEquipeNom())
|
.chefEquipeNom(phase.getChefEquipeNom())
|
||||||
.dureePrevueJours(phase.getDureePrevueJours())
|
.dureePrevueJours(phase.getDureePrevueJours())
|
||||||
.dureeReelleJours(phase.getDureeReelleJours())
|
.dureeReelleJours(phase.getDureeReelleJours())
|
||||||
.priorite(phase.getPriorite())
|
.priorite(phase.getPriorite())
|
||||||
.prerequis(phase.getPrerequis())
|
.prerequis(phase.getPrerequis())
|
||||||
.livrablesAttendus(phase.getLivrablesAttendus())
|
.livrablesAttendus(phase.getLivrablesAttendus())
|
||||||
.commentaires(phase.getCommentaires())
|
.commentaires(phase.getCommentaires())
|
||||||
.risquesIdentifies(phase.getRisquesIdentifies())
|
.risquesIdentifies(phase.getRisquesIdentifies())
|
||||||
.mesuresSecurite(phase.getMesuresSecurite())
|
.mesuresSecurite(phase.getMesuresSecurite())
|
||||||
.materielRequis(phase.getMaterielRequis())
|
.materielRequis(phase.getMaterielRequis())
|
||||||
.competencesRequises(phase.getCompetencesRequises())
|
.competencesRequises(phase.getCompetencesRequises())
|
||||||
.bloquante(phase.getBloquante())
|
.bloquante(phase.getBloquante())
|
||||||
.facturable(phase.getFacturable())
|
.facturable(phase.getFacturable())
|
||||||
.actif(phase.getActif())
|
.actif(phase.getActif())
|
||||||
.code(phase.getCode())
|
.code(phase.getCode())
|
||||||
.categorie(phase.getCategorie())
|
.categorie(phase.getCategorie())
|
||||||
.objectifs(phase.getObjectifs())
|
.objectifs(phase.getObjectifs())
|
||||||
.dateCreation(phase.getDateCreation())
|
.dateCreation(phase.getDateCreation())
|
||||||
.dateModification(phase.getDateModification())
|
.dateModification(phase.getDateModification())
|
||||||
.creePar(phase.getCreePar())
|
.creePar(phase.getCreePar())
|
||||||
.modifiePar(phase.getModifiePar())
|
.modifiePar(phase.getModifiePar())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// Relations simplifiées
|
// Relations simplifiées
|
||||||
if (phase.getChantier() != null) {
|
if (phase.getChantier() != null) {
|
||||||
dto.setChantierId(phase.getChantier().getId());
|
dto.setChantierId(phase.getChantier().getId());
|
||||||
dto.setChantierNom(phase.getChantier().getNom());
|
dto.setChantierNom(phase.getChantier().getNom());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (phase.getPhaseParent() != null) {
|
if (phase.getPhaseParent() != null) {
|
||||||
dto.setPhaseParentId(phase.getPhaseParent().getId());
|
dto.setPhaseParentId(phase.getPhaseParent().getId());
|
||||||
dto.setPhaseParentNom(phase.getPhaseParent().getNom());
|
dto.setPhaseParentNom(phase.getPhaseParent().getNom());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compter les sous-phases
|
// Compter les sous-phases
|
||||||
if (phase.getSousPhases() != null) {
|
if (phase.getSousPhases() != null) {
|
||||||
dto.setNombreSousPhases(phase.getSousPhases().size());
|
dto.setNombreSousPhases(phase.getSousPhases().size());
|
||||||
} else {
|
} else {
|
||||||
dto.setNombreSousPhases(0);
|
dto.setNombreSousPhases(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculs
|
// Calculs
|
||||||
// Note: Les méthodes isEnRetard, isEnCours, isTerminee ne sont pas directement disponibles
|
// Note: Les méthodes isEnRetard, isEnCours, isTerminee ne sont pas directement disponibles
|
||||||
// sur PhaseChantier, donc on les calcule ici si nécessaire
|
// sur PhaseChantier, donc on les calcule ici si nécessaire
|
||||||
dto.setEnRetard(false);
|
dto.setEnRetard(false);
|
||||||
dto.setEnCours(false);
|
dto.setEnCours(false);
|
||||||
dto.setTerminee(false);
|
dto.setTerminee(false);
|
||||||
|
|
||||||
if (phase.getStatut() != null) {
|
if (phase.getStatut() != null) {
|
||||||
switch (phase.getStatut()) {
|
switch (phase.getStatut()) {
|
||||||
case EN_COURS:
|
case EN_COURS:
|
||||||
dto.setEnCours(true);
|
dto.setEnCours(true);
|
||||||
break;
|
break;
|
||||||
case TERMINEE:
|
case TERMINEE:
|
||||||
dto.setTerminee(true);
|
dto.setTerminee(true);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Vérifier si en retard (date fin prévue dépassée et pas terminée)
|
// Vérifier si en retard (date fin prévue dépassée et pas terminée)
|
||||||
if (phase.getDateFinPrevue() != null && !dto.getTerminee()) {
|
if (phase.getDateFinPrevue() != null && !dto.getTerminee()) {
|
||||||
dto.setEnRetard(java.time.LocalDate.now().isAfter(phase.getDateFinPrevue()));
|
dto.setEnRetard(java.time.LocalDate.now().isAfter(phase.getDateFinPrevue()));
|
||||||
}
|
}
|
||||||
|
|
||||||
return dto;
|
return dto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,108 +1,108 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.mapper;
|
package dev.lions.btpxpress.domain.shared.mapper;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.PlanningEvent;
|
import dev.lions.btpxpress.domain.core.entity.PlanningEvent;
|
||||||
import dev.lions.btpxpress.domain.shared.dto.PlanningEventCreateDTO;
|
import dev.lions.btpxpress.domain.shared.dto.PlanningEventCreateDTO;
|
||||||
import dev.lions.btpxpress.domain.shared.dto.PlanningEventResponseDTO;
|
import dev.lions.btpxpress.domain.shared.dto.PlanningEventResponseDTO;
|
||||||
import jakarta.enterprise.context.ApplicationScoped;
|
import jakarta.enterprise.context.ApplicationScoped;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapper pour les événements de planning - Architecture 2025
|
* Mapper pour les événements de planning - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@ApplicationScoped
|
@ApplicationScoped
|
||||||
public class PlanningEventMapper {
|
public class PlanningEventMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion DTO vers entité
|
* Conversion DTO vers entité
|
||||||
*/
|
*/
|
||||||
public PlanningEvent toEntity(PlanningEventCreateDTO dto) {
|
public PlanningEvent toEntity(PlanningEventCreateDTO dto) {
|
||||||
if (dto == null) {
|
if (dto == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
PlanningEvent event = PlanningEvent.builder()
|
PlanningEvent event = PlanningEvent.builder()
|
||||||
.titre(dto.getTitre())
|
.titre(dto.getTitre())
|
||||||
.description(dto.getDescription())
|
.description(dto.getDescription())
|
||||||
.dateDebut(dto.getDateDebut())
|
.dateDebut(dto.getDateDebut())
|
||||||
.dateFin(dto.getDateFin())
|
.dateFin(dto.getDateFin())
|
||||||
.type(dto.getType())
|
.type(dto.getType())
|
||||||
.priorite(dto.getPriorite() != null ? dto.getPriorite() : dev.lions.btpxpress.domain.core.entity.PrioritePlanningEvent.NORMALE)
|
.priorite(dto.getPriorite() != null ? dto.getPriorite() : dev.lions.btpxpress.domain.core.entity.PrioritePlanningEvent.NORMALE)
|
||||||
.notes(dto.getNotes())
|
.notes(dto.getNotes())
|
||||||
.couleur(dto.getCouleur())
|
.couleur(dto.getCouleur())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
return event;
|
return event;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion entité vers ResponseDTO
|
* Conversion entité vers ResponseDTO
|
||||||
*/
|
*/
|
||||||
public PlanningEventResponseDTO toResponseDTO(PlanningEvent event) {
|
public PlanningEventResponseDTO toResponseDTO(PlanningEvent event) {
|
||||||
if (event == null) {
|
if (event == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
PlanningEventResponseDTO dto = PlanningEventResponseDTO.builder()
|
PlanningEventResponseDTO dto = PlanningEventResponseDTO.builder()
|
||||||
.id(event.getId())
|
.id(event.getId())
|
||||||
.titre(event.getTitre())
|
.titre(event.getTitre())
|
||||||
.description(event.getDescription())
|
.description(event.getDescription())
|
||||||
.dateDebut(event.getDateDebut())
|
.dateDebut(event.getDateDebut())
|
||||||
.dateFin(event.getDateFin())
|
.dateFin(event.getDateFin())
|
||||||
.type(event.getType())
|
.type(event.getType())
|
||||||
.statut(event.getStatut())
|
.statut(event.getStatut())
|
||||||
.priorite(event.getPriorite())
|
.priorite(event.getPriorite())
|
||||||
.notes(event.getNotes())
|
.notes(event.getNotes())
|
||||||
.couleur(event.getCouleur())
|
.couleur(event.getCouleur())
|
||||||
.dateCreation(event.getDateCreation())
|
.dateCreation(event.getDateCreation())
|
||||||
.dateModification(event.getDateModification())
|
.dateModification(event.getDateModification())
|
||||||
.actif(event.getActif())
|
.actif(event.getActif())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// Relations simplifiées
|
// Relations simplifiées
|
||||||
if (event.getChantier() != null) {
|
if (event.getChantier() != null) {
|
||||||
dto.setChantierId(event.getChantier().getId());
|
dto.setChantierId(event.getChantier().getId());
|
||||||
dto.setChantierNom(event.getChantier().getNom());
|
dto.setChantierNom(event.getChantier().getNom());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.getEquipe() != null) {
|
if (event.getEquipe() != null) {
|
||||||
dto.setEquipeId(event.getEquipe().getId());
|
dto.setEquipeId(event.getEquipe().getId());
|
||||||
dto.setEquipeNom(event.getEquipe().getNom());
|
dto.setEquipeNom(event.getEquipe().getNom());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Employés
|
// Employés
|
||||||
if (event.getEmployes() != null) {
|
if (event.getEmployes() != null) {
|
||||||
dto.setEmployeIds(event.getEmployes().stream()
|
dto.setEmployeIds(event.getEmployes().stream()
|
||||||
.map(emp -> emp.getId())
|
.map(emp -> emp.getId())
|
||||||
.collect(Collectors.toList()));
|
.collect(Collectors.toList()));
|
||||||
dto.setNombreEmployes(event.getEmployes().size());
|
dto.setNombreEmployes(event.getEmployes().size());
|
||||||
} else {
|
} else {
|
||||||
dto.setEmployeIds(new ArrayList<>());
|
dto.setEmployeIds(new ArrayList<>());
|
||||||
dto.setNombreEmployes(0);
|
dto.setNombreEmployes(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Matériels
|
// Matériels
|
||||||
if (event.getMateriels() != null) {
|
if (event.getMateriels() != null) {
|
||||||
dto.setMaterielIds(event.getMateriels().stream()
|
dto.setMaterielIds(event.getMateriels().stream()
|
||||||
.map(mat -> mat.getId())
|
.map(mat -> mat.getId())
|
||||||
.collect(Collectors.toList()));
|
.collect(Collectors.toList()));
|
||||||
dto.setNombreMateriels(event.getMateriels().size());
|
dto.setNombreMateriels(event.getMateriels().size());
|
||||||
} else {
|
} else {
|
||||||
dto.setMaterielIds(new ArrayList<>());
|
dto.setMaterielIds(new ArrayList<>());
|
||||||
dto.setNombreMateriels(0);
|
dto.setNombreMateriels(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Métadonnées calculées
|
// Métadonnées calculées
|
||||||
dto.setDureeEnHeures(event.getDureeEnHeures());
|
dto.setDureeEnHeures(event.getDureeEnHeures());
|
||||||
dto.setEnCours(event.isEnCours());
|
dto.setEnCours(event.isEnCours());
|
||||||
dto.setTermine(event.isTermine());
|
dto.setTermine(event.isTermine());
|
||||||
dto.setEnRetard(event.isEnRetard());
|
dto.setEnRetard(event.isEnRetard());
|
||||||
|
|
||||||
return dto;
|
return dto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,126 +1,126 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.mapper;
|
package dev.lions.btpxpress.domain.shared.mapper;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.PlanningMateriel;
|
import dev.lions.btpxpress.domain.core.entity.PlanningMateriel;
|
||||||
import dev.lions.btpxpress.domain.shared.dto.PlanningMaterielCreateDTO;
|
import dev.lions.btpxpress.domain.shared.dto.PlanningMaterielCreateDTO;
|
||||||
import dev.lions.btpxpress.domain.shared.dto.PlanningMaterielResponseDTO;
|
import dev.lions.btpxpress.domain.shared.dto.PlanningMaterielResponseDTO;
|
||||||
import jakarta.enterprise.context.ApplicationScoped;
|
import jakarta.enterprise.context.ApplicationScoped;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapper pour les plannings de matériel - Architecture 2025
|
* Mapper pour les plannings de matériel - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@ApplicationScoped
|
@ApplicationScoped
|
||||||
public class PlanningMaterielMapper {
|
public class PlanningMaterielMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion DTO vers entité
|
* Conversion DTO vers entité
|
||||||
*/
|
*/
|
||||||
public PlanningMateriel toEntity(PlanningMaterielCreateDTO dto) {
|
public PlanningMateriel toEntity(PlanningMaterielCreateDTO dto) {
|
||||||
if (dto == null) {
|
if (dto == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
PlanningMateriel planning = PlanningMateriel.builder()
|
PlanningMateriel planning = PlanningMateriel.builder()
|
||||||
.nomPlanning(dto.getNomPlanning())
|
.nomPlanning(dto.getNomPlanning())
|
||||||
.descriptionPlanning(dto.getDescriptionPlanning())
|
.descriptionPlanning(dto.getDescriptionPlanning())
|
||||||
.dateDebut(dto.getDateDebut())
|
.dateDebut(dto.getDateDebut())
|
||||||
.dateFin(dto.getDateFin())
|
.dateFin(dto.getDateFin())
|
||||||
.typePlanning(dto.getTypePlanning())
|
.typePlanning(dto.getTypePlanning())
|
||||||
.statutPlanning(dto.getStatutPlanning() != null ? dto.getStatutPlanning() : dev.lions.btpxpress.domain.core.entity.StatutPlanning.BROUILLON)
|
.statutPlanning(dto.getStatutPlanning() != null ? dto.getStatutPlanning() : dev.lions.btpxpress.domain.core.entity.StatutPlanning.BROUILLON)
|
||||||
.versionPlanning(dto.getVersionPlanning() != null ? dto.getVersionPlanning() : 1)
|
.versionPlanning(dto.getVersionPlanning() != null ? dto.getVersionPlanning() : 1)
|
||||||
.planningParentId(dto.getPlanningParentId())
|
.planningParentId(dto.getPlanningParentId())
|
||||||
.planificateur(dto.getPlanificateur())
|
.planificateur(dto.getPlanificateur())
|
||||||
.valideur(dto.getValideur())
|
.valideur(dto.getValideur())
|
||||||
.commentairesValidation(dto.getCommentairesValidation())
|
.commentairesValidation(dto.getCommentairesValidation())
|
||||||
.conflitsDetectes(dto.getConflitsDetectes() != null ? dto.getConflitsDetectes() : false)
|
.conflitsDetectes(dto.getConflitsDetectes() != null ? dto.getConflitsDetectes() : false)
|
||||||
.nombreConflits(dto.getNombreConflits() != null ? dto.getNombreConflits() : 0)
|
.nombreConflits(dto.getNombreConflits() != null ? dto.getNombreConflits() : 0)
|
||||||
.resolutionConflitsAuto(dto.getResolutionConflitsAuto() != null ? dto.getResolutionConflitsAuto() : false)
|
.resolutionConflitsAuto(dto.getResolutionConflitsAuto() != null ? dto.getResolutionConflitsAuto() : false)
|
||||||
.tauxUtilisationPrevu(dto.getTauxUtilisationPrevu())
|
.tauxUtilisationPrevu(dto.getTauxUtilisationPrevu())
|
||||||
.scoreOptimisation(dto.getScoreOptimisation())
|
.scoreOptimisation(dto.getScoreOptimisation())
|
||||||
.optimiseAutomatiquement(dto.getOptimiseAutomatiquement() != null ? dto.getOptimiseAutomatiquement() : false)
|
.optimiseAutomatiquement(dto.getOptimiseAutomatiquement() != null ? dto.getOptimiseAutomatiquement() : false)
|
||||||
.notificationsActivees(dto.getNotificationsActivees() != null ? dto.getNotificationsActivees() : true)
|
.notificationsActivees(dto.getNotificationsActivees() != null ? dto.getNotificationsActivees() : true)
|
||||||
.alerteConflits(dto.getAlerteConflits() != null ? dto.getAlerteConflits() : true)
|
.alerteConflits(dto.getAlerteConflits() != null ? dto.getAlerteConflits() : true)
|
||||||
.alerteSurcharge(dto.getAlerteSurcharge() != null ? dto.getAlerteSurcharge() : true)
|
.alerteSurcharge(dto.getAlerteSurcharge() != null ? dto.getAlerteSurcharge() : true)
|
||||||
.seuilAlerteUtilisation(dto.getSeuilAlerteUtilisation() != null ? dto.getSeuilAlerteUtilisation() : 85.0)
|
.seuilAlerteUtilisation(dto.getSeuilAlerteUtilisation() != null ? dto.getSeuilAlerteUtilisation() : 85.0)
|
||||||
.couleurPlanning(dto.getCouleurPlanning())
|
.couleurPlanning(dto.getCouleurPlanning())
|
||||||
.vueParDefaut(dto.getVueParDefaut() != null ? dto.getVueParDefaut() : dev.lions.btpxpress.domain.core.entity.VuePlanning.GANTT)
|
.vueParDefaut(dto.getVueParDefaut() != null ? dto.getVueParDefaut() : dev.lions.btpxpress.domain.core.entity.VuePlanning.GANTT)
|
||||||
.granulariteAffichage(dto.getGranulariteAffichage() != null ? dto.getGranulariteAffichage() : "JOUR")
|
.granulariteAffichage(dto.getGranulariteAffichage() != null ? dto.getGranulariteAffichage() : "JOUR")
|
||||||
.optionsAffichage(dto.getOptionsAffichage())
|
.optionsAffichage(dto.getOptionsAffichage())
|
||||||
.reglesPlanification(dto.getReglesPlanification())
|
.reglesPlanification(dto.getReglesPlanification())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
return planning;
|
return planning;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion entité vers ResponseDTO
|
* Conversion entité vers ResponseDTO
|
||||||
*/
|
*/
|
||||||
public PlanningMaterielResponseDTO toResponseDTO(PlanningMateriel planning) {
|
public PlanningMaterielResponseDTO toResponseDTO(PlanningMateriel planning) {
|
||||||
if (planning == null) {
|
if (planning == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
PlanningMaterielResponseDTO dto = PlanningMaterielResponseDTO.builder()
|
PlanningMaterielResponseDTO dto = PlanningMaterielResponseDTO.builder()
|
||||||
.id(planning.getId())
|
.id(planning.getId())
|
||||||
.nomPlanning(planning.getNomPlanning())
|
.nomPlanning(planning.getNomPlanning())
|
||||||
.descriptionPlanning(planning.getDescriptionPlanning())
|
.descriptionPlanning(planning.getDescriptionPlanning())
|
||||||
.dateDebut(planning.getDateDebut())
|
.dateDebut(planning.getDateDebut())
|
||||||
.dateFin(planning.getDateFin())
|
.dateFin(planning.getDateFin())
|
||||||
.typePlanning(planning.getTypePlanning())
|
.typePlanning(planning.getTypePlanning())
|
||||||
.statutPlanning(planning.getStatutPlanning())
|
.statutPlanning(planning.getStatutPlanning())
|
||||||
.versionPlanning(planning.getVersionPlanning())
|
.versionPlanning(planning.getVersionPlanning())
|
||||||
.planningParentId(planning.getPlanningParentId())
|
.planningParentId(planning.getPlanningParentId())
|
||||||
.planificateur(planning.getPlanificateur())
|
.planificateur(planning.getPlanificateur())
|
||||||
.valideur(planning.getValideur())
|
.valideur(planning.getValideur())
|
||||||
.dateValidation(planning.getDateValidation())
|
.dateValidation(planning.getDateValidation())
|
||||||
.commentairesValidation(planning.getCommentairesValidation())
|
.commentairesValidation(planning.getCommentairesValidation())
|
||||||
.conflitsDetectes(planning.getConflitsDetectes())
|
.conflitsDetectes(planning.getConflitsDetectes())
|
||||||
.nombreConflits(planning.getNombreConflits())
|
.nombreConflits(planning.getNombreConflits())
|
||||||
.derniereVerificationConflits(planning.getDerniereVerificationConflits())
|
.derniereVerificationConflits(planning.getDerniereVerificationConflits())
|
||||||
.resolutionConflitsAuto(planning.getResolutionConflitsAuto())
|
.resolutionConflitsAuto(planning.getResolutionConflitsAuto())
|
||||||
.tauxUtilisationPrevu(planning.getTauxUtilisationPrevu())
|
.tauxUtilisationPrevu(planning.getTauxUtilisationPrevu())
|
||||||
.scoreOptimisation(planning.getScoreOptimisation())
|
.scoreOptimisation(planning.getScoreOptimisation())
|
||||||
.optimiseAutomatiquement(planning.getOptimiseAutomatiquement())
|
.optimiseAutomatiquement(planning.getOptimiseAutomatiquement())
|
||||||
.derniereOptimisation(planning.getDerniereOptimisation())
|
.derniereOptimisation(planning.getDerniereOptimisation())
|
||||||
.notificationsActivees(planning.getNotificationsActivees())
|
.notificationsActivees(planning.getNotificationsActivees())
|
||||||
.alerteConflits(planning.getAlerteConflits())
|
.alerteConflits(planning.getAlerteConflits())
|
||||||
.alerteSurcharge(planning.getAlerteSurcharge())
|
.alerteSurcharge(planning.getAlerteSurcharge())
|
||||||
.seuilAlerteUtilisation(planning.getSeuilAlerteUtilisation())
|
.seuilAlerteUtilisation(planning.getSeuilAlerteUtilisation())
|
||||||
.couleurPlanning(planning.getCouleurPlanning())
|
.couleurPlanning(planning.getCouleurPlanning())
|
||||||
.vueParDefaut(planning.getVueParDefaut())
|
.vueParDefaut(planning.getVueParDefaut())
|
||||||
.granulariteAffichage(planning.getGranulariteAffichage())
|
.granulariteAffichage(planning.getGranulariteAffichage())
|
||||||
.optionsAffichage(planning.getOptionsAffichage())
|
.optionsAffichage(planning.getOptionsAffichage())
|
||||||
.reglesPlanification(planning.getReglesPlanification())
|
.reglesPlanification(planning.getReglesPlanification())
|
||||||
.dateCreation(planning.getDateCreation())
|
.dateCreation(planning.getDateCreation())
|
||||||
.dateModification(planning.getDateModification())
|
.dateModification(planning.getDateModification())
|
||||||
.creePar(planning.getCreePar())
|
.creePar(planning.getCreePar())
|
||||||
.modifiePar(planning.getModifiePar())
|
.modifiePar(planning.getModifiePar())
|
||||||
.actif(planning.getActif())
|
.actif(planning.getActif())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// Relations simplifiées
|
// Relations simplifiées
|
||||||
if (planning.getMateriel() != null) {
|
if (planning.getMateriel() != null) {
|
||||||
dto.setMaterielId(planning.getMateriel().getId());
|
dto.setMaterielId(planning.getMateriel().getId());
|
||||||
dto.setMaterielNom(planning.getMateriel().getNom());
|
dto.setMaterielNom(planning.getMateriel().getNom());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (planning.getReservations() != null) {
|
if (planning.getReservations() != null) {
|
||||||
dto.setNombreReservations(planning.getReservations().size());
|
dto.setNombreReservations(planning.getReservations().size());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Métadonnées calculées
|
// Métadonnées calculées
|
||||||
dto.setDureePlanningJours(planning.getDureePlanningJours());
|
dto.setDureePlanningJours(planning.getDureePlanningJours());
|
||||||
dto.setEstValide(planning.estValide());
|
dto.setEstValide(planning.estValide());
|
||||||
dto.setPeutEtreModifie(planning.peutEtreModifie());
|
dto.setPeutEtreModifie(planning.peutEtreModifie());
|
||||||
dto.setNecessiteAttention(planning.necessiteAttention());
|
dto.setNecessiteAttention(planning.necessiteAttention());
|
||||||
dto.setCouleurAffichage(planning.getCouleurAffichage());
|
dto.setCouleurAffichage(planning.getCouleurAffichage());
|
||||||
dto.setIconeTypePlanning(planning.getIconeTypePlanning());
|
dto.setIconeTypePlanning(planning.getIconeTypePlanning());
|
||||||
dto.setPourcentageAvancement(planning.getPourcentageAvancement());
|
dto.setPourcentageAvancement(planning.getPourcentageAvancement());
|
||||||
|
|
||||||
return dto;
|
return dto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,130 +1,130 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.mapper;
|
package dev.lions.btpxpress.domain.shared.mapper;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.ReservationMateriel;
|
import dev.lions.btpxpress.domain.core.entity.ReservationMateriel;
|
||||||
import dev.lions.btpxpress.domain.shared.dto.ReservationMaterielCreateDTO;
|
import dev.lions.btpxpress.domain.shared.dto.ReservationMaterielCreateDTO;
|
||||||
import dev.lions.btpxpress.domain.shared.dto.ReservationMaterielResponseDTO;
|
import dev.lions.btpxpress.domain.shared.dto.ReservationMaterielResponseDTO;
|
||||||
import jakarta.enterprise.context.ApplicationScoped;
|
import jakarta.enterprise.context.ApplicationScoped;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapper pour les réservations de matériel - Architecture 2025
|
* Mapper pour les réservations de matériel - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@ApplicationScoped
|
@ApplicationScoped
|
||||||
public class ReservationMaterielMapper {
|
public class ReservationMaterielMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion DTO vers entité
|
* Conversion DTO vers entité
|
||||||
*/
|
*/
|
||||||
public ReservationMateriel toEntity(ReservationMaterielCreateDTO dto) {
|
public ReservationMateriel toEntity(ReservationMaterielCreateDTO dto) {
|
||||||
if (dto == null) {
|
if (dto == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReservationMateriel reservation = ReservationMateriel.builder()
|
ReservationMateriel reservation = ReservationMateriel.builder()
|
||||||
.dateDebut(dto.getDateDebut())
|
.dateDebut(dto.getDateDebut())
|
||||||
.dateFin(dto.getDateFin())
|
.dateFin(dto.getDateFin())
|
||||||
.heureDebut(dto.getHeureDebut())
|
.heureDebut(dto.getHeureDebut())
|
||||||
.heureFin(dto.getHeureFin())
|
.heureFin(dto.getHeureFin())
|
||||||
.quantite(dto.getQuantite())
|
.quantite(dto.getQuantite())
|
||||||
.unite(dto.getUnite())
|
.unite(dto.getUnite())
|
||||||
.prixUnitairePrevisionnel(dto.getPrixUnitairePrevisionnel())
|
.prixUnitairePrevisionnel(dto.getPrixUnitairePrevisionnel())
|
||||||
.prixTotalPrevisionnel(dto.getPrixTotalPrevisionnel())
|
.prixTotalPrevisionnel(dto.getPrixTotalPrevisionnel())
|
||||||
.statut(dto.getStatut() != null ? dto.getStatut() : dev.lions.btpxpress.domain.core.entity.StatutReservationMateriel.PLANIFIEE)
|
.statut(dto.getStatut() != null ? dto.getStatut() : dev.lions.btpxpress.domain.core.entity.StatutReservationMateriel.PLANIFIEE)
|
||||||
.priorite(dto.getPriorite() != null ? dto.getPriorite() : dev.lions.btpxpress.domain.core.entity.PrioriteReservation.NORMALE)
|
.priorite(dto.getPriorite() != null ? dto.getPriorite() : dev.lions.btpxpress.domain.core.entity.PrioriteReservation.NORMALE)
|
||||||
.lieuLivraison(dto.getLieuLivraison())
|
.lieuLivraison(dto.getLieuLivraison())
|
||||||
.instructionsLivraison(dto.getInstructionsLivraison())
|
.instructionsLivraison(dto.getInstructionsLivraison())
|
||||||
.responsableReception(dto.getResponsableReception())
|
.responsableReception(dto.getResponsableReception())
|
||||||
.telephoneContact(dto.getTelephoneContact())
|
.telephoneContact(dto.getTelephoneContact())
|
||||||
.dateLivraisonPrevue(dto.getDateLivraisonPrevue())
|
.dateLivraisonPrevue(dto.getDateLivraisonPrevue())
|
||||||
.dateRetourPrevue(dto.getDateRetourPrevue())
|
.dateRetourPrevue(dto.getDateRetourPrevue())
|
||||||
.demandeur(dto.getDemandeur())
|
.demandeur(dto.getDemandeur())
|
||||||
.valideur(dto.getValideur())
|
.valideur(dto.getValideur())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
return reservation;
|
return reservation;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion entité vers ResponseDTO
|
* Conversion entité vers ResponseDTO
|
||||||
*/
|
*/
|
||||||
public ReservationMaterielResponseDTO toResponseDTO(ReservationMateriel reservation) {
|
public ReservationMaterielResponseDTO toResponseDTO(ReservationMateriel reservation) {
|
||||||
if (reservation == null) {
|
if (reservation == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReservationMaterielResponseDTO dto = ReservationMaterielResponseDTO.builder()
|
ReservationMaterielResponseDTO dto = ReservationMaterielResponseDTO.builder()
|
||||||
.id(reservation.getId())
|
.id(reservation.getId())
|
||||||
.dateDebut(reservation.getDateDebut())
|
.dateDebut(reservation.getDateDebut())
|
||||||
.dateFin(reservation.getDateFin())
|
.dateFin(reservation.getDateFin())
|
||||||
.heureDebut(reservation.getHeureDebut())
|
.heureDebut(reservation.getHeureDebut())
|
||||||
.heureFin(reservation.getHeureFin())
|
.heureFin(reservation.getHeureFin())
|
||||||
.quantite(reservation.getQuantite())
|
.quantite(reservation.getQuantite())
|
||||||
.unite(reservation.getUnite())
|
.unite(reservation.getUnite())
|
||||||
.prixUnitairePrevisionnel(reservation.getPrixUnitairePrevisionnel())
|
.prixUnitairePrevisionnel(reservation.getPrixUnitairePrevisionnel())
|
||||||
.prixTotalPrevisionnel(reservation.getPrixTotalPrevisionnel())
|
.prixTotalPrevisionnel(reservation.getPrixTotalPrevisionnel())
|
||||||
.prixUnitaireReel(reservation.getPrixUnitaireReel())
|
.prixUnitaireReel(reservation.getPrixUnitaireReel())
|
||||||
.prixTotalReel(reservation.getPrixTotalReel())
|
.prixTotalReel(reservation.getPrixTotalReel())
|
||||||
.statut(reservation.getStatut())
|
.statut(reservation.getStatut())
|
||||||
.priorite(reservation.getPriorite())
|
.priorite(reservation.getPriorite())
|
||||||
.referenceReservation(reservation.getReferenceReservation())
|
.referenceReservation(reservation.getReferenceReservation())
|
||||||
.lieuLivraison(reservation.getLieuLivraison())
|
.lieuLivraison(reservation.getLieuLivraison())
|
||||||
.instructionsLivraison(reservation.getInstructionsLivraison())
|
.instructionsLivraison(reservation.getInstructionsLivraison())
|
||||||
.responsableReception(reservation.getResponsableReception())
|
.responsableReception(reservation.getResponsableReception())
|
||||||
.telephoneContact(reservation.getTelephoneContact())
|
.telephoneContact(reservation.getTelephoneContact())
|
||||||
.dateLivraisonPrevue(reservation.getDateLivraisonPrevue())
|
.dateLivraisonPrevue(reservation.getDateLivraisonPrevue())
|
||||||
.dateLivraisonReelle(reservation.getDateLivraisonReelle())
|
.dateLivraisonReelle(reservation.getDateLivraisonReelle())
|
||||||
.dateRetourPrevue(reservation.getDateRetourPrevue())
|
.dateRetourPrevue(reservation.getDateRetourPrevue())
|
||||||
.dateRetourReelle(reservation.getDateRetourReelle())
|
.dateRetourReelle(reservation.getDateRetourReelle())
|
||||||
.observationsLivraison(reservation.getObservationsLivraison())
|
.observationsLivraison(reservation.getObservationsLivraison())
|
||||||
.observationsRetour(reservation.getObservationsRetour())
|
.observationsRetour(reservation.getObservationsRetour())
|
||||||
.etatMaterielLivraison(reservation.getEtatMaterielLivraison())
|
.etatMaterielLivraison(reservation.getEtatMaterielLivraison())
|
||||||
.etatMaterielRetour(reservation.getEtatMaterielRetour())
|
.etatMaterielRetour(reservation.getEtatMaterielRetour())
|
||||||
.kilometrageDebut(reservation.getKilometrageDebut())
|
.kilometrageDebut(reservation.getKilometrageDebut())
|
||||||
.kilometrageFin(reservation.getKilometrageFin())
|
.kilometrageFin(reservation.getKilometrageFin())
|
||||||
.demandeur(reservation.getDemandeur())
|
.demandeur(reservation.getDemandeur())
|
||||||
.valideur(reservation.getValideur())
|
.valideur(reservation.getValideur())
|
||||||
.dateValidation(reservation.getDateValidation())
|
.dateValidation(reservation.getDateValidation())
|
||||||
.motifRefus(reservation.getMotifRefus())
|
.motifRefus(reservation.getMotifRefus())
|
||||||
.numeroFactureFournisseur(reservation.getNumeroFactureFournisseur())
|
.numeroFactureFournisseur(reservation.getNumeroFactureFournisseur())
|
||||||
.dateFactureFournisseur(reservation.getDateFactureFournisseur())
|
.dateFactureFournisseur(reservation.getDateFactureFournisseur())
|
||||||
.factureTraitee(reservation.getFactureTraitee())
|
.factureTraitee(reservation.getFactureTraitee())
|
||||||
.dateCreation(reservation.getDateCreation())
|
.dateCreation(reservation.getDateCreation())
|
||||||
.dateModification(reservation.getDateModification())
|
.dateModification(reservation.getDateModification())
|
||||||
.creePar(reservation.getCreePar())
|
.creePar(reservation.getCreePar())
|
||||||
.modifiePar(reservation.getModifiePar())
|
.modifiePar(reservation.getModifiePar())
|
||||||
.actif(reservation.getActif())
|
.actif(reservation.getActif())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// Relations simplifiées
|
// Relations simplifiées
|
||||||
if (reservation.getMateriel() != null) {
|
if (reservation.getMateriel() != null) {
|
||||||
dto.setMaterielId(reservation.getMateriel().getId());
|
dto.setMaterielId(reservation.getMateriel().getId());
|
||||||
dto.setMaterielNom(reservation.getMateriel().getNom());
|
dto.setMaterielNom(reservation.getMateriel().getNom());
|
||||||
// Note: Materiel n'a pas de getReference(), utiliser getNom() ou autre champ disponible
|
// Note: Materiel n'a pas de getReference(), utiliser getNom() ou autre champ disponible
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reservation.getChantier() != null) {
|
if (reservation.getChantier() != null) {
|
||||||
dto.setChantierId(reservation.getChantier().getId());
|
dto.setChantierId(reservation.getChantier().getId());
|
||||||
dto.setChantierNom(reservation.getChantier().getNom());
|
dto.setChantierNom(reservation.getChantier().getNom());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reservation.getPhase() != null) {
|
if (reservation.getPhase() != null) {
|
||||||
dto.setPhaseId(reservation.getPhase().getId());
|
dto.setPhaseId(reservation.getPhase().getId());
|
||||||
dto.setPhaseNom(reservation.getPhase().getNom());
|
dto.setPhaseNom(reservation.getPhase().getNom());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reservation.getPlanningMateriel() != null) {
|
if (reservation.getPlanningMateriel() != null) {
|
||||||
dto.setPlanningMaterielId(reservation.getPlanningMateriel().getId());
|
dto.setPlanningMaterielId(reservation.getPlanningMateriel().getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Métadonnées calculées
|
// Métadonnées calculées
|
||||||
dto.setDureeReservationJours(reservation.getDureeReservationJours());
|
dto.setDureeReservationJours(reservation.getDureeReservationJours());
|
||||||
dto.setEstEnCours(reservation.estEnCours());
|
dto.setEstEnCours(reservation.estEnCours());
|
||||||
dto.setEstEnRetard(reservation.estEnRetard());
|
dto.setEstEnRetard(reservation.estEnRetard());
|
||||||
|
|
||||||
return dto;
|
return dto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,126 +1,126 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.mapper;
|
package dev.lions.btpxpress.domain.shared.mapper;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.Stock;
|
import dev.lions.btpxpress.domain.core.entity.Stock;
|
||||||
import dev.lions.btpxpress.domain.shared.dto.StockCreateDTO;
|
import dev.lions.btpxpress.domain.shared.dto.StockCreateDTO;
|
||||||
import dev.lions.btpxpress.domain.shared.dto.StockResponseDTO;
|
import dev.lions.btpxpress.domain.shared.dto.StockResponseDTO;
|
||||||
import jakarta.enterprise.context.ApplicationScoped;
|
import jakarta.enterprise.context.ApplicationScoped;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapper pour les stocks - Architecture 2025
|
* Mapper pour les stocks - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@ApplicationScoped
|
@ApplicationScoped
|
||||||
public class StockMapper {
|
public class StockMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion DTO vers entité
|
* Conversion DTO vers entité
|
||||||
*/
|
*/
|
||||||
public Stock toEntity(StockCreateDTO dto) {
|
public Stock toEntity(StockCreateDTO dto) {
|
||||||
if (dto == null) {
|
if (dto == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Stock stock = new Stock();
|
Stock stock = new Stock();
|
||||||
stock.setReference(dto.getReference());
|
stock.setReference(dto.getReference());
|
||||||
stock.setDesignation(dto.getDesignation());
|
stock.setDesignation(dto.getDesignation());
|
||||||
stock.setDescription(dto.getDescription());
|
stock.setDescription(dto.getDescription());
|
||||||
stock.setCategorie(dto.getCategorie());
|
stock.setCategorie(dto.getCategorie());
|
||||||
stock.setSousCategorie(dto.getSousCategorie());
|
stock.setSousCategorie(dto.getSousCategorie());
|
||||||
stock.setUniteMesure(dto.getUniteMesure());
|
stock.setUniteMesure(dto.getUniteMesure());
|
||||||
stock.setQuantiteStock(dto.getQuantiteStock() != null ? dto.getQuantiteStock() : BigDecimal.ZERO);
|
stock.setQuantiteStock(dto.getQuantiteStock() != null ? dto.getQuantiteStock() : BigDecimal.ZERO);
|
||||||
stock.setQuantiteMinimum(dto.getQuantiteMinimum());
|
stock.setQuantiteMinimum(dto.getQuantiteMinimum());
|
||||||
stock.setQuantiteMaximum(dto.getQuantiteMaximum());
|
stock.setQuantiteMaximum(dto.getQuantiteMaximum());
|
||||||
stock.setPrixUnitaireHT(dto.getPrixUnitaireHT());
|
stock.setPrixUnitaireHT(dto.getPrixUnitaireHT());
|
||||||
stock.setTauxTVA(dto.getTauxTVA() != null ? dto.getTauxTVA() : new BigDecimal("20.00"));
|
stock.setTauxTVA(dto.getTauxTVA() != null ? dto.getTauxTVA() : new BigDecimal("20.00"));
|
||||||
stock.setEmplacementStockage(dto.getEmplacementStockage());
|
stock.setEmplacementStockage(dto.getEmplacementStockage());
|
||||||
stock.setCodeZone(dto.getCodeZone());
|
stock.setCodeZone(dto.getCodeZone());
|
||||||
stock.setCodeAllee(dto.getCodeAllee());
|
stock.setCodeAllee(dto.getCodeAllee());
|
||||||
stock.setCodeEtagere(dto.getCodeEtagere());
|
stock.setCodeEtagere(dto.getCodeEtagere());
|
||||||
stock.setMarque(dto.getMarque());
|
stock.setMarque(dto.getMarque());
|
||||||
stock.setModele(dto.getModele());
|
stock.setModele(dto.getModele());
|
||||||
stock.setReferenceFournisseur(dto.getReferenceFournisseur());
|
stock.setReferenceFournisseur(dto.getReferenceFournisseur());
|
||||||
stock.setCodeBarre(dto.getCodeBarre());
|
stock.setCodeBarre(dto.getCodeBarre());
|
||||||
stock.setCodeEAN(dto.getCodeEAN());
|
stock.setCodeEAN(dto.getCodeEAN());
|
||||||
|
|
||||||
return stock;
|
return stock;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion entité vers ResponseDTO
|
* Conversion entité vers ResponseDTO
|
||||||
*/
|
*/
|
||||||
public StockResponseDTO toResponseDTO(Stock stock) {
|
public StockResponseDTO toResponseDTO(Stock stock) {
|
||||||
if (stock == null) {
|
if (stock == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
StockResponseDTO dto = StockResponseDTO.builder()
|
StockResponseDTO dto = StockResponseDTO.builder()
|
||||||
.id(stock.getId())
|
.id(stock.getId())
|
||||||
.reference(stock.getReference())
|
.reference(stock.getReference())
|
||||||
.designation(stock.getDesignation())
|
.designation(stock.getDesignation())
|
||||||
.description(stock.getDescription())
|
.description(stock.getDescription())
|
||||||
.categorie(stock.getCategorie())
|
.categorie(stock.getCategorie())
|
||||||
.sousCategorie(stock.getSousCategorie())
|
.sousCategorie(stock.getSousCategorie())
|
||||||
.uniteMesure(stock.getUniteMesure())
|
.uniteMesure(stock.getUniteMesure())
|
||||||
.quantiteStock(stock.getQuantiteStock())
|
.quantiteStock(stock.getQuantiteStock())
|
||||||
.quantiteMinimum(stock.getQuantiteMinimum())
|
.quantiteMinimum(stock.getQuantiteMinimum())
|
||||||
.quantiteMaximum(stock.getQuantiteMaximum())
|
.quantiteMaximum(stock.getQuantiteMaximum())
|
||||||
.quantiteSecurite(stock.getQuantiteSecurite())
|
.quantiteSecurite(stock.getQuantiteSecurite())
|
||||||
.quantiteReservee(stock.getQuantiteReservee())
|
.quantiteReservee(stock.getQuantiteReservee())
|
||||||
.quantiteEnCommande(stock.getQuantiteEnCommande())
|
.quantiteEnCommande(stock.getQuantiteEnCommande())
|
||||||
.prixUnitaireHT(stock.getPrixUnitaireHT())
|
.prixUnitaireHT(stock.getPrixUnitaireHT())
|
||||||
.coutMoyenPondere(stock.getCoutMoyenPondere())
|
.coutMoyenPondere(stock.getCoutMoyenPondere())
|
||||||
.coutDerniereEntree(stock.getCoutDerniereEntree())
|
.coutDerniereEntree(stock.getCoutDerniereEntree())
|
||||||
.tauxTVA(stock.getTauxTVA())
|
.tauxTVA(stock.getTauxTVA())
|
||||||
.emplacementStockage(stock.getEmplacementStockage())
|
.emplacementStockage(stock.getEmplacementStockage())
|
||||||
.codeZone(stock.getCodeZone())
|
.codeZone(stock.getCodeZone())
|
||||||
.codeAllee(stock.getCodeAllee())
|
.codeAllee(stock.getCodeAllee())
|
||||||
.codeEtagere(stock.getCodeEtagere())
|
.codeEtagere(stock.getCodeEtagere())
|
||||||
.statut(stock.getStatut())
|
.statut(stock.getStatut())
|
||||||
.gestionParLot(stock.getGestionParLot())
|
.gestionParLot(stock.getGestionParLot())
|
||||||
.traçabiliteRequise(stock.getTraçabiliteRequise())
|
.traçabiliteRequise(stock.getTraçabiliteRequise())
|
||||||
.articlePerissable(stock.getArticlePerissable())
|
.articlePerissable(stock.getArticlePerissable())
|
||||||
.controleQualiteRequis(stock.getControleQualiteRequis())
|
.controleQualiteRequis(stock.getControleQualiteRequis())
|
||||||
.articleDangereux(stock.getArticleDangereux())
|
.articleDangereux(stock.getArticleDangereux())
|
||||||
.classeDanger(stock.getClasseDanger())
|
.classeDanger(stock.getClasseDanger())
|
||||||
.marque(stock.getMarque())
|
.marque(stock.getMarque())
|
||||||
.modele(stock.getModele())
|
.modele(stock.getModele())
|
||||||
.referenceFournisseur(stock.getReferenceFournisseur())
|
.referenceFournisseur(stock.getReferenceFournisseur())
|
||||||
.codeBarre(stock.getCodeBarre())
|
.codeBarre(stock.getCodeBarre())
|
||||||
.codeEAN(stock.getCodeEAN())
|
.codeEAN(stock.getCodeEAN())
|
||||||
.dateCreation(stock.getDateCreation())
|
.dateCreation(stock.getDateCreation())
|
||||||
.dateModification(stock.getDateModification())
|
.dateModification(stock.getDateModification())
|
||||||
.creePar(stock.getCreePar())
|
.creePar(stock.getCreePar())
|
||||||
.modifiePar(stock.getModifiePar())
|
.modifiePar(stock.getModifiePar())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// Relations simplifiées
|
// Relations simplifiées
|
||||||
if (stock.getFournisseurPrincipal() != null) {
|
if (stock.getFournisseurPrincipal() != null) {
|
||||||
dto.setFournisseurPrincipalId(stock.getFournisseurPrincipal().getId());
|
dto.setFournisseurPrincipalId(stock.getFournisseurPrincipal().getId());
|
||||||
dto.setFournisseurPrincipalNom(stock.getFournisseurPrincipal().getNom());
|
dto.setFournisseurPrincipalNom(stock.getFournisseurPrincipal().getNom());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stock.getChantier() != null) {
|
if (stock.getChantier() != null) {
|
||||||
dto.setChantierId(stock.getChantier().getId());
|
dto.setChantierId(stock.getChantier().getId());
|
||||||
dto.setChantierNom(stock.getChantier().getNom());
|
dto.setChantierNom(stock.getChantier().getNom());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculs
|
// Calculs
|
||||||
if (stock.getPrixUnitaireHT() != null && stock.getQuantiteStock() != null) {
|
if (stock.getPrixUnitaireHT() != null && stock.getQuantiteStock() != null) {
|
||||||
dto.setValeurStock(stock.getPrixUnitaireHT().multiply(stock.getQuantiteStock()));
|
dto.setValeurStock(stock.getPrixUnitaireHT().multiply(stock.getQuantiteStock()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Vérifier si en rupture
|
// Vérifier si en rupture
|
||||||
if (stock.getQuantiteMinimum() != null && stock.getQuantiteStock() != null) {
|
if (stock.getQuantiteMinimum() != null && stock.getQuantiteStock() != null) {
|
||||||
dto.setEnRupture(stock.getQuantiteStock().compareTo(stock.getQuantiteMinimum()) < 0);
|
dto.setEnRupture(stock.getQuantiteStock().compareTo(stock.getQuantiteMinimum()) < 0);
|
||||||
} else {
|
} else {
|
||||||
dto.setEnRupture(false);
|
dto.setEnRupture(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
return dto;
|
return dto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,86 +1,86 @@
|
|||||||
package dev.lions.btpxpress.domain.shared.mapper;
|
package dev.lions.btpxpress.domain.shared.mapper;
|
||||||
|
|
||||||
import dev.lions.btpxpress.domain.core.entity.User;
|
import dev.lions.btpxpress.domain.core.entity.User;
|
||||||
import dev.lions.btpxpress.domain.shared.dto.UserCreateDTO;
|
import dev.lions.btpxpress.domain.shared.dto.UserCreateDTO;
|
||||||
import dev.lions.btpxpress.domain.shared.dto.UserResponseDTO;
|
import dev.lions.btpxpress.domain.shared.dto.UserResponseDTO;
|
||||||
import jakarta.enterprise.context.ApplicationScoped;
|
import jakarta.enterprise.context.ApplicationScoped;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapper pour les utilisateurs - Architecture 2025
|
* Mapper pour les utilisateurs - Architecture 2025
|
||||||
*
|
*
|
||||||
* @author BTPXpress Team
|
* @author BTPXpress Team
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @since 2025-01-30
|
* @since 2025-01-30
|
||||||
*/
|
*/
|
||||||
@ApplicationScoped
|
@ApplicationScoped
|
||||||
public class UserMapper {
|
public class UserMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion DTO vers entité
|
* Conversion DTO vers entité
|
||||||
* Note: Le mot de passe doit être hashé avant d'être assigné à l'entité
|
* Note: Le mot de passe doit être hashé avant d'être assigné à l'entité
|
||||||
*/
|
*/
|
||||||
public User toEntity(UserCreateDTO dto) {
|
public User toEntity(UserCreateDTO dto) {
|
||||||
if (dto == null) {
|
if (dto == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
User user = new User();
|
User user = new User();
|
||||||
user.setEmail(dto.getEmail());
|
user.setEmail(dto.getEmail());
|
||||||
user.setNom(dto.getNom());
|
user.setNom(dto.getNom());
|
||||||
user.setPrenom(dto.getPrenom());
|
user.setPrenom(dto.getPrenom());
|
||||||
// Le mot de passe doit être hashé par le service avant d'être assigné
|
// Le mot de passe doit être hashé par le service avant d'être assigné
|
||||||
user.setPassword(dto.getPassword()); // Le service devra le hasher
|
user.setPassword(dto.getPassword()); // Le service devra le hasher
|
||||||
user.setRole(dto.getRole() != null ? dto.getRole() : dev.lions.btpxpress.domain.core.entity.UserRole.OUVRIER);
|
user.setRole(dto.getRole() != null ? dto.getRole() : dev.lions.btpxpress.domain.core.entity.UserRole.OUVRIER);
|
||||||
user.setActif(dto.getActif() != null ? dto.getActif() : true);
|
user.setActif(dto.getActif() != null ? dto.getActif() : true);
|
||||||
user.setStatus(dto.getStatus() != null ? dto.getStatus() : dev.lions.btpxpress.domain.core.entity.UserStatus.PENDING);
|
user.setStatus(dto.getStatus() != null ? dto.getStatus() : dev.lions.btpxpress.domain.core.entity.UserStatus.PENDING);
|
||||||
user.setTelephone(dto.getTelephone());
|
user.setTelephone(dto.getTelephone());
|
||||||
user.setAdresse(dto.getAdresse());
|
user.setAdresse(dto.getAdresse());
|
||||||
user.setCodePostal(dto.getCodePostal());
|
user.setCodePostal(dto.getCodePostal());
|
||||||
user.setVille(dto.getVille());
|
user.setVille(dto.getVille());
|
||||||
user.setEntreprise(dto.getEntreprise());
|
user.setEntreprise(dto.getEntreprise());
|
||||||
user.setSiret(dto.getSiret());
|
user.setSiret(dto.getSiret());
|
||||||
user.setSecteurActivite(dto.getSecteurActivite());
|
user.setSecteurActivite(dto.getSecteurActivite());
|
||||||
user.setEffectif(dto.getEffectif());
|
user.setEffectif(dto.getEffectif());
|
||||||
user.setCommentaireAdmin(dto.getCommentaireAdmin());
|
user.setCommentaireAdmin(dto.getCommentaireAdmin());
|
||||||
|
|
||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion entité vers ResponseDTO
|
* Conversion entité vers ResponseDTO
|
||||||
* Note: Le mot de passe n'est jamais inclus pour des raisons de sécurité
|
* Note: Le mot de passe n'est jamais inclus pour des raisons de sécurité
|
||||||
*/
|
*/
|
||||||
public UserResponseDTO toResponseDTO(User user) {
|
public UserResponseDTO toResponseDTO(User user) {
|
||||||
if (user == null) {
|
if (user == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
UserResponseDTO dto = UserResponseDTO.builder()
|
UserResponseDTO dto = UserResponseDTO.builder()
|
||||||
.id(user.getId())
|
.id(user.getId())
|
||||||
.email(user.getEmail())
|
.email(user.getEmail())
|
||||||
.nom(user.getNom())
|
.nom(user.getNom())
|
||||||
.prenom(user.getPrenom())
|
.prenom(user.getPrenom())
|
||||||
.role(user.getRole())
|
.role(user.getRole())
|
||||||
.actif(user.getActif())
|
.actif(user.getActif())
|
||||||
.status(user.getStatus())
|
.status(user.getStatus())
|
||||||
.telephone(user.getTelephone())
|
.telephone(user.getTelephone())
|
||||||
.adresse(user.getAdresse())
|
.adresse(user.getAdresse())
|
||||||
.codePostal(user.getCodePostal())
|
.codePostal(user.getCodePostal())
|
||||||
.ville(user.getVille())
|
.ville(user.getVille())
|
||||||
.entreprise(user.getEntreprise())
|
.entreprise(user.getEntreprise())
|
||||||
.siret(user.getSiret())
|
.siret(user.getSiret())
|
||||||
.secteurActivite(user.getSecteurActivite())
|
.secteurActivite(user.getSecteurActivite())
|
||||||
.effectif(user.getEffectif())
|
.effectif(user.getEffectif())
|
||||||
.commentaireAdmin(user.getCommentaireAdmin())
|
.commentaireAdmin(user.getCommentaireAdmin())
|
||||||
.dateCreation(user.getDateCreation())
|
.dateCreation(user.getDateCreation())
|
||||||
.dateModification(user.getDateModification())
|
.dateModification(user.getDateModification())
|
||||||
.derniereConnexion(user.getDerniereConnexion())
|
.derniereConnexion(user.getDerniereConnexion())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// Métadonnées calculées
|
// Métadonnées calculées
|
||||||
dto.setCanLogin(user.canLogin());
|
dto.setCanLogin(user.canLogin());
|
||||||
|
|
||||||
return dto;
|
return dto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
quarkus.datasource.jdbc.url=${DB_URL:jdbc:postgresql://postgres:5432/btpxpress}
|
quarkus.datasource.jdbc.url=${DB_URL:jdbc:postgresql://postgres:5432/btpxpress}
|
||||||
quarkus.datasource.username=${DB_USERNAME:btpxpress_user}
|
quarkus.datasource.username=${DB_USERNAME:btpxpress_user}
|
||||||
quarkus.datasource.password=${DB_PASSWORD}
|
quarkus.datasource.password=${DB_PASSWORD}
|
||||||
quarkus.hibernate-orm.database.generation=validate
|
quarkus.hibernate-orm.schema-management.strategy=validate
|
||||||
quarkus.hibernate-orm.log.sql=false
|
quarkus.hibernate-orm.log.sql=false
|
||||||
quarkus.hibernate-orm.log.bind-parameters=false
|
quarkus.hibernate-orm.log.bind-parameters=false
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@ quarkus.http.host=0.0.0.0
|
|||||||
# External URL: https://api.lions.dev/btpxpress/... → Backend receives: /...
|
# External URL: https://api.lions.dev/btpxpress/... → Backend receives: /...
|
||||||
|
|
||||||
# CORS Configuration pour production
|
# CORS Configuration pour production
|
||||||
quarkus.http.cors=true
|
quarkus.http.cors.enabled=true
|
||||||
quarkus.http.cors.origins=https://btpxpress.lions.dev
|
quarkus.http.cors.origins=https://btpxpress.lions.dev
|
||||||
quarkus.http.cors.methods=GET,POST,PUT,DELETE,OPTIONS
|
quarkus.http.cors.methods=GET,POST,PUT,DELETE,OPTIONS
|
||||||
quarkus.http.cors.headers=Content-Type,Authorization,X-Requested-With
|
quarkus.http.cors.headers=Content-Type,Authorization,X-Requested-With
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ quarkus.datasource.password=${DB_PASSWORD:?DB_PASSWORD must be set}
|
|||||||
|
|
||||||
# Configuration de performance et optimisation
|
# Configuration de performance et optimisation
|
||||||
quarkus.hibernate-orm.sql-load-script=no-file
|
quarkus.hibernate-orm.sql-load-script=no-file
|
||||||
quarkus.hibernate-orm.database.generation=drop-and-create
|
quarkus.hibernate-orm.schema-management.strategy=drop-and-create
|
||||||
quarkus.hibernate-orm.log.sql=true
|
quarkus.hibernate-orm.log.sql=false
|
||||||
quarkus.hibernate-orm.log.bind-parameters=false
|
quarkus.hibernate-orm.log.bind-parameters=false
|
||||||
|
|
||||||
# Optimisation des connexions de base de données
|
# Optimisation des connexions de base de données
|
||||||
@@ -75,7 +75,7 @@ quarkus.http.host=0.0.0.0
|
|||||||
quarkus.http.non-application-root-path=/q
|
quarkus.http.non-application-root-path=/q
|
||||||
|
|
||||||
# CORS pour développement
|
# CORS pour développement
|
||||||
quarkus.http.cors=true
|
quarkus.http.cors.enabled=true
|
||||||
quarkus.http.cors.origins=${CORS_ORIGINS:http://localhost:3000,http://localhost:5173,http://localhost:8081}
|
quarkus.http.cors.origins=${CORS_ORIGINS:http://localhost:3000,http://localhost:5173,http://localhost:8081}
|
||||||
quarkus.http.cors.methods=GET,POST,PUT,DELETE,OPTIONS
|
quarkus.http.cors.methods=GET,POST,PUT,DELETE,OPTIONS
|
||||||
quarkus.http.cors.headers=Content-Type,Authorization,X-Requested-With
|
quarkus.http.cors.headers=Content-Type,Authorization,X-Requested-With
|
||||||
@@ -133,15 +133,17 @@ quarkus.arc.detect-unused-false-positives=false
|
|||||||
|
|
||||||
# Logging
|
# Logging
|
||||||
quarkus.log.level=INFO
|
quarkus.log.level=INFO
|
||||||
quarkus.log.category."dev.lions.btpxpress".level=DEBUG
|
quarkus.log.category."dev.lions.btpxpress".level=INFO
|
||||||
quarkus.log.category."io.agroal".level=DEBUG
|
quarkus.log.category."io.agroal".level=WARN
|
||||||
quarkus.log.category."io.vertx.core.impl.BlockedThreadChecker".level=WARN
|
quarkus.log.category."io.vertx.core.impl.BlockedThreadChecker".level=WARN
|
||||||
quarkus.log.category."org.hibernate".level=DEBUG
|
quarkus.log.category."org.hibernate".level=WARN
|
||||||
quarkus.log.category."io.quarkus.smallrye.jwt".level=DEBUG
|
quarkus.log.category."io.quarkus.smallrye.jwt".level=WARN
|
||||||
quarkus.log.console.format=%d{HH:mm:ss} %-5p [%c{2.}] (%t) %s%e%n
|
quarkus.log.console.format=%d{HH:mm:ss} %-5p [%c{2.}] (%t) %s%e%n
|
||||||
quarkus.log.console.color=true
|
quarkus.log.console.color=false
|
||||||
quarkus.log.async=true
|
|
||||||
quarkus.log.async.queue-length=16384
|
# Dev Mode - Active les logs de debug
|
||||||
|
%dev.quarkus.log.category."dev.lions.btpxpress".level=DEBUG
|
||||||
|
%dev.quarkus.log.console.color=true
|
||||||
|
|
||||||
# Métriques et monitoring
|
# Métriques et monitoring
|
||||||
quarkus.micrometer.export.prometheus.enabled=true
|
quarkus.micrometer.export.prometheus.enabled=true
|
||||||
|
|||||||
@@ -1,63 +1,63 @@
|
|||||||
# Configuration complète pour les tests
|
# Configuration complète pour les tests
|
||||||
# Consolidation de toutes les configurations des fichiers .yml
|
# Consolidation de toutes les configurations des fichiers .yml
|
||||||
|
|
||||||
# ===== PORT HTTP - Port aléatoire pour éviter conflits =====
|
# ===== PORT HTTP - Port aléatoire pour éviter conflits =====
|
||||||
%test.quarkus.http.port=0
|
%test.quarkus.http.port=0
|
||||||
%test.quarkus.http.test-port=0
|
%test.quarkus.http.test-port=0
|
||||||
%test.quarkus.http.host=127.0.0.1
|
%test.quarkus.http.host=127.0.0.1
|
||||||
|
|
||||||
# ===== BASE DE DONNÉES H2 EN MÉMOIRE =====
|
# ===== BASE DE DONNÉES H2 EN MÉMOIRE =====
|
||||||
%test.quarkus.datasource.db-kind=h2
|
%test.quarkus.datasource.db-kind=h2
|
||||||
%test.quarkus.datasource.username=sa
|
%test.quarkus.datasource.username=sa
|
||||||
%test.quarkus.datasource.password=
|
%test.quarkus.datasource.password=
|
||||||
%test.quarkus.datasource.jdbc.url=jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE;MODE=PostgreSQL
|
%test.quarkus.datasource.jdbc.url=jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE;MODE=PostgreSQL
|
||||||
%test.quarkus.datasource.jdbc.driver=org.h2.Driver
|
%test.quarkus.datasource.jdbc.driver=org.h2.Driver
|
||||||
|
|
||||||
# ===== HIBERNATE ORM =====
|
# ===== HIBERNATE ORM =====
|
||||||
%test.quarkus.hibernate-orm.database.generation=drop-and-create
|
%test.quarkus.hibernate-orm.database.generation=drop-and-create
|
||||||
%test.quarkus.hibernate-orm.log.sql=false
|
%test.quarkus.hibernate-orm.log.sql=false
|
||||||
%test.quarkus.hibernate-orm.log.bind-parameters=false
|
%test.quarkus.hibernate-orm.log.bind-parameters=false
|
||||||
%test.quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect
|
%test.quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect
|
||||||
|
|
||||||
# ===== FLYWAY - DÉSACTIVÉ =====
|
# ===== FLYWAY - DÉSACTIVÉ =====
|
||||||
%test.quarkus.flyway.migrate-at-start=false
|
%test.quarkus.flyway.migrate-at-start=false
|
||||||
|
|
||||||
# ===== SÉCURITÉ COMPLÈTEMENT DÉSACTIVÉE POUR TESTS =====
|
# ===== SÉCURITÉ COMPLÈTEMENT DÉSACTIVÉE POUR TESTS =====
|
||||||
%test.quarkus.security.auth.enabled=false
|
%test.quarkus.security.auth.enabled=false
|
||||||
%test.quarkus.security.jaxrs.deny-unannotated-endpoints=false
|
%test.quarkus.security.jaxrs.deny-unannotated-endpoints=false
|
||||||
%test.quarkus.oidc.enabled=false
|
%test.quarkus.oidc.enabled=false
|
||||||
%test.quarkus.oidc.tenant-enabled=false
|
%test.quarkus.oidc.tenant-enabled=false
|
||||||
%test.quarkus.smallrye-jwt.enabled=false
|
%test.quarkus.smallrye-jwt.enabled=false
|
||||||
|
|
||||||
# ===== PERMISSIONS HTTP - TOUT PERMIS =====
|
# ===== PERMISSIONS HTTP - TOUT PERMIS =====
|
||||||
%test.quarkus.http.auth.permission.authenticated.paths=/*
|
%test.quarkus.http.auth.permission.authenticated.paths=/*
|
||||||
%test.quarkus.http.auth.permission.authenticated.policy=permit
|
%test.quarkus.http.auth.permission.authenticated.policy=permit
|
||||||
|
|
||||||
# ===== CORS POUR TESTS =====
|
# ===== CORS POUR TESTS =====
|
||||||
%test.quarkus.http.cors=true
|
%test.quarkus.http.cors=true
|
||||||
%test.quarkus.http.cors.origins=*
|
%test.quarkus.http.cors.origins=*
|
||||||
%test.quarkus.http.cors.methods=*
|
%test.quarkus.http.cors.methods=*
|
||||||
%test.quarkus.http.cors.headers=*
|
%test.quarkus.http.cors.headers=*
|
||||||
|
|
||||||
# ===== LOGGING =====
|
# ===== LOGGING =====
|
||||||
%test.quarkus.log.level=WARN
|
%test.quarkus.log.level=WARN
|
||||||
%test.quarkus.log.category."dev.lions.btpxpress".level=DEBUG
|
%test.quarkus.log.category."dev.lions.btpxpress".level=WARN
|
||||||
%test.quarkus.log.category."io.quarkus.security".level=DEBUG
|
%test.quarkus.log.category."io.quarkus.security".level=WARN
|
||||||
%test.quarkus.log.category."org.hibernate".level=WARN
|
%test.quarkus.log.category."org.hibernate".level=WARN
|
||||||
%test.quarkus.log.category."io.quarkus".level=WARN
|
%test.quarkus.log.category."io.quarkus".level=WARN
|
||||||
|
|
||||||
# ===== FEATURES NON NÉCESSAIRES EN TEST =====
|
# ===== FEATURES NON NÉCESSAIRES EN TEST =====
|
||||||
%test.quarkus.swagger-ui.enable=false
|
%test.quarkus.swagger-ui.enable=false
|
||||||
%test.quarkus.health.extensions.enabled=false
|
%test.quarkus.health.extensions.enabled=false
|
||||||
%test.quarkus.micrometer.enabled=false
|
%test.quarkus.micrometer.enabled=false
|
||||||
%test.quarkus.opentelemetry.enabled=false
|
%test.quarkus.opentelemetry.enabled=false
|
||||||
|
|
||||||
# ===== DEV SERVICES DÉSACTIVÉS =====
|
# ===== DEV SERVICES DÉSACTIVÉS =====
|
||||||
%test.quarkus.devservices.enabled=false
|
%test.quarkus.devservices.enabled=false
|
||||||
|
|
||||||
# ===== CONFIGURATION MAVEN/AETHER (pour éviter conflits Quarkus) =====
|
# ===== CONFIGURATION MAVEN/AETHER (pour éviter conflits Quarkus) =====
|
||||||
%test.quarkus.maven.resolver.transport=wagon
|
%test.quarkus.maven.resolver.transport=wagon
|
||||||
|
|
||||||
# ===== JWT POUR TESTS (si nécessaire) =====
|
# ===== JWT POUR TESTS (si nécessaire) =====
|
||||||
%test.jwt.secret=test-secret-key-for-jwt-token-generation-that-is-long-enough-for-hmac-sha256-algorithm-requirements
|
%test.jwt.secret=test-secret-key-for-jwt-token-generation-that-is-long-enough-for-hmac-sha256-algorithm-requirements
|
||||||
%test.jwt.expiration=3600
|
%test.jwt.expiration=3600
|
||||||
|
|||||||
Reference in New Issue
Block a user