package com.eactive.eai.rms.common.acl.audit.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.eactive.eai.rms.common.acl.audit.adapter.in.web.AuditLogInterceptor;
import com.eactive.eai.rms.common.acl.audit.port.in.IsAuditableUsecase;
import com.eactive.eai.rms.common.acl.audit.port.in.SaveAuditLogUseCase;

import lombok.RequiredArgsConstructor;

@RequiredArgsConstructor
@Configuration
public class AuditLogConfiguration {

	private final SaveAuditLogUseCase saveAuditLogUseCase;

	private final IsAuditableUsecase isAuditableUsecase;

	@Bean
	public AuditLogInterceptor auditLogInterceptor() {
		return new AuditLogInterceptor(saveAuditLogUseCase, isAuditableUsecase);
	}
}
