fix: Use TypeConflitPlanification and GraviteConflict enums instead of strings

This commit is contained in:
dahoud
2025-10-15 21:10:33 +00:00
parent 9ba1e71041
commit d537b0c1c2

View File

@@ -23,6 +23,7 @@ import { Divider } from 'primereact/divider';
import { chantierService } from '../../../../services/api'; import { chantierService } from '../../../../services/api';
import { formatDate, formatDateTime } from '../../../../utils/formatters'; import { formatDate, formatDateTime } from '../../../../utils/formatters';
import type { Chantier, PlanningEvent as PlanningEventType, Equipe, Materiel, Employe, PlanningConflict } from '../../../../types/btp'; import type { Chantier, PlanningEvent as PlanningEventType, Equipe, Materiel, Employe, PlanningConflict } from '../../../../types/btp';
import { TypeConflitPlanification, GraviteConflict } from '../../../../types/btp';
interface PlanningCalendrierEvent { interface PlanningCalendrierEvent {
id: string; id: string;
@@ -303,11 +304,11 @@ const CalendrierPlanningPage = () => {
if (event1.start < event2.end && event1.end > event2.start) { if (event1.start < event2.end && event1.end > event2.start) {
conflicts.push({ conflicts.push({
id: `conflict-${i}-${j}`, id: `conflict-${i}-${j}`,
type: 'CHEVAUCHEMENT_HORAIRES', type: TypeConflitPlanification.CHEVAUCHEMENT_HORAIRES,
description: `Conflit horaire entre "${event1.title}" et "${event2.title}"`, description: `Conflit horaire entre "${event1.title}" et "${event2.title}"`,
events: [event1, event2] as any, events: [event1, event2] as any,
ressources: [], ressources: [],
gravite: 'ATTENTION', gravite: GraviteConflict.ATTENTION,
suggestions: [ suggestions: [
'Décaler l\'un des événements', 'Décaler l\'un des événements',
'Réduire la durée des événements', 'Réduire la durée des événements',