front correction id number|null

This commit is contained in:
trochas
2026-01-09 17:49:35 +01:00
parent 7a2b72e0b1
commit aa21d046cf
6 changed files with 29 additions and 24 deletions

View File

@@ -4,20 +4,21 @@ export type Groupe = "Entrainement" | "Competition" | "Loisir"| "";
export class Ligne{
id!: number;
id: number|null = null;
nom!: string;
composition!: Athlete[] //les joueurs compososant la ligne
tempsDeJeu!: number; // en minutes
}
export class User{
id!: number;
id: number|null = null;
keycloakId!: string;
nom!: string;
prenom!:string;
email!: string;
}
export class Admin extends User{
constructor(dto:AdminDTO);
@@ -25,7 +26,7 @@ export class Admin extends User{
constructor(dto?:AdminDTO){
super();
this.id = dto?.id ?? 0;
this.id = dto?.id ?? null;
this.keycloakId = dto?.id_keycloak ?? "";
this.nom = dto?.name ?? "";
this.prenom = dto?.prenom ?? "";
@@ -113,7 +114,7 @@ export class Coach extends User{
}
export class Session{
id!: number;
id: number|null = null;
name!: string;
activitesID: number[] = [];
activites: Activite[] = [];
@@ -147,7 +148,7 @@ export class Session{
toDTO():SessionDTO{
const dto:SessionDTO = {
id: 0,
id: this.id,
name: this.name,
isRecurrent: this.isRecurrent,
creneau: this.creneau.toISOString(),
@@ -162,7 +163,7 @@ export class Session{
}
export class Activite{
id!: number;
id: number|null = null;
nom!: string;
session!: Session;
theme!: string;
@@ -184,7 +185,7 @@ export class Activite{
toDTO():ActiviteDTO{
const dto:ActiviteDTO = {
id: 0,
id: this.id,
name: this.nom,
duree: this.duree,
dataActivite: [],