fix: Use TypeConflitPlanification and GraviteConflict enums instead of strings
This commit is contained in:
@@ -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',
|
||||||
|
|||||||
Reference in New Issue
Block a user