diff --git a/.github/workflows/security-scan.yml b/.github/workflows/security-scan.yml index 3783154..bb69457 100644 --- a/.github/workflows/security-scan.yml +++ b/.github/workflows/security-scan.yml @@ -49,7 +49,7 @@ jobs: sarif_file: 'results.sarif' - name: CVE Description escaped extraction and print run: | - SCAN_RESULTS=$(jq -r 'try .runs[0].tool.driver.rules | map(.help.text) | join("\\n")' results.sarif) + SCAN_RESULTS=$(jq -r 'try .runs[0].tool.driver.rules | try map(.shortDescription.text) | join("\\n")' results.sarif) echo "CVE_CRITICAL=$(echo $SCAN_RESULTS | grep -o CRITICAL | wc -l)" >> $GITHUB_ENV echo "CVE_HIGH=$(echo $SCAN_RESULTS | grep -o HIGH | wc -l)" >> $GITHUB_ENV echo "CVE_MEDIUM=$(echo $SCAN_RESULTS | grep -o MEDIUM | wc -l)" >> $GITHUB_ENV @@ -67,4 +67,4 @@ jobs: CVE_CRITICAL: ${{needs.BuildAndScan.outputs.CVE_CRITICAL}} CVE_HIGH: ${{needs.BuildAndScan.outputs.CVE_HIGH}} CVE_MEDIUM: ${{needs.BuildAndScan.outputs.CVE_MEDIUM}} - secrets: inherit \ No newline at end of file + secrets: inherit diff --git a/Dockerfile b/Dockerfile index 42c852e..4632b6d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,11 +3,11 @@ # # 🎯 Version Management # -ARG CORRETTO_VERSION="21-alpine3.20" -ARG CORRETTO_SHA="8b16834e7fabfc62d4c8faa22de5df97f99627f148058d52718054aaa4ea3674" +ARG CORRETTO_VERSION="21-alpine3.21" +ARG CORRETTO_SHA="1b53a05c5693b5452a0c41a39b1fa3b8e7d77aa37f325acc378b7928bc1d8253" ARG GRADLE_VERSION="8.10.2" ARG GRADLE_DOWNLOAD_SHA256="31c55713e40233a8303827ceb42ca48a47267a0ad4bab9177123121e71524c26" -ARG APPINSIGHTS_VERSION="3.6.2" +ARG APPINSIGHTS_VERSION="3.7.0" # 🌍 Timezone Configuration ARG TZ="Europe/Rome" diff --git a/build.gradle.kts b/build.gradle.kts index 3cb1298..881fc9b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,6 +1,6 @@ plugins { java - id("org.springframework.boot") version "3.4.1" + id("org.springframework.boot") version "3.4.3" id("io.spring.dependency-management") version "1.1.7" jacoco id("org.sonarqube") version "6.0.1.5171" @@ -28,11 +28,11 @@ repositories { mavenCentral() } -val springDocOpenApiVersion = "2.7.0" +val springDocOpenApiVersion = "2.8.5" val openApiToolsVersion = "0.2.6" -val micrometerVersion = "1.4.1" -val postgresJdbcVersion = "42.7.4" -val bouncycastleVersion = "1.79" +val micrometerVersion = "1.4.3" +val postgresJdbcVersion = "42.7.5" +val bouncycastleVersion = "1.80" dependencies { implementation("org.springframework.boot:spring-boot-starter") @@ -47,17 +47,13 @@ dependencies { implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:$springDocOpenApiVersion") implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310") implementation("org.openapitools:jackson-databind-nullable:$openApiToolsVersion") + implementation("org.bouncycastle:bcprov-jdk18on:$bouncycastleVersion") + implementation("org.postgresql:postgresql:$postgresJdbcVersion") compileOnly("org.projectlombok:lombok") annotationProcessor("org.projectlombok:lombok") testAnnotationProcessor("org.projectlombok:lombok") - //security - implementation("org.bouncycastle:bcprov-jdk18on:$bouncycastleVersion") - - //postgres jdbc - implementation("org.postgresql:postgresql:$postgresJdbcVersion") - // Testing testImplementation("org.springframework.boot:spring-boot-starter-test") testImplementation("org.mockito:mockito-core") diff --git a/gradle.lockfile b/gradle.lockfile index ee07c8e..6a5c079 100644 --- a/gradle.lockfile +++ b/gradle.lockfile @@ -2,8 +2,8 @@ # Manual edits can break the build and are not advised. # This file is expected to be part of source control. aopalliance:aopalliance:1.0=compileClasspath -ch.qos.logback:logback-classic:1.5.12=compileClasspath -ch.qos.logback:logback-core:1.5.12=compileClasspath +ch.qos.logback:logback-classic:1.5.16=compileClasspath +ch.qos.logback:logback-core:1.5.16=compileClasspath com.fasterxml.jackson.core:jackson-annotations:2.18.2=compileClasspath com.fasterxml.jackson.core:jackson-core:2.18.2=compileClasspath com.fasterxml.jackson.core:jackson-databind:2.18.2=compileClasspath @@ -18,13 +18,13 @@ com.jayway.jsonpath:json-path:2.9.0=compileClasspath com.nimbusds:nimbus-jose-jwt:9.37.3=compileClasspath com.zaxxer:HikariCP:5.1.0=compileClasspath io.micrometer:context-propagation:1.1.2=compileClasspath -io.micrometer:micrometer-commons:1.14.2=compileClasspath -io.micrometer:micrometer-core:1.14.2=compileClasspath -io.micrometer:micrometer-jakarta9:1.14.2=compileClasspath -io.micrometer:micrometer-observation:1.14.2=compileClasspath -io.micrometer:micrometer-registry-prometheus:1.14.2=compileClasspath -io.micrometer:micrometer-tracing-bridge-otel:1.4.1=compileClasspath -io.micrometer:micrometer-tracing:1.4.1=compileClasspath +io.micrometer:micrometer-commons:1.14.4=compileClasspath +io.micrometer:micrometer-core:1.14.4=compileClasspath +io.micrometer:micrometer-jakarta9:1.14.4=compileClasspath +io.micrometer:micrometer-observation:1.14.4=compileClasspath +io.micrometer:micrometer-registry-prometheus:1.14.4=compileClasspath +io.micrometer:micrometer-tracing-bridge-otel:1.4.3=compileClasspath +io.micrometer:micrometer-tracing:1.4.3=compileClasspath io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-incubator:2.9.0-alpha=compileClasspath io.opentelemetry.instrumentation:opentelemetry-instrumentation-api:2.9.0=compileClasspath io.opentelemetry.semconv:opentelemetry-semconv:1.25.0-alpha=compileClasspath @@ -36,13 +36,13 @@ io.opentelemetry:opentelemetry-sdk-logs:1.43.0=compileClasspath io.opentelemetry:opentelemetry-sdk-metrics:1.43.0=compileClasspath io.opentelemetry:opentelemetry-sdk-trace:1.43.0=compileClasspath io.opentelemetry:opentelemetry-sdk:1.43.0=compileClasspath -io.prometheus:prometheus-metrics-config:1.3.5=compileClasspath -io.prometheus:prometheus-metrics-core:1.3.5=compileClasspath -io.prometheus:prometheus-metrics-model:1.3.5=compileClasspath -io.prometheus:prometheus-metrics-tracer-common:1.3.5=compileClasspath -io.swagger.core.v3:swagger-annotations-jakarta:2.2.25=compileClasspath -io.swagger.core.v3:swagger-core-jakarta:2.2.25=compileClasspath -io.swagger.core.v3:swagger-models-jakarta:2.2.25=compileClasspath +io.prometheus:prometheus-metrics-config:1.3.6=compileClasspath +io.prometheus:prometheus-metrics-core:1.3.6=compileClasspath +io.prometheus:prometheus-metrics-model:1.3.6=compileClasspath +io.prometheus:prometheus-metrics-tracer-common:1.3.6=compileClasspath +io.swagger.core.v3:swagger-annotations-jakarta:2.2.28=compileClasspath +io.swagger.core.v3:swagger-core-jakarta:2.2.28=compileClasspath +io.swagger.core.v3:swagger-models-jakarta:2.2.28=compileClasspath jakarta.activation:jakarta.activation-api:2.1.3=compileClasspath jakarta.annotation:jakarta.annotation-api:2.1.1=compileClasspath jakarta.persistence:jakarta.persistence-api:3.1.0=compileClasspath @@ -53,65 +53,65 @@ org.antlr:antlr4-runtime:4.13.0=compileClasspath org.apache.commons:commons-lang3:3.17.0=compileClasspath org.apache.logging.log4j:log4j-api:2.24.3=compileClasspath org.apache.logging.log4j:log4j-to-slf4j:2.24.3=compileClasspath -org.apache.tomcat.embed:tomcat-embed-core:10.1.34=compileClasspath -org.apache.tomcat.embed:tomcat-embed-el:10.1.34=compileClasspath -org.apache.tomcat.embed:tomcat-embed-websocket:10.1.34=compileClasspath +org.apache.tomcat.embed:tomcat-embed-core:10.1.36=compileClasspath +org.apache.tomcat.embed:tomcat-embed-el:10.1.36=compileClasspath +org.apache.tomcat.embed:tomcat-embed-websocket:10.1.36=compileClasspath org.aspectj:aspectjweaver:1.9.22.1=compileClasspath org.atteo:evo-inflector:1.3=compileClasspath -org.bouncycastle:bcprov-jdk18on:1.79=compileClasspath -org.hibernate.orm:hibernate-core:6.6.4.Final=compileClasspath +org.bouncycastle:bcprov-jdk18on:1.80=compileClasspath +org.hibernate.orm:hibernate-core:6.6.8.Final=compileClasspath org.hibernate.validator:hibernate-validator:8.0.2.Final=compileClasspath org.jboss.logging:jboss-logging:3.6.1.Final=compileClasspath org.jspecify:jspecify:1.0.0=compileClasspath org.openapitools:jackson-databind-nullable:0.2.6=compileClasspath -org.postgresql:postgresql:42.7.4=compileClasspath +org.postgresql:postgresql:42.7.5=compileClasspath org.projectlombok:lombok:1.18.36=compileClasspath org.slf4j:jul-to-slf4j:2.0.16=compileClasspath org.slf4j:slf4j-api:2.0.16=compileClasspath -org.springdoc:springdoc-openapi-starter-common:2.7.0=compileClasspath -org.springdoc:springdoc-openapi-starter-webmvc-api:2.7.0=compileClasspath -org.springdoc:springdoc-openapi-starter-webmvc-ui:2.7.0=compileClasspath -org.springframework.boot:spring-boot-actuator-autoconfigure:3.4.1=compileClasspath -org.springframework.boot:spring-boot-actuator:3.4.1=compileClasspath -org.springframework.boot:spring-boot-autoconfigure:3.4.1=compileClasspath -org.springframework.boot:spring-boot-starter-actuator:3.4.1=compileClasspath -org.springframework.boot:spring-boot-starter-data-jpa:3.4.1=compileClasspath -org.springframework.boot:spring-boot-starter-data-rest:3.4.1=compileClasspath -org.springframework.boot:spring-boot-starter-jdbc:3.4.1=compileClasspath -org.springframework.boot:spring-boot-starter-json:3.4.1=compileClasspath -org.springframework.boot:spring-boot-starter-logging:3.4.1=compileClasspath -org.springframework.boot:spring-boot-starter-oauth2-resource-server:3.4.1=compileClasspath -org.springframework.boot:spring-boot-starter-tomcat:3.4.1=compileClasspath -org.springframework.boot:spring-boot-starter-validation:3.4.1=compileClasspath -org.springframework.boot:spring-boot-starter-web:3.4.1=compileClasspath -org.springframework.boot:spring-boot-starter:3.4.1=compileClasspath -org.springframework.boot:spring-boot:3.4.1=compileClasspath -org.springframework.data:spring-data-commons:3.4.1=compileClasspath -org.springframework.data:spring-data-jpa:3.4.1=compileClasspath -org.springframework.data:spring-data-rest-core:4.4.1=compileClasspath -org.springframework.data:spring-data-rest-webmvc:4.4.1=compileClasspath +org.springdoc:springdoc-openapi-starter-common:2.8.5=compileClasspath +org.springdoc:springdoc-openapi-starter-webmvc-api:2.8.5=compileClasspath +org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.5=compileClasspath +org.springframework.boot:spring-boot-actuator-autoconfigure:3.4.3=compileClasspath +org.springframework.boot:spring-boot-actuator:3.4.3=compileClasspath +org.springframework.boot:spring-boot-autoconfigure:3.4.3=compileClasspath +org.springframework.boot:spring-boot-starter-actuator:3.4.3=compileClasspath +org.springframework.boot:spring-boot-starter-data-jpa:3.4.3=compileClasspath +org.springframework.boot:spring-boot-starter-data-rest:3.4.3=compileClasspath +org.springframework.boot:spring-boot-starter-jdbc:3.4.3=compileClasspath +org.springframework.boot:spring-boot-starter-json:3.4.3=compileClasspath +org.springframework.boot:spring-boot-starter-logging:3.4.3=compileClasspath +org.springframework.boot:spring-boot-starter-oauth2-resource-server:3.4.3=compileClasspath +org.springframework.boot:spring-boot-starter-tomcat:3.4.3=compileClasspath +org.springframework.boot:spring-boot-starter-validation:3.4.3=compileClasspath +org.springframework.boot:spring-boot-starter-web:3.4.3=compileClasspath +org.springframework.boot:spring-boot-starter:3.4.3=compileClasspath +org.springframework.boot:spring-boot:3.4.3=compileClasspath +org.springframework.data:spring-data-commons:3.4.3=compileClasspath +org.springframework.data:spring-data-jpa:3.4.3=compileClasspath +org.springframework.data:spring-data-rest-core:4.4.3=compileClasspath +org.springframework.data:spring-data-rest-webmvc:4.4.3=compileClasspath org.springframework.hateoas:spring-hateoas:2.4.1=compileClasspath org.springframework.plugin:spring-plugin-core:3.0.0=compileClasspath -org.springframework.security:spring-security-config:6.4.2=compileClasspath -org.springframework.security:spring-security-core:6.4.2=compileClasspath -org.springframework.security:spring-security-crypto:6.4.2=compileClasspath -org.springframework.security:spring-security-oauth2-core:6.4.2=compileClasspath -org.springframework.security:spring-security-oauth2-jose:6.4.2=compileClasspath -org.springframework.security:spring-security-oauth2-resource-server:6.4.2=compileClasspath -org.springframework.security:spring-security-web:6.4.2=compileClasspath -org.springframework:spring-aop:6.2.1=compileClasspath -org.springframework:spring-aspects:6.2.1=compileClasspath -org.springframework:spring-beans:6.2.1=compileClasspath -org.springframework:spring-context:6.2.1=compileClasspath -org.springframework:spring-core:6.2.1=compileClasspath -org.springframework:spring-expression:6.2.1=compileClasspath -org.springframework:spring-jcl:6.2.1=compileClasspath -org.springframework:spring-jdbc:6.2.1=compileClasspath -org.springframework:spring-orm:6.2.1=compileClasspath -org.springframework:spring-tx:6.2.1=compileClasspath -org.springframework:spring-web:6.2.1=compileClasspath -org.springframework:spring-webmvc:6.2.1=compileClasspath -org.webjars:swagger-ui:5.18.2=compileClasspath +org.springframework.security:spring-security-config:6.4.3=compileClasspath +org.springframework.security:spring-security-core:6.4.3=compileClasspath +org.springframework.security:spring-security-crypto:6.4.3=compileClasspath +org.springframework.security:spring-security-oauth2-core:6.4.3=compileClasspath +org.springframework.security:spring-security-oauth2-jose:6.4.3=compileClasspath +org.springframework.security:spring-security-oauth2-resource-server:6.4.3=compileClasspath +org.springframework.security:spring-security-web:6.4.3=compileClasspath +org.springframework:spring-aop:6.2.3=compileClasspath +org.springframework:spring-aspects:6.2.3=compileClasspath +org.springframework:spring-beans:6.2.3=compileClasspath +org.springframework:spring-context:6.2.3=compileClasspath +org.springframework:spring-core:6.2.3=compileClasspath +org.springframework:spring-expression:6.2.3=compileClasspath +org.springframework:spring-jcl:6.2.3=compileClasspath +org.springframework:spring-jdbc:6.2.3=compileClasspath +org.springframework:spring-orm:6.2.3=compileClasspath +org.springframework:spring-tx:6.2.3=compileClasspath +org.springframework:spring-web:6.2.3=compileClasspath +org.springframework:spring-webmvc:6.2.3=compileClasspath +org.webjars:swagger-ui:5.18.3=compileClasspath org.webjars:webjars-locator-lite:1.0.1=compileClasspath org.yaml:snakeyaml:2.3=compileClasspath empty= diff --git a/openapi/generated.openapi.json b/openapi/generated.openapi.json index 27d631c..feca029 100644 --- a/openapi/generated.openapi.json +++ b/openapi/generated.openapi.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.1", + "openapi" : "3.1.0", "info" : { "title" : "p4pa-classification", "description" : "Api and Models", @@ -34,9 +34,9 @@ "description" : "Zero-based page index (0..N)", "required" : false, "schema" : { - "minimum" : 0, "type" : "integer", - "default" : 0 + "default" : 0, + "minimum" : 0 } }, { "name" : "size", @@ -44,9 +44,9 @@ "description" : "The size of the page to be returned", "required" : false, "schema" : { - "minimum" : 1, "type" : "integer", - "default" : 20 + "default" : 20, + "minimum" : 1 } }, { "name" : "sort", @@ -259,9 +259,9 @@ "description" : "Zero-based page index (0..N)", "required" : false, "schema" : { - "minimum" : 0, "type" : "integer", - "default" : 0 + "default" : 0, + "minimum" : 0 } }, { "name" : "size", @@ -269,9 +269,9 @@ "description" : "The size of the page to be returned", "required" : false, "schema" : { - "minimum" : 1, "type" : "integer", - "default" : 20 + "default" : 20, + "minimum" : 1 } }, { "name" : "sort", @@ -379,9 +379,9 @@ "description" : "Zero-based page index (0..N)", "required" : false, "schema" : { - "minimum" : 0, "type" : "integer", - "default" : 0 + "default" : 0, + "minimum" : 0 } }, { "name" : "size", @@ -389,9 +389,9 @@ "description" : "The size of the page to be returned", "required" : false, "schema" : { - "minimum" : 1, "type" : "integer", - "default" : 20 + "default" : 20, + "minimum" : 1 } }, { "name" : "sort", @@ -755,9 +755,9 @@ "description" : "Zero-based page index (0..N)", "required" : false, "schema" : { - "minimum" : 0, "type" : "integer", - "default" : 0 + "default" : 0, + "minimum" : 0 } }, { "name" : "size", @@ -765,9 +765,9 @@ "description" : "The size of the page to be returned", "required" : false, "schema" : { - "minimum" : 1, "type" : "integer", - "default" : 20 + "default" : 20, + "minimum" : 1 } }, { "name" : "sort", @@ -1356,6 +1356,87 @@ }, "components" : { "schemas" : { + "PaymentsReportingView" : { + "type" : "object", + "properties" : { + "ingestionFlowFileId" : { + "type" : "integer", + "format" : "int64" + }, + "organizationId" : { + "type" : "integer", + "format" : "int64" + }, + "iuf" : { + "type" : "string" + }, + "regulationUniqueIdentifier" : { + "type" : "string" + }, + "regulationDate" : { + "type" : "string", + "format" : "date" + }, + "flowDateTime" : { + "type" : "string", + "format" : "date-time" + }, + "totalPayments" : { + "type" : "integer", + "format" : "int64" + }, + "totalAmountCents" : { + "type" : "integer", + "format" : "int64" + }, + "_links" : { + "$ref" : "#/components/schemas/Links" + } + } + }, + "PageMetadata" : { + "type" : "object", + "properties" : { + "size" : { + "type" : "integer", + "format" : "int64" + }, + "totalElements" : { + "type" : "integer", + "format" : "int64" + }, + "totalPages" : { + "type" : "integer", + "format" : "int64" + }, + "number" : { + "type" : "integer", + "format" : "int64" + } + } + }, + "PagedModelPaymentsReportingView" : { + "type" : "object", + "properties" : { + "_embedded" : { + "type" : "object", + "properties" : { + "paymentsReportingViews" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PaymentsReportingView" + } + } + } + }, + "_links" : { + "$ref" : "#/components/schemas/Links" + }, + "page" : { + "$ref" : "#/components/schemas/PageMetadata" + } + } + }, "AbstractJsonSchemaPropertyObject" : { "type" : "object", "properties" : { @@ -1422,12 +1503,6 @@ } } }, - "Links" : { - "type" : "object", - "additionalProperties" : { - "$ref" : "#/components/schemas/Link" - } - }, "RepresentationModelObject" : { "type" : "object", "properties" : { @@ -1436,112 +1511,7 @@ } } }, - "Classification" : { - "required" : [ "label", "organizationId" ], - "type" : "object", - "properties" : { - "creationDate" : { - "type" : "string", - "format" : "date-time" - }, - "updateDate" : { - "type" : "string", - "format" : "date-time" - }, - "updateOperatorExternalId" : { - "type" : "string" - }, - "classificationId" : { - "type" : "integer", - "format" : "int64" - }, - "organizationId" : { - "type" : "integer", - "format" : "int64" - }, - "transferId" : { - "type" : "integer", - "format" : "int64" - }, - "paymentNotifyId" : { - "type" : "integer", - "format" : "int64" - }, - "paymentsReportingId" : { - "type" : "string" - }, - "treasuryId" : { - "type" : "string" - }, - "iuf" : { - "type" : "string" - }, - "iud" : { - "type" : "string" - }, - "iuv" : { - "type" : "string" - }, - "iur" : { - "type" : "string" - }, - "transferIndex" : { - "type" : "integer", - "format" : "int32" - }, - "label" : { - "type" : "string" - }, - "_links" : { - "$ref" : "#/components/schemas/Links" - } - } - }, - "PageMetadata" : { - "type" : "object", - "properties" : { - "size" : { - "type" : "integer", - "format" : "int64" - }, - "totalElements" : { - "type" : "integer", - "format" : "int64" - }, - "totalPages" : { - "type" : "integer", - "format" : "int64" - }, - "number" : { - "type" : "integer", - "format" : "int64" - } - } - }, - "PagedModelClassification" : { - "type" : "object", - "properties" : { - "_embedded" : { - "type" : "object", - "properties" : { - "classifications" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/Classification" - } - } - } - }, - "_links" : { - "$ref" : "#/components/schemas/Links" - }, - "page" : { - "$ref" : "#/components/schemas/PageMetadata" - } - } - }, "PaymentsReporting" : { - "required" : [ "acquiringDate", "amountPaidCents", "flowDateTime", "ingestionFlowFileId", "iuf", "iur", "iuv", "organizationId", "payDate", "paymentOutcomeCode", "pspIdentifier", "regulationDate", "regulationUniqueIdentifier", "senderPspCode", "senderPspType", "totalAmountCents", "totalPayments", "transferIndex" ], "type" : "object", "properties" : { "creationDate" : { @@ -1640,7 +1610,8 @@ "_links" : { "$ref" : "#/components/schemas/Links" } - } + }, + "required" : [ "acquiringDate", "amountPaidCents", "flowDateTime", "ingestionFlowFileId", "iuf", "iur", "iuv", "organizationId", "payDate", "paymentOutcomeCode", "pspIdentifier", "regulationDate", "regulationUniqueIdentifier", "senderPspCode", "senderPspType", "totalAmountCents", "totalPayments", "transferIndex" ] }, "PagedModelPaymentsReporting" : { "type" : "object", @@ -1684,7 +1655,6 @@ } }, "Treasury" : { - "required" : [ "billAmountCents", "billCode", "billDate", "billYear", "ingestionFlowFileId", "organizationId", "pspLastName" ], "type" : "object", "properties" : { "creationDate" : { @@ -1832,7 +1802,8 @@ "_links" : { "$ref" : "#/components/schemas/Links" } - } + }, + "required" : [ "billAmountCents", "billCode", "billDate", "billYear", "ingestionFlowFileId", "organizationId", "pspLastName" ] }, "PagedModelTreasury" : { "type" : "object", @@ -1856,10 +1827,21 @@ } } }, - "PaymentsReportingView" : { + "Classification" : { "type" : "object", "properties" : { - "ingestionFlowFileId" : { + "creationDate" : { + "type" : "string", + "format" : "date-time" + }, + "updateDate" : { + "type" : "string", + "format" : "date-time" + }, + "updateOperatorExternalId" : { + "type" : "string" + }, + "classificationId" : { "type" : "integer", "format" : "int64" }, @@ -1867,43 +1849,55 @@ "type" : "integer", "format" : "int64" }, + "transferId" : { + "type" : "integer", + "format" : "int64" + }, + "paymentNotifyId" : { + "type" : "integer", + "format" : "int64" + }, + "paymentsReportingId" : { + "type" : "string" + }, + "treasuryId" : { + "type" : "string" + }, "iuf" : { "type" : "string" }, - "regulationUniqueIdentifier" : { + "iud" : { "type" : "string" }, - "regulationDate" : { - "type" : "string", - "format" : "date" + "iuv" : { + "type" : "string" }, - "flowDateTime" : { - "type" : "string", - "format" : "date-time" + "iur" : { + "type" : "string" }, - "totalPayments" : { + "transferIndex" : { "type" : "integer", - "format" : "int64" + "format" : "int32" }, - "totalAmountCents" : { - "type" : "integer", - "format" : "int64" + "label" : { + "type" : "string" }, "_links" : { "$ref" : "#/components/schemas/Links" } - } + }, + "required" : [ "label", "organizationId" ] }, - "PagedModelPaymentsReportingView" : { + "PagedModelClassification" : { "type" : "object", "properties" : { "_embedded" : { "type" : "object", "properties" : { - "paymentsReportingViews" : { + "classifications" : { "type" : "array", "items" : { - "$ref" : "#/components/schemas/PaymentsReportingView" + "$ref" : "#/components/schemas/Classification" } } } @@ -1917,7 +1911,6 @@ } }, "ClassificationRequestBody" : { - "required" : [ "label", "organizationId" ], "type" : "object", "properties" : { "creationDate" : { @@ -1972,10 +1965,10 @@ "label" : { "type" : "string" } - } + }, + "required" : [ "label", "organizationId" ] }, "PaymentsReportingRequestBody" : { - "required" : [ "acquiringDate", "amountPaidCents", "flowDateTime", "ingestionFlowFileId", "iuf", "iur", "iuv", "organizationId", "payDate", "paymentOutcomeCode", "pspIdentifier", "regulationDate", "regulationUniqueIdentifier", "senderPspCode", "senderPspType", "totalAmountCents", "totalPayments", "transferIndex" ], "type" : "object", "properties" : { "creationDate" : { @@ -2071,10 +2064,10 @@ "bicCodePouringBank" : { "type" : "string" } - } + }, + "required" : [ "acquiringDate", "amountPaidCents", "flowDateTime", "ingestionFlowFileId", "iuf", "iur", "iuv", "organizationId", "payDate", "paymentOutcomeCode", "pspIdentifier", "regulationDate", "regulationUniqueIdentifier", "senderPspCode", "senderPspType", "totalAmountCents", "totalPayments", "transferIndex" ] }, "TreasuryRequestBody" : { - "required" : [ "billAmountCents", "billCode", "billDate", "billYear", "ingestionFlowFileId", "organizationId", "pspLastName" ], "type" : "object", "properties" : { "creationDate" : { @@ -2219,10 +2212,10 @@ "regularized" : { "type" : "boolean" } - } + }, + "required" : [ "billAmountCents", "billCode", "billDate", "billYear", "ingestionFlowFileId", "organizationId", "pspLastName" ] }, "ClassificationErrorDTO" : { - "required" : [ "code", "message" ], "type" : "object", "properties" : { "code" : { @@ -2232,7 +2225,8 @@ "message" : { "type" : "string" } - } + }, + "required" : [ "code", "message" ] }, "Link" : { "type" : "object", @@ -2262,6 +2256,12 @@ "type" : "boolean" } } + }, + "Links" : { + "type" : "object", + "additionalProperties" : { + "$ref" : "#/components/schemas/Link" + } } }, "securitySchemes" : { diff --git a/src/test/java/it/gov/pagopa/pu/classification/OpenApiGeneratorTest.java b/src/test/java/it/gov/pagopa/pu/classification/OpenApiGeneratorTest.java index 495d7f2..47e7b07 100644 --- a/src/test/java/it/gov/pagopa/pu/classification/OpenApiGeneratorTest.java +++ b/src/test/java/it/gov/pagopa/pu/classification/OpenApiGeneratorTest.java @@ -48,7 +48,7 @@ void generateAndVerifyCommit() throws Exception { .replace("\r", "") .replace("EntityModel", ""); - Assertions.assertTrue(openApiResult.startsWith("{\n \"openapi\" : \"3.0.")); + Assertions.assertTrue(openApiResult.startsWith("{\n \"openapi\" : \"3.")); Path openApiGeneratedPath = Path.of("openapi/generated.openapi.json"); boolean toStore=true;