Mise à jour des modèles et du service formation

master
Yanaël GRETTE 5 years ago
parent 9c85714fd6
commit 38856a04f9
  1. 7
      src/app/modeles/modele-collaborateur.ts
  2. 38
      src/app/modeles/modele-ep.ts
  3. 27
      src/app/modeles/modele-formation.ts
  4. 7
      src/app/service/service-ep.ts
  5. 16
      src/app/service/service-formation.ts

@ -1,9 +1,10 @@
export class CollaborateurModel { export interface CollaborateurModel {
id? : number; idCollaborateur? : number;
nom? : string; nom? : string;
prenom? : string; prenom? : string;
mail? : string; mail? : string;
agence? : string; agence? : string;
dateEmbauche? : Date;
fonction? : string; fonction? : string;
dateEmbauche? : Date;
dateDepart? : Date;
}; };

@ -1,8 +1,9 @@
import { CollaborateurModel } from "./modele-collaborateur"; import { CollaborateurModel } from "./modele-collaborateur";
//PLUSIEURS REFERENT AVEC LE DROIT D'ECRITURE ?!
export class EpModel { export class EpModel {
id? : number; idEp? : number;
type? : string; type? : string;
dateCreation? : Date;
dateDisponibilite? : Date; dateDisponibilite? : Date;
dateSaisie? : Date; dateSaisie? : Date;
etat? : string; etat? : string;
@ -10,36 +11,47 @@ export class EpModel {
dateEntretien? : Date; dateEntretien? : Date;
typeEntretien? : string; typeEntretien? : string;
commentaireCommercial? : string; commentaireCommercial? : string;
rdvEntretien? : RDVEntretienModel; rdvEntretien? : RDVEntretienModel[];
augmentationSalaire? : AugmentationSalaireModel; augmentationSalaire? : AugmentationSalaireModel;
participants? : ParticipantModel[]; participants? : ParticipantModel[];
engagement? : EngagementModel;
collaborateur?: CollaborateurModel; collaborateur?: CollaborateurModel;
//TODO : ajouter contenu de base et contenu EPA quand il s'agit d'un EPA referent?: CollaborateurModel;
engagement? : EngagementModel;
nbRappelSignature?: number;
notifications?: Notification[];
}; };
export interface AugmentationSalaireModel { export class AugmentationSalaireModel {
idAugmentationSalaire? : number; idAugmentation? : number;
nouveauSalaire? : number; nouveauSalaire? : number;
dateDemande? : number; dateDemande? : Date;
}; };
export interface RDVEntretienModel { export class RDVEntretienModel {
idRDV? : number; idTypeEntretien? : number;
typeEntretien? :string; typeEntretien? :string;
dateEntretien? : Date; dateEntretien? : Date;
}; };
export interface EngagementModel { export class EngagementModel {
idEngagement? : number; idEngagement? : number;
engagement? : string; engagement? : string;
dateLimie? : Date; dateLimie? : Date;
accomplie? : boolean; accomplie? : boolean;
}; };
export interface ParticipantModel { export class ParticipantModel {
collaborateur : CollaborateurModel; idParticipant? : number;
collaborateur? : CollaborateurModel;
role? : string; role? : string;
}; };
export class Notification {
idNotification? : number;
type? : string;
titre?: string;
description?: string;
lu?: boolean;
}

@ -1,5 +1,5 @@
export class FormationModel { export class FormationModel {
id? : number; idFormation? : number;
intitule? : string; intitule? : string;
dateDebut? : Date; dateDebut? : Date;
dateFin? : Date; dateFin? : Date;
@ -7,7 +7,7 @@ export class FormationModel {
lieu? : string; lieu? : string;
duree? : number; duree? : number;
organisme? : string; organisme? : string;
nomFormateur : string; nomFormateur? : string;
}; };
@ -17,7 +17,7 @@ export class DemandeFormationModel {
statut? : string; statut? : string;
libelle? : string; libelle? : string;
description? : string; description? : string;
theme : ThemeModel; theme? : ThemeModel;
}; };
@ -26,6 +26,25 @@ export interface ThemeModel {
nom : string; nom : string;
}; };
export interface ParticipationFormationModel {
idParticipation : number;
formation : FormationModel;
collaborateur : CollaborateurModel;
evaluation : EvaluationFormationModel[];
}
export class EvaluationFormationModel { export class EvaluationFormationModel {
//TODO note? : number;
commentaire?: string;
critere? : CritereModel;
}
export interface CritereModel {
idCritere?: number;
texte?: string;
type?: string;
ordre?: string;
section?: string;
} }

@ -80,5 +80,12 @@ export class ServiceEP {
return this.http.post(urlsEP.epi, null, { params, headers}); return this.http.post(urlsEP.epi, null, { params, headers});
} }
ajouterParticipant(idParticipant, idEp) {
//TODO
}
deleguerEP(idNewRef, idEp){
//TODO
}
} }

@ -7,12 +7,16 @@ import { KeycloakService } from 'keycloak-angular';
import {FormationModel, DemandeFormationModel, EvaluationFormationModel, ThemeModel } from "../modeles/modele-formation"; import {FormationModel, DemandeFormationModel, EvaluationFormationModel, ThemeModel } from "../modeles/modele-formation";
import { urlsFormation } from "../utils/path-values-formations"; import { urlsFormation } from "../utils/path-values-formations";
@Injectable({ @Injectable({
providedIn : 'root' providedIn : 'root'
}) })
export class ServiceFormation { export class ServiceFormation {
constructor(private http: HttpClient, private keycloakService : KeycloakService) {} constructor(private http: HttpClient, private keycloakService : KeycloakService) {}
listeFormations() : Observable<FormationModel[]> { listeFormations() : Observable<FormationModel[]> {
let token = this.keycloakService.getKeycloakInstance().token; let token = this.keycloakService.getKeycloakInstance().token;
const headers = { Authorization: "Bearer "+token }; const headers = { Authorization: "Bearer "+token };
@ -20,11 +24,11 @@ export class ServiceFormation {
} }
listeFormationsCollaborateur(id) : Observable<FormationModel[]> { listeFormationsCollaborateur(id) : Observable<ParticipationFormationModel[]> {
let token = this.keycloakService.getKeycloakInstance().token; let token = this.keycloakService.getKeycloakInstance().token;
const headers = { Authorization: "Bearer "+token }; const headers = { Authorization: "Bearer "+token };
let params = { idCollab : id }; let params = { idCollab : id };
return this.http.get<FormationModel[]>(urlsFormation.urlFormation, { params, headers }); return this.http.get<ParticipationFormationModel[]>(urlsFormation.urlFormation, { params, headers });
} }
nouvelleFormation(formation) : Observable<FormationModel> { nouvelleFormation(formation) : Observable<FormationModel> {
@ -36,7 +40,7 @@ export class ServiceFormation {
return this.http.post<FormationModel>(urlsFormation.newFormation, formation, {headers}); return this.http.post<FormationModel>(urlsFormation.newFormation, formation, {headers});
} }
updateFormation(formation) : Observable<FormationModel> { updateFormation(formation) {
let token = this.keycloakService.getKeycloakInstance().token; let token = this.keycloakService.getKeycloakInstance().token;
const headers = { const headers = {
Authorization: "Bearer "+token, Authorization: "Bearer "+token,
@ -86,4 +90,10 @@ export class ServiceFormation {
return this.http.get<ThemeModel[]>(urlsFormation.urlTheme, {headers}); return this.http.get<ThemeModel[]>(urlsFormation.urlTheme, {headers});
} }
listeCritere() : Observable<CritereModel[]> {
let token = this.keycloakService.getKeycloakInstance().token;
const headers = { Authorization: "Bearer "+token };
return this.http.get<ThemeModel[]>(urlsFormation.urlCritere, {headers});
}
} }

Loading…
Cancel
Save