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

[PAGOPA-1967] feat: Update Stamp converter #108

Merged
merged 1 commit into from
Jul 25, 2024
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ __pycache__
local.settings.json
**/*.iml
/lib/
**/.env
**/*.env
bin/
**/application-azure.properties
.cache_ggshield
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import org.modelmapper.MappingException;
import org.modelmapper.spi.MappingContext;

import java.util.Base64;

public class ConvertMarcaDaBolloToCtRichiestaMarcaDaBollo
implements Converter<Stamp, CtRichiestaMarcaDaBollo> {

Expand All @@ -17,7 +19,10 @@ public CtRichiestaMarcaDaBollo convert(MappingContext<Stamp, CtRichiestaMarcaDaB
CtRichiestaMarcaDaBollo ctRichiestaMarcaDaBollo = new CtRichiestaMarcaDaBollo();
ctRichiestaMarcaDaBollo.setTipoBollo(source.getStampType());
ctRichiestaMarcaDaBollo.setProvinciaResidenza(source.getProvincialResidence());
ctRichiestaMarcaDaBollo.setHashDocumento(source.getHashDocument().getBytes());
// the given source.getHashDocument() is already taken as base64 from GPD-Core,
// so in this point decode the base64 byte array and encode it next (at the time of response marshalling)
ctRichiestaMarcaDaBollo.setHashDocumento(Base64.getDecoder().decode(source.getHashDocument().getBytes()));

return ctRichiestaMarcaDaBollo;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -479,14 +479,13 @@ private PaGetPaymentV2Response generatePaGetPaymentResponse(
transferList
.getTransfer()
.addAll(
source
.getTransfer()
.stream()
.map(
paymentsTransferModelResponse ->
getTransferResponseV2(
paymentsTransferModelResponse, request.getTransferType()))
.collect(Collectors.toList()));
source
.getTransfer()
.stream()
.map(
paymentsTransferModelResponse ->
getTransferResponseV2(
paymentsTransferModelResponse, request.getTransferType())).toList());

responseData.setTransferList(transferList);
responseData.setDebtor(debtor);
Expand Down Expand Up @@ -574,6 +573,7 @@ private CtTransferPAV2 getTransferResponseV2(

CtTransferPAV2 transferPA = new CtTransferPAV2();
transferPA.setFiscalCodePA(transfer.getOrganizationFiscalCode());
transferPA.setCompanyName(" "); // stText140(1, 140) todo: to be filled in with the correct company name for the PO Nth transfer
transferPA.setRichiestaMarcaDaBollo(richiestaMarcaDaBollo);
transferPA.setIdTransfer(Integer.parseInt(transfer.getIdTransfer()));
transferPA.setRemittanceInformation(transfer.getRemittanceInformation());
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application-local.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
properties.environment=local

server.port=8080
server.port=8081

pt.id_intermediario=80007580279
pt.id_stazione=80007580279_01
Expand Down
Loading