package com.cameleer.server.app.config;

import com.cameleer.server.app.storage.PostgresClaimMappingRepository;
import com.cameleer.server.core.rbac.ClaimMappingRepository;
import com.cameleer.server.core.rbac.ClaimMappingService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.core.JdbcTemplate;

/**
 * Creates the {@link ClaimMappingRepository} and {@link ClaimMappingService} beans.
 * <p>
 * Follows the established pattern: core module plain class, app module bean config.
 */
@Configuration
public class RbacBeanConfig {

    @Bean
    public ClaimMappingRepository claimMappingRepository(JdbcTemplate jdbcTemplate) {
        return new PostgresClaimMappingRepository(jdbcTemplate);
    }

    @Bean
    public ClaimMappingService claimMappingService() {
        return new ClaimMappingService();
    }
}
