diff --git a/openapi/openapi_external_v3.json b/openapi/openapi_external_v3.json index a55286c8..e860c3d4 100644 --- a/openapi/openapi_external_v3.json +++ b/openapi/openapi_external_v3.json @@ -9,12 +9,7 @@ "servers" : [ { "url" : "https://api.uat.platform.pagopa.it/gpd/debt-positions-service/v3", "description" : "GPD Test environment" - } ], - "tags" : [ { - "name" : "Debt Positions API: Installments and Payment Options Manager" - }, { - "name" : "Debt Position Actions API" - } ], + }], "paths" : { "/organizations/{organizationfiscalcode}/debtpositions/{iupd}" : { "get" : { @@ -41,8 +36,8 @@ } } ], "responses" : { - "500" : { - "description" : "Service unavailable.", + "401" : { + "description" : "Wrong or missing function key.", "headers" : { "X-Request-Id" : { "description" : "This header identifies the call", @@ -50,17 +45,10 @@ "type" : "string" } } - }, - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ProblemJson" - } - } } }, - "200" : { - "description" : "Obtained debt position details.", + "404" : { + "description" : "No debt position found.", "headers" : { "X-Request-Id" : { "description" : "This header identifies the call", @@ -72,13 +60,13 @@ "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/PaymentPositionModelResponseV3" + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "401" : { - "description" : "Wrong or missing function key.", + "500" : { + "description" : "Service unavailable.", "headers" : { "X-Request-Id" : { "description" : "This header identifies the call", @@ -86,10 +74,17 @@ "type" : "string" } } + }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" + } + } } }, - "404" : { - "description" : "No debt position found.", + "200" : { + "description" : "Obtained debt position details.", "headers" : { "X-Request-Id" : { "description" : "This header identifies the call", @@ -101,7 +96,7 @@ "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ProblemJson" + "$ref" : "#/components/schemas/PaymentPositionModelResponseV3" } } } @@ -151,8 +146,8 @@ "required" : true }, "responses" : { - "500" : { - "description" : "Service unavailable.", + "400" : { + "description" : "Malformed request.", "headers" : { "X-Request-Id" : { "description" : "This header identifies the call", @@ -169,8 +164,8 @@ } } }, - "400" : { - "description" : "Malformed request.", + "401" : { + "description" : "Wrong or missing function key.", "headers" : { "X-Request-Id" : { "description" : "This header identifies the call", @@ -178,17 +173,10 @@ "type" : "string" } } - }, - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ProblemJson" - } - } } }, - "200" : { - "description" : "Debt Position updated.", + "404" : { + "description" : "No debt position found.", "headers" : { "X-Request-Id" : { "description" : "This header identifies the call", @@ -200,13 +188,13 @@ "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/PaymentPositionModelV3" + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "401" : { - "description" : "Wrong or missing function key.", + "500" : { + "description" : "Service unavailable.", "headers" : { "X-Request-Id" : { "description" : "This header identifies the call", @@ -214,10 +202,17 @@ "type" : "string" } } + }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" + } + } } }, - "404" : { - "description" : "No debt position found.", + "200" : { + "description" : "Debt Position updated.", "headers" : { "X-Request-Id" : { "description" : "This header identifies the call", @@ -229,7 +224,7 @@ "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ProblemJson" + "$ref" : "#/components/schemas/PaymentPositionModelV3" } } } @@ -299,6 +294,17 @@ } } }, + "401" : { + "description" : "Wrong or missing function key.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" + } + } + } + }, "500" : { "description" : "Service unavailable.", "headers" : { @@ -335,17 +341,6 @@ } } }, - "401" : { - "description" : "Wrong or missing function key.", - "headers" : { - "X-Request-Id" : { - "description" : "This header identifies the call", - "schema" : { - "type" : "string" - } - } - } - }, "409" : { "description" : "Conflict: existing related payment found.", "headers" : { @@ -480,8 +475,8 @@ } } ], "responses" : { - "500" : { - "description" : "Service unavailable.", + "400" : { + "description" : "Malformed request.", "headers" : { "X-Request-Id" : { "description" : "This header identifies the call", @@ -498,6 +493,17 @@ } } }, + "401" : { + "description" : "Wrong or missing function key.", + "headers" : { + "X-Request-Id" : { + "description" : "This header identifies the call", + "schema" : { + "type" : "string" + } + } + } + }, "200" : { "description" : "Obtained all organization payment positions.", "headers" : { @@ -516,8 +522,8 @@ } } }, - "400" : { - "description" : "Malformed request.", + "500" : { + "description" : "Service unavailable.", "headers" : { "X-Request-Id" : { "description" : "This header identifies the call", @@ -534,17 +540,6 @@ } } }, - "401" : { - "description" : "Wrong or missing function key.", - "headers" : { - "X-Request-Id" : { - "description" : "This header identifies the call", - "schema" : { - "type" : "string" - } - } - } - }, "429" : { "description" : "Too many requests.", "headers" : { @@ -581,17 +576,7 @@ "type" : "boolean", "default" : false } - }, { - "name" : "serviceType", - "in" : "query", - "description" : "The field must not be considered as its value is set via the API Management (APIM) policy", - "required" : false, - "schema" : { - "type" : "string", - "default" : "GPD", - "enum" : [ "ACA", "WISP", "GPD" ] - } - } ], + }], "requestBody" : { "content" : { "application/json" : { @@ -603,8 +588,8 @@ "required" : true }, "responses" : { - "500" : { - "description" : "Service unavailable.", + "400" : { + "description" : "Malformed request.", "headers" : { "X-Request-Id" : { "description" : "This header identifies the call", @@ -621,8 +606,8 @@ } } }, - "400" : { - "description" : "Malformed request.", + "401" : { + "description" : "Wrong or missing function key.", "headers" : { "X-Request-Id" : { "description" : "This header identifies the call", @@ -630,17 +615,10 @@ "type" : "string" } } - }, - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ProblemJson" - } - } } }, - "401" : { - "description" : "Wrong or missing function key.", + "409" : { + "description" : "Conflict: duplicate debt position found.", "headers" : { "X-Request-Id" : { "description" : "This header identifies the call", @@ -648,10 +626,17 @@ "type" : "string" } } + }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" + } + } } }, - "201" : { - "description" : "Request created.", + "500" : { + "description" : "Service unavailable.", "headers" : { "X-Request-Id" : { "description" : "This header identifies the call", @@ -663,13 +648,13 @@ "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/PaymentPositionModelV3" + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "409" : { - "description" : "Conflict: duplicate debt position found.", + "201" : { + "description" : "Request created.", "headers" : { "X-Request-Id" : { "description" : "This header identifies the call", @@ -681,7 +666,7 @@ "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ProblemJson" + "$ref" : "#/components/schemas/PaymentPositionModelV3" } } } @@ -723,8 +708,8 @@ } } ], "responses" : { - "500" : { - "description" : "Service unavailable.", + "401" : { + "description" : "Wrong or missing function key.", "headers" : { "X-Request-Id" : { "description" : "This header identifies the call", @@ -732,17 +717,10 @@ "type" : "string" } } - }, - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ProblemJson" - } - } } }, - "401" : { - "description" : "Wrong or missing function key.", + "404" : { + "description" : "No debt position found.", "headers" : { "X-Request-Id" : { "description" : "This header identifies the call", @@ -750,10 +728,17 @@ "type" : "string" } } + }, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ProblemJson" + } + } } }, - "404" : { - "description" : "No debt position found.", + "409" : { + "description" : "Conflict: debt position is not in publishable state.", "headers" : { "X-Request-Id" : { "description" : "This header identifies the call", @@ -770,8 +755,8 @@ } } }, - "200" : { - "description" : "Request published.", + "500" : { + "description" : "Service unavailable.", "headers" : { "X-Request-Id" : { "description" : "This header identifies the call", @@ -783,13 +768,13 @@ "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/PaymentPositionModelV3" + "$ref" : "#/components/schemas/ProblemJson" } } } }, - "409" : { - "description" : "Conflict: debt position is not in publishable state.", + "200" : { + "description" : "Request published.", "headers" : { "X-Request-Id" : { "description" : "This header identifies the call", @@ -801,7 +786,7 @@ "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ProblemJson" + "$ref" : "#/components/schemas/PaymentPositionModelV3" } } } @@ -1002,7 +987,7 @@ "status" : { "type" : "string", "readOnly" : true, - "enum" : [ "DRAFT", "PUBLISHED", "VALID", "INVALID", "EXPIRED", "PARTIALLY_PAID", "PAID", "REPORTED" ] + "enum" : [ "DRAFT", "PUBLISHED", "VALID", "UNPAYABLE", "PARTIALLY_PAID", "PAID" ] }, "paymentOption" : { "type" : "array", @@ -1293,7 +1278,7 @@ }, "status" : { "type" : "string", - "enum" : [ "DRAFT", "PUBLISHED", "VALID", "INVALID", "EXPIRED", "PARTIALLY_PAID", "PAID", "REPORTED" ] + "enum" : [ "DRAFT", "PUBLISHED", "VALID", "UNPAYABLE", "PARTIALLY_PAID", "PAID" ] }, "lastUpdatedDate" : { "type" : "string", diff --git a/src/main/java/it/gov/pagopa/debtposition/model/v3/InstallmentModel.java b/src/main/java/it/gov/pagopa/debtposition/model/v3/InstallmentModel.java index 7ddc159c..7747df28 100644 --- a/src/main/java/it/gov/pagopa/debtposition/model/v3/InstallmentModel.java +++ b/src/main/java/it/gov/pagopa/debtposition/model/v3/InstallmentModel.java @@ -31,11 +31,13 @@ public class InstallmentModel implements Serializable { @NotNull(message = "due date is required") private LocalDateTime dueDate; @JsonProperty(access = JsonProperty.Access.READ_ONLY) + @Schema(accessMode = Schema.AccessMode.READ_ONLY) private long fee; @JsonProperty(access = JsonProperty.Access.READ_ONLY) @Schema(accessMode = Schema.AccessMode.READ_ONLY) private long notificationFee; @JsonProperty(access = JsonProperty.Access.READ_ONLY) + @Schema(accessMode = Schema.AccessMode.READ_ONLY) private InstallmentStatus status; @Valid diff --git a/src/main/java/it/gov/pagopa/debtposition/model/v3/PaymentPositionModelV3.java b/src/main/java/it/gov/pagopa/debtposition/model/v3/PaymentPositionModelV3.java index f2a795b3..13ca61aa 100644 --- a/src/main/java/it/gov/pagopa/debtposition/model/v3/PaymentPositionModelV3.java +++ b/src/main/java/it/gov/pagopa/debtposition/model/v3/PaymentPositionModelV3.java @@ -3,7 +3,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty.Access; import io.swagger.v3.oas.annotations.media.Schema; -import it.gov.pagopa.debtposition.model.enumeration.DebtPositionStatus; +import it.gov.pagopa.debtposition.model.enumeration.DebtPositionStatusV3; import lombok.Data; import lombok.NoArgsConstructor; @@ -28,9 +28,11 @@ public class PaymentPositionModelV3 implements Serializable { @Size(max = 140) // compliant to paForNode.xsd private String officeName; // es. Ufficio Tributi @JsonProperty(access = Access.READ_ONLY) + @Schema(accessMode = Schema.AccessMode.READ_ONLY) private LocalDateTime paymentDate; @JsonProperty(access = Access.READ_ONLY) - private DebtPositionStatus status; + @Schema(accessMode = Schema.AccessMode.READ_ONLY) + private DebtPositionStatusV3 status; @Valid private List<@Valid PaymentOptionModelV3> paymentOption = new ArrayList<>(); diff --git a/src/main/java/it/gov/pagopa/debtposition/model/v3/PaymentPositionsInfoV3.java b/src/main/java/it/gov/pagopa/debtposition/model/v3/PaymentPositionsInfoV3.java index ab38e647..90dbb866 100644 --- a/src/main/java/it/gov/pagopa/debtposition/model/v3/PaymentPositionsInfoV3.java +++ b/src/main/java/it/gov/pagopa/debtposition/model/v3/PaymentPositionsInfoV3.java @@ -33,5 +33,4 @@ public class PaymentPositionsInfoV3 { @NotNull @Valid private PageInfo pageInfo; - } diff --git a/src/main/java/it/gov/pagopa/debtposition/model/v3/response/PaymentPositionModelResponseV3.java b/src/main/java/it/gov/pagopa/debtposition/model/v3/response/PaymentPositionModelResponseV3.java index ac8894b4..bf7e1673 100644 --- a/src/main/java/it/gov/pagopa/debtposition/model/v3/response/PaymentPositionModelResponseV3.java +++ b/src/main/java/it/gov/pagopa/debtposition/model/v3/response/PaymentPositionModelResponseV3.java @@ -1,6 +1,6 @@ package it.gov.pagopa.debtposition.model.v3.response; -import it.gov.pagopa.debtposition.model.enumeration.DebtPositionStatus; +import it.gov.pagopa.debtposition.model.enumeration.DebtPositionStatusV3; import lombok.Data; import lombok.NoArgsConstructor; @@ -20,7 +20,7 @@ public class PaymentPositionModelResponseV3 implements Serializable { private LocalDateTime insertedDate; private LocalDateTime publishDate; private LocalDateTime paymentDate; - private DebtPositionStatus status; + private DebtPositionStatusV3 status; private LocalDateTime lastUpdatedDate; private List paymentOption = new ArrayList<>();