Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PPANTT-118] chore: Update Stations models with new OdP fields #323

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -18716,6 +18716,12 @@
"type": "integer",
"description": "Primitive number version",
"format": "int32"
},
"is_payment_options_enabled": {
"type": "boolean"
},
"rest_endpoint": {
"type": "string"
}
}
},
Expand Down Expand Up @@ -20956,4 +20962,4 @@
}
}
}
}
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<postgresql-version>42.5.5</postgresql-version>
<azure.storage.table.version>8.6.6</azure.storage.table.version>
<testcontainer.version>1.17.6</testcontainer.version>
<starter.version>1.22.2</starter.version>
<starter.version>1.23.0</starter.version>
</properties>

<repositories>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,58 +4,61 @@
import it.gov.pagopa.apiconfig.core.model.creditorinstitution.StationDetails;
import it.gov.pagopa.apiconfig.starter.entity.IntermediariPa;
import it.gov.pagopa.apiconfig.starter.entity.Stazioni;
import javax.validation.Valid;
import org.modelmapper.Converter;
import org.modelmapper.spi.MappingContext;

import javax.validation.Valid;

public class ConvertStationDetailsToStazioni implements Converter<StationDetails, Stazioni> {

@Override
public Stazioni convert(MappingContext<StationDetails, Stazioni> context) {
@Valid StationDetails source = context.getSource();
return Stazioni.builder()
.idStazione(source.getStationCode())
.enabled(source.getEnabled())
.versione(source.getVersion())
.password(source.getPassword())
.protocollo(getProtocol(source.getProtocol()))
.ip(source.getIp())
.porta(source.getPort())
.servizio(source.getService())
.servizioPof(source.getPofService())
.intermediarioPa(IntermediariPa.builder().objId(source.getBrokerObjId()).build())
.protocollo4Mod(getProtocol(source.getProtocol4Mod()))
.ip4Mod(source.getIp4Mod())
.porta4Mod(source.getPort4Mod())
.servizio4Mod(source.getService4Mod())
.redirectProtocollo(getProtocol(source.getRedirectProtocol()))
.redirectIp(source.getRedirectIp())
.redirectPorta(source.getRedirectPort())
.redirectPath(source.getRedirectPath())
.redirectQueryString(source.getRedirectQueryString())
.proxyEnabled(source.getProxyEnabled())
.proxyHost(source.getProxyHost())
.proxyPort(source.getProxyPort())
.proxyUsername(source.getProxyUsername())
.proxyPassword(source.getProxyPassword())
.targetHost(source.getTargetHost())
.targetPort(source.getTargetPort())
.targetPath(source.getTargetPath())
.targetHostPof(source.getTargetHostPof())
.targetPortPof(source.getTargetPortPof())
.targetPathPof(source.getTargetPathPof())
.flagOnline(source.getFlagOnline())
.numThread(source.getThreadNumber())
.timeoutA(source.getTimeoutA())
.timeoutB(source.getTimeoutB())
.timeoutC(source.getTimeoutC())
.rtEnabled(true)
.invioRtIstantaneo(source.getRtInstantaneousDispatch())
.versionePrimitive(source.getPrimitiveVersion())
.build();
}
@Override
public Stazioni convert(MappingContext<StationDetails, Stazioni> context) {
@Valid StationDetails source = context.getSource();
return Stazioni.builder()
.idStazione(source.getStationCode())
.enabled(source.getEnabled())
.versione(source.getVersion())
.password(source.getPassword())
.protocollo(getProtocol(source.getProtocol()))
.ip(source.getIp())
.porta(source.getPort())
.servizio(source.getService())
.servizioPof(source.getPofService())
.intermediarioPa(IntermediariPa.builder().objId(source.getBrokerObjId()).build())
.protocollo4Mod(getProtocol(source.getProtocol4Mod()))
.ip4Mod(source.getIp4Mod())
.porta4Mod(source.getPort4Mod())
.servizio4Mod(source.getService4Mod())
.redirectProtocollo(getProtocol(source.getRedirectProtocol()))
.redirectIp(source.getRedirectIp())
.redirectPorta(source.getRedirectPort())
.redirectPath(source.getRedirectPath())
.redirectQueryString(source.getRedirectQueryString())
.proxyEnabled(source.getProxyEnabled())
.proxyHost(source.getProxyHost())
.proxyPort(source.getProxyPort())
.proxyUsername(source.getProxyUsername())
.proxyPassword(source.getProxyPassword())
.targetHost(source.getTargetHost())
.targetPort(source.getTargetPort())
.targetPath(source.getTargetPath())
.targetHostPof(source.getTargetHostPof())
.targetPortPof(source.getTargetPortPof())
.targetPathPof(source.getTargetPathPof())
.flagOnline(source.getFlagOnline())
.numThread(source.getThreadNumber())
.timeoutA(source.getTimeoutA())
.timeoutB(source.getTimeoutB())
.timeoutC(source.getTimeoutC())
.rtEnabled(true)
.invioRtIstantaneo(source.getRtInstantaneousDispatch())
.versionePrimitive(source.getPrimitiveVersion())
.isPaymentOptionsEnabled(source.getIsPaymentOptionsEnabled())
.restEndpoint(source.getRestEndpoint())
.build();
}

private String getProtocol(Protocol source) {
return source != null ? source.name() : null;
}
private String getProtocol(Protocol source) {
return source != null ? source.name() : null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ public StationDetails convert(MappingContext<Stazioni, StationDetails> context)
.rtInstantaneousDispatch(source.getInvioRtIstantaneo())
.primitiveVersion(source.getVersionePrimitive())
.isConnectionSync(isConnectionSync(source))
.isPaymentOptionsEnabled(source.getIsPaymentOptionsEnabled())
.restEndpoint(source.getRestEndpoint())
.build();
}
}
Loading
Loading