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

Commit

Permalink
[SELC-4642] feat: removed contraints about taxCode and vatNumber for …
Browse files Browse the repository at this point in the history
…request objects (#473)

Co-authored-by: pierpaolo.didato@emeal.nttdata.com <Aiap1955?^@#>
  • Loading branch information
pierpaolodidato89 and pierpaolo.didato@emeal.nttdata.com authored Apr 17, 2024
1 parent cde4a55 commit f943976
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ public ResponseEntity<InstitutionResponse> updateInstitution(@ApiParam("${swagge
@ApiOperation(value = "${swagger.mscore.onboarding.users}", notes = "${swagger.mscore.onboarding.users}")
@PostMapping(value = "/{id}/onboarding")
public ResponseEntity<InstitutionResponse> onboardingInstitution(@RequestBody @Valid InstitutionOnboardingRequest request,
@PathVariable("id") String id) {
@PathVariable("id") String id) {
CustomExceptionMessage.setCustomMessage(GenericError.ONBOARDING_OPERATION_ERROR);
List<UserToOnboard> usersToOnboard = Optional.ofNullable(request.getUsers())
.map(users -> users.stream().map(userMapper::toUserToOnboard).toList())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ public class InstitutionRequest {
private String country;
private String taxCode;
private String ivassCode;

private BillingRequest billing;
private List<OnboardingRequest> onboarding;
private List<GeoTaxonomies> geographicTaxonomies;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public class InstitutionResponse {
private String digitalAddress;
private String address;
private String zipCode;
@NotBlank
private String taxCode;
private String city;
private String county;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package it.pagopa.selfcare.mscore.web.controller;

import com.fasterxml.jackson.databind.ObjectMapper;
import it.pagopa.selfcare.commons.base.security.PartyRole;
import it.pagopa.selfcare.commons.base.security.SelfCareUser;
import it.pagopa.selfcare.commons.base.utils.InstitutionType;
import it.pagopa.selfcare.mscore.core.OnboardingService;
Expand All @@ -11,14 +10,8 @@
import it.pagopa.selfcare.mscore.model.institution.InstitutionUpdate;
import it.pagopa.selfcare.mscore.model.institution.PaymentServiceProvider;
import it.pagopa.selfcare.mscore.model.onboarding.ResourceResponse;
import it.pagopa.selfcare.mscore.web.model.institution.BillingRequest;
import it.pagopa.selfcare.mscore.web.model.institution.DataProtectionOfficerRequest;
import it.pagopa.selfcare.mscore.web.model.institution.InstitutionUpdateRequest;
import it.pagopa.selfcare.mscore.web.model.institution.PaymentServiceProviderRequest;
import it.pagopa.selfcare.mscore.web.model.mapper.*;
import it.pagopa.selfcare.mscore.web.model.onboarding.ContractRequest;
import it.pagopa.selfcare.mscore.web.model.onboarding.OnboardingInstitutionOperatorsRequest;
import it.pagopa.selfcare.mscore.web.model.onboarding.OnboardingInstitutionRequest;
import it.pagopa.selfcare.mscore.web.model.onboarding.OnboardingInstitutionUsersRequest;
import it.pagopa.selfcare.mscore.web.model.user.Person;
import org.junit.jupiter.api.BeforeEach;
Expand Down Expand Up @@ -203,52 +196,6 @@ void testGetOnboardingDocument2() throws Exception {
.andExpect(MockMvcResultMatchers.content().string(""));
}

private OnboardingInstitutionRequest createOnboardingInstitutionRequest() {
BillingRequest billingRequest = new BillingRequest();
billingRequest.setPublicServices(true);
billingRequest.setRecipientCode("Recipient Code");
billingRequest.setVatNumber("42");

ContractRequest contractRequest = new ContractRequest();
contractRequest.setPath("Path");
contractRequest.setVersion("1.0.2");

InstitutionUpdateRequest institutionUpdate = new InstitutionUpdateRequest();
institutionUpdate.setAddress("42 Main St");
institutionUpdate.setDescription("The characteristics of someone or something");
institutionUpdate.setDigitalAddress("42 Main St");
List<String> geographicTaxonomiesList = new ArrayList<>();
institutionUpdate.setGeographicTaxonomyCodes(geographicTaxonomiesList);
institutionUpdate.setInstitutionType(InstitutionType.GSP);
institutionUpdate.setTaxCode("Tax Code");
institutionUpdate.setZipCode("21654");
institutionUpdate.setPaymentServiceProvider(new PaymentServiceProviderRequest());
institutionUpdate.setDataProtectionOfficer(new DataProtectionOfficerRequest());

Person person = new Person();
person.setId("42");
person.setName("Name");
person.setProductRole("Product Role");
person.setRole(PartyRole.MANAGER);
person.setSurname("Doe");
person.setTaxCode("Tax Code");

ArrayList<Person> personList = new ArrayList<>();
personList.add(person);

OnboardingInstitutionRequest onboardingInstitutionRequest = new OnboardingInstitutionRequest();
onboardingInstitutionRequest.setUsers(personList);
onboardingInstitutionRequest.setBilling(billingRequest);
onboardingInstitutionRequest.setContract(contractRequest);
onboardingInstitutionRequest.setInstitutionExternalId("42");
onboardingInstitutionRequest.setInstitutionUpdate(institutionUpdate);
onboardingInstitutionRequest.setPricingPlan("Pricing Plan");
onboardingInstitutionRequest.setProductId("42");
onboardingInstitutionRequest.setProductName("Product Name");

return onboardingInstitutionRequest;
}

/**
* Method under test: {@link OnboardingController#onboardingInstitutionOperators(OnboardingInstitutionOperatorsRequest, Authentication)}
*/
Expand Down

0 comments on commit f943976

Please sign in to comment.