"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.UpdateTokenMinimumSwapValueUseCase = void 0;
const token_1 = require("../../../domain/entities/token");
const not_found_error_1 = require("../../../domain/errors/not-found-error");
class UpdateTokenMinimumSwapValueUseCase {
    tokenRepository;
    constructor(tokenRepository) {
        this.tokenRepository = tokenRepository;
    }
    async execute(input) {
        const token = await this.tokenRepository.findById(input.tokenId);
        if (!token) {
            throw new not_found_error_1.NotFoundError('Token', input.tokenId);
        }
        const updated = new token_1.Token(token.id, token.isNative, token.address, token.networkId, token.thumbnail, token.name, token.symbol, token.decimals, token.code, token.info, token.isActive, input.minimumSwapValue, token.mcap, token.createdAt, new Date());
        return this.tokenRepository.update(updated);
    }
}
exports.UpdateTokenMinimumSwapValueUseCase = UpdateTokenMinimumSwapValueUseCase;
//# sourceMappingURL=update-token-minimum-swap-value.use-case.js.map