package infrastructure.mapper;

import application.port.input.command.ValidateOtpCommand;
import domain.model.Otp;
import infrastructure.client.otp.dto.request.ValidateOtpRequest;
import infrastructure.client.otp.dto.response.ValidateOtpResponse;

public class OtpMapper {
    public static Otp toEntity(ValidateOtpResponse dto) {
        return Otp.builder()
                .msgRsHdr(dto.getMsgRsHdr())
                .status(dto.getStatus())
                .build();
    }

    public static ValidateOtpRequest toRequestDto(ValidateOtpCommand otp) {
        return ValidateOtpRequest.builder()
                .servicio(otp.servicio())
                .canal(otp.canal())
                .ipAddress(otp.ipAddress())
                .login(otp.login())
                .appOrigen(otp.appOrigen())
                .otpToken(otp.otpToken())
                .build();
    }
}