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

hotfix iban list #412

Merged
merged 1 commit into from
May 31, 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
3 changes: 2 additions & 1 deletion .github/workflows/cd_next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ jobs:
steps:
- name: Make Release
id: release
uses: pagopa/github-actions-template/maven-release@v1.13.3
uses: pagopa/github-actions-template/maven-release@create-tag-only
with:
semver: buildNumber
github_token: ${{ secrets.BOT_TOKEN_GITHUB }}
beta: false
skip_ci: false
prerelease: true
only_tag: true

image:
needs: [ pre_release ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,7 @@
import it.pagopa.selfcare.pagopa.backoffice.model.configuration.WfespPluginConfs;
import it.pagopa.selfcare.pagopa.backoffice.model.connector.broker.BrokerDetails;
import it.pagopa.selfcare.pagopa.backoffice.model.connector.broker.Brokers;
import it.pagopa.selfcare.pagopa.backoffice.model.connector.channel.BrokerPspDetails;
import it.pagopa.selfcare.pagopa.backoffice.model.connector.channel.BrokersPsp;
import it.pagopa.selfcare.pagopa.backoffice.model.connector.channel.ChannelDetails;
import it.pagopa.selfcare.pagopa.backoffice.model.connector.channel.ChannelPspList;
import it.pagopa.selfcare.pagopa.backoffice.model.connector.channel.Channels;
import it.pagopa.selfcare.pagopa.backoffice.model.connector.channel.PaymentServiceProviderDetails;
import it.pagopa.selfcare.pagopa.backoffice.model.connector.channel.PaymentServiceProviders;
import it.pagopa.selfcare.pagopa.backoffice.model.connector.channel.PspChannelPaymentTypes;
import it.pagopa.selfcare.pagopa.backoffice.model.connector.channel.*;
import it.pagopa.selfcare.pagopa.backoffice.model.connector.creditorinstitution.CreditorInstitutionDetails;
import it.pagopa.selfcare.pagopa.backoffice.model.connector.creditorinstitution.CreditorInstitutions;
import it.pagopa.selfcare.pagopa.backoffice.model.connector.station.CreditorInstitutionStationEdit;
Expand All @@ -23,19 +16,12 @@
import it.pagopa.selfcare.pagopa.backoffice.model.connector.station.Stations;
import it.pagopa.selfcare.pagopa.backoffice.model.creditorinstituions.CreditorInstitutionsView;
import it.pagopa.selfcare.pagopa.backoffice.model.iban.IbanCreateApiconfig;
import it.pagopa.selfcare.pagopa.backoffice.model.iban.Ibans;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.core.io.Resource;
import org.springframework.http.MediaType;
import org.springframework.retry.annotation.Backoff;
import org.springframework.retry.annotation.Retryable;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
Expand Down Expand Up @@ -229,10 +215,6 @@ CreditorInstitutions getCreditorInstitutionsByStation(@PathVariable(required = f
void deleteCreditorInstitutionStationRelationship(@PathVariable("creditorinstitutioncode") String ecCode,
@PathVariable(required = false, name = "stationcode") String stationcode);

@GetMapping(value = "/creditorinstitutions/{creditorinstitutioncode}/ibans/list")
@Valid
Ibans getCreditorInstitutionIbans(@PathVariable("creditorinstitutioncode") String creditorInstitutionCode,
@RequestParam String label);

@PostMapping(value = "/creditorinstitutions/{creditorinstitutioncode}/ibans", produces = MediaType.APPLICATION_JSON_VALUE)
@Valid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,14 @@
import it.pagopa.selfcare.pagopa.backoffice.model.connector.creditorinstitution.BrokerCreditorInstitutionDetails;
import it.pagopa.selfcare.pagopa.backoffice.model.connector.creditorinstitution.CreditorInstitutionAssociatedCodeList;
import it.pagopa.selfcare.pagopa.backoffice.model.connector.station.StationDetailsList;
import it.pagopa.selfcare.pagopa.backoffice.model.iban.Ibans;
import it.pagopa.selfcare.pagopa.backoffice.model.iban.IbansList;
import it.pagopa.selfcare.pagopa.backoffice.model.institutions.client.CreditorInstitutionInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.retry.annotation.Backoff;
import org.springframework.retry.annotation.Retryable;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.List;
Expand Down Expand Up @@ -82,4 +78,9 @@ BrokerCreditorInstitutionDetails getCreditorInstitutionsAssociatedToBroker(
@GetMapping(value = "/creditorinstitutions", produces = MediaType.APPLICATION_JSON_VALUE)
@Valid
List<CreditorInstitutionInfo> getCreditorInstitutionInfo(@RequestParam List<String> taxCodeList);

@GetMapping(value = "/creditorinstitutions/{creditorinstitutioncode}/ibans/list")
@Valid
Ibans getCreditorInstitutionIbans(@PathVariable("creditorinstitutioncode") String creditorInstitutionCode,
@RequestParam String label);
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public IbanService(ApiConfigClient apiConfigClient, ApiConfigSelfcareIntegration


public Ibans getIban(String ciCode, String labelName) {
return apiConfigClient.getCreditorInstitutionIbans(ciCode, labelName);
return apiConfigSelfcareIntegrationClient.getCreditorInstitutionIbans(ciCode, labelName);
}

public Iban createIban(String ciCode, IbanCreate requestDto) {
Expand All @@ -48,7 +48,7 @@ public Iban createIban(String ciCode, IbanCreate requestDto) {
public Iban updateIban(String ciCode, String ibanValue, IbanCreate dto) {
// updating labels, owned by other CI, related to the passed IBAN
if(!isEmpty(dto.getLabels())) {
Ibans ibansEnhanced = apiConfigClient.getCreditorInstitutionIbans(ciCode, dto.getLabels().get(0).getName());
Ibans ibansEnhanced = apiConfigSelfcareIntegrationClient.getCreditorInstitutionIbans(ciCode, dto.getLabels().get(0).getName());
if(ibansEnhanced != null && !ObjectUtils.isEmpty(ibansEnhanced.getIbanList())) {
ibansEnhanced.getIbanList().forEach(iban -> {
IbanCreateApiconfig ibanCreate = modelMapper.map(iban, IbanCreateApiconfig.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@
import it.pagopa.selfcare.pagopa.backoffice.client.ApiConfigClient;
import it.pagopa.selfcare.pagopa.backoffice.client.ApiConfigSelfcareIntegrationClient;
import it.pagopa.selfcare.pagopa.backoffice.client.ExternalApiClient;
import it.pagopa.selfcare.pagopa.backoffice.entity.BrokerIbansEntity;
import it.pagopa.selfcare.pagopa.backoffice.entity.BrokerInstitutionsEntity;
import it.pagopa.selfcare.pagopa.backoffice.exception.AppException;
import it.pagopa.selfcare.pagopa.backoffice.model.iban.IbanCreateApiconfig;
import it.pagopa.selfcare.pagopa.backoffice.model.iban.Ibans;
import it.pagopa.selfcare.pagopa.backoffice.repository.BrokerIbansRepository;
import it.pagopa.selfcare.pagopa.backoffice.repository.BrokerInstitutionsRepository;
import org.junit.jupiter.api.Test;
import org.mockito.InjectMocks;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -22,9 +17,9 @@
import org.springframework.test.web.servlet.MockMvc;

import java.io.IOException;
import java.util.Optional;

import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.when;
Expand Down Expand Up @@ -57,7 +52,7 @@ class IbanServiceTest {

@Test
void getIban() throws IOException {
when(apiConfigClient.getCreditorInstitutionIbans(eq("1111"), any()))
when(apiConfigSelfcareIntegrationClient.getCreditorInstitutionIbans(eq("1111"), any()))
.thenReturn(TestUtil.fileToObject("response/apiconfig/ibans.json", Ibans.class));
Ibans response = ibanService.getIban("1111", null);
assertNotNull(response);
Expand All @@ -68,7 +63,7 @@ void getIban() throws IOException {
@Test
void getCreditorInstitutionIbans() throws Exception {
String url = "/creditor-institutions/11111/ibans";
when(apiConfigClient.getCreditorInstitutionIbans(eq("11111"), any()))
when(apiConfigSelfcareIntegrationClient.getCreditorInstitutionIbans(eq("11111"), any()))
.thenReturn(TestUtil.fileToObject("response/apiconfig/ibans.json", Ibans.class));
mvc.perform(get(url).contentType(MediaType.APPLICATION_JSON))
.andExpect(status().isOk())
Expand Down
Loading