30 lines
799 B
Go
30 lines
799 B
Go
// utils/soap_utils.go
|
|
package utils
|
|
|
|
import (
|
|
"daemonService/internal/models/obtencionCodigos/response"
|
|
"fmt"
|
|
)
|
|
|
|
// parsea la respuesta SOAP para CUIS
|
|
func ParseSoapCuisResponse(respSoap interface{}) (string, string, bool, error) {
|
|
resp, ok := respSoap.(response.SoapBodyCuis)
|
|
if !ok {
|
|
return "", "", false, fmt.Errorf("%w: %T", ErrUnexpectedRespType, respSoap)
|
|
}
|
|
|
|
return resp.Response.Respuesta.Codigo,
|
|
resp.Response.Respuesta.FechaVigencia,
|
|
resp.Response.Respuesta.Transaccion,
|
|
nil
|
|
}
|
|
|
|
// parsea la respuesta SOAP para CUIS
|
|
func ParseSoapCufdResponse(respSoap interface{}) (response.SoapBodyCufd, error) {
|
|
vBodyCufd, ok := respSoap.(response.SoapBodyCufd)
|
|
if !ok {
|
|
return response.SoapBodyCufd{}, fmt.Errorf("%w: %T", ErrUnexpectedRespType, respSoap)
|
|
}
|
|
return vBodyCufd, nil
|
|
}
|