import { BaseRepositoryPort } from '@humand-packages/common';
import { LimitOffsetPagination } from '../../../../../types/listOptions';
import { Shift, ShiftForCreation } from '../../../business/models/shiftManagement/shift';
import { ShiftsListFiltersVC } from '../../../presentation/validationClasses/shiftManagement/shiftsListFiltersVC';

export default abstract class ShiftRepositoryPort extends BaseRepositoryPort {
    abstract getShifts(
        instanceId: number,
        filters: ShiftsListFiltersVC,
        pagination: LimitOffsetPagination,
    ): Promise<{ count: number; rows: Shift[] }>;

    abstract createShift(instanceId: number, shift: ShiftForCreation): Promise<Shift>;

    abstract getById(id: number): Promise<Shift | null>;

    abstract updateShiftTemplate(instanceId: number, newShift: ShiftForCreation, existingShift: Shift): Promise<Shift>;

    abstract bumpShiftVersion(instanceId: number, newShift: ShiftForCreation, existingShift: Shift): Promise<Shift>;

    abstract removeFromTemplates(instanceId: number, shiftTemplateId: number): Promise<void>;

    abstract getShiftsByCodes(instanceId: number, codes: string[]): Promise<Shift[]>;

    abstract getTemplatesByIds(instanceId: number, ids: number[]): Promise<Shift[]>;

    abstract deleteByCodes(instanceId: number, codes: string[]): Promise<void>;
}
