package com.banesco.domain.services;

import com.banesco.domain.ports.inbound.RegisterSecurityUseCase;
import com.banesco.domain.ports.outbound.RegisterSecurityPort;
import com.banesco.infrastructure.dtos.RegisterSecurityRq;
import jakarta.enterprise.context.ApplicationScoped;
import lombok.extern.slf4j.Slf4j;

@ApplicationScoped
@Slf4j
public class RegisterSecurityService implements RegisterSecurityUseCase {


    private final RegisterSecurityPort registerSecurityPort;

    public RegisterSecurityService(RegisterSecurityPort registerSecurityPort) {
        this.registerSecurityPort = registerSecurityPort;
    }


    @Override
    public void writeTrace(String requestId, RegisterSecurityRq request) {
        try {
            registerSecurityPort.writeTrace(requestId, request);
        } catch (Exception e) {
            log.error("Error writing trace: {}", e.getMessage());
        }

    }
}
