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
35 lines
767 B
TypeScript
35 lines
767 B
TypeScript
import { Authorization } from './authorization.model';
|
|
import { Organization } from './organization.model';
|
|
|
|
export interface User {
|
|
id: string;
|
|
firstName: string;
|
|
lastName: string;
|
|
fullName: string;
|
|
ssn: string;
|
|
organizations: Organization[];
|
|
authorizations: Authorization[];
|
|
}
|
|
|
|
export interface UserApiResponse {
|
|
id: string;
|
|
firstName: string;
|
|
lastName: string;
|
|
ssn: string;
|
|
organizations: Organization[];
|
|
authorizations: Authorization[];
|
|
}
|
|
|
|
export function mapUserApiResponseToUser(data: UserApiResponse): User {
|
|
const { id, firstName, lastName, ssn, organizations, authorizations } = data;
|
|
return {
|
|
id,
|
|
firstName,
|
|
lastName,
|
|
fullName: `${firstName} ${lastName}`,
|
|
ssn,
|
|
organizations,
|
|
authorizations,
|
|
};
|
|
}
|