Début de mise en place des services avec fonctionnement du service collaborateur (test fait depuis home-assistante)
parent
f7ab45774b
commit
d2dc0511dc
@ -1,13 +1,48 @@ |
|||||||
import { Component, OnInit } from '@angular/core'; |
import { Component, OnInit, OnDestroy } from '@angular/core'; |
||||||
|
import { Observable, Subscription } from 'rxjs'; |
||||||
|
|
||||||
|
import { ServiceCollaborateur } from "../../service"; |
||||||
|
import { CollaborateurModel } from "../../modeles/modele-collaborateur"; |
||||||
|
|
||||||
@Component({ |
@Component({ |
||||||
selector : 'home-assistante', |
selector : 'home-assistante', |
||||||
templateUrl : 'home-assistante.component.html' |
templateUrl : 'home-assistante.component.html' |
||||||
}) |
}) |
||||||
export class HomeAssistanteComponent implements OnInit { |
export class HomeAssistanteComponent implements OnInit { |
||||||
constructor() { |
|
||||||
|
private collabListSubscription : Subscription; |
||||||
|
private collab1Subscription : Subscription; |
||||||
|
private collab2Subscription : Subscription; |
||||||
|
private listeCollaborateurs : CollaborateurModel[]; |
||||||
|
constructor(private serviceCollaborateur : ServiceCollaborateur) { |
||||||
|
this.collabListSubscription = this.serviceCollaborateur.listeCollaborateurs(). |
||||||
|
subscribe(collaborateurs => this.test(collaborateurs)); |
||||||
|
let params = { mail : "angelique@apside.com"}; |
||||||
|
this.collab1Subscription = this.serviceCollaborateur.getCollaborateurByParam(params). |
||||||
|
subscribe(collaborateurs => this.test2(collaborateurs)); |
||||||
|
let params2 = { id : 1 }; |
||||||
|
this.collab2Subscription = this.serviceCollaborateur.getCollaborateurByParam(params2). |
||||||
|
subscribe(collaborateurs => this.test2(collaborateurs)); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
test(collaborateurs) { |
||||||
|
for(let collaborateur of collaborateurs) { |
||||||
|
console.log(collaborateur); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
test2(collaborateur) { |
||||||
|
console.log(collaborateur); |
||||||
} |
} |
||||||
|
|
||||||
ngOnInit() { |
ngOnInit() { |
||||||
} |
} |
||||||
|
|
||||||
|
ngOnDestroy() { |
||||||
|
if(this.collabListSubscription != null) { |
||||||
|
this.collabListSubscription.unsubscribe(); |
||||||
|
} |
||||||
|
} |
||||||
} |
} |
||||||
|
@ -0,0 +1,9 @@ |
|||||||
|
export class CollaborateurModel { |
||||||
|
id? : number; |
||||||
|
nom? : string; |
||||||
|
prenom? : string; |
||||||
|
adresse? : string; |
||||||
|
agence? : string; |
||||||
|
mail? : string; |
||||||
|
fonction? : string |
||||||
|
}; |
@ -0,0 +1,42 @@ |
|||||||
|
export interface EpModel { |
||||||
|
idEp? : number; |
||||||
|
type? : string; |
||||||
|
dateDisponibilité? : Date; |
||||||
|
dateSaisie? : Date; |
||||||
|
etat? : string; |
||||||
|
cv? : string; |
||||||
|
dateEntretien? : Date; |
||||||
|
typeEntretien? : string; |
||||||
|
commentaireCommercial? : string; |
||||||
|
augmentationSalaire? : AugmentationSalaire; |
||||||
|
rdvEntretien? : RDVEntretien; |
||||||
|
augmentationSalaire? : AugmentationSalaire; |
||||||
|
participants? : Participant; |
||||||
|
engagement? : Engagement |
||||||
|
}; |
||||||
|
|
||||||
|
|
||||||
|
export interface AugmentationSalaireModel { |
||||||
|
idAugmentationSalaire? : number; |
||||||
|
nouveauSalaire? : number; |
||||||
|
dateDemande? : number |
||||||
|
}; |
||||||
|
|
||||||
|
export interface RDVEntretienModel { |
||||||
|
idRDV? : number; |
||||||
|
typeEntretien? :string; |
||||||
|
dateEntretien? : Date |
||||||
|
}; |
||||||
|
|
||||||
|
|
||||||
|
export interface EngagementModel { |
||||||
|
idEngagement? : number; |
||||||
|
engagement? : string; |
||||||
|
dateLimie? : Date |
||||||
|
}; |
||||||
|
|
||||||
|
export interface ParticipantModel { |
||||||
|
idParticipant? : number; |
||||||
|
idCollaborateur? : number; |
||||||
|
role? : string |
||||||
|
}; |
@ -0,0 +1,27 @@ |
|||||||
|
export interface FormationModel { |
||||||
|
idFormation? : number; |
||||||
|
intitule? : string; |
||||||
|
dateDebut? : Date; |
||||||
|
dateFin? : Date; |
||||||
|
statut? : string; |
||||||
|
lieu? : string; |
||||||
|
duree? : number; |
||||||
|
organisme? : string; |
||||||
|
nomFormateur : string |
||||||
|
}; |
||||||
|
|
||||||
|
|
||||||
|
export interface DemandeFormationModel { |
||||||
|
idDemandeFormation? : number; |
||||||
|
idEp? : number; |
||||||
|
statut? : string; |
||||||
|
libelle? : string; |
||||||
|
description? : string; |
||||||
|
theme : Theme |
||||||
|
}; |
||||||
|
|
||||||
|
|
||||||
|
export interface ThemeModel { |
||||||
|
idTheme : number; |
||||||
|
nom : string |
||||||
|
}; |
@ -0,0 +1,3 @@ |
|||||||
|
export * from "./service-ep"; |
||||||
|
export * from "./service-formation"; |
||||||
|
export * from "./service-collaborateur"; |
@ -0,0 +1,23 @@ |
|||||||
|
import { Injectable } from "@angular/core"; |
||||||
|
import { HttpClient } from "@angular/common/http"; |
||||||
|
import { Observable } from 'rxjs'; |
||||||
|
import { map } from 'rxjs/operators'; |
||||||
|
import { urlCollaborateur } from "../utils/path-values-collaborateurs"; |
||||||
|
import { CollaborateurModel } from "../modeles/modele-collaborateur"; |
||||||
|
|
||||||
|
@Injectable({ |
||||||
|
providedIn : 'root' |
||||||
|
}) |
||||||
|
export class ServiceCollaborateur { |
||||||
|
constructor(private http: HttpClient) { |
||||||
|
} |
||||||
|
|
||||||
|
listeCollaborateurs() : Observable<CollaborateurModel[]> { |
||||||
|
return this.http.get<CollaborateurModel[]>(urlCollaborateur); |
||||||
|
} |
||||||
|
|
||||||
|
getCollaborateurByParam(params) : Observable<CollaborateurModel> { |
||||||
|
return this.http.get<CollaborateurModel>(urlCollaborateur, { params }); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,13 @@ |
|||||||
|
import { Injectable } from "@angular/core"; |
||||||
|
import { HttpClient } from "@angular/common/http"; |
||||||
|
import { Observable } from "rxjs"; |
||||||
|
|
||||||
|
|
||||||
|
@Injectable({ |
||||||
|
providedIn : 'root' |
||||||
|
}) |
||||||
|
export class ServiceEP { |
||||||
|
constructor(private http: HttpClient) { |
||||||
|
|
||||||
|
} |
||||||
|
} |
@ -0,0 +1,16 @@ |
|||||||
|
import { Injectable } from "@angular/core"; |
||||||
|
import { HttpClient } from "@angular/common/http"; |
||||||
|
import { Observable } from "rxjs"; |
||||||
|
|
||||||
|
|
||||||
|
@Injectable({ |
||||||
|
providedIn : 'root' |
||||||
|
}) |
||||||
|
export class ServiceFormation { |
||||||
|
constructor(private http: HttpClient) { |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} |
@ -0,0 +1,7 @@ |
|||||||
|
import { environment } from '../../environments/environment'; |
||||||
|
|
||||||
|
const baseUrl = environment.serveurConfig.url; |
||||||
|
|
||||||
|
const urlCollaborateur = baseUrl+"/collaborateurs"; |
||||||
|
|
||||||
|
export { urlCollaborateur }; |
@ -0,0 +1,28 @@ |
|||||||
|
import { environment } from '../../environments/environment'; |
||||||
|
|
||||||
|
const baseUrl = environment.serveurConfig.url; |
||||||
|
|
||||||
|
const urlEP = baseUrl+"/ep"; |
||||||
|
|
||||||
|
const prochainsEPReferent = urlEP+"/prochains"; |
||||||
|
const epDisponibles = urlEP+"/disponible"; |
||||||
|
const epCollaborateur = urlEP+"/collaborateur"; |
||||||
|
const epReferent = urlEP+"/referent"; |
||||||
|
const prochainEpCollaborateur = urlEP+"/prochain"; |
||||||
|
const envoieEP = urlEP+"/envoieep"; |
||||||
|
const propositionDate = urlEP+"/propositiondate"; |
||||||
|
const rappelSignature = urlEP+"/rappelSignature"; |
||||||
|
const epi = urlEP+"/epi"; |
||||||
|
|
||||||
|
export const urlsEP = { |
||||||
|
urlEP, |
||||||
|
prochainsEPReferent, |
||||||
|
epDisponibles, |
||||||
|
epCollaborateur, |
||||||
|
epReferent, |
||||||
|
prochainEpCollaborateur, |
||||||
|
envoieEP, |
||||||
|
propositionDate, |
||||||
|
rappelSignature, |
||||||
|
epi |
||||||
|
}; |
@ -0,0 +1,18 @@ |
|||||||
|
import { environment } from '../../environments/environment'; |
||||||
|
|
||||||
|
const baseUrl = environment.serveurConfig.url; |
||||||
|
|
||||||
|
const urlFormation = baseUrl+"/formations"; |
||||||
|
const newFormation = urlFormation+"/new"; |
||||||
|
const updateFormation = urlFormation+"/update"; |
||||||
|
const evaluationsFormation = urlFormation+"/evaluations"; |
||||||
|
const evaluerFormation = urlFormation+"/evaluer"; |
||||||
|
const evaluationCollaborateur = urlFormation+"/collaborateur"; |
||||||
|
const urlDemandesFormation = urlFormation+/"demandesFormation"; |
||||||
|
|
||||||
|
|
||||||
|
export const urlsFormation = { |
||||||
|
urlFormation, |
||||||
|
newFf |
||||||
|
urlDemandesFormation |
||||||
|
}; |
@ -0,0 +1 @@ |
|||||||
|
export const appVersion = '1.0.0'; |
@ -0,0 +1,2 @@ |
|||||||
|
export * from './app-version'; |
||||||
|
export * from './environment'; |
Loading…
Reference in new issue