import { Device } from '../../../domain/entities/device';
import { IDeviceRepository } from '../../../domain/repositories/device-repository';
import { PaginationInput } from '../../dto/pagination.dto';

export class GetAllDevicesUseCase {
  constructor(private readonly deviceRepository: IDeviceRepository) {}

  async execute(input: PaginationInput): Promise<Device[]> {
    return this.deviceRepository.findAll({
      limit: input.limit,
      offset: input.offset,
    });
  }
}
