feat(api): Added connection to the dotnet api (TV-189)
Squashed commit of the following:
commit 6f06bf69b87c77473c21fbe5fcc5669964793b17
Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se>
Date: Thu May 20 15:01:16 2021 +0200
Fixed issue with including qp insde breadcrumbs
commit 579b6105acc7a60864f07b6082329872a2105bd3
Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se>
Date: Thu May 20 14:46:54 2021 +0200
Added some more data to the mock-api and fixed navigation-bar
commit f9b820136017584655fadafaf716155aec85316e
Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se>
Date: Thu May 20 10:11:55 2021 +0200
Updated mock-api
commit 5367d2a475b1c0b8807cf5a9c3f8987b3a586de4
Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se>
Date: Wed May 19 16:00:07 2021 +0200
Added different config for dotnet api
commit 47de5b8ad7c0924c82f07568aa2a4386613e3bd6
Merge: 22d5e9a dc40953
Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se>
Date: Wed May 19 07:54:55 2021 +0200
Merged develop
commit 22d5e9a126e3c1237531407ec3e6d47fbfea55e8
Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se>
Date: Wed May 12 11:48:25 2021 +0200
Added new configuration to talk with local API
This commit is contained in:
@@ -1,21 +1,30 @@
|
||||
import { AccessGroup, mapPegaAccessGroupToAccessGroups, PegaAccessGroup } from '@dafa-enums/access-group.enum';
|
||||
import { Authorization, mapPegaAuthorizationToAuthorization, PegaAuthorization } from '@dafa-enums/authorization.enum';
|
||||
import { Organization } from './organization.model';
|
||||
|
||||
export interface User {
|
||||
id: string;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
fullName: string;
|
||||
organization: string;
|
||||
organizationDivision: string;
|
||||
organizationUnit: string;
|
||||
ssn: string;
|
||||
phone: string;
|
||||
email: string;
|
||||
accessGroups: AccessGroup[];
|
||||
utforandeverksamhet: string;
|
||||
service: string;
|
||||
organization: Organization;
|
||||
authorizations: Authorization[];
|
||||
}
|
||||
|
||||
export interface UserApiResponse {
|
||||
id: string;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
ssn: string;
|
||||
phone: string;
|
||||
email: string;
|
||||
organization: Organization;
|
||||
authorizations: Authorization[];
|
||||
}
|
||||
|
||||
export interface PegaUserApiResponse {
|
||||
pxInsName: string;
|
||||
pxLimitedAccess: string;
|
||||
pxObjClass: string;
|
||||
@@ -39,19 +48,42 @@ export interface UserApiResponse {
|
||||
};
|
||||
}
|
||||
|
||||
export function mapUserApiReponseToUser(data: UserApiResponse): User {
|
||||
export function mapUserApiResponseToUser(data: UserApiResponse): User {
|
||||
const { id, firstName, lastName, ssn, organization, phone, email, authorizations } = data;
|
||||
return {
|
||||
id,
|
||||
firstName,
|
||||
lastName,
|
||||
fullName: `${firstName} ${lastName}`,
|
||||
ssn,
|
||||
organization,
|
||||
phone,
|
||||
email,
|
||||
authorizations,
|
||||
};
|
||||
}
|
||||
|
||||
export function mapPegaUserApiReponseToUser(data: PegaUserApiResponse): User {
|
||||
return {
|
||||
id: data.pyUserIdentifier,
|
||||
lastName: data.pyLastName,
|
||||
firstName: data.pyFirstName,
|
||||
fullName: `${data.pyFirstName} ${data.pyLastName}`,
|
||||
organization: data.pyOrganization,
|
||||
organizationDivision: data.pyOrgDivision,
|
||||
organizationUnit: data.pyOrgUnit,
|
||||
ssn: null,
|
||||
organization: {
|
||||
id: '',
|
||||
name: data.pyOrganization,
|
||||
kaNumber: null,
|
||||
address: {
|
||||
street: null,
|
||||
houseNumber: null,
|
||||
postalCode: null,
|
||||
city: null,
|
||||
kommun: null,
|
||||
},
|
||||
},
|
||||
phone: data.pyTelephone,
|
||||
email: data.pyAddresses.Email.pyEmailAddress,
|
||||
accessGroups: mapPegaAccessGroupToAccessGroups(data.pyAccessGroup as PegaAccessGroup),
|
||||
utforandeverksamhet: '',
|
||||
service: '',
|
||||
authorizations: mapPegaAuthorizationToAuthorization(data.pyAccessGroup as PegaAuthorization),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user