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

[SELC-6064] feat: added origin IPA for pa/import api #499

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 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
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors;

@Mapper(componentModel = "spring")
public interface OnboardingMapper {
Expand Down Expand Up @@ -53,7 +52,13 @@ public interface OnboardingMapper {
target = "contractImported.activatedAt",
source = "contractImported.activatedAt",
qualifiedByName = "convertDate")
OnboardingImportRequest toOnboardingImportRequest(OnboardingData onboardingData);
OnboardingImportRequest mapToOnboardingImportRequest(OnboardingData onboardingData);

default OnboardingImportRequest toOnboardingImportRequest(OnboardingData onboardingData) {
OnboardingImportRequest onboardingImportRequest = mapToOnboardingImportRequest(onboardingData);
onboardingImportRequest.getInstitution().setOrigin(Origin.IPA);
andrea-putzu marked this conversation as resolved.
Show resolved Hide resolved
return onboardingImportRequest;
}

GeographicTaxonomyDto toGeographicTaxonomyDto(GeographicTaxonomy geographicTaxonomy);

Expand Down Expand Up @@ -91,7 +96,7 @@ default InstitutionBaseRequest toInstitutionBase(OnboardingData onboardingData)
geotaxes ->
geotaxes.stream()
.map(this::toGeographicTaxonomyDto)
.collect(Collectors.toList()))
.toList())
.orElse(null));
institution.rea(onboardingData.getInstitutionUpdate().getRea());
institution.shareCapital(onboardingData.getInstitutionUpdate().getShareCapital());
Expand Down Expand Up @@ -133,7 +138,7 @@ default InstitutionPspRequest toInstitutionPsp(OnboardingData onboardingData) {
geotaxes ->
geotaxes.stream()
.map(this::toGeographicTaxonomyDto)
.collect(Collectors.toList()))
.toList())
.orElse(null));
institutionPsp.rea(onboardingData.getInstitutionUpdate().getRea());
institutionPsp.shareCapital(onboardingData.getInstitutionUpdate().getShareCapital());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public void setUp() {
void oldContractOnboardingTest() {
OnboardingData onboardingData = new OnboardingData();
onboardingData.setInstitutionExternalId("externalId");
onboardingData.setInstitutionUpdate(new InstitutionUpdate());
Assertions.assertDoesNotThrow(() -> onboardingService.oldContractOnboardingV2(onboardingData));
}

Expand Down Expand Up @@ -147,6 +148,6 @@ void onboardingUsers_happyPath() throws Exception {
List<RelationshipInfo> result =
onboardingService.onboardingUsers(onboardingUsersRequest, "userName", "surname");

assertEquals(result.size(), 2);
assertEquals(2, result.size());
}
}
Loading