Files
mina-sidor-fa-web/apps/dafa-web/src/app/data/models/user.model.ts
Erik Tiekstra d91b3e6445 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
2021-06-04 09:23:55 +02:00

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,
};
}