generated from pagopa/template-java-spring-microservice
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PPANTT-129] feat: Add API to retrieve creditor institution segregati…
…on codes (#61) * [PPANTT-129] move method to utility class * [PPANTT-129] added API to retrieve all segregation codes associated to broker stations * [PPANTT-129] added unit tests * [PPANTT-129] updated openapi * [PPANTT-129] removed unused imports
- Loading branch information
1 parent
e15c789
commit 9ce4191
Showing
14 changed files
with
458 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...pa/apiconfig/selfcareintegration/mapper/ConvertICIStationRelationToCIStationRelation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package it.gov.pagopa.apiconfig.selfcareintegration.mapper; | ||
|
||
import it.gov.pagopa.apiconfig.selfcareintegration.model.creditorinstitution.CIStationRelation; | ||
import it.gov.pagopa.apiconfig.selfcareintegration.model.creditorinstitution.ICIStationRelation; | ||
import it.gov.pagopa.apiconfig.selfcareintegration.util.Utility; | ||
import org.modelmapper.Converter; | ||
import org.modelmapper.spi.MappingContext; | ||
|
||
/** | ||
* Converter class, define how to map the {@link ICIStationRelation} entity into the {@link CIStationRelation} model | ||
*/ | ||
public class ConvertICIStationRelationToCIStationRelation implements Converter<ICIStationRelation, CIStationRelation> { | ||
|
||
@Override | ||
public CIStationRelation convert(MappingContext<ICIStationRelation, CIStationRelation> context) { | ||
ICIStationRelation source = context.getSource(); | ||
|
||
return CIStationRelation.builder() | ||
.ciTaxCode(source.getIdDominio()) | ||
.segregationCode(Utility.getDoubleDigitCode(source.getSegregazione())) | ||
.build(); | ||
} | ||
} |
Oops, something went wrong.