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