Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
feat: add isAggregation field in Onboarding, OnboardingEntity, Onboar…
Browse files Browse the repository at this point in the history
…dingProductResponse, OnboardingResponse
  • Loading branch information
giulia-tremolada committed Jun 4, 2024
1 parent 4b70441 commit 290af7d
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 5 deletions.
6 changes: 6 additions & 0 deletions app/src/main/resources/swagger/api-docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -3569,6 +3569,9 @@
"type" : "string",
"format" : "date-time"
},
"isAggregator" : {
"type" : "boolean"
},
"productId" : {
"type" : "string"
},
Expand Down Expand Up @@ -3666,6 +3669,9 @@
"type" : "string",
"format" : "date-time"
},
"isAggregator" : {
"type" : "boolean"
},
"pricingPlan" : {
"type" : "string"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ void persistOnboarding_whenUserNotExistsOnRegistry() {
onboardingToPersist.setPricingPlan(pricingPlan);
onboardingToPersist.setProductId(productId);
onboardingToPersist.setBilling(billing);
onboardingToPersist.setIsAggregator(true);

Institution institution = new Institution();
institution.setId("institutionId");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package it.pagopa.selfcare.mscore.web.model.institution;

import it.pagopa.selfcare.mscore.constant.RelationshipState;
import it.pagopa.selfcare.mscore.model.institution.Billing;
import lombok.Data;

import java.time.OffsetDateTime;
Expand All @@ -18,4 +17,5 @@ public class OnboardingResponse {
private OffsetDateTime createdAt;
private OffsetDateTime updatedAt;
private OffsetDateTime closedAt;
private Boolean isAggregator;
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package it.pagopa.selfcare.mscore.web.model.mapper;


import it.pagopa.selfcare.mscore.model.institution.Billing;
import it.pagopa.selfcare.mscore.model.institution.Onboarding;
import it.pagopa.selfcare.mscore.model.onboarding.OnboardingRequest;
import it.pagopa.selfcare.mscore.model.onboarding.OnboardingUsersRequest;
import it.pagopa.selfcare.mscore.web.model.institution.BillingRequest;
import it.pagopa.selfcare.mscore.web.model.institution.InstitutionOnboardingRequest;
import it.pagopa.selfcare.mscore.web.model.institution.OnboardingResponse;
import it.pagopa.selfcare.mscore.web.model.onboarding.OnboardingInstitutionRequest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ public class OnboardedProductResponse {
private BillingResponse billing;
private OffsetDateTime createdAt;
private OffsetDateTime updatedAt;
private Boolean isAggregator;
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ class InstitutionControllerTest {
onboarding.setContract("contract");
onboarding.setTokenId("tokenId");
onboarding.setPricingPlan("setPricingPlan");
onboarding.setIsAggregator(true);

Attributes attribute = new Attributes();
attribute.setCode("code");
Expand Down Expand Up @@ -257,7 +258,7 @@ void shouldGetOnboardingsInstitutionByProductId() throws Exception {
.andExpect(MockMvcResultMatchers.content().contentType("application/json"))
.andExpect(MockMvcResultMatchers.content()
.string(
"{\"onboardings\":[{\"productId\":\"example\",\"tokenId\":\"tokenId\",\"status\":\"ACTIVE\",\"contract\":\"contract\",\"pricingPlan\":\"setPricingPlan\",\"billing\":{\"vatNumber\":\"example\",\"taxCodeInvoicing\":\"example\",\"recipientCode\":\"example\",\"publicServices\":false},\"createdAt\":null,\"updatedAt\":null,\"closedAt\":null}]}"));
"{\"onboardings\":[{\"productId\":\"example\",\"tokenId\":\"tokenId\",\"status\":\"ACTIVE\",\"contract\":\"contract\",\"pricingPlan\":\"setPricingPlan\",\"billing\":{\"vatNumber\":\"example\",\"taxCodeInvoicing\":\"example\",\"recipientCode\":\"example\",\"publicServices\":false},\"createdAt\":null,\"updatedAt\":null,\"closedAt\":null,\"isAggregator\":true}]}"));
}

@Test
Expand Down Expand Up @@ -286,7 +287,7 @@ void testRetrieveInstitutionById() throws Exception {
.perform(requestBuilder)
.andExpect(MockMvcResultMatchers.status().isOk())
.andExpect(MockMvcResultMatchers.content().contentType("application/json"))
.andExpect(MockMvcResultMatchers.content().string("{\"id\":\"42\",\"description\":\"description\",\"institutionType\":\"PG\",\"istatCode\":\"istatCode\",\"attributes\":[{\"origin\":null,\"code\":\"code\",\"description\":\"description\"}],\"onboarding\":[{\"productId\":\"example\",\"status\":\"ACTIVE\",\"billing\":{\"vatNumber\":\"example\",\"taxCodeInvoicing\":\"example\",\"recipientCode\":\"example\",\"publicServices\":false},\"createdAt\":null,\"updatedAt\":null}],\"imported\":false,\"delegation\":false}"));
.andExpect(MockMvcResultMatchers.content().string("{\"id\":\"42\",\"description\":\"description\",\"institutionType\":\"PG\",\"istatCode\":\"istatCode\",\"attributes\":[{\"origin\":null,\"code\":\"code\",\"description\":\"description\"}],\"onboarding\":[{\"productId\":\"example\",\"status\":\"ACTIVE\",\"billing\":{\"vatNumber\":\"example\",\"taxCodeInvoicing\":\"example\",\"recipientCode\":\"example\",\"publicServices\":false},\"createdAt\":null,\"updatedAt\":null,\"isAggregator\":true}],\"imported\":false,\"delegation\":false}"));
}

@Test
Expand Down Expand Up @@ -1353,6 +1354,7 @@ void institutionOnboarding() throws Exception {
InstitutionOnboardingRequest request = new InstitutionOnboardingRequest();
request.setProductId("id");
request.setUsers(List.of(new Person()));
request.setIsAggregator(true);

when(onboardingService.persistOnboarding(any(), any(), any(), any()))
.thenReturn(new Institution());
Expand Down

0 comments on commit 290af7d

Please sign in to comment.