package infrastructure.config;

import com.banesco.common.domain.model.redis.UserAccountRedis;
import com.banesco.common.infraestructure.repository.UserAccountRedisRepository;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.quarkus.redis.client.RedisClient;
import io.quarkus.runtime.annotations.RegisterForReflection;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import jakarta.ws.rs.Produces;

@ApplicationScoped
@RegisterForReflection(targets = {UserAccountRedis.class})
public class RedisRepositoryProducer {

    @Inject
    RedisClient redisClient;

    @Inject
    ObjectMapper objectMapper;

    @Produces
    @ApplicationScoped
    public UserAccountRedisRepository userAccountRedisRepository() {
        return new UserAccountRedisRepository(redisClient, objectMapper);
    }
}