From 06ae254e3c4eb1da1201b7f4aba66a2851cf3599 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yana=C3=ABl=20GRETTE?= Date: Tue, 23 Jun 2020 16:33:41 +0200 Subject: [PATCH] =?UTF-8?q?Impl=C3=A9mentation=20de=20chaque=20service=20(?= =?UTF-8?q?TESTS=20NON=20EFFECTUES=20pour=20ep=20et=20formation)=20et=20de?= =?UTF-8?q?s=20mod=C3=A8les=20(=C3=A0=20compl=C3=A9ter=20malgr=C3=A9=20tou?= =?UTF-8?q?t=20pour=20ep=20et=20formation)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/modeles/modele-collaborateur.ts | 2 +- src/app/modeles/modele-ep.ts | 27 ++++++++------ src/app/modeles/modele-formation.ts | 10 +++-- src/app/service/service-ep.ts | 49 ++++++++++++++++++++++++- src/app/service/service-formation.ts | 39 ++++++++++++++++++++ src/app/utils/path-values-formations.ts | 13 +++++-- 6 files changed, 119 insertions(+), 21 deletions(-) diff --git a/src/app/modeles/modele-collaborateur.ts b/src/app/modeles/modele-collaborateur.ts index bbb5827..f063bdd 100644 --- a/src/app/modeles/modele-collaborateur.ts +++ b/src/app/modeles/modele-collaborateur.ts @@ -5,5 +5,5 @@ export class CollaborateurModel { adresse? : string; agence? : string; mail? : string; - fonction? : string + fonction? : string; }; diff --git a/src/app/modeles/modele-ep.ts b/src/app/modeles/modele-ep.ts index 3e91be8..5ea69ff 100644 --- a/src/app/modeles/modele-ep.ts +++ b/src/app/modeles/modele-ep.ts @@ -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; }; diff --git a/src/app/modeles/modele-formation.ts b/src/app/modeles/modele-formation.ts index db257e1..3a26d33 100644 --- a/src/app/modeles/modele-formation.ts +++ b/src/app/modeles/modele-formation.ts @@ -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 +} diff --git a/src/app/service/service-ep.ts b/src/app/service/service-ep.ts index 5cd7eec..c729a7d 100644 --- a/src/app/service/service-ep.ts +++ b/src/app/service/service-ep.ts @@ -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 { + let params = { idReferent : id }; + return this.http.get(urlsEP.prochainsEPReferent, { params }); + } + + listeEPDisponibles() : Observable { + return this.http.get(urlsEP.epDisponibles); + } + + listeEPCollaborateur(id) : Observable { + let params = { idCollab : id }; + return this.http.get(urlsEP.epCollaborateur, {params}); + } + + listeEPReferent(id) : Observable { + let params = { idReferent : id }; + return this.http.get(urlsEP.epReferent); + } + + prochainEPCollaborateur(id) : Observable { + let params = { idCollab : id }; + return this.http.get(urlsEP.prochainEpCollaborateur); + } + + envoieEP(ep : EpModel, action) { + let params = { action : action }; + return this.http.post(urlsEP.envoieEP, ep, {params}); + } + + propositionDate(dates) { + return this.http.post(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); + } + + } diff --git a/src/app/service/service-formation.ts b/src/app/service/service-formation.ts index 98c2073..b37a020 100644 --- a/src/app/service/service-formation.ts +++ b/src/app/service/service-formation.ts @@ -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 { + return this.http.get(urlsFormation.urlFormation); + } + + nouvelleFormation(formation) : Observable { + return this.http.post(urlsFormation.newFormation, formation); + } + + updateFormation(formation) : Observable { + return this.http.post(urlsFormation.newFormation, formation); + } + + deleteFormation(id) { + let params = { idFormation : id }; + return this.http.delete(urlsFormation.urlFormation); + } + + evaluationsFormation(id) : Observable { + let params = { idFormation : id }; + return this.http.get(urlsFormation.evaluationsFormation); + } + + evaluerFormation(evaluation) { + return this.http.post(urlsFormation.evaluerFormation, evaluation); + } + + listeDemandesFormation() : Observable { + return this.http.get(urlsFormation.urlDemandesFormation); + } + + reponseDemandeFormation(demandeFormation) { + return this.http.post(urlsFormation.urlDemandesFormation, demandeFormation); + } + + listeTheme() : Observable { + return this.http.get(urlsFormation.urlTheme); + } } diff --git a/src/app/utils/path-values-formations.ts b/src/app/utils/path-values-formations.ts index e2e90a9..68b8954 100644 --- a/src/app/utils/path-values-formations.ts +++ b/src/app/utils/path-values-formations.ts @@ -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 };