import { Authorization } from './authorization.model'; import { Organization } from './organization.model'; import { Participant } from './participant.model'; import { Service } from './service.model'; import { User, UserApiResponse } from './user.model'; export interface Employee extends User { languages: string[]; participants: Participant[]; services: Service[]; } export interface EmployeeApiResponse extends UserApiResponse { languages: string[]; participants: Participant[]; services: Service[]; } // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface EmployeeApiRequestData { firstName: string; lastName: string; ssn: string; organizations: Organization[]; services: Service[]; authorizations: Authorization[]; } export function mapEmployeeToEmployeeApiRequestData(data: Employee): EmployeeApiRequestData { const { firstName, lastName, ssn, services, organizations, authorizations } = data; return { firstName, lastName, ssn, services, organizations, authorizations, }; } export function mapEmployeeReponseToEmployee(data: EmployeeApiResponse): Employee { const { id, firstName, lastName, ssn, services, languages, organizations, authorizations, participants } = data; return { id, firstName, lastName, fullName: `${firstName} ${lastName}`, organizations, authorizations, services, languages, ssn, participants, }; }