import { PaginatedSerializationClass } from '@humand-packages/common';
import { ShiftRotationListItem } from '../../../business/models/shiftManagement/shiftRotation';
import { ShiftRotationHeaderDTO } from './ShiftRotationSC';

export interface ShiftRotationListItemDTO extends ShiftRotationHeaderDTO {
    cycleLength: number;
    workDaysCount: number;
    restDaysCount: number;
    totalHours: number;
}

export class ShiftRotationListItemSC extends PaginatedSerializationClass<ShiftRotationListItem, ShiftRotationListItemDTO> {
    serialize(entity: ShiftRotationListItem): ShiftRotationListItemDTO {
        return {
            createdAt: entity.createdAt.toISOString(),
            cycleLength: entity.cycleLength,
            description: entity.description,
            id: entity.id,
            name: entity.name,
            restDaysCount: entity.restDaysCount,
            totalHours: entity.totalHours,
            updatedAt: entity.updatedAt.toISOString(),
            workDaysCount: entity.workDaysCount,
        };
    }
}
