targo-backend/src/time-and-attendance/modules/leave-requests/utils/leave-request.transform.ts

19 lines
821 B
TypeScript

import { LeaveRequestArchiveRow } from './leave-requests-archive.select';
import { LeaveRequestViewDto } from '../dtos/leave-request-view.dto';
import { mapArchiveRowToView } from '../mappers/leave-requests-archive.mapper';
import { LeaveRequestRow } from 'src/time-and-attendance/utils/type.utils';
import { mapRowToView } from '../mappers/leave-requests.mapper';
/** Active (table leave_requests) : proxy to base mapper */
export function mapRowToViewWithDays(row: LeaveRequestRow): LeaveRequestViewDto {
return mapRowToView(row);
}
/** Archive (table leave_requests_archive) : proxy to base mapper */
export function mapArchiveRowToViewWithDays(
row: LeaveRequestArchiveRow,
email: string,
employee_full_name?: string,
): LeaveRequestViewDto {
return mapArchiveRowToView(row, email, employee_full_name!);
}