Mise à jour des modèles et du service formation

master
Yanaël GRETTE 4 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 {
id? : number;
export interface CollaborateurModel {
idCollaborateur? : number;
nom? : string;
prenom? : string;
mail? : string;
agence? : string;
dateEmbauche? : Date;
fonction? : string;
dateEmbauche? : Date;
dateDepart? : Date;
};

@ -1,8 +1,9 @@
import { CollaborateurModel } from "./modele-collaborateur";
//PLUSIEURS REFERENT AVEC LE DROIT D'ECRITURE ?!
export class EpModel {
id? : number;
idEp? : number;
type? : string;
dateCreation? : Date;
dateDisponibilite? : Date;
dateSaisie? : Date;
etat? : string;
@ -10,36 +11,47 @@ export class EpModel {
dateEntretien? : Date;
typeEntretien? : string;
commentaireCommercial? : string;
rdvEntretien? : RDVEntretienModel;
rdvEntretien? : RDVEntretienModel[];
augmentationSalaire? : AugmentationSalaireModel;
participants? : ParticipantModel[];
engagement? : EngagementModel;
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 {
idAugmentationSalaire? : number;
export class AugmentationSalaireModel {
idAugmentation? : number;
nouveauSalaire? : number;
dateDemande? : number;
dateDemande? : Date;
};
export interface RDVEntretienModel {
idRDV? : number;
export class RDVEntretienModel {
idTypeEntretien? : number;
typeEntretien? :string;
dateEntretien? : Date;
};
export interface EngagementModel {
export class EngagementModel {
idEngagement? : number;
engagement? : string;
dateLimie? : Date;
accomplie? : boolean;
};
export interface ParticipantModel {
collaborateur : CollaborateurModel;
export class ParticipantModel {
idParticipant? : number;
collaborateur? : CollaborateurModel;
role? : string;
};
export class Notification {
idNotification? : number;
type? : string;
titre?: string;
description?: string;
lu?: boolean;
}

@ -1,5 +1,5 @@
export class FormationModel {
id? : number;
idFormation? : number;
intitule? : string;
dateDebut? : Date;
dateFin? : Date;
@ -7,7 +7,7 @@ export class FormationModel {
lieu? : string;
duree? : number;
organisme? : string;
nomFormateur : string;
nomFormateur? : string;
};
@ -17,7 +17,7 @@ export class DemandeFormationModel {
statut? : string;
libelle? : string;
description? : string;
theme : ThemeModel;
theme? : ThemeModel;
};
@ -26,6 +26,25 @@ export interface ThemeModel {
nom : string;
};
export interface ParticipationFormationModel {
idParticipation : number;
formation : FormationModel;
collaborateur : CollaborateurModel;
evaluation : 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});
}
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 { urlsFormation } from "../utils/path-values-formations";
@Injectable({
providedIn : 'root'
})
export class ServiceFormation {
constructor(private http: HttpClient, private keycloakService : KeycloakService) {}
listeFormations() : Observable<FormationModel[]> {
let token = this.keycloakService.getKeycloakInstance().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;
const headers = { Authorization: "Bearer "+token };
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> {
@ -36,7 +40,7 @@ export class ServiceFormation {
return this.http.post<FormationModel>(urlsFormation.newFormation, formation, {headers});
}
updateFormation(formation) : Observable<FormationModel> {
updateFormation(formation) {
let token = this.keycloakService.getKeycloakInstance().token;
const headers = {
Authorization: "Bearer "+token,
@ -86,4 +90,10 @@ export class ServiceFormation {
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