Initial commit
This commit is contained in:
155
types/chantier-form.ts
Normal file
155
types/chantier-form.ts
Normal file
@@ -0,0 +1,155 @@
|
||||
/**
|
||||
* Types pour les formulaires de chantier avec gestion avancée des types et phases
|
||||
*/
|
||||
|
||||
import { TypeChantier } from './chantier-templates';
|
||||
|
||||
// Interface pour le formulaire de création/modification de chantier
|
||||
export interface ChantierFormData {
|
||||
nom: string;
|
||||
description?: string;
|
||||
adresse: string;
|
||||
codePostal?: string;
|
||||
ville?: string;
|
||||
dateDebut: string;
|
||||
dateFinPrevue?: string;
|
||||
montantPrevu?: number;
|
||||
clientId: string;
|
||||
|
||||
// Nouveaux champs avancés
|
||||
typeChantier: TypeChantier;
|
||||
surface?: number;
|
||||
nombreNiveaux?: number;
|
||||
autoGenererPhases: boolean;
|
||||
inclureSousPhases: boolean;
|
||||
ajusterDelais: boolean;
|
||||
|
||||
// Spécificités et contraintes
|
||||
specificites?: string[];
|
||||
contraintes?: string;
|
||||
accesPMR?: boolean;
|
||||
performanceEnergetique?: string;
|
||||
|
||||
// Informations techniques
|
||||
natureTerrain?: string;
|
||||
presenceReseaux?: boolean;
|
||||
accessibiliteChantier?: 'FACILE' | 'MOYENNE' | 'DIFFICILE';
|
||||
stockagePossible?: boolean;
|
||||
|
||||
// Réglementation
|
||||
permisRequis?: boolean;
|
||||
numeroPermis?: string;
|
||||
dateObtentionPermis?: string;
|
||||
controleUrbanismeRequis?: boolean;
|
||||
|
||||
// Options de planification
|
||||
margeSecurite?: number; // en jours
|
||||
periodesTravailRestreintes?: Array<{
|
||||
dateDebut: string;
|
||||
dateFin: string;
|
||||
motif: string;
|
||||
}>;
|
||||
|
||||
// Équipes et ressources préférées
|
||||
equipePrefereId?: string;
|
||||
materielsRequis?: string[];
|
||||
}
|
||||
|
||||
// Interface pour la prévisualisation du projet
|
||||
export interface ChantierPreview {
|
||||
typeChantier: TypeChantier;
|
||||
nom: string;
|
||||
dureeEstimee: number;
|
||||
dateFinEstimee: Date;
|
||||
complexite: {
|
||||
niveau: 'SIMPLE' | 'MOYEN' | 'COMPLEXE' | 'TRES_COMPLEXE';
|
||||
score: number;
|
||||
facteurs: string[];
|
||||
};
|
||||
phasesCount: number;
|
||||
sousePhasesCount: number;
|
||||
specificites: string[];
|
||||
reglementations: string[];
|
||||
coutEstime?: number;
|
||||
}
|
||||
|
||||
// Interface pour les options de génération de phases
|
||||
export interface PhaseGenerationOptions {
|
||||
inclureSousPhases: boolean;
|
||||
ajusterDelais: boolean;
|
||||
margeSecurite: number;
|
||||
personnaliserDurees: boolean;
|
||||
conserverOrdreStandard: boolean;
|
||||
genererMateriels: boolean;
|
||||
genererFournisseurs: boolean;
|
||||
calculerAnalysePrix: boolean;
|
||||
}
|
||||
|
||||
// Interface pour les contraintes temporelles
|
||||
export interface ContrainteTemporelle {
|
||||
id?: string;
|
||||
nom: string;
|
||||
dateDebut: string;
|
||||
dateFin: string;
|
||||
type: 'INTEMPERIE' | 'CONGE' | 'AUTRE_CHANTIER' | 'MAINTENANCE' | 'REGLEMENTATION';
|
||||
description?: string;
|
||||
impactPhases?: string[]; // IDs des phases impactées
|
||||
}
|
||||
|
||||
// Interface pour la validation du formulaire
|
||||
export interface ChantierFormValidation {
|
||||
isValid: boolean;
|
||||
errors: {
|
||||
[key in keyof ChantierFormData]?: string;
|
||||
};
|
||||
warnings: string[];
|
||||
recommendations: string[];
|
||||
}
|
||||
|
||||
// Interface pour les données calculées
|
||||
export interface ChantierCalculatedData {
|
||||
dureeEstimee: number;
|
||||
dateFinCalculee: Date;
|
||||
coutEstimeTotal?: number;
|
||||
coutEstimeParPhase?: { [phaseId: string]: number };
|
||||
ressourcesRequises: {
|
||||
equipes: number;
|
||||
materiels: string[];
|
||||
competences: string[];
|
||||
};
|
||||
jalonsImportants: Array<{
|
||||
nom: string;
|
||||
date: Date;
|
||||
critique: boolean;
|
||||
}>;
|
||||
}
|
||||
|
||||
// Types pour les options de projet
|
||||
export type AccessibiliteChantier = 'FACILE' | 'MOYENNE' | 'DIFFICILE';
|
||||
export type NatureTerrain = 'PLAT' | 'PENTE_LEGERE' | 'PENTE_FORTE' | 'ROCHEUX' | 'HUMIDE' | 'INSTABLE';
|
||||
export type PerformanceEnergetique = 'RT2012' | 'RT2020' | 'RE2020' | 'PASSIF' | 'POSITIF' | 'STANDARD';
|
||||
|
||||
// Constantes pour les options
|
||||
export const ACCESSIBILITE_OPTIONS = [
|
||||
{ value: 'FACILE', label: 'Facile - Accès direct, terrain plat' },
|
||||
{ value: 'MOYENNE', label: 'Moyenne - Quelques contraintes d\'accès' },
|
||||
{ value: 'DIFFICILE', label: 'Difficile - Accès restreint, terrain complexe' }
|
||||
] as const;
|
||||
|
||||
export const NATURE_TERRAIN_OPTIONS = [
|
||||
{ value: 'PLAT', label: 'Terrain plat' },
|
||||
{ value: 'PENTE_LEGERE', label: 'Pente légère' },
|
||||
{ value: 'PENTE_FORTE', label: 'Pente forte' },
|
||||
{ value: 'ROCHEUX', label: 'Terrain rocheux' },
|
||||
{ value: 'HUMIDE', label: 'Terrain humide' },
|
||||
{ value: 'INSTABLE', label: 'Terrain instable' }
|
||||
] as const;
|
||||
|
||||
export const PERFORMANCE_ENERGETIQUE_OPTIONS = [
|
||||
{ value: 'STANDARD', label: 'Standard (réglementation minimale)' },
|
||||
{ value: 'RT2012', label: 'RT 2012' },
|
||||
{ value: 'RT2020', label: 'RT 2020' },
|
||||
{ value: 'RE2020', label: 'RE 2020 (obligatoire neuf)' },
|
||||
{ value: 'PASSIF', label: 'Bâtiment passif' },
|
||||
{ value: 'POSITIF', label: 'Bâtiment à énergie positive' }
|
||||
] as const;
|
||||
Reference in New Issue
Block a user