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

feat: PPD-206 crud gps #5

Merged
merged 41 commits into from
Jun 30, 2022
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
492b8e4
[PPD-206] crud gps: added enrollments api (no business code)
Jun 20, 2022
de8b9d6
[PPD-206] crud gps: added services api (no business code)
Jun 20, 2022
685f01a
Merge branch 'PPD-206-CRUD-GPS' of
Jun 20, 2022
45f8e3a
[PPD-206] crud gps: updated openapi
Jun 20, 2022
7c9700d
Merge branch 'PPD-206-CRUD-GPS' of https://github.com/pagopa/pagopa-s…
Jun 20, 2022
f2338ef
[PPD-206] crud gps: first DRAFT api impl
Jun 20, 2022
63fa75f
Merge branch 'PPD-206-CRUD-GPS' of https://github.com/pagopa/pagopa-s…
Jun 21, 2022
c0e6e85
[PPD-206] crud gps: added create business code
Jun 21, 2022
14d4561
Merge branch 'PPD-206-CRUD-GPS' of https://github.com/pagopa/pagopa-s…
Jun 22, 2022
68959e4
[PPD-206] crud gps: all enrollments crud impl
Jun 22, 2022
29e6cf4
Merge branch 'PPD-206-CRUD-GPS' of https://github.com/pagopa/pagopa-s…
Jun 22, 2022
59aba33
[PPD-206] crud GPS: added EnrollmentsController Junit test
Jun 22, 2022
0889c20
Merge branch 'PPD-206-CRUD-GPS' of https://github.com/pagopa/pagopa-s…
Jun 23, 2022
00c0bd3
[PPD-206] crud gps: added EnrollmentsService JUNIT test based on
Jun 23, 2022
5220cbd
Merge branch 'PPD-206-CRUD-GPS' of https://github.com/pagopa/pagopa-s…
Jun 24, 2022
6825864
[PPD-206] crud gps: removed unnecessary test
Jun 24, 2022
e05c2f9
[PPD-206] crud gps: corrected error "unable to find valid certification
Jun 24, 2022
d28786e
Merge branch 'PPD-206-CRUD-GPS' of https://github.com/pagopa/pagopa-s…
Jun 24, 2022
27d54fb
upd vmimage
pasqualespica Jun 24, 2022
16f7879
disable junit result
pasqualespica Jun 24, 2022
3574103
jdk vers
pasqualespica Jun 24, 2022
c94ef3e
Update code-review-pipelines.yml for Azure Pipelines
pasqualespica Jun 24, 2022
e6a6987
Update code-review-pipelines.yml for Azure Pipelines
pasqualespica Jun 24, 2022
1092121
Update code-review-pipelines.yml for Azure Pipelines
pasqualespica Jun 24, 2022
c2fd00e
Update code-review-pipelines.yml for Azure Pipelines
pasqualespica Jun 27, 2022
f9c6874
Update code-review-pipelines.yml for Azure Pipelines
jacopocarlini Jun 27, 2022
cddf340
[PPD-206] CRUD GPS: added junit test for sonar coverage
Jun 24, 2022
5313608
Merge branch 'PPD-206-CRUD-GPS' of https://github.com/pagopa/pagopa-s…
Jun 27, 2022
75422a9
Update code-review-pipelines.yml for Azure Pipelines
pasqualespica Jun 27, 2022
b7ece5a
[PPD-206] CRUD GPS: updated swagger definition
Jun 28, 2022
a5deadb
Merge branch 'PPD-206-CRUD-GPS' of https://github.com/pagopa/pagopa-s…
Jun 28, 2022
ebffb93
[PPD-206] CRUD GPS: StreamSupport with true flag for parallel stream
Jun 28, 2022
8434ddc
Merge branch 'PPD-206-CRUD-GPS' of https://github.com/pagopa/pagopa-s…
Jun 28, 2022
b09fae3
[PPD-206] CRUD GPS: removed custom converter
Jun 28, 2022
2392730
Merge branch 'PPD-206-CRUD-GPS' of https://github.com/pagopa/pagopa-s…
Jun 30, 2022
cc54d8d
[PPD-206] CRUD GPS: corrected swagger for getServices 200
Jun 30, 2022
994299d
Merge branch 'PPD-206-CRUD-GPS' of https://github.com/pagopa/pagopa-s…
Jun 30, 2022
60c3122
refactor
jacopocarlini Jun 30, 2022
4705748
[PPD-206] CRUD GPS: correct swagger for array in getServices
Jun 30, 2022
de9be63
Merge branch 'PPD-206-CRUD-GPS' of
Jun 30, 2022
a3084a0
fix
jacopocarlini Jun 30, 2022
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
2,100 changes: 1,643 additions & 457 deletions openapi/openapi.json

Large diffs are not rendered by default.

206 changes: 111 additions & 95 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,106 +1,122 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.0</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.0</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>

<groupId>it.gov.pagopa</groupId>
<artifactId>spontaneouspayment</artifactId>
<version>0.0.1</version>
<name>Gestione Pagamenti Spontanei</name>
<description>Progetto Gestione Pagamenti Spontanei</description>
<groupId>it.gov.pagopa</groupId>
<artifactId>spontaneouspayment</artifactId>
<version>0.0.1</version>
<name>Gestione Pagamenti Spontanei</name>
<description>Progetto Gestione Pagamenti Spontanei</description>

<properties>
<java.version>11</java.version>
<testcontainers.version>1.17.2</testcontainers.version>
<springfox-version>3.0.0</springfox-version>
<springdoc-version>1.6.9</springdoc-version>
<cosmos-data-version>3.21.0</cosmos-data-version>
<openfeign-version>3.1.3</openfeign-version>
</properties>
<properties>
<java.version>11</java.version>
<testcontainers.version>1.17.2</testcontainers.version>
<springfox-version>3.0.0</springfox-version>
<springdoc-version>1.6.9</springdoc-version>
<cosmos-data-version>3.21.0</cosmos-data-version>
<openfeign-version>3.1.3</openfeign-version>
<modelmapper-version>3.1.0</modelmapper-version>
</properties>

<dependencies>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-spring-data-cosmos</artifactId>
<version>${cosmos-data-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.retry</groupId>
<artifactId>spring-retry</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>${springdoc-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
<version>${openfeign-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<dependencies>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-spring-data-cosmos</artifactId>
<version>${cosmos-data-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.retry</groupId>
<artifactId>spring-retry</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>${springdoc-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
<version>${openfeign-version}</version>
</dependency>
<dependency>
<groupId>org.modelmapper</groupId>
<artifactId>modelmapper</artifactId>
<version>${modelmapper-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>azure</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers-bom</artifactId>
<version>${testcontainers.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers-bom</artifactId>
<version>${testcontainers.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -1,91 +1,19 @@
package it.gov.pagopa.spontaneouspayment;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.DependsOn;

import com.azure.spring.data.cosmos.core.mapping.EnableCosmosAuditing;
import com.azure.spring.data.cosmos.repository.config.EnableCosmosRepositories;

import it.gov.pagopa.spontaneouspayment.entity.CreditInstitution;
import it.gov.pagopa.spontaneouspayment.entity.Service;
import it.gov.pagopa.spontaneouspayment.entity.ServiceProperty;
import it.gov.pagopa.spontaneouspayment.entity.ServiceRef;
import it.gov.pagopa.spontaneouspayment.repository.CIRepository;
import it.gov.pagopa.spontaneouspayment.repository.ServiceRepository;

@SpringBootApplication
@EnableCosmosRepositories("it.gov.pagopa.spontaneouspayment.repository")
@EnableCosmosAuditing
@DependsOn("expressionResolver")
public class SpontaneousPaymentApplication implements CommandLineRunner {

@Autowired
private CIRepository ciRepository;

@Autowired
private ServiceRepository serviceRepository;
public class SpontaneousPaymentApplication {

public static void main(String[] args) {
SpringApplication.run(SpontaneousPaymentApplication.class, args);
}

public void run(String... var1) {
CreditInstitution ci = new CreditInstitution();
ci.setFiscalCode("organizationTest");
ci.setCompanyName("Comune di Roma");
ci.setStatus("ATTIVO");


Service s1 = new Service();
s1.setId("id-servizio-1");
s1.setTransferCategory("tassonomia-1");
s1.setRemittanceInformation("causale-1");
s1.setBasePath("base-path-1");
s1.setEndpoint("endpont-1");

ServiceProperty sp1 = new ServiceProperty("propName1", "number", true);
List<ServiceProperty> properties1 = new ArrayList<>();
properties1.add(sp1);
s1.setProperties(properties1);

Service s2 = new Service();
s2.setId("id-servizio-2");
s2.setTransferCategory("tassonomia-2");
s2.setRemittanceInformation("causale-2");
s2.setBasePath("base-path-2");
s2.setEndpoint("endpont-2");

ServiceProperty sp2 = new ServiceProperty("propName2", "string", true);
List<ServiceProperty> properties2 = new ArrayList<>();
properties2.add(sp2);
s2.setProperties(properties2);

ServiceRef ref1 = new ServiceRef();
ref1.setId("id-servizio-1");
ref1.setIban("iban-1");
ServiceRef ref2 = new ServiceRef();
ref2.setId("id-servizio-2");
ref2.setIban("iban-2");
List<ServiceRef> servicesRef = new ArrayList<>();
servicesRef.add(ref1);
servicesRef.add(ref2);


ci.setServices(servicesRef);


ciRepository.deleteAll();
ciRepository.save(ci);
serviceRepository.deleteAll();
serviceRepository.save(s1);
serviceRepository.save(s2);

}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package it.gov.pagopa.spontaneouspayment.config;


import org.modelmapper.Converter;
import org.modelmapper.ModelMapper;
import org.modelmapper.convention.MatchingStrategies;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import it.gov.pagopa.spontaneouspayment.entity.Organization;
import it.gov.pagopa.spontaneouspayment.mapper.ConvertOrganizationModelToOrganizationEntity;
import it.gov.pagopa.spontaneouspayment.model.OrganizationEnrollmentModel;

@Configuration
public class MappingsConfiguration {

@Bean
public ModelMapper modelMapper() {
ModelMapper mapper = new ModelMapper();
mapper.getConfiguration().setMatchingStrategy(MatchingStrategies.STRICT);
jacopocarlini marked this conversation as resolved.
Show resolved Hide resolved

Converter<OrganizationEnrollmentModel, Organization> convertOrganizationModelToOrganizationEntity = new ConvertOrganizationModelToOrganizationEntity();
mapper.createTypeMap(OrganizationEnrollmentModel.class, Organization.class).setConverter(convertOrganizationModelToOrganizationEntity);

return mapper;
}

}
Loading