import { Injectable } from '@nestjs/common';
import { WorkTime } from '@prisma/client';
import { Interval } from 'date-fns';
import { WorkTimeRepository } from './work-time.repository';

@Injectable()
export class WorkTimeService {
  constructor(private readonly repository: WorkTimeRepository) {}

  async findById(id: string): Promise<WorkTime> {
    return this.repository.findById(id);
  }

  async findByPersonnelNumberInInterval(
    personnelNumber: string,
    interval: Interval,
  ): Promise<WorkTime> {
    return this.repository.findByPersonnelNumberInInterval(
      personnelNumber,
      interval,
    );
  }
}
