diff --git a/.github/workflows/code_review.yml b/.github/workflows/code_review.yml
index 937d4fd..a819d19 100644
--- a/.github/workflows/code_review.yml
+++ b/.github/workflows/code_review.yml
@@ -40,8 +40,6 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
sonar_token: ${{ secrets.SONAR_TOKEN }}
project_key: ${{env.PROJECT_KEY}}
- coverage_exclusions: "**/config/**,**/*Mock*,**/model/**,**/entity/*,**/util/*"
- cpd_exclusions: "**/model/**,**/entity/*"
java_version: 17
smoke-test:
diff --git a/.github/workflows/integration_test.yml b/.github/workflows/integration_test.yml
index b0e2e3e..82cc6d0 100644
--- a/.github/workflows/integration_test.yml
+++ b/.github/workflows/integration_test.yml
@@ -65,7 +65,7 @@ jobs:
needs: [ integration_test ]
runs-on: ubuntu-latest
name: Notify
- if: ${{ always() && inputs.notify == 'true' }}
+ if: ${{ inputs.notify == 'true' }}
steps:
- name: Report Status
if: ${{ inputs.notify }}
diff --git a/README.md b/README.md
index 1bb87c6..2b38bb2 100644
--- a/README.md
+++ b/README.md
@@ -14,7 +14,9 @@ It allows the creditor institutions to:
## Api Documentation 📖
-See the [OpenApi 3 here.](https://editor.swagger.io/?url=https://raw.githubusercontent.com/pagopa/pagopa-gpd-upload/main/openapi/openapi.json)
+See the external [OpenApi 3 here.](https://editor.swagger.io/?url=https://raw.githubusercontent.com/pagopa/pagopa-gpd-upload/main/openapi/openapi.json)
+
+See the internal [OpenApi 3 here.](https://editor.swagger.io/?url=https://raw.githubusercontent.com/pagopa/pagopa-gpd-upload/main/openapi/openapi-support-internal.json)
---
diff --git a/helm/Chart.yaml b/helm/Chart.yaml
index 17342da..7bc7b36 100644
--- a/helm/Chart.yaml
+++ b/helm/Chart.yaml
@@ -2,8 +2,8 @@ apiVersion: v2
name: pagopa-gpd-upload
description: Microservice that handles file upload of massive debt positions JSON object
type: application
-version: 0.107.0
-appVersion: 0.1.33
+version: 0.108.0
+appVersion: 0.1.33-1-recover-delete-operation-status
dependencies:
- name: microservice-chart
version: 2.8.0
diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml
index 0753fdc..5f4bba5 100644
--- a/helm/values-dev.yaml
+++ b/helm/values-dev.yaml
@@ -4,7 +4,7 @@ microservice-chart:
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/pagopa-gpd-upload
- tag: "0.1.33"
+ tag: "0.1.33-1-recover-delete-operation-status"
pullPolicy: Always
livenessProbe:
httpGet:
diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml
index cd77ce9..61c9a8c 100644
--- a/helm/values-prod.yaml
+++ b/helm/values-prod.yaml
@@ -4,7 +4,7 @@ microservice-chart:
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/pagopa-gpd-upload
- tag: "0.1.33"
+ tag: "0.1.33-1-recover-delete-operation-status"
pullPolicy: Always
livenessProbe:
httpGet:
diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml
index 34463ac..a0acd85 100644
--- a/helm/values-uat.yaml
+++ b/helm/values-uat.yaml
@@ -4,7 +4,7 @@ microservice-chart:
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/pagopa-gpd-upload
- tag: "0.1.33"
+ tag: "0.1.33-1-recover-delete-operation-status"
pullPolicy: Always
livenessProbe:
httpGet:
diff --git a/openapi/openapi-support-internal.json b/openapi/openapi-support-internal.json
new file mode 100644
index 0000000..a8dbb71
--- /dev/null
+++ b/openapi/openapi-support-internal.json
@@ -0,0 +1,916 @@
+{
+ "openapi": "3.0.1",
+ "info": {
+ "title": "GPD-Upload-Support-API",
+ "description": "Microservice to manage PagoPA GPD Upload",
+ "termsOfService": "https://www.pagopa.gov.it/",
+ "version": "0.1.33-1-recover-delete-operation-status"
+ },
+ "servers": [
+ {
+ "url": "http://localhost:8080"
+ },
+ {
+ "url": "https://{host}{basePath}",
+ "variables": {
+ "basePath": {
+ "default": "/upload/gpd/debt-positions-service/v1",
+ "enum": [
+ "/upload/gpd/debt-positions-service/v1"
+ ]
+ },
+ "host": {
+ "default": "api.dev.platform.pagopa.it",
+ "enum": [
+ "api.dev.platform.pagopa.it",
+ "api.uat.platform.pagopa.it",
+ "api.platform.pagopa.it"
+ ]
+ }
+ }
+ }
+ ],
+ "paths": {
+ "/brokers/{broker-code}/organizations/{organization-fiscal-code}/debtpositions/file": {
+ "put": {
+ "tags": [
+ "Debt Positions CRUD via file upload API"
+ ],
+ "summary": "The Organization updates the debt positions listed in the file.",
+ "operationId": "update-debt-positions-by-file-upload",
+ "parameters": [
+ {
+ "name": "broker-code",
+ "in": "path",
+ "description": "The broker code",
+ "required": true,
+ "schema": {
+ "minLength": 1,
+ "type": "string"
+ }
+ },
+ {
+ "name": "organization-fiscal-code",
+ "in": "path",
+ "description": "The organization fiscal code",
+ "required": true,
+ "schema": {
+ "minLength": 1,
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "multipart/form-data": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "file": {
+ "type": "string",
+ "description": "File to be uploaded",
+ "format": "binary"
+ }
+ }
+ },
+ "encoding": {
+ "file": {
+ "contentType": "application/octet-stream"
+ }
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "202": {
+ "description": "Request accepted."
+ },
+ "400": {
+ "description": "Malformed request.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ProblemJson"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Wrong or missing function key.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ProblemJson"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "allOf": [],
+ "anyOf": [],
+ "oneOf": []
+ }
+ }
+ }
+ },
+ "409": {
+ "description": "Conflict: duplicate file found.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ProblemJson"
+ }
+ }
+ }
+ },
+ "429": {
+ "description": "Too many requests.",
+ "content": {
+ "text/json": {}
+ }
+ },
+ "500": {
+ "description": "Service unavailable.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ProblemJson"
+ }
+ }
+ }
+ }
+ },
+ "security": [
+ {
+ "ApiKey": []
+ },
+ {
+ "Authorization": []
+ }
+ ]
+ },
+ "post": {
+ "tags": [
+ "Debt Positions CRUD via file upload API"
+ ],
+ "summary": "The Organization creates the debt positions listed in the file.",
+ "operationId": "create-debt-positions-by-file-upload",
+ "parameters": [
+ {
+ "name": "broker-code",
+ "in": "path",
+ "description": "The broker code",
+ "required": true,
+ "schema": {
+ "minLength": 1,
+ "type": "string"
+ }
+ },
+ {
+ "name": "organization-fiscal-code",
+ "in": "path",
+ "description": "The organization fiscal code",
+ "required": true,
+ "schema": {
+ "minLength": 1,
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "multipart/form-data": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "file": {
+ "type": "string",
+ "description": "File to be uploaded",
+ "format": "binary"
+ }
+ }
+ },
+ "encoding": {
+ "file": {
+ "contentType": "application/octet-stream"
+ }
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "202": {
+ "description": "Request accepted."
+ },
+ "400": {
+ "description": "Malformed request.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ProblemJson"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Wrong or missing function key.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ProblemJson"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "allOf": [],
+ "anyOf": [],
+ "oneOf": []
+ }
+ }
+ }
+ },
+ "409": {
+ "description": "Conflict: duplicate file found.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ProblemJson"
+ }
+ }
+ }
+ },
+ "429": {
+ "description": "Too many requests.",
+ "content": {
+ "text/json": {}
+ }
+ },
+ "500": {
+ "description": "Service unavailable.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ProblemJson"
+ }
+ }
+ }
+ }
+ },
+ "security": [
+ {
+ "ApiKey": []
+ },
+ {
+ "Authorization": []
+ }
+ ]
+ },
+ "delete": {
+ "tags": [
+ "Debt Positions CRUD via file upload API"
+ ],
+ "summary": "The Organization deletes the debt positions based on IUPD listed in the file.",
+ "operationId": "delete-debt-positions-by-file-upload",
+ "parameters": [
+ {
+ "name": "broker-code",
+ "in": "path",
+ "description": "The broker code",
+ "required": true,
+ "schema": {
+ "minLength": 1,
+ "type": "string"
+ }
+ },
+ {
+ "name": "organization-fiscal-code",
+ "in": "path",
+ "description": "The organization fiscal code",
+ "required": true,
+ "schema": {
+ "minLength": 1,
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "multipart/form-data": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "file": {
+ "type": "string",
+ "description": "File to be uploaded",
+ "format": "binary"
+ }
+ }
+ },
+ "encoding": {
+ "file": {
+ "contentType": "application/octet-stream"
+ }
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "202": {
+ "description": "Request accepted."
+ },
+ "400": {
+ "description": "Malformed request.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ProblemJson"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Wrong or missing function key.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ProblemJson"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "allOf": [],
+ "anyOf": [],
+ "oneOf": []
+ }
+ }
+ }
+ },
+ "409": {
+ "description": "Conflict: duplicate file found.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ProblemJson"
+ }
+ }
+ }
+ },
+ "429": {
+ "description": "Too many requests.",
+ "content": {
+ "text/json": {}
+ }
+ },
+ "500": {
+ "description": "Service unavailable.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ProblemJson"
+ }
+ }
+ }
+ }
+ },
+ "security": [
+ {
+ "ApiKey": []
+ },
+ {
+ "Authorization": []
+ }
+ ]
+ }
+ },
+ "/brokers/{broker-code}/organizations/{organization-fiscal-code}/debtpositions/file/{file-id}/report": {
+ "get": {
+ "tags": [
+ "Upload Status API"
+ ],
+ "summary": "Returns the debt positions upload report.",
+ "operationId": "get-debt-positions-upload-report",
+ "parameters": [
+ {
+ "name": "broker-code",
+ "in": "path",
+ "description": "The broker code",
+ "required": true,
+ "schema": {
+ "minLength": 1,
+ "type": "string"
+ }
+ },
+ {
+ "name": "organization-fiscal-code",
+ "in": "path",
+ "description": "The organization fiscal code",
+ "required": true,
+ "schema": {
+ "minLength": 1,
+ "type": "string"
+ }
+ },
+ {
+ "name": "file-id",
+ "in": "path",
+ "description": "The unique identifier for file upload",
+ "required": true,
+ "schema": {
+ "minLength": 1,
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Upload report found.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/UploadReport"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Malformed request.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ProblemJson"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Wrong or missing function key.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ProblemJson"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "allOf": [],
+ "anyOf": [],
+ "oneOf": []
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Upload report not found.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ProblemJson"
+ }
+ }
+ }
+ },
+ "429": {
+ "description": "Too many requests.",
+ "content": {
+ "text/json": {}
+ }
+ },
+ "500": {
+ "description": "Service unavailable.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ProblemJson"
+ }
+ }
+ }
+ }
+ },
+ "security": [
+ {
+ "ApiKey": []
+ },
+ {
+ "Authorization": []
+ }
+ ]
+ }
+ },
+ "/brokers/{broker-code}/organizations/{organization-fiscal-code}/debtpositions/file/{file-id}/status": {
+ "get": {
+ "tags": [
+ "Upload Status API"
+ ],
+ "summary": "Returns the debt positions upload status.",
+ "operationId": "get-debt-positions-upload-status",
+ "parameters": [
+ {
+ "name": "broker-code",
+ "in": "path",
+ "description": "The broker code",
+ "required": true,
+ "schema": {
+ "minLength": 1,
+ "type": "string"
+ }
+ },
+ {
+ "name": "organization-fiscal-code",
+ "in": "path",
+ "description": "The organization fiscal code",
+ "required": true,
+ "schema": {
+ "minLength": 1,
+ "type": "string"
+ }
+ },
+ {
+ "name": "file-id",
+ "in": "path",
+ "description": "The unique identifier for file upload",
+ "required": true,
+ "schema": {
+ "minLength": 1,
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Upload found.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/UploadStatus"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Malformed request.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ProblemJson"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Wrong or missing function key.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ProblemJson"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "allOf": [],
+ "anyOf": [],
+ "oneOf": []
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Upload not found.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ProblemJson"
+ }
+ }
+ }
+ },
+ "429": {
+ "description": "Too many requests.",
+ "content": {
+ "text/json": {}
+ }
+ },
+ "500": {
+ "description": "Service unavailable.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ProblemJson"
+ }
+ }
+ }
+ }
+ },
+ "security": [
+ {
+ "ApiKey": []
+ },
+ {
+ "Authorization": []
+ }
+ ]
+ }
+ },
+ "/info": {
+ "get": {
+ "tags": [
+ "Health check"
+ ],
+ "summary": "health check",
+ "description": "Return OK if application is started",
+ "operationId": "healthCheck",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/AppInfo"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad Request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ProblemJson"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "allOf": [],
+ "anyOf": [],
+ "oneOf": []
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "allOf": [],
+ "anyOf": [],
+ "oneOf": []
+ }
+ }
+ }
+ },
+ "429": {
+ "description": "Too many requests.",
+ "content": {
+ "text/json": {}
+ }
+ },
+ "500": {
+ "description": "Service unavailable",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ProblemJson"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/support/uploads/{upload}/status/refresh": {
+ "get": {
+ "tags": [
+ "Support API"
+ ],
+ "summary": "Support API to recover status on CREATE and DELETE operation",
+ "description": "Returns the debt positions upload report recovered.",
+ "operationId": "recoverStatus",
+ "parameters": [
+ {
+ "name": "upload",
+ "in": "path",
+ "description": "The unique identifier for file upload",
+ "required": true,
+ "schema": {
+ "minLength": 1,
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/AppInfo"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad Request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ProblemJson"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "allOf": [],
+ "anyOf": [],
+ "oneOf": []
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden",
+ "content": {
+ "application/json": {
+ "schema": {
+ "allOf": [],
+ "anyOf": [],
+ "oneOf": []
+ }
+ }
+ }
+ },
+ "429": {
+ "description": "Too many requests.",
+ "content": {
+ "text/json": {}
+ }
+ },
+ "500": {
+ "description": "Service unavailable",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ProblemJson"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "components": {
+ "schemas": {
+ "AppInfo": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "version": {
+ "type": "string"
+ },
+ "environment": {
+ "type": "string"
+ }
+ }
+ },
+ "ProblemJson": {
+ "type": "object",
+ "properties": {
+ "title": {
+ "type": "string",
+ "description": "A short, summary of the problem type. Written in english and readable for engineers (usually not suited for non technical stakeholders and not localized); example: Service Unavailable"
+ },
+ "status": {
+ "type": "integer",
+ "description": "The HTTP status code generated by the origin server for this occurrence of the problem.",
+ "format": "int32",
+ "example": 200
+ },
+ "detail": {
+ "type": "string",
+ "description": "A human readable explanation specific to this occurrence of the problem.",
+ "example": "There was an error processing the request"
+ }
+ },
+ "description": "Object returned as response in case of an error."
+ },
+ "ResponseEntry": {
+ "type": "object",
+ "properties": {
+ "statusCode": {
+ "type": "integer",
+ "format": "int32",
+ "example": 400
+ },
+ "statusMessage": {
+ "type": "string",
+ "example": "Bad request caused by invalid email address"
+ },
+ "requestIDs": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "UploadReport": {
+ "type": "object",
+ "properties": {
+ "uploadID": {
+ "type": "string"
+ },
+ "processedItem": {
+ "type": "integer",
+ "format": "int32"
+ },
+ "submittedItem": {
+ "type": "integer",
+ "format": "int32"
+ },
+ "responses": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/ResponseEntry"
+ }
+ },
+ "startTime": {
+ "type": "string",
+ "format": "date-time",
+ "example": "2024-10-08T14:55:16.302Z"
+ },
+ "endTime": {
+ "type": "string",
+ "format": "date-time",
+ "example": "2024-10-08T14:55:16.302Z"
+ }
+ }
+ },
+ "UploadStatus": {
+ "type": "object",
+ "properties": {
+ "uploadID": {
+ "type": "string"
+ },
+ "processedItem": {
+ "type": "integer",
+ "format": "int32"
+ },
+ "submittedItem": {
+ "type": "integer",
+ "format": "int32"
+ },
+ "startTime": {
+ "type": "string",
+ "format": "date-time",
+ "example": "2024-10-08T14:55:16.302Z"
+ }
+ }
+ }
+ },
+ "securitySchemes": {
+ "Ocp-Apim-Subscription-Key": {
+ "type": "apiKey",
+ "name": "Ocp-Apim-Subscription-Key",
+ "in": "header"
+ }
+ }
+ }
+}
diff --git a/openapi/openapi.json b/openapi/openapi.json
index 1cc8d54..2ebccc7 100644
--- a/openapi/openapi.json
+++ b/openapi/openapi.json
@@ -1,10 +1,10 @@
{
"openapi": "3.0.1",
"info": {
- "title": "pagopa-gpd-upload",
+ "title": "GPD-Upload-API",
"description": "Microservice to manage PagoPA GPD Upload",
"termsOfService": "https://www.pagopa.gov.it/",
- "version": "0.1.33"
+ "version": "0.1.33-1-recover-delete-operation-status"
},
"servers": [
{
@@ -708,110 +708,6 @@
}
}
}
- },
- "/support/brokers/{broker}/organizations/{organization}/{upload}/status/created/refresh": {
- "get": {
- "tags": [
- "Support API"
- ],
- "summary": "Support API to recover status on CREATE operation",
- "description": "Returns the debt positions upload report recovered.",
- "operationId": "recoverStatus",
- "parameters": [
- {
- "name": "broker",
- "in": "path",
- "description": "The broker code",
- "required": true,
- "schema": {
- "minLength": 1,
- "type": "string"
- }
- },
- {
- "name": "organization",
- "in": "path",
- "description": "The organization fiscal code",
- "required": true,
- "schema": {
- "minLength": 1,
- "type": "string"
- }
- },
- {
- "name": "upload",
- "in": "path",
- "description": "The unique identifier for file upload",
- "required": true,
- "schema": {
- "minLength": 1,
- "type": "string"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/AppInfo"
- }
- }
- }
- },
- "400": {
- "description": "Bad Request",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ProblemJson"
- }
- }
- }
- },
- "401": {
- "description": "Unauthorized",
- "content": {
- "application/json": {
- "schema": {
- "allOf": [],
- "anyOf": [],
- "oneOf": []
- }
- }
- }
- },
- "403": {
- "description": "Forbidden",
- "content": {
- "application/json": {
- "schema": {
- "allOf": [],
- "anyOf": [],
- "oneOf": []
- }
- }
- }
- },
- "429": {
- "description": "Too many requests.",
- "content": {
- "text/json": {}
- }
- },
- "500": {
- "description": "Service unavailable",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ProblemJson"
- }
- }
- }
- }
- }
- }
}
},
"components": {
diff --git a/pom.xml b/pom.xml
index b9ff881..b8a8fb0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
4.0.0
it.gov.pagopa.gpd.upload
pagopa-gpd-upload
- 0.1.33
+ 0.1.33-1-recover-delete-operation-status
${packaging}
diff --git a/src/main/java/it/gov/pagopa/gpd/upload/Application.java b/src/main/java/it/gov/pagopa/gpd/upload/Application.java
index b0c248a..846191f 100644
--- a/src/main/java/it/gov/pagopa/gpd/upload/Application.java
+++ b/src/main/java/it/gov/pagopa/gpd/upload/Application.java
@@ -9,7 +9,7 @@
@OpenAPIDefinition(
info = @Info(
- title = "pagopa-gpd-upload",
+ title = "${info.application.title}",
version = "${openapi.application.version}",
description = "Microservice to manage PagoPA GPD Upload",
termsOfService = "https://www.pagopa.gov.it/"
diff --git a/src/main/java/it/gov/pagopa/gpd/upload/config/duplicate/NoDuplicate.java b/src/main/java/it/gov/pagopa/gpd/upload/config/duplicate/NoDuplicate.java
new file mode 100644
index 0000000..dbae0ce
--- /dev/null
+++ b/src/main/java/it/gov/pagopa/gpd/upload/config/duplicate/NoDuplicate.java
@@ -0,0 +1,22 @@
+package it.gov.pagopa.gpd.upload.config.duplicate;
+
+import jakarta.validation.Constraint;
+import jakarta.validation.Payload;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Constraint(validatedBy = NoDuplicateValidator.class)
+@Target({ ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER })
+@Retention(RetentionPolicy.RUNTIME)
+public @interface NoDuplicate {
+ String message() default "there are duplicates in the list";
+
+ Class>[] groups() default {};
+
+ Class extends Payload>[] payload() default {};
+
+ String fieldName() default ""; // Check duplicate on this field
+}
\ No newline at end of file
diff --git a/src/main/java/it/gov/pagopa/gpd/upload/config/duplicate/NoDuplicateValidator.java b/src/main/java/it/gov/pagopa/gpd/upload/config/duplicate/NoDuplicateValidator.java
new file mode 100644
index 0000000..4bf697c
--- /dev/null
+++ b/src/main/java/it/gov/pagopa/gpd/upload/config/duplicate/NoDuplicateValidator.java
@@ -0,0 +1,53 @@
+package it.gov.pagopa.gpd.upload.config.duplicate;
+
+
+import jakarta.validation.ConstraintValidator;
+import jakarta.validation.ConstraintValidatorContext;
+import lombok.extern.slf4j.Slf4j;
+
+import java.lang.reflect.Field;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Objects;
+import java.util.Set;
+
+@Slf4j
+public class NoDuplicateValidator implements ConstraintValidator> {
+
+ private String fieldName;
+
+ @Override
+ public void initialize(NoDuplicate constraintAnnotation) {
+ this.fieldName = constraintAnnotation.fieldName();
+ }
+
+ @Override
+ public boolean isValid(List> list, ConstraintValidatorContext context) {
+ if (list == null) {
+ return true;
+ }
+
+ if(Objects.equals(fieldName, "")) {
+ HashSet> unique = new HashSet<>(list);
+ return unique.size() == list.size();
+ } else {
+ Set