Skip to content

Commit

Permalink
[PAGOPA-691] chore: Add station enabled field (#292)
Browse files Browse the repository at this point in the history
* [PAGOPA-691] added station enabled field to getCreditorInstitutionView API

* [PAGOPA-691] updated openapi

---------

Co-authored-by: giomella <gioele.mella@emeal.nttdata.com>
  • Loading branch information
gioelemella and giomella committed Apr 8, 2024
1 parent 1f5ba30 commit 37e1c75
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 18 deletions.
5 changes: 4 additions & 1 deletion openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -19389,6 +19389,9 @@
},
"mod4": {
"type": "boolean"
},
"station_enabled": {
"type": "boolean"
}
}
},
Expand Down Expand Up @@ -19797,4 +19800,4 @@
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,27 @@

import it.gov.pagopa.apiconfig.core.model.creditorinstitution.CreditorInstitutionView;
import it.gov.pagopa.apiconfig.starter.entity.PaStazionePa;
import javax.validation.Valid;
import org.modelmapper.Converter;
import org.modelmapper.spi.MappingContext;

import javax.validation.Valid;

public class ConvertPaStazionePaToCreditorInstitutionView
implements Converter<PaStazionePa, CreditorInstitutionView> {
implements Converter<PaStazionePa, CreditorInstitutionView> {

@Override
public CreditorInstitutionView convert(
MappingContext<PaStazionePa, CreditorInstitutionView> context) {
@Valid PaStazionePa source = context.getSource();
return CreditorInstitutionView.builder()
.idDominio(source.getPa().getIdDominio())
.idIntermediarioPa(source.getFkStazione().getIntermediarioPa().getIdIntermediarioPa())
.idStazione(source.getFkStazione().getIdStazione())
.auxDigit(source.getAuxDigit())
.progressivo(source.getProgressivo())
.segregazione(source.getSegregazione())
.quartoModello(source.getQuartoModello())
.build();
}
@Override
public CreditorInstitutionView convert(
MappingContext<PaStazionePa, CreditorInstitutionView> context) {
@Valid PaStazionePa source = context.getSource();
return CreditorInstitutionView.builder()
.idDominio(source.getPa().getIdDominio())
.idIntermediarioPa(source.getFkStazione().getIntermediarioPa().getIdIntermediarioPa())
.idStazione(source.getFkStazione().getIdStazione())
.auxDigit(source.getAuxDigit())
.progressivo(source.getProgressivo())
.segregazione(source.getSegregazione())
.quartoModello(source.getQuartoModello())
.stationEnabled(source.getFkStazione().getEnabled())
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,7 @@ public class CreditorInstitutionView {

@JsonProperty("mod4")
private Boolean quartoModello;

@JsonProperty("station_enabled")
private Boolean stationEnabled;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"aux_digit": 1,
"application_code": 2,
"segregation_code": 3,
"mod4": true
"mod4": true,
"station_enabled": true
}
],
"page_info": {
Expand Down

0 comments on commit 37e1c75

Please sign in to comment.