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-691] chore: Add station enabled field #292

Merged
merged 2 commits into from
Apr 8, 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
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
Loading