class métier + selectChanter toujours en cours

This commit is contained in:
Rochas
2025-11-16 19:24:46 +01:00
parent 7d38286bb7
commit a10b2fa953
9 changed files with 242 additions and 46 deletions

139
class/class.tsx Normal file
View File

@@ -0,0 +1,139 @@
export class Chantier{
id: number;
adresse: string;
etat: string;
contact: string;
chef: Chef;
equipe : Equipier[];
materiel : Materiel[];
dateDep : string;
tempsEst : number;
vehicules : Vehicule[];
anomalies : string[];
constructor(
id: number,
adresse: string,
etat: string,
contact: string,
chef: Chef,
equipe: Equipier[],
materiel: Materiel[],
dateDep: string,
tempsEst: number,
vehicules: Vehicule[],
anomalies: string[]
) {
this.id = id;
this.adresse = adresse;
this.etat = etat;
this.contact = contact;
this.chef = chef;
this.equipe = equipe;
this.materiel = materiel;
this.dateDep = dateDep;
this.tempsEst = tempsEst;
this.vehicules = vehicules;
this.anomalies = anomalies;
}
}
export abstract class Equipier{
id: number;
nom: string;
prenom: string;
allocation: Reservation[];
constructor(id: number, nom:string, prenom:string, allocation: Reservation[]){
this.id = id;
this.nom = nom;
this.prenom = prenom;
this.allocation = allocation;
}
}
export class Chef extends Equipier{
constructor(id: number, nom:string, prenom:string, allocation: Reservation[]){
super(id,nom,prenom,allocation);
}
}
export class Ouvrier extends Equipier{
qualification : string;
constructor(id: number, nom:string, prenom:string, allocation: Reservation[], qualification: string){
super(id,nom,prenom,allocation);
this.qualification=qualification;
}
}
export class ResponsableChantier extends Equipier{
constructor(id: number, nom:string, prenom:string, allocation: Reservation[]){
super(id,nom,prenom,allocation);
}
}
export class Materiel {
id: number;
nom: string;
prenom: string;
type: string;
allocation: Reservation[];
constructor(
id: number,
nom: string,
prenom: string,
type: string,
allocation: Reservation[]
) {
this.id = id;
this.nom = nom;
this.prenom = prenom;
this.type = type;
this.allocation = allocation;
}
}
export class Reservation {
id: string;
dateChantier: Date;
dateFin: Date;
duree: number;
constructor(
id: string,
dateChantier: Date,
dateFin: Date,
duree: number
) {
this.id = id;
this.dateChantier = dateChantier;
this.dateFin = dateFin;
this.duree = duree;
}
}
export class Vehicule {
id: number;
nom: string;
type: string;
allocation: Reservation[];
constructor(
id: number,
nom: string,
type: string,
allocation: Reservation[]
) {
this.id = id;
this.nom = nom;
this.type = type;
this.allocation = allocation;
}
}
export const exempleChantier = new Chantier(1,"Rennes","en cours","contact",new Chef(1,"Chyeef","YEE",[]),[],[],"01/01/25",10,[],["YEE"])