"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GetDeviceByIdUseCase = void 0;
const not_found_error_1 = require("../../../domain/errors/not-found-error");
class GetDeviceByIdUseCase {
    deviceRepository;
    constructor(deviceRepository) {
        this.deviceRepository = deviceRepository;
    }
    async execute(id) {
        const device = await this.deviceRepository.findById(id);
        if (!device) {
            throw new not_found_error_1.NotFoundError('Device', id);
        }
        return device;
    }
}
exports.GetDeviceByIdUseCase = GetDeviceByIdUseCase;
//# sourceMappingURL=get-device-by-id.use-case.js.map