This commit is contained in:
trochas
2026-01-08 13:17:57 +01:00
26 changed files with 474 additions and 100 deletions

View File

@@ -1,43 +1,41 @@
export type Groupe = "Entrainement" | "Competition" | "Loisir"| "";
export type Role = "Admin" | "Athlete" | "Coach";
export type Role = "admin" | "athlete" | "coach";
export class User{
id!: number;
nom!: String;
keycloakId!: String;
nom!: string;
prenom!:string;
sessions: Session[] = []; //nb: Admin liaison non symétrique /!\
email!: String;
email!: string;
role!: Role;
}
export class Ligne{
id!: number;
nom!: String;
nom!: string;
composition!: Athlete[] //les joueurs compososant la ligne
tempsDeJeu!: number; // en minutes
}
export class Admin extends User{
role!: Role;
}
export class Athlete extends User{
nom!: String;
nom!: string;
groupe!: Groupe;
role!: Role;
}
export class Coach extends User{
nom!: String;
nom!: string;
role!: Role;
}
export class Session{
id!: number;
name!: String;
name!: string;
activites: Activite[] = [];
isRecurrent! : Boolean;
creneau!: Date;
@@ -50,10 +48,10 @@ export class Session{
export class Activite{
id!: number;
nom!: String;
nom!: string;
session!: Session;
theme!: String;
data!: Map<String,String>;
theme!: string;
data!: Map<string,string>;
duree!: number;
}
@@ -101,13 +99,15 @@ export function getUserTest():User{
user.id = 0;
user.nom = "Emilien-Yee NootNoot";
user.role = "coach"
user.email = "emilien@nootnoot.yee";
user.role = "Coach"
s1.creneau = new Date();
s1.id = 1;
s1.name = "Entrainement Frisbee"
s1.isRecurrent = true;
s1.ligne = [ligne1];
s1.duree= 90;
s1.athletes = [athlete1,athlete2];
var date2 = new Date();
date2.setDate(date2.getDate() + 2);
s2.creneau = date2;
@@ -115,18 +115,16 @@ export function getUserTest():User{
s2.isRecurrent = false;
s2.name = "entraintement 2"
s2.ligne = [ligne2];
s2.duree= 120;
s2.athletes = [athlete1,athlete2, athlete3];
s3.creneau = date2;
s3.id = 3;
s3.isRecurrent = false;
s3.name = "entraintement 3"
s3.ligne = [ligne3];
s1.athletes = [athlete1, athlete2];
s2.athletes = [athlete2, athlete3];
s3.athletes = [athlete1, athlete3];
s3.ligne = [ligne3, ligne1];
s3.duree= 120;
s3.athletes = [athlete2, athlete3];
const act1 = new Activite();
act1.id = 1;
@@ -189,9 +187,9 @@ export function getUserTest():User{
user.sessions.push(s2);
user.sessions.push(s3);
athlete1.role = "Athlete";
athlete2.role = "Athlete";
athlete3.role = "Athlete";
athlete1.role = "athlete";
athlete2.role = "athlete";
athlete3.role = "athlete";
return user;
}