import { TimeTrackingIncidenceNotificationLog } from '../../business/models/timeTracking/timeTrackingIncidenceNotificationLog';
import { NotifiableIncidenceType } from '../../business/types/timeTracking/notifiableIncidenceType';
import { TimeTrackingIncidenceNotificationLogDAO } from '../dataAccessObjects/timeTracking/timeTrackingIncidenceNotificationLogDAO';

export const timeTrackingIncidenceNotificationLogDAOToTimeTrackingIncidenceNotificationLog = (
    dao: TimeTrackingIncidenceNotificationLogDAO,
): TimeTrackingIncidenceNotificationLog => {
    return new TimeTrackingIncidenceNotificationLog({
        id: dao.id,
        instanceId: dao.instanceId,
        userId: dao.userId,
        dateString: dao.dateString,
        incidenceType: dao.incidenceType as NotifiableIncidenceType,
        entryId: dao.entryId ?? null,
        createdAt: dao.createdAt,
    });
};
