Skip to content

Commit

Permalink
feat: main branch alignment for next parallel task working (#3)
Browse files Browse the repository at this point in the history
* [NOD-781] feat: first definition of redirect flow [WIP]
* [NOD-781] feat: added scripts for update WSDL specification
* [NOD_781] feat: merging version update from main
* [NOD-781] feat: added scripts for update WSDL specification
* NOD-784 upgrade wsdl generation
* [NOD-781] feat: continuing redirect flow [WIP]
* [NOD-781] feat: aligned some classes wrongly merged

---------

Co-authored-by: maxsca <[email protected]>
Co-authored-by: pagopa-github-bot <[email protected]>
  • Loading branch information
3 people authored Mar 26, 2024
1 parent 66089f1 commit 88deb06
Show file tree
Hide file tree
Showing 59 changed files with 3,942 additions and 121 deletions.
Binary file added .DS_Store
Binary file not shown.
53 changes: 19 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,69 +1,54 @@
# Template for Java Spring Microservice project
# pagoPA WISP Converter

[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=TODO-set-your-id&metric=alert_status)](https://sonarcloud.io/dashboard?id=TODO-set-your-id)
[![Integration Tests](https://github.com/pagopa/<TODO-repo>/actions/workflows/integration_test.yml/badge.svg?branch=main)](https://github.com/pagopa/<TODO-repo>/actions/workflows/integration_test.yml)

TODO: add a description

TODO: generate a index with this tool: https://ecotrust-canada.github.io/markdown-toc/

TODO: resolve all the TODOs in this template
A service that permits to handle nodoInviaRPT and nodoInviaCarrelloRPT request from WISP, interfacing
them with GPD system

---

## Api Documentation 📖

See the [OpenApi 3 here.](https://editor.swagger.io/?url=https://raw.githubusercontent.com/pagopa/<TODO-repo>/main/openapi/openapi.json)
See
the [OpenApi 3 here.](https://editor.swagger.io/?url=https://raw.githubusercontent.com/pagopa/pagopa-wisp-converter/main/openapi/openapi.json)

---

## Technology Stack

- Java 11
- Java 17
- Spring Boot
- Spring Web
- Hibernate
- JPA
- ...
- TODO
- Azure CosmosDB
- Redis Cache

---

## Start Project Locally 🚀
## Develop Locally 💻

### Prerequisites

- docker

### Run docker container

from `./docker` directory

`sh ./run_docker.sh local`
- Maven
- JDK17

ℹ️ Note: for PagoPa ACR is required the login `az acr login -n <acr-name>`
### Before the first run

---

## Develop Locally 💻
In order to get the latest updated sources and to correctly execute the application, it is necessary to
generate the source classes from WSDL and XSD definition. For doing so, move in `script` folder and
execute the following command:

### Prerequisites
`sh update-specs.sh`

- git
- maven
- jdk-11
After the execution, in `target/generated-sources/jaxb` folder there will be the newly generated classes.
The application now can be run and all the class references are correctly resolved.

### Run the project

Start the springboot application with this command:
Start the Spring Boot application with this command:

`mvn spring-boot:run -Dspring-boot.run.profiles=local`

### Spring Profiles

- **local**: to develop locally.
- _default (no profile set)_: The application gets the properties from the environment (for Azure).

### Testing 🧪

#### Unit testing
Expand Down
4 changes: 2 additions & 2 deletions helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: pagopa-wisp-converter
description: A service that permits to handle nodoInviaRPT and nodoInviaCarrelloRPT request from WISP, interfacing them with GPD system
type: application
version: 0.1.0
appVersion: 0.0.1
version: 0.2.0
appVersion: 0.0.1-1-NOD-781-dismissione-wisp-sviluppo-conversione-rpt-in-pd
dependencies:
- name: microservice-chart
version: 3.0.0
Expand Down
2 changes: 1 addition & 1 deletion helm/values-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ microservice-chart:
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/pagopa-wisp-converter
tag: "0.0.1"
tag: "0.0.1-1-NOD-781-dismissione-wisp-sviluppo-conversione-rpt-in-pd"
pullPolicy: Always
livenessProbe:
httpGet:
Expand Down
2 changes: 1 addition & 1 deletion helm/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ microservice-chart:
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/pagopa-wisp-converter
tag: "0.0.1"
tag: "0.0.1-1-NOD-781-dismissione-wisp-sviluppo-conversione-rpt-in-pd"
pullPolicy: Always
livenessProbe:
httpGet:
Expand Down
2 changes: 1 addition & 1 deletion helm/values-uat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ microservice-chart:
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/pagopa-wisp-converter
tag: "0.0.1"
tag: "0.0.1-1-NOD-781-dismissione-wisp-sviluppo-conversione-rpt-in-pd"
pullPolicy: Always
livenessProbe:
httpGet:
Expand Down
87 changes: 85 additions & 2 deletions openapi/openapi.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"openapi": "3.0.1",
"info": {
"description": "A service that permits to handle nodoInviaRPT and nodoInviaCarrelloRPT request from WISP, interfacing them with GPD system",
"description": "A service that permits to handle nodoInviaRPT and nodoInviaCarrelloRPT request from WISP, interfacing",
"termsOfService": "https://www.pagopa.gov.it/",
"title": "wisp-converter",
"version": "0.0.1"
"version": "0.0.1-1-NOD-781-dismissione-wisp-sviluppo-conversione-rpt-in-pd"
},
"servers": [
{
Expand Down Expand Up @@ -96,6 +96,89 @@
}
}
]
},
"/redirect": {
"get": {
"operationId": "redirect",
"parameters": [
{
"example": "identificativoIntermediarioPA_sessionId",
"in": "query",
"name": "sessionId",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"302": {
"description": "Redirect to Checkout service.",
"headers": {
"X-Request-Id": {
"description": "This header identifies the call",
"schema": {
"type": "string"
}
}
}
},
"401": {
"description": "Wrong or missing function key.",
"headers": {
"X-Request-Id": {
"description": "This header identifies the call",
"schema": {
"type": "string"
}
}
}
},
"403": {
"description": "Forbidden.",
"headers": {
"X-Request-Id": {
"description": "This header identifies the call",
"schema": {
"type": "string"
}
}
}
},
"500": {
"content": {
"text/html": {}
},
"description": "Internal server error.",
"headers": {
"X-Request-Id": {
"description": "This header identifies the call",
"schema": {
"type": "string"
}
}
}
}
},
"security": [
{
"ApiKey": []
}
],
"tags": [
"Home"
]
},
"parameters": [
{
"description": "This header identifies the call, if not passed it is self-generated. This ID is returned in the response.",
"in": "header",
"name": "X-Request-Id",
"schema": {
"type": "string"
}
}
]
}
},
"components": {
Expand Down
113 changes: 94 additions & 19 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@

<groupId>it.gov.pagopa</groupId>
<artifactId>wisp-converter</artifactId>
<version>0.0.1</version>
<version>0.0.1-1-NOD-781-dismissione-wisp-sviluppo-conversione-rpt-in-pd</version>
<name>pagoPA WISP Converter</name>
<description>A service that permits to handle nodoInviaRPT and nodoInviaCarrelloRPT request from WISP, interfacing them with GPD system</description>
<description>A service that permits to handle nodoInviaRPT and nodoInviaCarrelloRPT request from WISP, interfacing
them with GPD system
</description>

<properties>
<java.version>17</java.version>
Expand All @@ -25,8 +27,24 @@
<aspectjrt.version>1.9.20.1</aspectjrt.version>
<azure-sdk-bom.version>1.2.21</azure-sdk-bom.version>
<netty.version>4.1.101.Final</netty.version>
<cosmos-data-version>5.10.0</cosmos-data-version>
<spring-cloud.version>2023.0.0</spring-cloud.version>
<jsr305.version>3.0.2</jsr305.version>
<openfeign-version>4.1.0</openfeign-version>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand All @@ -45,26 +63,10 @@
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>

<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-data-jpa</artifactId>-->
<!-- </dependency>-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web-services</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
</dependency>
<dependency>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
</dependency>

<!-- Spring utils-->
<dependency>
Expand All @@ -84,6 +86,27 @@
<scope>test</scope>
</dependency>

<!-- Data persistence -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-spring-data-cosmos</artifactId>
<version>${cosmos-data-version}</version>
</dependency>

<!-- Feign client -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
<version>${openfeign-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.retry</groupId>
<artifactId>spring-retry</artifactId>
</dependency>

<!-- Swagger/OpenAPI -->
<dependency>
Expand All @@ -103,6 +126,11 @@
<artifactId>mapstruct</artifactId>
<version>${mapstruct.version}</version>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>${jsr305.version}</version>
</dependency>

<dependency>
<groupId>junit</groupId>
Expand Down Expand Up @@ -185,6 +213,53 @@
</excludes>
</configuration>
</plugin>
<!-- Plugin required to build java classes from XSD using CXF -->
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>4.0.4</version>
<executions>
<execution>
<id>wsdl-to-java</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${project.build.directory}/generated-sources</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>${basedir}/src/main/resources/wsdl/NodoPerPa.wsdl</wsdl>
<wsdlLocation>classpath:wsdl/NodoPerPa.wsdl</wsdlLocation>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-xjc-plugin</artifactId>
<version>4.0.1</version>
<executions>
<execution>
<id>xsd-to-java</id>
<phase>generate-sources</phase>
<goals>
<goal>xsdtojava</goal>
</goals>
<configuration>
<sourceRoot>${project.build.directory}/generated-sources</sourceRoot>
<xsdOptions>
<xsdOption>
<xsd>${project.basedir}/src/main/resources/xsd/PagInf_RPT_RT_6_2_0.xsd</xsd>
</xsdOption>
</xsdOptions>
</configuration>
</execution>
</executions>
</plugin>


<plugin>
<groupId>org.jacoco</groupId>
Expand Down Expand Up @@ -225,8 +300,8 @@
</plugins>
<resources>
<resource>
<filtering>true</filtering>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<testResources>
Expand Down
Loading

0 comments on commit 88deb06

Please sign in to comment.