refactor(pega): Removed Pega references from the application (TV-242)
Squashed commit of the following: commit f0af4736b6a196db9a1306ca8b355c62610905ee Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se> Date: Thu Jun 3 06:32:21 2021 +0200 Removed PEGA references from repository
This commit is contained in:
@@ -17,86 +17,10 @@ export interface EmployeeApiResponse extends UserApiResponse {
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
||||
export interface EmployeeApiRequestData extends Employee {}
|
||||
|
||||
export interface PegaEmployeesApiResponse {
|
||||
pxMore: string;
|
||||
pxObjClass: string;
|
||||
pxPageCount: string;
|
||||
pxQueryTimeStamp: string;
|
||||
pxResultCount: string;
|
||||
pxTotalResultCount: string;
|
||||
pyMaxRecords: string;
|
||||
pyObjClass: string;
|
||||
pxResults: PegaEmployeeApiResponse[];
|
||||
pzPerformanceSettings: string[];
|
||||
}
|
||||
|
||||
export interface PegaEmployeeApiResponse {
|
||||
pxInsHandle: string;
|
||||
pxObjClass: string;
|
||||
pyAccessGroup: string;
|
||||
pyFirstName: string;
|
||||
pyLastName: string;
|
||||
pyOrganization: string;
|
||||
pyOrgDivision: string;
|
||||
pyOrgUnit: string;
|
||||
pyUserIdentifier: string;
|
||||
pyUserName: string;
|
||||
}
|
||||
|
||||
export interface PegaEmployeeApiRequestData {
|
||||
pyFirstName: string;
|
||||
pyLastName: string;
|
||||
}
|
||||
|
||||
export interface PegaEmployeeApiPostResponse {
|
||||
pxObjClass: string;
|
||||
pyErrorMessage: string;
|
||||
pyFirstName: string;
|
||||
pyHasError: 'true' | 'false';
|
||||
pyLastName: string;
|
||||
pyUserIdentifier: string;
|
||||
}
|
||||
|
||||
export function mapEmployeeToEmployeeApiRequestData(data: Employee): EmployeeApiRequestData {
|
||||
return data;
|
||||
}
|
||||
|
||||
export function mapEmployeeToPegaEmployeeApiRequestData(data: Employee): PegaEmployeeApiRequestData {
|
||||
return {
|
||||
pyFirstName: data.firstName,
|
||||
pyLastName: data.lastName,
|
||||
};
|
||||
}
|
||||
|
||||
export function mapPegaEmployeeReponseToEmployee(data: PegaEmployeeApiResponse): Employee {
|
||||
return {
|
||||
id: data.pyUserIdentifier,
|
||||
lastName: data.pyLastName,
|
||||
firstName: data.pyFirstName,
|
||||
fullName: `${data.pyFirstName} ${data.pyLastName}`,
|
||||
organizations: [
|
||||
{
|
||||
id: '',
|
||||
name: data.pyOrganization,
|
||||
kaNumber: null,
|
||||
address: {
|
||||
street: null,
|
||||
houseNumber: null,
|
||||
postalCode: null,
|
||||
city: null,
|
||||
kommun: null,
|
||||
},
|
||||
},
|
||||
],
|
||||
authorizations: null,
|
||||
// authorizations: mapPegaAuthorizationToAuthorization(data.pyAccessGroup as PegaAuthorization),
|
||||
services: [],
|
||||
languages: [],
|
||||
ssn: '',
|
||||
participants: [],
|
||||
};
|
||||
}
|
||||
|
||||
export function mapEmployeeReponseToEmployee(data: EmployeeApiResponse): Employee {
|
||||
const { id, firstName, lastName, ssn, services, languages, organizations, authorizations, participants } = data;
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user