Implémentation de chaque service (TESTS NON EFFECTUES pour ep et formation) et des modèles (à compléter malgré tout pour ep et formation)

master
Yanaël GRETTE 4 years ago
parent d2dc0511dc
commit 06ae254e3c
  1. 2
      src/app/modeles/modele-collaborateur.ts
  2. 27
      src/app/modeles/modele-ep.ts
  3. 10
      src/app/modeles/modele-formation.ts
  4. 49
      src/app/service/service-ep.ts
  5. 39
      src/app/service/service-formation.ts
  6. 13
      src/app/utils/path-values-formations.ts

@ -5,5 +5,5 @@ export class CollaborateurModel {
adresse? : string;
agence? : string;
mail? : string;
fonction? : string
fonction? : string;
};

@ -1,42 +1,45 @@
import { CollaborateurModel } from "./modele-collaborateur";
export interface EpModel {
idEp? : number;
type? : string;
dateDisponibilité? : Date;
dateDisponibilite? : Date;
dateSaisie? : Date;
etat? : string;
cv? : string;
dateEntretien? : Date;
typeEntretien? : string;
commentaireCommercial? : string;
augmentationSalaire? : AugmentationSalaire;
rdvEntretien? : RDVEntretien;
augmentationSalaire? : AugmentationSalaire;
participants? : Participant;
engagement? : Engagement
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
};
export interface AugmentationSalaireModel {
idAugmentationSalaire? : number;
nouveauSalaire? : number;
dateDemande? : number
dateDemande? : number;
};
export interface RDVEntretienModel {
idRDV? : number;
typeEntretien? :string;
dateEntretien? : Date
dateEntretien? : Date;
};
export interface EngagementModel {
idEngagement? : number;
engagement? : string;
dateLimie? : Date
dateLimie? : Date;
accomplie? : boolean;
};
export interface ParticipantModel {
idParticipant? : number;
idCollaborateur? : number;
role? : string
collaborateur : CollaborateurModel;
role? : string;
};

@ -7,7 +7,7 @@ export interface FormationModel {
lieu? : string;
duree? : number;
organisme? : string;
nomFormateur : string
nomFormateur : string;
};
@ -17,11 +17,15 @@ export interface DemandeFormationModel {
statut? : string;
libelle? : string;
description? : string;
theme : Theme
theme : ThemeModel;
};
export interface ThemeModel {
idTheme : number;
nom : string
nom : string;
};
export interface EvaluationFormationModel {
//TODO
}

@ -1,7 +1,9 @@
import { Injectable } from "@angular/core";
import { HttpClient } from "@angular/common/http";
import { Observable } from "rxjs";
import { Observable } from 'rxjs';
import { urlsEP } from "../utils/path-values-ep";
import { EpModel, RDVEntretienModel } from "../modeles/modele-ep";
@Injectable({
providedIn : 'root'
@ -10,4 +12,49 @@ export class ServiceEP {
constructor(private http: HttpClient) {
}
listeProchainsEPReferent(id) : Observable<EpModel[]> {
let params = { idReferent : id };
return this.http.get<EpModel[]>(urlsEP.prochainsEPReferent, { params });
}
listeEPDisponibles() : Observable<EpModel[]> {
return this.http.get<EpModel[]>(urlsEP.epDisponibles);
}
listeEPCollaborateur(id) : Observable<EpModel[]> {
let params = { idCollab : id };
return this.http.get<EpModel[]>(urlsEP.epCollaborateur, {params});
}
listeEPReferent(id) : Observable<EpModel[]> {
let params = { idReferent : id };
return this.http.get<EpModel[]>(urlsEP.epReferent);
}
prochainEPCollaborateur(id) : Observable<EpModel> {
let params = { idCollab : id };
return this.http.get<EpModel>(urlsEP.prochainEpCollaborateur);
}
envoieEP(ep : EpModel, action) {
let params = { action : action };
return this.http.post<EpModel>(urlsEP.envoieEP, ep, {params});
}
propositionDate(dates) {
return this.http.post<RDVEntretienModel>(urlsEP.propositionDate, dates);
}
rappelerSignature(id) {
let params = { idEp : id };
return this.http.get(urlsEP.rappelSignature, {params});
}
demandeEPI(id) {
let params = { IdCollab : id };
return this.http.post(urlsEP.epi, params);
}
}

@ -2,6 +2,8 @@ import { Injectable } from "@angular/core";
import { HttpClient } from "@angular/common/http";
import { Observable } from "rxjs";
import {FormationModel, DemandeFormationModel, EvaluationFormationModel, ThemeModel } from "../modeles/modele-formation";
import { urlsFormation } from "../utils/path-values-formations";
@Injectable({
providedIn : 'root'
@ -11,6 +13,43 @@ export class ServiceFormation {
}
listeFormations() : Observable<FormationModel[]> {
return this.http.get<FormationModel[]>(urlsFormation.urlFormation);
}
nouvelleFormation(formation) : Observable<FormationModel> {
return this.http.post<FormationModel>(urlsFormation.newFormation, formation);
}
updateFormation(formation) : Observable<FormationModel> {
return this.http.post<FormationModel>(urlsFormation.newFormation, formation);
}
deleteFormation(id) {
let params = { idFormation : id };
return this.http.delete(urlsFormation.urlFormation);
}
evaluationsFormation(id) : Observable<EvaluationFormationModel[]> {
let params = { idFormation : id };
return this.http.get<EvaluationFormationModel[]>(urlsFormation.evaluationsFormation);
}
evaluerFormation(evaluation) {
return this.http.post<EvaluationFormationModel>(urlsFormation.evaluerFormation, evaluation);
}
listeDemandesFormation() : Observable<DemandeFormationModel[]> {
return this.http.get<DemandeFormationModel[]>(urlsFormation.urlDemandesFormation);
}
reponseDemandeFormation(demandeFormation) {
return this.http.post<DemandeFormationModel>(urlsFormation.urlDemandesFormation, demandeFormation);
}
listeTheme() : Observable<ThemeModel[]> {
return this.http.get<ThemeModel[]>(urlsFormation.urlTheme);
}
}

@ -8,11 +8,16 @@ const updateFormation = urlFormation+"/update";
const evaluationsFormation = urlFormation+"/evaluations";
const evaluerFormation = urlFormation+"/evaluer";
const evaluationCollaborateur = urlFormation+"/collaborateur";
const urlDemandesFormation = urlFormation+/"demandesFormation";
const urlDemandesFormation = urlFormation+"/demandesFormation";
const urlTheme = urlFormation+"/themes";
export const urlsFormation = {
urlFormation,
newFf
urlDemandesFormation
newFormation,
updateFormation,
evaluationsFormation,
evaluerFormation,
evaluationCollaborateur,
urlDemandesFormation,
urlTheme
};

Loading…
Cancel
Save