"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GetAllTokensUseCase = void 0;
const CACHE_TTL_SECONDS = 5 * 60; // 5 minutes
class GetAllTokensUseCase {
    tokenRepository;
    cacheService;
    constructor(tokenRepository, cacheService) {
        this.tokenRepository = tokenRepository;
        this.cacheService = cacheService;
    }
    async execute(input) {
        const cacheKey = `tokens:all:limit:${input.limit}:offset:${input.offset}`;
        return this.cacheService.wrap(cacheKey, () => this.tokenRepository.findAll({
            limit: input.limit,
            offset: input.offset,
        }), CACHE_TTL_SECONDS);
    }
}
exports.GetAllTokensUseCase = GetAllTokensUseCase;
//# sourceMappingURL=get-all-tokens.use-case.js.map