152 lines
3.7 KiB
Markdown
152 lines
3.7 KiB
Markdown
# 📅 CONCEPT: PLANNING
|
|
|
|
## 📌 Vue d'ensemble
|
|
|
|
Le concept **PLANNING** gère le planning général avec événements, rendez-vous, affectations de ressources et calendrier.
|
|
|
|
**Importance**: ⭐⭐⭐⭐ (Concept stratégique)
|
|
|
|
---
|
|
|
|
## 🗂️ Fichiers concernés
|
|
|
|
### **Entités JPA**
|
|
| Fichier | Description |
|
|
|---------|-------------|
|
|
| `PlanningEvent.java` | Événement de planning |
|
|
| `StatutPlanningEvent.java` | Enum statuts |
|
|
| `TypePlanningEvent.java` | Enum types |
|
|
| `PrioritePlanningEvent.java` | Enum priorités |
|
|
| `RappelPlanningEvent.java` | Rappels |
|
|
| `TypeRappel.java` | Enum types rappel |
|
|
| `VuePlanning.java` | Enum vues (JOUR, SEMAINE, MOIS, ANNEE) |
|
|
|
|
### **Services**
|
|
| Fichier | Description |
|
|
|---------|-------------|
|
|
| `PlanningService.java` | Service métier planning |
|
|
|
|
### **Resources**
|
|
| Fichier | Description |
|
|
|---------|-------------|
|
|
| `PlanningResource.java` | API REST planning |
|
|
|
|
---
|
|
|
|
## 📊 Modèle de données
|
|
|
|
```java
|
|
@Entity
|
|
@Table(name = "planning_events")
|
|
public class PlanningEvent extends PanacheEntityBase {
|
|
@Id
|
|
@GeneratedValue(strategy = GenerationType.UUID)
|
|
private UUID id;
|
|
|
|
@Column(name = "titre", nullable = false)
|
|
private String titre;
|
|
|
|
@Column(name = "description", length = 2000)
|
|
private String description;
|
|
|
|
@Column(name = "date_debut", nullable = false)
|
|
private LocalDateTime dateDebut;
|
|
|
|
@Column(name = "date_fin", nullable = false)
|
|
private LocalDateTime dateFin;
|
|
|
|
@Enumerated(EnumType.STRING)
|
|
@Column(name = "type")
|
|
private TypePlanningEvent type;
|
|
|
|
@Enumerated(EnumType.STRING)
|
|
@Column(name = "statut")
|
|
private StatutPlanningEvent statut;
|
|
|
|
@Enumerated(EnumType.STRING)
|
|
@Column(name = "priorite")
|
|
private PrioritePlanningEvent priorite;
|
|
|
|
@ManyToOne
|
|
@JoinColumn(name = "chantier_id")
|
|
private Chantier chantier;
|
|
|
|
@ManyToMany
|
|
@JoinTable(name = "planning_event_employes")
|
|
private List<Employe> employes;
|
|
|
|
@ManyToMany
|
|
@JoinTable(name = "planning_event_materiels")
|
|
private List<Materiel> materiels;
|
|
|
|
@Column(name = "lieu", length = 500)
|
|
private String lieu;
|
|
|
|
@Column(name = "tout_la_journee")
|
|
private Boolean toutLaJournee = false;
|
|
}
|
|
```
|
|
|
|
---
|
|
|
|
## 🔌 API REST
|
|
|
|
### **Endpoints**
|
|
|
|
| Méthode | Endpoint | Description |
|
|
|---------|----------|-------------|
|
|
| GET | `/api/v1/planning` | Liste événements |
|
|
| GET | `/api/v1/planning/{id}` | Détails |
|
|
| POST | `/api/v1/planning` | Créer |
|
|
| PUT | `/api/v1/planning/{id}` | Modifier |
|
|
| DELETE | `/api/v1/planning/{id}` | Supprimer |
|
|
| GET | `/api/v1/planning/periode` | Par période |
|
|
| GET | `/api/v1/planning/chantier/{id}` | Par chantier |
|
|
| GET | `/api/v1/planning/employe/{id}` | Par employé |
|
|
|
|
---
|
|
|
|
## 💻 Exemples
|
|
|
|
### **Créer un événement**
|
|
|
|
```bash
|
|
curl -X POST http://localhost:8080/api/v1/planning \
|
|
-H "Content-Type: application/json" \
|
|
-d '{
|
|
"titre": "Coulage dalle béton",
|
|
"description": "Coulage de la dalle du RDC",
|
|
"dateDebut": "2025-10-15T08:00:00",
|
|
"dateFin": "2025-10-15T17:00:00",
|
|
"type": "CHANTIER",
|
|
"priorite": "HAUTE",
|
|
"chantierId": "chantier-uuid",
|
|
"employeIds": ["emp1-uuid", "emp2-uuid"],
|
|
"materielIds": ["mat1-uuid"],
|
|
"lieu": "Chantier Villa Moderne"
|
|
}'
|
|
```
|
|
|
|
### **Événements par période**
|
|
|
|
```bash
|
|
curl -X GET "http://localhost:8080/api/v1/planning/periode?debut=2025-10-01&fin=2025-10-31"
|
|
```
|
|
|
|
---
|
|
|
|
## 🔧 Services métier
|
|
|
|
**PlanningService - Méthodes**:
|
|
- `create(PlanningEventDTO)` - Créer
|
|
- `findByPeriode(LocalDate debut, LocalDate fin)` - Par période
|
|
- `findByChantier(UUID chantierId)` - Par chantier
|
|
- `findByEmploye(UUID employeId)` - Par employé
|
|
- `detecterConflits(PlanningEventDTO)` - Détecter conflits
|
|
|
|
---
|
|
|
|
**Dernière mise à jour**: 2025-09-30
|
|
**Version**: 1.0
|
|
|