Added user service

This commit is contained in:
Erik Tiekstra
2021-05-05 10:12:47 +02:00
parent 1c0f77b506
commit cd60e9383a
15 changed files with 100 additions and 41 deletions

View File

@@ -1,4 +1,23 @@
import { UserResponse } from './api/user-response.model';
export interface User {
id: string;
name: string;
firstName: string;
lastName: string;
fullName: string;
userName: string;
phone: string;
email: string;
}
export function mapUserReponseToUser(data: UserResponse): User {
return {
id: data.pyUserIdentifier,
lastName: data.pyLastName,
firstName: data.pyFirstName,
fullName: `${data.pyFirstName} ${data.pyLastName}`,
userName: data.pyUserName,
phone: data.pyTelephone,
email: data.pyAddresses.Email.pyEmailAddress,
};
}