diff --git a/openapi/generated.openapi.json b/openapi/generated.openapi.json index de229324..2127f5e9 100644 --- a/openapi/generated.openapi.json +++ b/openapi/generated.openapi.json @@ -628,94 +628,6 @@ } } }, - "/crud/debt-position-types-with-count" : { - "get" : { - "tags" : [ "debt-position-type-with-count-entity-controller" ], - "description" : "get-debtpositiontypewithcount", - "operationId" : "crud-get-debtpositiontypewithcounts", - "parameters" : [ { - "name" : "page", - "in" : "query", - "description" : "Zero-based page index (0..N)", - "required" : false, - "schema" : { - "minimum" : 0, - "type" : "integer", - "default" : 0 - } - }, { - "name" : "size", - "in" : "query", - "description" : "The size of the page to be returned", - "required" : false, - "schema" : { - "minimum" : 1, - "type" : "integer", - "default" : 20 - } - }, { - "name" : "sort", - "in" : "query", - "description" : "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", - "required" : false, - "schema" : { - "type" : "array", - "items" : { - "type" : "string" - } - } - } ], - "responses" : { - "200" : { - "description" : "OK", - "content" : { - "application/hal+json" : { - "schema" : { - "$ref" : "#/components/schemas/PagedModelDebtPositionTypeWithCount" - } - }, - "application/x-spring-data-compact+json" : { - "schema" : { - "$ref" : "#/components/schemas/PagedModelDebtPositionTypeWithCount" - } - }, - "text/uri-list" : { - "schema" : { - "type" : "string" - } - } - } - } - } - }, - "post" : { - "tags" : [ "debt-position-type-with-count-entity-controller" ], - "description" : "create-debtpositiontypewithcount", - "operationId" : "crud-create-debtpositiontypewithcount", - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/DebtPositionTypeWithCountRequestBody" - } - } - }, - "required" : true - }, - "responses" : { - "201" : { - "description" : "Created", - "content" : { - "application/hal+json" : { - "schema" : { - "$ref" : "#/components/schemas/DebtPositionTypeWithCount" - } - } - } - } - } - } - }, "/crud/debt-position-types-with-count/search/findByBrokerId" : { "get" : { "tags" : [ "debt-position-type-with-count-search-controller" ], @@ -776,143 +688,6 @@ } } }, - "/crud/debt-position-types-with-count/{id}" : { - "get" : { - "tags" : [ "debt-position-type-with-count-entity-controller" ], - "description" : "get-debtpositiontypewithcount", - "operationId" : "crud-get-debtpositiontypewithcount", - "parameters" : [ { - "name" : "id", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "200" : { - "description" : "OK", - "content" : { - "application/hal+json" : { - "schema" : { - "$ref" : "#/components/schemas/DebtPositionTypeWithCount" - } - } - } - }, - "404" : { - "description" : "Not Found" - } - } - }, - "put" : { - "tags" : [ "debt-position-type-with-count-entity-controller" ], - "description" : "update-debtpositiontypewithcount", - "operationId" : "crud-update-debtpositiontypewithcount", - "parameters" : [ { - "name" : "id", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - } ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/DebtPositionTypeWithCountRequestBody" - } - } - }, - "required" : true - }, - "responses" : { - "200" : { - "description" : "OK", - "content" : { - "application/hal+json" : { - "schema" : { - "$ref" : "#/components/schemas/DebtPositionTypeWithCount" - } - } - } - }, - "201" : { - "description" : "Created", - "content" : { - "application/hal+json" : { - "schema" : { - "$ref" : "#/components/schemas/DebtPositionTypeWithCount" - } - } - } - }, - "204" : { - "description" : "No Content" - } - } - }, - "delete" : { - "tags" : [ "debt-position-type-with-count-entity-controller" ], - "description" : "delete-debtpositiontypewithcount", - "operationId" : "crud-delete-debtpositiontypewithcount", - "parameters" : [ { - "name" : "id", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "204" : { - "description" : "No Content" - }, - "404" : { - "description" : "Not Found" - } - } - }, - "patch" : { - "tags" : [ "debt-position-type-with-count-entity-controller" ], - "description" : "patch-debtpositiontypewithcount", - "operationId" : "crud-patch-debtpositiontypewithcount", - "parameters" : [ { - "name" : "id", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - } ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/DebtPositionTypeWithCountRequestBody" - } - } - }, - "required" : true - }, - "responses" : { - "200" : { - "description" : "OK", - "content" : { - "application/hal+json" : { - "schema" : { - "$ref" : "#/components/schemas/DebtPositionTypeWithCount" - } - } - } - }, - "204" : { - "description" : "No Content" - } - } - } - }, "/crud/debt-position-types/{id}" : { "get" : { "tags" : [ "debt-position-type-entity-controller" ], @@ -2614,34 +2389,6 @@ } } }, - "/crud/profile/debt-position-types-with-count" : { - "get" : { - "tags" : [ "profile-controller" ], - "operationId" : "crud-profile-debt-position-types-with-count", - "responses" : { - "200" : { - "description" : "OK", - "content" : { - "*/*" : { - "schema" : { - "type" : "string" - } - }, - "application/alps+json" : { - "schema" : { - "type" : "string" - } - }, - "application/schema+json" : { - "schema" : { - "$ref" : "#/components/schemas/JsonSchema" - } - } - } - } - } - } - }, "/crud/profile/debt-positions" : { "get" : { "tags" : [ "profile-controller" ], @@ -2870,34 +2617,147 @@ } } }, - "/crud/receipts/{id}" : { + "/crud/receipts-view/search/findReceiptsByFilters" : { "get" : { - "tags" : [ "receipt-no-pii-entity-controller" ], - "description" : "get-receiptnopii", - "operationId" : "crud-get-receiptnopii", + "tags" : [ "receipt-view-search-controller" ], + "operationId" : "crud-receipts-view-findReceiptsByFilters", "parameters" : [ { - "name" : "id", - "in" : "path", + "name" : "organizationId", + "in" : "query", "required" : true, "schema" : { "type" : "string" } - } ], - "responses" : { - "200" : { - "description" : "OK", - "content" : { - "application/hal+json" : { - "schema" : { - "$ref" : "#/components/schemas/ReceiptNoPII" - } - } - } - }, - "404" : { - "description" : "Not Found" + }, { + "name" : "receiptOrigin", + "in" : "query", + "required" : true, + "schema" : { + "type" : "string" } - } + }, { + "name" : "operatorExternalUserId", + "in" : "query", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "iuv", + "in" : "query", + "schema" : { + "type" : "string" + } + }, { + "name" : "iur", + "in" : "query", + "schema" : { + "type" : "string" + } + }, { + "name" : "iud", + "in" : "query", + "schema" : { + "type" : "string" + } + }, { + "name" : "debtPositionTypeOrgId", + "in" : "query", + "schema" : { + "type" : "integer", + "format" : "int64" + } + }, { + "name" : "fromDate", + "in" : "query", + "schema" : { + "type" : "string", + "format" : "date-time" + } + }, { + "name" : "toDate", + "in" : "query", + "schema" : { + "type" : "string", + "format" : "date-time" + } + }, { + "name" : "page", + "in" : "query", + "description" : "Zero-based page index (0..N)", + "required" : false, + "schema" : { + "minimum" : 0, + "type" : "integer", + "default" : 0 + } + }, { + "name" : "size", + "in" : "query", + "description" : "The size of the page to be returned", + "required" : false, + "schema" : { + "minimum" : 1, + "type" : "integer", + "default" : 20 + } + }, { + "name" : "sort", + "in" : "query", + "description" : "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "required" : false, + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "200" : { + "description" : "OK", + "content" : { + "application/hal+json" : { + "schema" : { + "$ref" : "#/components/schemas/PagedModelReceiptView" + } + } + } + }, + "404" : { + "description" : "Not Found" + } + } + } + }, + "/crud/receipts/{id}" : { + "get" : { + "tags" : [ "receipt-no-pii-entity-controller" ], + "description" : "get-receiptnopii", + "operationId" : "crud-get-receiptnopii", + "parameters" : [ { + "name" : "id", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "OK", + "content" : { + "application/hal+json" : { + "schema" : { + "$ref" : "#/components/schemas/ReceiptNoPII" + } + } + } + }, + "404" : { + "description" : "Not Found" + } + } }, "put" : { "tags" : [ "receipt-no-pii-entity-controller" ], @@ -3787,8 +3647,8 @@ } } }, - "DebtPositionType" : { - "required" : [ "brokerId", "code", "collectingReason", "description", "macroArea", "orgType", "serviceType", "taxonomyCode" ], + "InstallmentNoPII" : { + "required" : [ "amountCents", "debtorEntityType", "debtorFiscalCodeHash", "iud", "legacyPaymentMetadata", "paymentOptionId", "paymentTypeCode", "personalDataId", "remittanceInformation", "status" ], "type" : "object", "properties" : { "creationDate" : { @@ -3802,52 +3662,97 @@ "updateOperatorExternalId" : { "type" : "string" }, - "debtPositionTypeId" : { + "installmentId" : { "type" : "integer", "format" : "int64" }, - "brokerId" : { + "paymentOptionId" : { "type" : "integer", "format" : "int64" }, - "code" : { + "status" : { + "type" : "string", + "enum" : [ "TO_SYNC", "REPORTED", "PAID", "CANCELLED", "INVALID", "EXPIRED", "UNPAID", "DRAFT" ] + }, + "iupdPagopa" : { "type" : "string" }, - "description" : { + "iud" : { "type" : "string" }, - "orgType" : { + "iuv" : { "type" : "string" }, - "macroArea" : { + "iur" : { "type" : "string" }, - "serviceType" : { + "iuf" : { "type" : "string" }, - "collectingReason" : { + "nav" : { "type" : "string" }, - "taxonomyCode" : { + "dueDate" : { + "type" : "string", + "format" : "date-time" + }, + "paymentTypeCode" : { "type" : "string" }, - "flagAnonymousFiscalCode" : { - "type" : "boolean" + "amountCents" : { + "type" : "integer", + "format" : "int64" }, - "flagMandatoryDueDate" : { - "type" : "boolean" + "notificationFeeCents" : { + "type" : "integer", + "format" : "int64" }, - "flagNotifyIo" : { - "type" : "boolean" + "remittanceInformation" : { + "type" : "string" }, - "ioTemplateMessage" : { + "humanFriendlyRemittanceInformation" : { + "type" : "string" + }, + "balance" : { + "type" : "string" + }, + "legacyPaymentMetadata" : { "type" : "string" }, + "personalDataId" : { + "type" : "integer", + "format" : "int64" + }, + "debtorEntityType" : { + "type" : "string", + "enum" : [ "F", "G" ] + }, + "debtorFiscalCodeHash" : { + "type" : "string", + "format" : "byte" + }, + "syncStatus" : { + "$ref" : "#/components/schemas/InstallmentSyncStatus" + }, "_links" : { "$ref" : "#/components/schemas/Links" } } }, + "InstallmentSyncStatus" : { + "required" : [ "syncStatusFrom", "syncStatusTo" ], + "type" : "object", + "properties" : { + "syncStatusFrom" : { + "type" : "string", + "enum" : [ "TO_SYNC", "REPORTED", "PAID", "CANCELLED", "INVALID", "EXPIRED", "UNPAID", "DRAFT" ] + }, + "syncStatusTo" : { + "type" : "string", + "enum" : [ "TO_SYNC", "REPORTED", "PAID", "CANCELLED", "INVALID", "EXPIRED", "UNPAID", "DRAFT" ] + } + } + }, "PageMetadata" : { "type" : "object", "properties" : { @@ -3869,16 +3774,16 @@ } } }, - "PagedModelDebtPositionType" : { + "PagedModelInstallmentNoPII" : { "type" : "object", "properties" : { "_embedded" : { "type" : "object", "properties" : { - "debtPositionTypes" : { + "installmentNoPIIs" : { "type" : "array", "items" : { - "$ref" : "#/components/schemas/DebtPositionType" + "$ref" : "#/components/schemas/InstallmentNoPII" } } } @@ -3891,78 +3796,40 @@ } } }, - "Transfer" : { - "required" : [ "amountCents", "category", "installmentId", "orgFiscalCode", "remittanceInformation", "transferIndex" ], + "Stamp" : { "type" : "object", "properties" : { - "creationDate" : { - "type" : "string", - "format" : "date-time" - }, - "updateDate" : { - "type" : "string", - "format" : "date-time" - }, - "updateOperatorExternalId" : { - "type" : "string" - }, - "transferId" : { - "type" : "integer", - "format" : "int64" - }, - "installmentId" : { - "type" : "integer", - "format" : "int64" - }, - "orgFiscalCode" : { + "stampType" : { "type" : "string" }, - "orgName" : { + "stampHashDocument" : { "type" : "string" }, - "amountCents" : { - "type" : "integer", - "format" : "int64" - }, - "remittanceInformation" : { + "stampProvincialResidence" : { "type" : "string" - }, - "stamp" : { - "$ref" : "#/components/schemas/Stamp" - }, - "iban" : { - "type" : "string" - }, - "postalIban" : { - "type" : "string" - }, - "category" : { - "type" : "string" - }, - "transferIndex" : { - "type" : "integer", - "format" : "int32" + } + } + }, + "CollectionModelObject" : { + "type" : "object", + "properties" : { + "_embedded" : { + "type" : "object", + "properties" : { + "objects" : { + "type" : "array", + "items" : { + "type" : "object" + } + } + } }, "_links" : { "$ref" : "#/components/schemas/Links" } } }, - "Stamp" : { - "type" : "object", - "properties" : { - "stampType" : { - "type" : "string" - }, - "stampHashDocument" : { - "type" : "string" - }, - "stampProvincialResidence" : { - "type" : "string" - } - } - }, - "PagedModelTransfer" : { + "CollectionModelTransfer" : { "type" : "object", "properties" : { "_embedded" : { @@ -3971,21 +3838,18 @@ "transfers" : { "type" : "array", "items" : { - "$ref" : "#/components/schemas/Transfer" + "$ref" : "#/components/schemas/TransferResponse" } } } }, "_links" : { "$ref" : "#/components/schemas/Links" - }, - "page" : { - "$ref" : "#/components/schemas/PageMetadata" } } }, - "InstallmentNoPII" : { - "required" : [ "amountCents", "debtorEntityType", "debtorFiscalCodeHash", "iud", "legacyPaymentMetadata", "paymentOptionId", "paymentTypeCode", "personalDataId", "remittanceInformation", "status" ], + "Transfer" : { + "required" : [ "amountCents", "category", "installmentId", "orgFiscalCode", "remittanceInformation", "transferIndex" ], "type" : "object", "properties" : { "creationDate" : { @@ -3999,107 +3863,58 @@ "updateOperatorExternalId" : { "type" : "string" }, - "installmentId" : { + "transferId" : { "type" : "integer", "format" : "int64" }, - "paymentOptionId" : { + "installmentId" : { "type" : "integer", "format" : "int64" }, - "status" : { - "type" : "string", - "enum" : [ "TO_SYNC", "REPORTED", "PAID", "CANCELLED", "INVALID", "EXPIRED", "UNPAID", "DRAFT" ] - }, - "iupdPagopa" : { - "type" : "string" - }, - "iud" : { - "type" : "string" - }, - "iuv" : { - "type" : "string" - }, - "iur" : { - "type" : "string" - }, - "iuf" : { - "type" : "string" - }, - "nav" : { + "orgFiscalCode" : { "type" : "string" }, - "dueDate" : { - "type" : "string", - "format" : "date-time" - }, - "paymentTypeCode" : { + "orgName" : { "type" : "string" }, "amountCents" : { "type" : "integer", "format" : "int64" }, - "notificationFeeCents" : { - "type" : "integer", - "format" : "int64" - }, "remittanceInformation" : { "type" : "string" }, - "humanFriendlyRemittanceInformation" : { + "stamp" : { + "$ref" : "#/components/schemas/Stamp" + }, + "iban" : { "type" : "string" }, - "balance" : { + "postalIban" : { "type" : "string" }, - "legacyPaymentMetadata" : { + "category" : { "type" : "string" }, - "personalDataId" : { + "transferIndex" : { "type" : "integer", - "format" : "int64" - }, - "debtorEntityType" : { - "type" : "string", - "enum" : [ "F", "G" ] - }, - "debtorFiscalCodeHash" : { - "type" : "string", - "format" : "byte" - }, - "syncStatus" : { - "$ref" : "#/components/schemas/InstallmentSyncStatus" + "format" : "int32" }, "_links" : { "$ref" : "#/components/schemas/Links" } } }, - "InstallmentSyncStatus" : { - "required" : [ "syncStatusFrom", "syncStatusTo" ], - "type" : "object", - "properties" : { - "syncStatusFrom" : { - "type" : "string", - "enum" : [ "TO_SYNC", "REPORTED", "PAID", "CANCELLED", "INVALID", "EXPIRED", "UNPAID", "DRAFT" ] - }, - "syncStatusTo" : { - "type" : "string", - "enum" : [ "TO_SYNC", "REPORTED", "PAID", "CANCELLED", "INVALID", "EXPIRED", "UNPAID", "DRAFT" ] - } - } - }, - "PagedModelInstallmentNoPII" : { + "PagedModelTransfer" : { "type" : "object", "properties" : { "_embedded" : { "type" : "object", "properties" : { - "installmentNoPIIs" : { + "transfers" : { "type" : "array", "items" : { - "$ref" : "#/components/schemas/InstallmentNoPII" + "$ref" : "#/components/schemas/Transfer" } } } @@ -4112,46 +3927,61 @@ } } }, - "CollectionModelTransfer" : { + "DebtPositionTypeOrgOperators" : { + "required" : [ "debtPositionTypeOrgId", "operatorExternalUserId" ], "type" : "object", "properties" : { - "_embedded" : { - "type" : "object", - "properties" : { - "transfers" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/TransferResponse" - } - } - } + "creationDate" : { + "type" : "string", + "format" : "date-time" + }, + "updateDate" : { + "type" : "string", + "format" : "date-time" + }, + "updateOperatorExternalId" : { + "type" : "string" + }, + "debtPositionTypeOrgOperatorId" : { + "type" : "integer", + "format" : "int64" + }, + "debtPositionTypeOrgId" : { + "type" : "integer", + "format" : "int64" + }, + "operatorExternalUserId" : { + "type" : "string" }, "_links" : { "$ref" : "#/components/schemas/Links" } } }, - "CollectionModelObject" : { + "PagedModelDebtPositionTypeOrgOperators" : { "type" : "object", "properties" : { "_embedded" : { "type" : "object", "properties" : { - "objects" : { + "debtPositionTypeOrgOperatorses" : { "type" : "array", "items" : { - "type" : "object" + "$ref" : "#/components/schemas/DebtPositionTypeOrgOperators" } } } }, "_links" : { "$ref" : "#/components/schemas/Links" + }, + "page" : { + "$ref" : "#/components/schemas/PageMetadata" } } }, - "PaymentOption" : { - "required" : [ "debtPositionId", "description", "paymentOptionType", "status", "totalAmountCents" ], + "DebtPositionTypeOrg" : { + "required" : [ "code", "debtPositionTypeId", "description", "iban", "organizationId" ], "type" : "object", "properties" : { "creationDate" : { @@ -4165,51 +3995,102 @@ "updateOperatorExternalId" : { "type" : "string" }, - "paymentOptionId" : { + "debtPositionTypeOrgId" : { "type" : "integer", "format" : "int64" }, - "debtPositionId" : { + "debtPositionTypeId" : { "type" : "integer", "format" : "int64" }, - "totalAmountCents" : { + "organizationId" : { "type" : "integer", "format" : "int64" }, - "status" : { - "type" : "string", - "enum" : [ "TO_SYNC", "REPORTED", "PAID", "PARTIALLY_PAID", "CANCELLED", "INVALID", "EXPIRED", "UNPAID", "DRAFT" ] + "balance" : { + "type" : "string" }, - "multiDebtor" : { + "code" : { + "type" : "string" + }, + "description" : { + "type" : "string" + }, + "iban" : { + "type" : "string" + }, + "postalIban" : { + "type" : "string" + }, + "postalAccountCode" : { + "type" : "string" + }, + "holderPostalCc" : { + "type" : "string" + }, + "orgSector" : { + "type" : "string" + }, + "xsdDefinitionRef" : { + "type" : "string" + }, + "amountCents" : { + "type" : "integer", + "format" : "int64" + }, + "externalPaymentUrl" : { + "type" : "string" + }, + "flagAnonymousFiscalCode" : { "type" : "boolean" }, - "dueDate" : { - "type" : "string", - "format" : "date-time" + "flagMandatoryDueDate" : { + "type" : "boolean" }, - "description" : { + "flagSpontaneous" : { + "type" : "boolean" + }, + "flagNotifyIo" : { + "type" : "boolean" + }, + "ioTemplateMessage" : { "type" : "string" }, - "paymentOptionType" : { - "type" : "string", - "enum" : [ "SINGLE_INSTALLMENT", "INSTALLMENTS", "DOWN_PAYMENT" ] + "flagActive" : { + "type" : "boolean" + }, + "flagNotifyOutcomePush" : { + "type" : "boolean" + }, + "notifyOutcomePushOrgSilServiceId" : { + "type" : "integer", + "format" : "int64" + }, + "flagAmountActualization" : { + "type" : "boolean" + }, + "amountActualizationOrgSilServiceId" : { + "type" : "integer", + "format" : "int64" + }, + "flagExternal" : { + "type" : "boolean" }, "_links" : { "$ref" : "#/components/schemas/Links" } } }, - "PagedModelPaymentOption" : { + "PagedModelDebtPositionTypeOrg" : { "type" : "object", "properties" : { "_embedded" : { "type" : "object", "properties" : { - "paymentOptions" : { + "debtPositionTypeOrgs" : { "type" : "array", "items" : { - "$ref" : "#/components/schemas/PaymentOption" + "$ref" : "#/components/schemas/DebtPositionTypeOrg" } } } @@ -4222,27 +4103,8 @@ } } }, - "CollectionModelInstallmentNoPII" : { - "type" : "object", - "properties" : { - "_embedded" : { - "type" : "object", - "properties" : { - "installmentNoPIIs" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/InstallmentNoPIIResponse" - } - } - } - }, - "_links" : { - "$ref" : "#/components/schemas/Links" - } - } - }, - "DebtPositionTypeOrgOperators" : { - "required" : [ "debtPositionTypeOrgId", "operatorExternalUserId" ], + "DebtPositionType" : { + "required" : [ "brokerId", "code", "collectingReason", "description", "macroArea", "orgType", "serviceType", "taxonomyCode" ], "type" : "object", "properties" : { "creationDate" : { @@ -4256,15 +4118,45 @@ "updateOperatorExternalId" : { "type" : "string" }, - "debtPositionTypeOrgOperatorId" : { + "debtPositionTypeId" : { "type" : "integer", "format" : "int64" }, - "debtPositionTypeOrgId" : { + "brokerId" : { "type" : "integer", "format" : "int64" }, - "operatorExternalUserId" : { + "code" : { + "type" : "string" + }, + "description" : { + "type" : "string" + }, + "orgType" : { + "type" : "string" + }, + "macroArea" : { + "type" : "string" + }, + "serviceType" : { + "type" : "string" + }, + "collectingReason" : { + "type" : "string" + }, + "taxonomyCode" : { + "type" : "string" + }, + "flagAnonymousFiscalCode" : { + "type" : "boolean" + }, + "flagMandatoryDueDate" : { + "type" : "boolean" + }, + "flagNotifyIo" : { + "type" : "boolean" + }, + "ioTemplateMessage" : { "type" : "string" }, "_links" : { @@ -4272,16 +4164,16 @@ } } }, - "PagedModelDebtPositionTypeOrgOperators" : { + "PagedModelDebtPositionType" : { "type" : "object", "properties" : { "_embedded" : { "type" : "object", "properties" : { - "debtPositionTypeOrgOperatorses" : { + "debtPositionTypes" : { "type" : "array", "items" : { - "$ref" : "#/components/schemas/DebtPositionTypeOrgOperators" + "$ref" : "#/components/schemas/DebtPositionType" } } } @@ -4294,81 +4186,46 @@ } } }, - "DebtPosition" : { - "required" : [ "debtPositionOrigin", "debtPositionTypeOrgId", "iupdOrg", "organizationId", "status" ], + "DebtPositionTypeWithCount" : { "type" : "object", "properties" : { - "creationDate" : { - "type" : "string", - "format" : "date-time" - }, - "updateDate" : { - "type" : "string", - "format" : "date-time" - }, - "updateOperatorExternalId" : { - "type" : "string" - }, - "debtPositionId" : { + "debtPositionTypeId" : { "type" : "integer", "format" : "int64" }, - "iupdOrg" : { + "code" : { "type" : "string" }, "description" : { "type" : "string" }, - "status" : { - "type" : "string", - "enum" : [ "TO_SYNC", "REPORTED", "PAID", "PARTIALLY_PAID", "CANCELLED", "EXPIRED", "UNPAID", "DRAFT" ] - }, - "debtPositionOrigin" : { + "updateDate" : { "type" : "string", - "enum" : [ "ORDINARY", "SPONTANEOUS", "SECONDARY_ORG", "RECEIPT_FILE", "RECEIPT_PAGOPA", "REPORTING_PAGOPA" ] - }, - "ingestionFlowFileId" : { - "type" : "integer", - "format" : "int64" - }, - "ingestionFlowFileLineNumber" : { - "type" : "integer", - "format" : "int64" + "format" : "date-time" }, - "organizationId" : { + "activeOrganizations" : { "type" : "integer", - "format" : "int64" + "format" : "int32" }, - "debtPositionTypeOrgId" : { + "brokerId" : { "type" : "integer", "format" : "int64" }, - "notificationDate" : { - "type" : "string", - "format" : "date-time" - }, - "validityDate" : { - "type" : "string", - "format" : "date-time" - }, - "flagIuvVolatile" : { - "type" : "boolean" - }, "_links" : { "$ref" : "#/components/schemas/Links" } } }, - "PagedModelDebtPosition" : { + "PagedModelDebtPositionTypeWithCount" : { "type" : "object", "properties" : { "_embedded" : { "type" : "object", "properties" : { - "debtPositions" : { + "debtPositionTypeWithCounts" : { "type" : "array", "items" : { - "$ref" : "#/components/schemas/DebtPosition" + "$ref" : "#/components/schemas/DebtPositionTypeWithCount" } } } @@ -4381,27 +4238,8 @@ } } }, - "CollectionModelPaymentOption" : { - "type" : "object", - "properties" : { - "_embedded" : { - "type" : "object", - "properties" : { - "paymentOptions" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/PaymentOptionResponse" - } - } - } - }, - "_links" : { - "$ref" : "#/components/schemas/Links" - } - } - }, - "DebtPositionTypeOrg" : { - "required" : [ "code", "debtPositionTypeId", "description", "iban", "organizationId" ], + "ReceiptNoPII" : { + "required" : [ "channelDescription", "companyName", "creditorReferenceId", "debtorEntityType", "debtorFiscalCodeHash", "description", "idChannel", "idPsp", "noticeNumber", "orgFiscalCode", "outcome", "paymentAmountCents", "paymentReceiptId", "personalDataId", "pspCompanyName", "receiptOrigin" ], "type" : "object", "properties" : { "creationDate" : { @@ -4415,102 +4253,119 @@ "updateOperatorExternalId" : { "type" : "string" }, - "debtPositionTypeOrgId" : { + "receiptId" : { "type" : "integer", "format" : "int64" }, - "debtPositionTypeId" : { + "installmentId" : { "type" : "integer", "format" : "int64" }, - "organizationId" : { + "ingestionFlowFileId" : { "type" : "integer", "format" : "int64" }, - "balance" : { + "receiptOrigin" : { "type" : "string" }, - "code" : { + "paymentReceiptId" : { "type" : "string" }, - "description" : { + "noticeNumber" : { "type" : "string" }, - "iban" : { + "paymentNote" : { "type" : "string" }, - "postalIban" : { + "orgFiscalCode" : { "type" : "string" }, - "postalAccountCode" : { + "outcome" : { "type" : "string" }, - "holderPostalCc" : { + "creditorReferenceId" : { "type" : "string" }, - "orgSector" : { - "type" : "string" + "paymentAmountCents" : { + "type" : "integer", + "format" : "int64" }, - "xsdDefinitionRef" : { + "description" : { "type" : "string" }, - "amountCents" : { - "type" : "integer", - "format" : "int64" + "companyName" : { + "type" : "string" }, - "externalPaymentUrl" : { + "officeName" : { "type" : "string" }, - "flagAnonymousFiscalCode" : { - "type" : "boolean" + "idPsp" : { + "type" : "string" }, - "flagMandatoryDueDate" : { - "type" : "boolean" + "pspFiscalCode" : { + "type" : "string" }, - "flagSpontaneous" : { - "type" : "boolean" + "pspPartitaIva" : { + "type" : "string" }, - "flagNotifyIo" : { - "type" : "boolean" + "pspCompanyName" : { + "type" : "string" }, - "ioTemplateMessage" : { + "idChannel" : { "type" : "string" }, - "flagActive" : { - "type" : "boolean" + "channelDescription" : { + "type" : "string" }, - "flagNotifyOutcomePush" : { - "type" : "boolean" + "paymentMethod" : { + "type" : "string" }, - "notifyOutcomePushOrgSilServiceId" : { + "feeCents" : { "type" : "integer", "format" : "int64" }, - "flagAmountActualization" : { + "paymentDateTime" : { + "type" : "string", + "format" : "date-time" + }, + "applicationDate" : { + "type" : "string", + "format" : "date-time" + }, + "transferDate" : { + "type" : "string", + "format" : "date-time" + }, + "standin" : { "type" : "boolean" }, - "amountActualizationOrgSilServiceId" : { + "debtorEntityType" : { + "type" : "string", + "enum" : [ "F", "G" ] + }, + "personalDataId" : { "type" : "integer", "format" : "int64" }, - "flagExternal" : { - "type" : "boolean" + "debtorFiscalCodeHash" : { + "type" : "string", + "format" : "byte" }, "_links" : { "$ref" : "#/components/schemas/Links" } } }, - "PagedModelDebtPositionTypeOrg" : { + "PagedModelReceiptNoPII" : { "type" : "object", "properties" : { "_embedded" : { "type" : "object", "properties" : { - "debtPositionTypeOrgs" : { + "receiptNoPIIs" : { "type" : "array", "items" : { - "$ref" : "#/components/schemas/DebtPositionTypeOrg" + "$ref" : "#/components/schemas/ReceiptNoPII" } } } @@ -4523,46 +4378,49 @@ } } }, - "DebtPositionTypeWithCount" : { + "ReceiptView" : { "type" : "object", "properties" : { - "debtPositionTypeId" : { + "receiptId" : { "type" : "integer", "format" : "int64" }, - "code" : { - "type" : "string" - }, - "description" : { - "type" : "string" + "paymentAmountCents" : { + "type" : "integer", + "format" : "int64" }, - "updateDate" : { + "paymentDateTime" : { "type" : "string", "format" : "date-time" }, - "activeOrganizations" : { - "type" : "integer", - "format" : "int32" - }, - "brokerId" : { + "installmentId" : { "type" : "integer", "format" : "int64" }, + "receiptOrigin" : { + "type" : "string" + }, + "iuv" : { + "type" : "string" + }, + "description" : { + "type" : "string" + }, "_links" : { "$ref" : "#/components/schemas/Links" } } }, - "PagedModelDebtPositionTypeWithCount" : { + "PagedModelReceiptView" : { "type" : "object", "properties" : { "_embedded" : { "type" : "object", "properties" : { - "debtPositionTypeWithCounts" : { + "receiptViews" : { "type" : "array", "items" : { - "$ref" : "#/components/schemas/DebtPositionTypeWithCount" + "$ref" : "#/components/schemas/ReceiptView" } } } @@ -4575,8 +4433,8 @@ } } }, - "ReceiptNoPII" : { - "required" : [ "channelDescription", "companyName", "creditorReferenceId", "debtorEntityType", "debtorFiscalCodeHash", "description", "idChannel", "idPsp", "noticeNumber", "orgFiscalCode", "outcome", "paymentAmountCents", "paymentReceiptId", "personalDataId", "pspCompanyName", "receiptOrigin" ], + "PaymentOption" : { + "required" : [ "debtPositionId", "description", "paymentOptionType", "status", "totalAmountCents" ], "type" : "object", "properties" : { "creationDate" : { @@ -4590,119 +4448,157 @@ "updateOperatorExternalId" : { "type" : "string" }, - "receiptId" : { + "paymentOptionId" : { "type" : "integer", "format" : "int64" }, - "installmentId" : { + "debtPositionId" : { "type" : "integer", "format" : "int64" }, - "ingestionFlowFileId" : { + "totalAmountCents" : { "type" : "integer", "format" : "int64" }, - "receiptOrigin" : { - "type" : "string" + "status" : { + "type" : "string", + "enum" : [ "TO_SYNC", "REPORTED", "PAID", "PARTIALLY_PAID", "CANCELLED", "INVALID", "EXPIRED", "UNPAID", "DRAFT" ] }, - "paymentReceiptId" : { - "type" : "string" + "multiDebtor" : { + "type" : "boolean" }, - "noticeNumber" : { - "type" : "string" + "dueDate" : { + "type" : "string", + "format" : "date-time" }, - "paymentNote" : { + "description" : { "type" : "string" }, - "orgFiscalCode" : { - "type" : "string" + "paymentOptionType" : { + "type" : "string", + "enum" : [ "SINGLE_INSTALLMENT", "INSTALLMENTS", "DOWN_PAYMENT" ] }, - "outcome" : { - "type" : "string" + "_links" : { + "$ref" : "#/components/schemas/Links" + } + } + }, + "PagedModelPaymentOption" : { + "type" : "object", + "properties" : { + "_embedded" : { + "type" : "object", + "properties" : { + "paymentOptions" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PaymentOption" + } + } + } }, - "creditorReferenceId" : { - "type" : "string" + "_links" : { + "$ref" : "#/components/schemas/Links" }, - "paymentAmountCents" : { - "type" : "integer", - "format" : "int64" + "page" : { + "$ref" : "#/components/schemas/PageMetadata" + } + } + }, + "CollectionModelInstallmentNoPII" : { + "type" : "object", + "properties" : { + "_embedded" : { + "type" : "object", + "properties" : { + "installmentNoPIIs" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/InstallmentNoPIIResponse" + } + } + } }, - "description" : { - "type" : "string" + "_links" : { + "$ref" : "#/components/schemas/Links" + } + } + }, + "DebtPosition" : { + "required" : [ "debtPositionOrigin", "debtPositionTypeOrgId", "iupdOrg", "organizationId", "status" ], + "type" : "object", + "properties" : { + "creationDate" : { + "type" : "string", + "format" : "date-time" }, - "companyName" : { - "type" : "string" + "updateDate" : { + "type" : "string", + "format" : "date-time" }, - "officeName" : { + "updateOperatorExternalId" : { "type" : "string" }, - "idPsp" : { - "type" : "string" + "debtPositionId" : { + "type" : "integer", + "format" : "int64" }, - "pspFiscalCode" : { + "iupdOrg" : { "type" : "string" }, - "pspPartitaIva" : { + "description" : { "type" : "string" }, - "pspCompanyName" : { - "type" : "string" + "status" : { + "type" : "string", + "enum" : [ "TO_SYNC", "REPORTED", "PAID", "PARTIALLY_PAID", "CANCELLED", "EXPIRED", "UNPAID", "DRAFT" ] }, - "idChannel" : { - "type" : "string" + "debtPositionOrigin" : { + "type" : "string", + "enum" : [ "ORDINARY", "SPONTANEOUS", "SECONDARY_ORG", "RECEIPT_FILE", "RECEIPT_PAGOPA", "REPORTING_PAGOPA" ] }, - "channelDescription" : { - "type" : "string" + "ingestionFlowFileId" : { + "type" : "integer", + "format" : "int64" }, - "paymentMethod" : { - "type" : "string" + "ingestionFlowFileLineNumber" : { + "type" : "integer", + "format" : "int64" }, - "feeCents" : { + "organizationId" : { "type" : "integer", "format" : "int64" }, - "paymentDateTime" : { - "type" : "string", - "format" : "date-time" + "debtPositionTypeOrgId" : { + "type" : "integer", + "format" : "int64" }, - "applicationDate" : { + "notificationDate" : { "type" : "string", "format" : "date-time" }, - "transferDate" : { + "validityDate" : { "type" : "string", "format" : "date-time" }, - "standin" : { + "flagIuvVolatile" : { "type" : "boolean" }, - "debtorEntityType" : { - "type" : "string", - "enum" : [ "F", "G" ] - }, - "personalDataId" : { - "type" : "integer", - "format" : "int64" - }, - "debtorFiscalCodeHash" : { - "type" : "string", - "format" : "byte" - }, "_links" : { "$ref" : "#/components/schemas/Links" } } }, - "PagedModelReceiptNoPII" : { + "PagedModelDebtPosition" : { "type" : "object", "properties" : { "_embedded" : { "type" : "object", "properties" : { - "receiptNoPIIs" : { + "debtPositions" : { "type" : "array", "items" : { - "$ref" : "#/components/schemas/ReceiptNoPII" + "$ref" : "#/components/schemas/DebtPosition" } } } @@ -4715,6 +4611,25 @@ } } }, + "CollectionModelPaymentOption" : { + "type" : "object", + "properties" : { + "_embedded" : { + "type" : "object", + "properties" : { + "paymentOptions" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PaymentOptionResponse" + } + } + } + }, + "_links" : { + "$ref" : "#/components/schemas/Links" + } + } + }, "DebtPositionTypeOrgOperatorsRequestBody" : { "required" : [ "debtPositionTypeOrgId", "operatorExternalUserId" ], "type" : "object", @@ -4899,33 +4814,6 @@ } } }, - "DebtPositionTypeWithCountRequestBody" : { - "type" : "object", - "properties" : { - "debtPositionTypeId" : { - "type" : "integer", - "format" : "int64" - }, - "code" : { - "type" : "string" - }, - "description" : { - "type" : "string" - }, - "updateDate" : { - "type" : "string", - "format" : "date-time" - }, - "activeOrganizations" : { - "type" : "integer", - "format" : "int32" - }, - "brokerId" : { - "type" : "integer", - "format" : "int64" - } - } - }, "DebtPositionRequestBody" : { "required" : [ "debtPositionOrigin", "debtPositionTypeOrgId", "iupdOrg", "organizationId", "status" ], "type" : "object", diff --git a/src/main/java/it/gov/pagopa/pu/debtpositions/model/debtpositiontype/DebtPositionTypeWithCount.java b/src/main/java/it/gov/pagopa/pu/debtpositions/model/view/debtpositiontype/DebtPositionTypeWithCount.java similarity index 94% rename from src/main/java/it/gov/pagopa/pu/debtpositions/model/debtpositiontype/DebtPositionTypeWithCount.java rename to src/main/java/it/gov/pagopa/pu/debtpositions/model/view/debtpositiontype/DebtPositionTypeWithCount.java index e4932ecb..1b09adc9 100644 --- a/src/main/java/it/gov/pagopa/pu/debtpositions/model/debtpositiontype/DebtPositionTypeWithCount.java +++ b/src/main/java/it/gov/pagopa/pu/debtpositions/model/view/debtpositiontype/DebtPositionTypeWithCount.java @@ -1,4 +1,4 @@ -package it.gov.pagopa.pu.debtpositions.model.debtpositiontype; +package it.gov.pagopa.pu.debtpositions.model.view.debtpositiontype; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import it.gov.pagopa.pu.debtpositions.config.json.LocalDateTimeToOffsetDateTimeSerializer; diff --git a/src/main/java/it/gov/pagopa/pu/debtpositions/model/view/receipt/ReceiptView.java b/src/main/java/it/gov/pagopa/pu/debtpositions/model/view/receipt/ReceiptView.java new file mode 100644 index 00000000..1b0f15ae --- /dev/null +++ b/src/main/java/it/gov/pagopa/pu/debtpositions/model/view/receipt/ReceiptView.java @@ -0,0 +1,31 @@ +package it.gov.pagopa.pu.debtpositions.model.view.receipt; + +import jakarta.persistence.Entity; +import jakarta.persistence.Id; +import jakarta.persistence.Table; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.time.OffsetDateTime; + +@Entity +@Table(name = "receipt") +@Data +@AllArgsConstructor +@NoArgsConstructor +@EqualsAndHashCode(callSuper = false) +public class ReceiptView implements Serializable { + + @Id + private Long receiptId; + private Long paymentAmountCents; + private OffsetDateTime paymentDateTime; + private Long installmentId; + private String receiptOrigin; + private String iuv; + private String description; + +} diff --git a/src/main/java/it/gov/pagopa/pu/debtpositions/repository/debtpositiontype/DebtPositionTypeWithCountRepository.java b/src/main/java/it/gov/pagopa/pu/debtpositions/repository/view/debtpositiontype/DebtPositionTypeWithCountRepository.java similarity index 51% rename from src/main/java/it/gov/pagopa/pu/debtpositions/repository/debtpositiontype/DebtPositionTypeWithCountRepository.java rename to src/main/java/it/gov/pagopa/pu/debtpositions/repository/view/debtpositiontype/DebtPositionTypeWithCountRepository.java index 048c3fab..608fb2a7 100644 --- a/src/main/java/it/gov/pagopa/pu/debtpositions/repository/debtpositiontype/DebtPositionTypeWithCountRepository.java +++ b/src/main/java/it/gov/pagopa/pu/debtpositions/repository/view/debtpositiontype/DebtPositionTypeWithCountRepository.java @@ -1,17 +1,19 @@ -package it.gov.pagopa.pu.debtpositions.repository.debtpositiontype; +package it.gov.pagopa.pu.debtpositions.repository.view.debtpositiontype; -import it.gov.pagopa.pu.debtpositions.model.debtpositiontype.DebtPositionTypeWithCount; +import it.gov.pagopa.pu.debtpositions.model.view.debtpositiontype.DebtPositionTypeWithCount; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; -import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.Repository; import org.springframework.data.repository.query.Param; import org.springframework.data.rest.core.annotation.RepositoryRestResource; @RepositoryRestResource(path = "debt-position-types-with-count") -public interface DebtPositionTypeWithCountRepository extends JpaRepository { +public interface DebtPositionTypeWithCountRepository extends Repository { + @Query(value = "SELECT d " + "FROM DebtPositionTypeWithCount d " + "WHERE d.brokerId = :brokerId ") - Page findByBrokerId(@Param("brokerId") Long brokerId, Pageable pageable); + Page findByBrokerId(@Param("brokerId") Long brokerId, Pageable pageable); + } diff --git a/src/main/java/it/gov/pagopa/pu/debtpositions/repository/view/receipt/ReceiptViewRepository.java b/src/main/java/it/gov/pagopa/pu/debtpositions/repository/view/receipt/ReceiptViewRepository.java new file mode 100644 index 00000000..131ec103 --- /dev/null +++ b/src/main/java/it/gov/pagopa/pu/debtpositions/repository/view/receipt/ReceiptViewRepository.java @@ -0,0 +1,47 @@ +package it.gov.pagopa.pu.debtpositions.repository.view.receipt; + +import io.swagger.v3.oas.annotations.Parameter; +import it.gov.pagopa.pu.debtpositions.model.view.receipt.ReceiptView; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.Repository; +import org.springframework.data.repository.query.Param; +import org.springframework.data.rest.core.annotation.RepositoryRestResource; + +import java.time.OffsetDateTime; + +@RepositoryRestResource(path = "receipts-view") +public interface ReceiptViewRepository extends Repository { + + @SuppressWarnings("squid:S107") // Suppressing too many parameters warning: it's allowed in query methods + @Query(value = "SELECT new ReceiptView(r.receiptId as receiptId, r.paymentAmountCents as paymentAmountCents,r.paymentDateTime as paymentDateTime, i.installmentId as installmentId, r.receiptOrigin as receiptOrigin,i.iuv as iuv, dp.description as description) " + + "FROM ReceiptView r " + + "JOIN InstallmentNoPII i ON r.installmentId = i.installmentId " + + "JOIN PaymentOption po ON i.paymentOptionId = po.paymentOptionId " + + "JOIN DebtPosition dp ON po.debtPositionId = dp.debtPositionId " + + "JOIN DebtPositionTypeOrg dpto ON dp.debtPositionTypeOrgId = dpto.debtPositionTypeOrgId " + + "JOIN DebtPositionTypeOrgOperators dptoo ON dpto.debtPositionTypeOrgId = dptoo.debtPositionTypeOrgId " + + "WHERE dp.organizationId = :organizationId " + + "AND dptoo.operatorExternalUserId = :operatorExternalUserId " + + "AND r.receiptOrigin = :receiptOrigin " + + "AND (:iuv IS NULL OR i.iuv = :iuv) " + + "AND (:iur IS NULL OR i.iur = :iur) " + + "AND (:iud IS NULL OR i.iud = :iud) " + + "AND (:debtPositionTypeOrgId IS NULL OR dp.debtPositionTypeOrgId = :debtPositionTypeOrgId) " + + "AND ((cast(:fromDate as date) IS NULL AND cast(:toDate as date) IS NULL) " + + "OR (cast(:fromDate as date) IS NOT NULL AND cast(:toDate as date) IS NOT NULL " + + "AND r.paymentDateTime BETWEEN :fromDate AND :toDate))") + Page findReceiptsByFilters( + @Parameter(required = true) @Param("organizationId") Long organizationId, + @Parameter(required = true) @Param("receiptOrigin") String receiptOrigin, + @Parameter(required = true) @Param("operatorExternalUserId") String operatorExternalUserId, + @Param("iuv") String iuv, + @Param("iur") String iur, + @Param("iud") String iud, + @Param("debtPositionTypeOrgId") Long debtPositionTypeOrgId, + @Param("fromDate") OffsetDateTime fromDate, + @Param("toDate") OffsetDateTime toDate, + Pageable pageable); + +}