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