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:
@@ -3,26 +3,4 @@ export enum Authorization {
|
||||
Economy = 'Economy',
|
||||
Reports = 'Reports',
|
||||
ParticipantManagement = 'ParticipantManagement',
|
||||
User = 'User',
|
||||
}
|
||||
|
||||
export enum PegaAuthorization {
|
||||
Users = 'MeetTest:Users',
|
||||
Administrators = 'MeetTest:Administrators',
|
||||
}
|
||||
|
||||
export function mapPegaAuthorizationToAuthorization(pegaAuthorization: PegaAuthorization): Authorization[] {
|
||||
const authorizations: Authorization[] = [];
|
||||
switch (pegaAuthorization) {
|
||||
case PegaAuthorization.Users:
|
||||
authorizations.push(Authorization.User);
|
||||
break;
|
||||
case PegaAuthorization.Administrators:
|
||||
authorizations.push(Authorization.UserManagement);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return authorizations;
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -20,22 +20,6 @@ export interface UserApiResponse {
|
||||
authorizations: Authorization[];
|
||||
}
|
||||
|
||||
export interface PegaUserApiResponse {
|
||||
pxInsName: string;
|
||||
pxLimitedAccess: string;
|
||||
pxObjClass: string;
|
||||
pyAccessGroup: string;
|
||||
pyFirstName: string;
|
||||
pyLastName: string;
|
||||
pyLastSignon: string;
|
||||
pyOrganization: string;
|
||||
pyOrgDivision: string;
|
||||
pyOrgUnit: string;
|
||||
pyUserIdentifier: string;
|
||||
pyUserName: string;
|
||||
pyAccessGroupsAdditional: string[];
|
||||
}
|
||||
|
||||
export function mapUserApiResponseToUser(data: UserApiResponse): User {
|
||||
const { id, firstName, lastName, ssn, organizations, authorizations } = data;
|
||||
return {
|
||||
@@ -48,29 +32,3 @@ export function mapUserApiResponseToUser(data: UserApiResponse): User {
|
||||
authorizations,
|
||||
};
|
||||
}
|
||||
|
||||
export function mapPegaUserApiReponseToUser(data: PegaUserApiResponse): User {
|
||||
return {
|
||||
id: data.pyUserIdentifier,
|
||||
lastName: data.pyLastName,
|
||||
firstName: data.pyFirstName,
|
||||
fullName: `${data.pyFirstName} ${data.pyLastName}`,
|
||||
ssn: null,
|
||||
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),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import {
|
||||
EmployeeApiResponse,
|
||||
mapEmployeeReponseToEmployee,
|
||||
mapEmployeeToEmployeeApiRequestData,
|
||||
PegaEmployeeApiPostResponse,
|
||||
} from '@dafa-models/employee.model';
|
||||
import { SortBy } from '@dafa-models/sort-by.model';
|
||||
import { sort } from '@dafa-utils/sort.util';
|
||||
@@ -73,11 +72,7 @@ export class EmployeeService {
|
||||
console.log(employeeData);
|
||||
return;
|
||||
return this.httpClient
|
||||
.post<PegaEmployeeApiPostResponse>(
|
||||
this._employeeApiUrl,
|
||||
mapEmployeeToEmployeeApiRequestData(employeeData),
|
||||
API_HEADERS
|
||||
)
|
||||
.post<any>(this._employeeApiUrl, mapEmployeeToEmployeeApiRequestData(employeeData), API_HEADERS)
|
||||
.pipe(
|
||||
map(data => {
|
||||
if (data.pyHasError === 'true') {
|
||||
|
||||
Reference in New Issue
Block a user