diff --git a/app/src/main/resources/swagger/api-docs.json b/app/src/main/resources/swagger/api-docs.json index d2dc53843..55a042f05 100644 --- a/app/src/main/resources/swagger/api-docs.json +++ b/app/src/main/resources/swagger/api-docs.json @@ -595,6 +595,64 @@ "schema" : { "type" : "string" } + }, { + "name" : "search", + "in" : "query", + "description" : "Institution's name to search", + "required" : false, + "style" : "form", + "schema" : { + "type" : "string" + } + }, { + "name" : "taxCode", + "in" : "query", + "description" : "Institution's tax code", + "required" : false, + "style" : "form", + "schema" : { + "type" : "string" + } + }, { + "name" : "mode", + "in" : "query", + "description" : "Mode (full or normal) to retrieve institution's delegations", + "required" : false, + "style" : "form", + "schema" : { + "type" : "string", + "enum" : [ "FULL", "NORMAL" ] + } + }, { + "name" : "order", + "in" : "query", + "description" : "Order to show response NONE, ASC, DESC", + "required" : false, + "style" : "form", + "schema" : { + "type" : "string", + "enum" : [ "ASC", "DESC", "NONE" ] + } + }, { + "name" : "page", + "in" : "query", + "description" : "page", + "required" : false, + "style" : "form", + "schema" : { + "type" : "integer", + "format" : "int32" + } + }, { + "name" : "size", + "in" : "query", + "description" : "size", + "required" : false, + "style" : "form", + "schema" : { + "type" : "integer", + "format" : "int32" + } } ], "responses" : { "200" : { @@ -1747,194 +1805,6 @@ } ] } }, - "/v1/onboarding-requests/approve/{tokenId}" : { - "post" : { - "tags" : [ "onboarding" ], - "summary" : "approveOnboardingRequest", - "description" : "Service to approve a specific onboarding request", - "operationId" : "approveOnboardingRequestUsingPOST", - "parameters" : [ { - "name" : "tokenId", - "in" : "path", - "description" : "Onboarding request's unique identifier", - "required" : true, - "style" : "simple", - "schema" : { - "type" : "string", - "format" : "uuid" - } - } ], - "responses" : { - "200" : { - "description" : "OK" - }, - "400" : { - "description" : "Bad Request", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "401" : { - "description" : "Unauthorized", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "500" : { - "description" : "Internal Server Error", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "security" : [ { - "bearerAuth" : [ "global" ] - } ] - } - }, - "/v1/onboarding-requests/reject/{tokenId}" : { - "delete" : { - "tags" : [ "onboarding" ], - "summary" : "rejectOnboardingRequest", - "description" : "Service to reject a specific onboarding request", - "operationId" : "rejectOnboardingRequestUsingDELETE", - "parameters" : [ { - "name" : "tokenId", - "in" : "path", - "description" : "Onboarding request's unique identifier", - "required" : true, - "style" : "simple", - "schema" : { - "type" : "string", - "format" : "uuid" - } - } ], - "responses" : { - "200" : { - "description" : "OK" - }, - "400" : { - "description" : "Bad Request", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "401" : { - "description" : "Unauthorized", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "500" : { - "description" : "Internal Server Error", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "security" : [ { - "bearerAuth" : [ "global" ] - } ] - } - }, - "/v1/onboarding-requests/{tokenId}" : { - "get" : { - "tags" : [ "onboarding" ], - "summary" : "retrieveOnboardingRequest", - "description" : "Service to retrieve a specific onboarding request", - "operationId" : "retrieveOnboardingRequestUsingGET", - "parameters" : [ { - "name" : "tokenId", - "in" : "path", - "description" : "Onboarding request's unique identifier", - "required" : true, - "style" : "simple", - "schema" : { - "type" : "string", - "format" : "uuid" - } - } ], - "responses" : { - "200" : { - "description" : "OK", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/OnboardingRequestResource" - } - } - } - }, - "400" : { - "description" : "Bad Request", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "401" : { - "description" : "Unauthorized", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "404" : { - "description" : "Not Found", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "500" : { - "description" : "Internal Server Error", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "security" : [ { - "bearerAuth" : [ "global" ] - } ] - } - }, "/v1/pnPGInstitutions/{institutionId}/products" : { "get" : { "tags" : [ "pnPGInstitutions" ], @@ -5375,52 +5245,6 @@ }, "components" : { "schemas" : { - "AdditionalInformations" : { - "title" : "AdditionalInformations", - "type" : "object", - "properties" : { - "agentOfPublicService" : { - "type" : "boolean", - "description" : "The institution is an agent of a public service", - "example" : false - }, - "agentOfPublicServiceNote" : { - "type" : "string", - "description" : "agentOfPublicService Note" - }, - "belongRegulatedMarket" : { - "type" : "boolean", - "description" : "The institution belongs to a regulated market", - "example" : false - }, - "establishedByRegulatoryProvision" : { - "type" : "boolean", - "description" : "The institution is a company established by a regulatory provision", - "example" : false - }, - "establishedByRegulatoryProvisionNote" : { - "type" : "string", - "description" : "establishedByRegulatoryProvision Note" - }, - "ipa" : { - "type" : "boolean", - "description" : "The institution is registered on IPA", - "example" : false - }, - "ipaCode" : { - "type" : "string", - "description" : "IPA code" - }, - "otherNote" : { - "type" : "string", - "description" : "Other note" - }, - "regulatedMarketNote" : { - "type" : "string", - "description" : "regulatedMarket Note" - } - } - }, "Attribute" : { "title" : "Attribute", "type" : "object", @@ -5652,29 +5476,6 @@ } } }, - "DpoData" : { - "title" : "DpoData", - "required" : [ "address", "email", "pec" ], - "type" : "object", - "properties" : { - "address" : { - "type" : "string", - "description" : "DPO's address" - }, - "email" : { - "type" : "string", - "description" : "DPO's email", - "format" : "email", - "example" : "email@example.com" - }, - "pec" : { - "type" : "string", - "description" : "DPO's PEC", - "format" : "email", - "example" : "email@example.com" - } - } - }, "GeographicTaxonomy" : { "title" : "GeographicTaxonomy", "type" : "object", @@ -5861,74 +5662,6 @@ } } }, - "InstitutionInfo" : { - "title" : "InstitutionInfo", - "required" : [ "address", "fiscalCode", "institutionType", "mailAddress", "name", "vatNumber", "zipCode" ], - "type" : "object", - "properties" : { - "additionalInformations" : { - "description" : "Institution's additional informations", - "$ref" : "#/components/schemas/AdditionalInformations" - }, - "address" : { - "type" : "string", - "description" : "Institution's physical address" - }, - "city" : { - "type" : "string", - "description" : "Institution's city" - }, - "country" : { - "type" : "string", - "description" : "Institution's country" - }, - "county" : { - "type" : "string", - "description" : "Institution's county" - }, - "dpoData" : { - "description" : "Data Protection Officer (DPO) specific data", - "$ref" : "#/components/schemas/DpoData" - }, - "fiscalCode" : { - "type" : "string", - "description" : "Fiscal code corresponding to the institution" - }, - "id" : { - "type" : "string", - "description" : "Institution's unique internal identifier" - }, - "institutionType" : { - "type" : "string", - "description" : "Institution's type", - "enum" : [ "AS", "CON", "GSP", "PA", "PG", "PSP", "PT", "REC", "SA", "SCP" ] - }, - "mailAddress" : { - "type" : "string", - "description" : "Institution's email address" - }, - "name" : { - "type" : "string", - "description" : "Institution's name" - }, - "pspData" : { - "description" : "Payment Service Provider (PSP) specific data", - "$ref" : "#/components/schemas/PspData" - }, - "recipientCode" : { - "type" : "string", - "description" : "Billing recipient code" - }, - "vatNumber" : { - "type" : "string", - "description" : "Institution's VAT number" - }, - "zipCode" : { - "type" : "string", - "description" : "Institution's zipCode" - } - } - }, "InstitutionResource" : { "title" : "InstitutionResource", "type" : "object", @@ -6193,37 +5926,6 @@ } } }, - "OnboardingRequestResource" : { - "title" : "OnboardingRequestResource", - "required" : [ "institutionInfo", "status" ], - "type" : "object", - "properties" : { - "admins" : { - "type" : "array", - "description" : "Administrators specific data", - "items" : { - "$ref" : "#/components/schemas/UserInfo" - } - }, - "institutionInfo" : { - "description" : "Institution specific data", - "$ref" : "#/components/schemas/InstitutionInfo" - }, - "manager" : { - "description" : "Manager specific data. It's required when institutionType is not PT", - "$ref" : "#/components/schemas/UserInfo" - }, - "productId" : { - "type" : "string", - "description" : "Product's identifier" - }, - "status" : { - "type" : "string", - "description" : "Onboarding request's status", - "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ] - } - } - }, "PageOfUserGroupPlainResource" : { "title" : "PageOfUserGroupPlainResource", "required" : [ "content", "number", "size", "totalElements", "totalPages" ], @@ -6560,34 +6262,6 @@ } } }, - "PspData" : { - "title" : "PspData", - "required" : [ "abiCode", "businessRegisterNumber", "legalRegisterName", "legalRegisterNumber", "vatNumberGroup" ], - "type" : "object", - "properties" : { - "abiCode" : { - "type" : "string", - "description" : "PSP's ABI code" - }, - "businessRegisterNumber" : { - "type" : "string", - "description" : "PSP's Business Register number" - }, - "legalRegisterName" : { - "type" : "string", - "description" : "PSP's legal register name" - }, - "legalRegisterNumber" : { - "type" : "string", - "description" : "PSP's legal register number" - }, - "vatNumberGroup" : { - "type" : "boolean", - "description" : "PSP's Vat Number group", - "example" : false - } - } - }, "RootParentResponse" : { "title" : "RootParentResponse", "type" : "object", @@ -6942,34 +6616,6 @@ } } }, - "UserInfo" : { - "title" : "UserInfo", - "required" : [ "email", "fiscalCode", "id", "name", "surname" ], - "type" : "object", - "properties" : { - "email" : { - "type" : "string", - "description" : "User's institutional email" - }, - "fiscalCode" : { - "type" : "string", - "description" : "User's fiscal code" - }, - "id" : { - "type" : "string", - "description" : "User's unique identifier", - "format" : "uuid" - }, - "name" : { - "type" : "string", - "description" : "User's name" - }, - "surname" : { - "type" : "string", - "description" : "User's surname" - } - } - }, "UserProductRoles" : { "title" : "UserProductRoles", "type" : "object", diff --git a/connector-api/src/main/java/it/pagopa/selfcare/dashboard/connector/api/MsCoreConnector.java b/connector-api/src/main/java/it/pagopa/selfcare/dashboard/connector/api/MsCoreConnector.java index 295045504..8a24130de 100644 --- a/connector-api/src/main/java/it/pagopa/selfcare/dashboard/connector/api/MsCoreConnector.java +++ b/connector-api/src/main/java/it/pagopa/selfcare/dashboard/connector/api/MsCoreConnector.java @@ -5,11 +5,11 @@ import it.pagopa.selfcare.dashboard.connector.model.delegation.Delegation; import it.pagopa.selfcare.dashboard.connector.model.delegation.DelegationId; import it.pagopa.selfcare.dashboard.connector.model.delegation.DelegationRequest; +import it.pagopa.selfcare.dashboard.connector.model.delegation.GetDelegationParameters; import it.pagopa.selfcare.dashboard.connector.model.institution.*; import it.pagopa.selfcare.dashboard.connector.model.product.PartyProduct; import it.pagopa.selfcare.dashboard.connector.model.user.CreateUserDto; import it.pagopa.selfcare.dashboard.connector.model.user.UserInfo; -import it.pagopa.selfcare.dashboard.connector.onboarding.OnboardingRequestInfo; import java.util.Collection; import java.util.List; @@ -30,7 +30,7 @@ public interface MsCoreConnector { List findInstitutionsByProductAndType(String productId, String type); - List getDelegations(String from, String to, String productId); + List getDelegations(GetDelegationParameters delegationParameters); void updateUser(String userId, String institutionId); @@ -52,11 +52,5 @@ public interface MsCoreConnector { void delete(String relationshipId); - OnboardingRequestInfo getOnboardingRequestInfo(String tokenId); - - void approveOnboardingRequest(String tokenId); - - void rejectOnboardingRequest(String tokenId); - Collection getUsers(String institutionId, UserInfo.UserInfoFilter userInfoFilter); } diff --git a/connector-api/src/main/java/it/pagopa/selfcare/dashboard/connector/model/delegation/Delegation.java b/connector-api/src/main/java/it/pagopa/selfcare/dashboard/connector/model/delegation/Delegation.java index fbf78c74a..d65be766f 100644 --- a/connector-api/src/main/java/it/pagopa/selfcare/dashboard/connector/model/delegation/Delegation.java +++ b/connector-api/src/main/java/it/pagopa/selfcare/dashboard/connector/model/delegation/Delegation.java @@ -9,6 +9,7 @@ public class Delegation { private String brokerId; private String productId; private String institutionName; + private String institutionRootName; private String brokerName; private DelegationType type; } diff --git a/connector-api/src/main/java/it/pagopa/selfcare/dashboard/connector/model/delegation/GetDelegationParameters.java b/connector-api/src/main/java/it/pagopa/selfcare/dashboard/connector/model/delegation/GetDelegationParameters.java new file mode 100644 index 000000000..a91865505 --- /dev/null +++ b/connector-api/src/main/java/it/pagopa/selfcare/dashboard/connector/model/delegation/GetDelegationParameters.java @@ -0,0 +1,18 @@ +package it.pagopa.selfcare.dashboard.connector.model.delegation; + +import lombok.Builder; +import lombok.Data; + +@Data +@Builder +public class GetDelegationParameters { + private String from; + private String to; + private String productId; + private String search; + private String taxCode; + private String mode; + private String order; + private Integer page; + private Integer size; +} diff --git a/connector-api/src/main/java/it/pagopa/selfcare/dashboard/connector/model/delegation/GetDelegationsMode.java b/connector-api/src/main/java/it/pagopa/selfcare/dashboard/connector/model/delegation/GetDelegationsMode.java new file mode 100644 index 000000000..33d1d9a66 --- /dev/null +++ b/connector-api/src/main/java/it/pagopa/selfcare/dashboard/connector/model/delegation/GetDelegationsMode.java @@ -0,0 +1,6 @@ +package it.pagopa.selfcare.dashboard.connector.model.delegation; + +public enum GetDelegationsMode { + FULL, + NORMAL +} diff --git a/connector-api/src/main/java/it/pagopa/selfcare/dashboard/connector/model/delegation/Order.java b/connector-api/src/main/java/it/pagopa/selfcare/dashboard/connector/model/delegation/Order.java new file mode 100644 index 000000000..10322b059 --- /dev/null +++ b/connector-api/src/main/java/it/pagopa/selfcare/dashboard/connector/model/delegation/Order.java @@ -0,0 +1,9 @@ +package it.pagopa.selfcare.dashboard.connector.model.delegation; + +public enum Order { + + NONE, + ASC, + DESC + +} diff --git a/connector/rest/docs/openapi/api-selfcare-core-docs.json b/connector/rest/docs/openapi/api-selfcare-core-docs.json index 3ba795079..13b99c3df 100644 --- a/connector/rest/docs/openapi/api-selfcare-core-docs.json +++ b/connector/rest/docs/openapi/api-selfcare-core-docs.json @@ -30,9 +30,6 @@ }, { "name" : "Management", "description" : "Management Controller" - }, { - "name" : "Migration", - "description" : "Crud Controller" }, { "name" : "Onboarding", "description" : "Onboarding Controller" @@ -47,28 +44,158 @@ "description" : "Queue Notification Controller" } ], "paths" : { - "/migration/institution" : { + "/delegations" : { + "get" : { + "tags" : [ "Delegation", "external-v2", "support" ], + "summary" : "Retrieve institution's delegations", + "description" : "Retrieve institution's delegations", + "operationId" : "getDelegationsUsingGET", + "parameters" : [ { + "name" : "institutionId", + "in" : "query", + "description" : "The internal identifier of the institution", + "required" : false, + "style" : "form", + "schema" : { + "type" : "string" + } + }, { + "name" : "brokerId", + "in" : "query", + "description" : "The internal identifier of the institution", + "required" : false, + "style" : "form", + "schema" : { + "type" : "string" + } + }, { + "name" : "productId", + "in" : "query", + "description" : "Product's unique identifier", + "required" : false, + "style" : "form", + "schema" : { + "type" : "string" + } + }, { + "name" : "search", + "in" : "query", + "description" : "Description ente", + "required" : false, + "style" : "form", + "schema" : { + "type" : "string" + } + }, { + "name" : "taxCode", + "in" : "query", + "description" : "Institution's tax code", + "required" : false, + "style" : "form", + "schema" : { + "type" : "string" + } + }, { + "name" : "mode", + "in" : "query", + "description" : "Mode (full or normal) to retreieve institution's delegations", + "required" : false, + "style" : "form", + "schema" : { + "type" : "string", + "enum" : [ "FULL", "NORMAL" ] + } + }, { + "name" : "order", + "in" : "query", + "description" : "Order to show response NONE, ASC, DESC", + "required" : false, + "style" : "form", + "schema" : { + "type" : "string", + "enum" : [ "ASC", "DESC", "NONE" ] + } + }, { + "name" : "page", + "in" : "query", + "description" : "page", + "required" : false, + "style" : "form", + "schema" : { + "type" : "integer", + "format" : "int32" + } + }, { + "name" : "size", + "in" : "query", + "description" : "size", + "required" : false, + "style" : "form", + "schema" : { + "type" : "integer", + "format" : "int32" + } + } ], + "responses" : { + "200" : { + "description" : "OK", + "content" : { + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/DelegationResponse" + } + } + } + } + }, + "400" : { + "description" : "Bad Request", + "content" : { + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + }, + "404" : { + "description" : "Not Found", + "content" : { + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + } + }, + "security" : [ { + "bearerAuth" : [ "global" ] + } ] + }, "post" : { - "tags" : [ "Migration" ], - "summary" : "${swagger.mscore.migration.save.institution}", - "description" : "${swagger.mscore.migration.save.institution}", - "operationId" : "createInstitutionUsingPOST", + "tags" : [ "Delegation" ], + "summary" : "Create an association between institution id and technical partner", + "description" : "Create an association between institution id and technical partner", + "operationId" : "createDelegationUsingPOST", "requestBody" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/MigrationInstitution" + "$ref" : "#/components/schemas/DelegationRequest" } } } }, "responses" : { - "200" : { - "description" : "OK", + "201" : { + "description" : "Created", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/Institution" + "$ref" : "#/components/schemas/DelegationResponse" } } } @@ -109,29 +236,28 @@ } ] } }, - "/migration/institution/{id}" : { - "get" : { - "tags" : [ "Migration" ], - "summary" : "${swagger.mscore.migration.findbyid.institution}", - "description" : "${swagger.mscore.migration.findbyid.institution}", - "operationId" : "findInstitutionByIdUsingGET", - "parameters" : [ { - "name" : "id", - "in" : "path", - "description" : "id", - "required" : true, - "style" : "simple", - "schema" : { - "type" : "string" + "/delegations/from-taxcode" : { + "post" : { + "tags" : [ "Delegation" ], + "summary" : "Create an association between institution and technical partner using taxCode for both instead of internal id. It is useful when we don't know institution's internal id.", + "description" : "Create an association between institution and technical partner using taxCode for both instead of internal id. It is useful when we don't know institution's internal id.", + "operationId" : "createDelegationFromInstitutionsTaxCodeUsingPOST", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/DelegationRequestFromTaxcode" + } + } } - } ], + }, "responses" : { - "200" : { - "description" : "OK", + "201" : { + "description" : "Created", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/Institution" + "$ref" : "#/components/schemas/DelegationResponse" } } } @@ -155,21 +281,33 @@ } } } + }, + "409" : { + "description" : "Conflict", + "content" : { + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } } }, "security" : [ { "bearerAuth" : [ "global" ] } ] - }, + } + }, + "/delegations/{delegationId}" : { "delete" : { - "tags" : [ "Migration" ], - "summary" : "${swagger.mscore.migration.delete.institution}", - "description" : "${swagger.mscore.migration.delete.institution}", - "operationId" : "deleteInstitutionUsingDELETE", + "tags" : [ "Delegation" ], + "summary" : "Delete an association between institution id and technical partner setting its status to DELETED and setting delegation to false on institution if it has no more delegations", + "description" : "Delete an association between institution id and technical partner setting its status to DELETED and setting delegation to false on institution if it has no more delegations", + "operationId" : "deleteDelegationUsingDELETE", "parameters" : [ { - "name" : "id", + "name" : "delegationId", "in" : "path", - "description" : "id", + "description" : "Delegation's unique internal identifier", "required" : true, "style" : "simple", "schema" : { @@ -178,14 +316,7 @@ } ], "responses" : { "204" : { - "description" : "No Content", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Institution" - } - } - } + "description" : "No Content" }, "400" : { "description" : "Bad Request", @@ -223,12 +354,23 @@ } ] } }, - "/migration/institutions" : { + "/external/institutions" : { "get" : { - "tags" : [ "Migration" ], - "summary" : "${swagger.mscore.migration.find.institution}", - "description" : "${swagger.mscore.migration.find.institution}", - "operationId" : "findInstitutionsUsingGET", + "tags" : [ "External" ], + "summary" : "Gets the corresponding institution using internal institution id", + "description" : "Gets the corresponding institution using internal institution id", + "operationId" : "retrieveInstitutionByIdsUsingGET", + "parameters" : [ { + "name" : "ids", + "in" : "query", + "description" : "List of Institution to onboard", + "required" : true, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + } ], "responses" : { "200" : { "description" : "OK", @@ -237,7 +379,7 @@ "schema" : { "type" : "array", "items" : { - "$ref" : "#/components/schemas/Institution" + "$ref" : "#/components/schemas/InstitutionResponse" } } } @@ -269,28 +411,28 @@ } ] } }, - "/migration/token" : { + "/external/institutions/pn-pg" : { "post" : { - "tags" : [ "Migration" ], - "summary" : "${swagger.mscore.migration.save.token}", - "description" : "${swagger.mscore.migration.save.token}", - "operationId" : "createTokenUsingPOST", + "tags" : [ "External" ], + "summary" : "create an institution (PG) using external institution id fetching data from info-camere", + "description" : "create an institution (PG) using external institution id fetching data from info-camere", + "operationId" : "createPnPgInstitutionUsingPOST", "requestBody" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/MigrationToken" + "$ref" : "#/components/schemas/CreatePnPgInstitutionRequest" } } } }, "responses" : { - "200" : { - "description" : "OK", + "201" : { + "description" : "Created", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/Token" + "$ref" : "#/components/schemas/InstitutionPnPgResponse" } } } @@ -331,16 +473,16 @@ } ] } }, - "/migration/token/{id}" : { + "/external/institutions/{externalId}" : { "get" : { - "tags" : [ "Migration" ], - "summary" : "${swagger.mscore.migration.findbyid.token}", - "description" : "${swagger.mscore.migration.findbyid.token}", - "operationId" : "findTokenByIdUsingGET", + "tags" : [ "External" ], + "summary" : "Gets institution using external institution id", + "description" : "Gets institution using external institution id", + "operationId" : "getByExternalIdUsingGET", "parameters" : [ { - "name" : "id", + "name" : "externalId", "in" : "path", - "description" : "id", + "description" : "Institution's unique external identifier", "required" : true, "style" : "simple", "schema" : { @@ -353,7 +495,7 @@ "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/Token" + "$ref" : "#/components/schemas/InstitutionResponse" } } } @@ -382,16 +524,18 @@ "security" : [ { "bearerAuth" : [ "global" ] } ] - }, - "delete" : { - "tags" : [ "Migration" ], - "summary" : "${swagger.mscore.migration.delete.token}", - "description" : "${swagger.mscore.migration.delete.token}", - "operationId" : "deleteTokenUsingDELETE", + } + }, + "/external/institutions/{externalId}/geotaxonomies" : { + "get" : { + "tags" : [ "External" ], + "summary" : "retrieves the geographic taxonomies related to Institution.", + "description" : "retrieves the geographic taxonomies related to Institution.", + "operationId" : "retrieveInstitutionGeoTaxonomiesByExternalIdUsingGET", "parameters" : [ { - "name" : "id", + "name" : "externalId", "in" : "path", - "description" : "id", + "description" : "Institution's unique external identifier", "required" : true, "style" : "simple", "schema" : { @@ -399,12 +543,15 @@ } } ], "responses" : { - "204" : { - "description" : "No Content", + "200" : { + "description" : "OK", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/Token" + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/GeographicTaxonomies" + } } } } @@ -428,16 +575,6 @@ } } } - }, - "409" : { - "description" : "Conflict", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } } }, "security" : [ { @@ -445,28 +582,40 @@ } ] } }, - "/migration/user" : { - "post" : { - "tags" : [ "Migration" ], - "summary" : "${swagger.mscore.migration.save.user}", - "description" : "${swagger.mscore.migration.save.user}", - "operationId" : "createUserUsingPOST", - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/MigrationOnboardedUser" - } - } + "/external/institutions/{externalId}/products" : { + "get" : { + "tags" : [ "External" ], + "summary" : "retrieves the products related to Institution", + "description" : "retrieves the products related to Institution", + "operationId" : "retrieveInstitutionProductsByExternalIdUsingGET", + "parameters" : [ { + "name" : "externalId", + "in" : "path", + "description" : "Institution's unique external identifier", + "required" : true, + "style" : "simple", + "schema" : { + "type" : "string" } - }, + }, { + "name" : "states", + "in" : "query", + "description" : "states", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string", + "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ] + } + } ], "responses" : { "200" : { "description" : "OK", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/OnboardedUser" + "$ref" : "#/components/schemas/OnboardedProducts" } } } @@ -490,16 +639,6 @@ } } } - }, - "409" : { - "description" : "Conflict", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } } }, "security" : [ { @@ -507,16 +646,25 @@ } ] } }, - "/migration/user/{id}" : { + "/external/institutions/{externalId}/products/{productId}/billing" : { "get" : { - "tags" : [ "Migration" ], - "summary" : "${swagger.mscore.migration.findbyid.user}", - "description" : "${swagger.mscore.migration.findbyid.user}", - "operationId" : "findUserByIdUsingGET", + "tags" : [ "External" ], + "summary" : "retrieves the billing data related to the institution even if the current user is not related to the institution/product", + "description" : "retrieves the billing data related to the institution even if the current user is not related to the institution/product", + "operationId" : "getBillingInstitutionByExternalIdUsingGET", "parameters" : [ { - "name" : "id", + "name" : "externalId", "in" : "path", - "description" : "id", + "description" : "Institution's unique external identifier", + "required" : true, + "style" : "simple", + "schema" : { + "type" : "string" + } + }, { + "name" : "productId", + "in" : "path", + "description" : "Product's unique identifier", "required" : true, "style" : "simple", "schema" : { @@ -529,7 +677,7 @@ "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/OnboardedUser" + "$ref" : "#/components/schemas/InstitutionBillingResponse" } } } @@ -558,16 +706,27 @@ "security" : [ { "bearerAuth" : [ "global" ] } ] - }, - "delete" : { - "tags" : [ "Migration" ], - "summary" : "${swagger.mscore.migration.delete.user}", - "description" : "${swagger.mscore.migration.delete.user}", - "operationId" : "deleteUserUsingDELETE", + } + }, + "/external/institutions/{externalId}/products/{productId}/manager" : { + "get" : { + "tags" : [ "External" ], + "summary" : "retrieves the manager related to the institution even if the current user is not related to the institution/product", + "description" : "retrieves the manager related to the institution even if the current user is not related to the institution/product", + "operationId" : "getManagerInstitutionByExternalIdUsingGET", "parameters" : [ { - "name" : "id", + "name" : "externalId", "in" : "path", - "description" : "id", + "description" : "Institution's unique external identifier", + "required" : true, + "style" : "simple", + "schema" : { + "type" : "string" + } + }, { + "name" : "productId", + "in" : "path", + "description" : "Product's unique identifier", "required" : true, "style" : "simple", "schema" : { @@ -575,12 +734,12 @@ } } ], "responses" : { - "204" : { - "description" : "No Content", + "200" : { + "description" : "OK", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/OnboardedUser" + "$ref" : "#/components/schemas/InstitutionManagerResponse" } } } @@ -604,16 +763,6 @@ } } } - }, - "409" : { - "description" : "Conflict", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } } }, "security" : [ { @@ -621,12 +770,73 @@ } ] } }, - "/migration/users" : { + "/external/institutions/{externalId}/relationships" : { "get" : { - "tags" : [ "Migration" ], - "summary" : "${swagger.mscore.migration.find.token}", - "description" : "${swagger.mscore.migration.find.token}", - "operationId" : "findUsersUsingGET", + "tags" : [ "External" ], + "summary" : "returns the relationships related to the institution", + "description" : "returns the relationships related to the institution", + "operationId" : "getUserInstitutionRelationshipsByExternalIdUsingGET", + "parameters" : [ { + "name" : "externalId", + "in" : "path", + "description" : "Institution's unique external identifier", + "required" : true, + "style" : "simple", + "schema" : { + "type" : "string" + } + }, { + "name" : "personId", + "in" : "query", + "description" : "personId", + "required" : false, + "style" : "form", + "schema" : { + "type" : "string" + } + }, { + "name" : "roles", + "in" : "query", + "description" : "roles", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string", + "enum" : [ "DELEGATE", "MANAGER", "OPERATOR", "SUB_DELEGATE" ] + } + }, { + "name" : "states", + "in" : "query", + "description" : "states", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string", + "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ] + } + }, { + "name" : "products", + "in" : "query", + "description" : "products", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "productRoles", + "in" : "query", + "description" : "productRoles", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + } ], "responses" : { "200" : { "description" : "OK", @@ -635,7 +845,7 @@ "schema" : { "type" : "array", "items" : { - "$ref" : "#/components/schemas/OnboardedUser" + "$ref" : "#/components/schemas/RelationshipResult" } } } @@ -667,48 +877,47 @@ } ] } }, - "/delegations" : { + "/institutions" : { "get" : { - "tags" : [ "Delegation", "external-v2", "support" ], - "summary" : "Retrieve institution's delegations", - "description" : "Retrieve institution's delegations", - "operationId" : "getDelegationsUsingGET", + "tags" : [ "Institution", "external-v2", "support" ], + "summary" : "Gets institutions filtering by taxCode and/or subunitCode", + "description" : "Gets institutions filtering by taxCode and/or subunitCode", + "operationId" : "getInstitutionsUsingGET", "parameters" : [ { - "name" : "institutionId", + "name" : "taxCode", "in" : "query", - "description" : "The internal identifier of the institution", + "description" : "Institution's tax code", "required" : false, "style" : "form", "schema" : { "type" : "string" } }, { - "name" : "brokerId", + "name" : "subunitCode", "in" : "query", - "description" : "The internal identifier of the institution", + "description" : "Institution's subunit code", "required" : false, "style" : "form", "schema" : { "type" : "string" } }, { - "name" : "productId", + "name" : "origin", "in" : "query", - "description" : "Product's unique identifier", + "description" : "origin", "required" : false, "style" : "form", "schema" : { "type" : "string" } }, { - "name" : "mode", + "name" : "originId", "in" : "query", - "description" : "Mode (full or normal) to retreieve institution's delegations", + "description" : "originId", "required" : false, "style" : "form", "schema" : { - "type" : "string", - "enum" : [ "FULL", "NORMAL" ] + "type" : "string" } } ], "responses" : { @@ -717,10 +926,7 @@ "content" : { "application/json" : { "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/DelegationResponse" - } + "$ref" : "#/components/schemas/InstitutionsResponse" } } } @@ -751,15 +957,15 @@ } ] }, "post" : { - "tags" : [ "Delegation" ], - "summary" : "Create an association between institution id and technical partner", - "description" : "Create an association between institution id and technical partner", - "operationId" : "createDelegationUsingPOST", + "tags" : [ "Institution" ], + "summary" : "create an institution using external institution id without fetching data from party-registry or info-camere", + "description" : "create an institution using external institution id without fetching data from party-registry or info-camere", + "operationId" : "createInstitutionUsingPOST", "requestBody" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/DelegationRequest" + "$ref" : "#/components/schemas/InstitutionRequest" } } } @@ -770,7 +976,7 @@ "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/DelegationResponse" + "$ref" : "#/components/schemas/InstitutionResponse" } } } @@ -811,17 +1017,17 @@ } ] } }, - "/delegations/from-taxcode" : { + "/institutions/from-anac" : { "post" : { - "tags" : [ "Delegation" ], - "summary" : "Create an association between institution and technical partner using taxCode for both instead of internal id. It is useful when we don't know institution's internal id.", - "description" : "Create an association between institution and technical partner using taxCode for both instead of internal id. It is useful when we don't know institution's internal id.", - "operationId" : "createDelegationFromInstitutionsTaxCodeUsingPOST", + "tags" : [ "Institution" ], + "summary" : "Create an association between institution id and technical partner from anac", + "description" : "Create an association between institution id and technical partner from anac", + "operationId" : "createInstitutionFromAnacUsingPOST", "requestBody" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/DelegationRequestFromTaxcode" + "$ref" : "#/components/schemas/InstitutionRequest" } } } @@ -832,7 +1038,7 @@ "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/DelegationResponse" + "$ref" : "#/components/schemas/InstitutionResponse" } } } @@ -873,30 +1079,36 @@ } ] } }, - "/delegations/{delegationId}" : { - "delete" : { - "tags" : [ "Delegation" ], - "summary" : "Il servizio elimina un'associazione tra l'ente ed il partner tecnologico", - "description" : "Il servizio elimina un'associazione tra l'ente ed il partner tecnologico", - "operationId" : "deleteDelegationUsingDELETE", - "parameters" : [ { - "name" : "delegationId", - "in" : "path", - "description" : "Identificativo interno della delega", - "required" : true, - "style" : "simple", - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "204" : { - "description" : "No Content" - }, - "400" : { - "description" : "Bad Request", - "content" : { - "application/problem+json" : { + "/institutions/from-infocamere" : { + "post" : { + "tags" : [ "Institution" ], + "summary" : "create an institution from infocamere registry", + "description" : "create an institution from infocamere registry", + "operationId" : "createInstitutionFromInfocamereUsingPOST", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/InstitutionRequest" + } + } + } + }, + "responses" : { + "201" : { + "description" : "Created", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/InstitutionResponse" + } + } + } + }, + "400" : { + "description" : "Bad Request", + "content" : { + "application/problem+json" : { "schema" : { "$ref" : "#/components/schemas/Problem" } @@ -929,33 +1141,28 @@ } ] } }, - "/external/institutions" : { - "get" : { - "tags" : [ "External" ], - "summary" : "Gets the corresponding institution using internal institution id", - "description" : "Gets the corresponding institution using internal institution id", - "operationId" : "retrieveInstitutionByIdsUsingGET", - "parameters" : [ { - "name" : "ids", - "in" : "query", - "description" : "List of Institution to onboard", - "required" : true, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "string" + "/institutions/from-ipa" : { + "post" : { + "tags" : [ "Institution" ], + "summary" : "create an institution from ipa registry", + "description" : "create an institution from ipa registry", + "operationId" : "createInstitutionFromIpaUsingPOST", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/InstitutionFromIpaPost" + } + } } - } ], + }, "responses" : { - "200" : { - "description" : "OK", + "201" : { + "description" : "Created", "content" : { "application/json" : { "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/InstitutionResponse" - } + "$ref" : "#/components/schemas/InstitutionResponse" } } } @@ -979,6 +1186,16 @@ } } } + }, + "409" : { + "description" : "Conflict", + "content" : { + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } } }, "security" : [ { @@ -986,17 +1203,17 @@ } ] } }, - "/external/institutions/pn-pg" : { + "/institutions/from-ivass" : { "post" : { - "tags" : [ "External" ], - "summary" : "create an institution (PG) using external institution id fetching data from info-camere", - "description" : "create an institution (PG) using external institution id fetching data from info-camere", - "operationId" : "createPnPgInstitutionUsingPOST", + "tags" : [ "Institution" ], + "summary" : "create an institution from ivass CSV", + "description" : "create an institution from ivass CSV", + "operationId" : "createInstitutionFromIvassUsingPOST", "requestBody" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/CreatePnPgInstitutionRequest" + "$ref" : "#/components/schemas/InstitutionRequest" } } } @@ -1007,7 +1224,7 @@ "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/InstitutionPnPgResponse" + "$ref" : "#/components/schemas/InstitutionResponse" } } } @@ -1048,25 +1265,24 @@ } ] } }, - "/external/institutions/{externalId}" : { - "get" : { - "tags" : [ "External" ], - "summary" : "Gets institution using external institution id", - "description" : "Gets institution using external institution id", - "operationId" : "getByExternalIdUsingGET", - "parameters" : [ { - "name" : "externalId", - "in" : "path", - "description" : "Institution's unique external identifier", - "required" : true, - "style" : "simple", - "schema" : { - "type" : "string" + "/institutions/from-pda" : { + "post" : { + "tags" : [ "Institution" ], + "summary" : "Create an association between institution id and technical partner from pda", + "description" : "create an institution from ipa registry", + "operationId" : "createInstitutionFromPdaUsingPOST", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PdaInstitutionRequest" + } + } } - } ], + }, "responses" : { - "200" : { - "description" : "OK", + "201" : { + "description" : "Created", "content" : { "application/json" : { "schema" : { @@ -1094,6 +1310,16 @@ } } } + }, + "409" : { + "description" : "Conflict", + "content" : { + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } } }, "security" : [ { @@ -1101,12 +1327,12 @@ } ] } }, - "/external/institutions/{externalId}/geotaxonomies" : { - "get" : { - "tags" : [ "External" ], - "summary" : "retrieves the geographic taxonomies related to Institution.", - "description" : "retrieves the geographic taxonomies related to Institution.", - "operationId" : "retrieveInstitutionGeoTaxonomiesByExternalIdUsingGET", + "/institutions/insert/{externalId}" : { + "post" : { + "tags" : [ "Institution" ], + "summary" : "create an institution using external institution id without fetching data from party-registry or info-camere", + "description" : "create an institution using external institution id without fetching data from party-registry or info-camere", + "operationId" : "createInstitutionRawUsingPOST", "parameters" : [ { "name" : "externalId", "in" : "path", @@ -1117,16 +1343,22 @@ "type" : "string" } } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/InstitutionRequest" + } + } + } + }, "responses" : { "200" : { "description" : "OK", "content" : { "application/json" : { "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/GeographicTaxonomies" - } + "$ref" : "#/components/schemas/InstitutionResponse" } } } @@ -1150,47 +1382,62 @@ } } } + }, + "409" : { + "description" : "Conflict", + "content" : { + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } } }, + "deprecated" : true, "security" : [ { "bearerAuth" : [ "global" ] } ] } }, - "/external/institutions/{externalId}/products" : { - "get" : { - "tags" : [ "External" ], - "summary" : "retrieves the products related to Institution", - "description" : "retrieves the products related to Institution", - "operationId" : "retrieveInstitutionProductsByExternalIdUsingGET", + "/institutions/onboarded/{productId}" : { + "post" : { + "tags" : [ "Institution" ], + "summary" : "Retrieve list of institution which logged user can onboard", + "description" : "Retrieve list of institution which logged user can onboard", + "operationId" : "getValidInstitutionToOnboardUsingPOST", "parameters" : [ { - "name" : "externalId", + "name" : "productId", "in" : "path", - "description" : "Institution's unique external identifier", + "description" : "productId", "required" : true, "style" : "simple", "schema" : { "type" : "string" } - }, { - "name" : "states", - "in" : "query", - "description" : "states", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "string", - "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ] - } } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/InstitutionToOnboard" + } + } + } + } + }, "responses" : { "200" : { "description" : "OK", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/OnboardedProducts" + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/InstitutionToOnboard" + } } } } @@ -1214,6 +1461,16 @@ } } } + }, + "409" : { + "description" : "Conflict", + "content" : { + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } } }, "security" : [ { @@ -1221,38 +1478,28 @@ } ] } }, - "/external/institutions/{externalId}/products/{productId}/billing" : { - "get" : { - "tags" : [ "External" ], - "summary" : "retrieves the billing data related to the institution even if the current user is not related to the institution/product", - "description" : "retrieves the billing data related to the institution even if the current user is not related to the institution/product", - "operationId" : "getBillingInstitutionByExternalIdUsingGET", - "parameters" : [ { - "name" : "externalId", - "in" : "path", - "description" : "Institution's unique external identifier", - "required" : true, - "style" : "simple", - "schema" : { - "type" : "string" + "/institutions/pg" : { + "post" : { + "tags" : [ "Institution" ], + "summary" : "create an institution (PG) using external institution id fetching data from info-camere", + "description" : "create an institution (PG) using external institution id fetching data from info-camere", + "operationId" : "createPgInstitutionUsingPOST", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/CreatePgInstitutionRequest" + } + } } - }, { - "name" : "productId", - "in" : "path", - "description" : "Product's unique identifier", - "required" : true, - "style" : "simple", - "schema" : { - "type" : "string" - } - } ], + }, "responses" : { - "200" : { - "description" : "OK", + "201" : { + "description" : "Created", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/InstitutionBillingResponse" + "$ref" : "#/components/schemas/InstitutionResponse" } } } @@ -1276,6 +1523,16 @@ } } } + }, + "409" : { + "description" : "Conflict", + "content" : { + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } } }, "security" : [ { @@ -1283,29 +1540,40 @@ } ] } }, - "/external/institutions/{externalId}/products/{productId}/manager" : { + "/institutions/products/{productId}" : { "get" : { - "tags" : [ "External" ], - "summary" : "retrieves the manager related to the institution even if the current user is not related to the institution/product", - "description" : "retrieves the manager related to the institution even if the current user is not related to the institution/product", - "operationId" : "getManagerInstitutionByExternalIdUsingGET", + "tags" : [ "Institution" ], + "summary" : "Gets institutions filtering onboardings by product id", + "description" : "Gets institutions filtering onboardings by product id", + "operationId" : "findFromProductUsingGET", "parameters" : [ { - "name" : "externalId", + "name" : "productId", "in" : "path", - "description" : "Institution's unique external identifier", + "description" : "Product's unique identifier", "required" : true, "style" : "simple", "schema" : { "type" : "string" } }, { - "name" : "productId", - "in" : "path", - "description" : "Product's unique identifier", - "required" : true, - "style" : "simple", + "name" : "page", + "in" : "query", + "description" : "Page number", + "required" : false, + "style" : "form", "schema" : { - "type" : "string" + "type" : "integer", + "format" : "int32" + } + }, { + "name" : "size", + "in" : "query", + "description" : "Page size", + "required" : false, + "style" : "form", + "schema" : { + "type" : "integer", + "format" : "int32" } } ], "responses" : { @@ -1314,7 +1582,7 @@ "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/InstitutionManagerResponse" + "$ref" : "#/components/schemas/InstitutionOnboardingListResponse" } } } @@ -1345,12 +1613,12 @@ } ] } }, - "/external/institutions/{externalId}/relationships" : { - "get" : { - "tags" : [ "External" ], - "summary" : "returns the relationships related to the institution", - "description" : "returns the relationships related to the institution", - "operationId" : "getUserInstitutionRelationshipsByExternalIdUsingGET", + "/institutions/{externalId}" : { + "post" : { + "tags" : [ "Institution" ], + "summary" : "create an institution (PA) using external institution id fetching data from party-registry", + "description" : "create an institution (PA) using external institution id fetching data from party-registry", + "operationId" : "createInstitutionByExternalIdUsingPOST", "parameters" : [ { "name" : "externalId", "in" : "path", @@ -1360,68 +1628,14 @@ "schema" : { "type" : "string" } - }, { - "name" : "personId", - "in" : "query", - "description" : "personId", - "required" : false, - "style" : "form", - "schema" : { - "type" : "string" - } - }, { - "name" : "roles", - "in" : "query", - "description" : "roles", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "string", - "enum" : [ "DELEGATE", "MANAGER", "OPERATOR", "SUB_DELEGATE" ] - } - }, { - "name" : "states", - "in" : "query", - "description" : "states", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "string", - "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ] - } - }, { - "name" : "products", - "in" : "query", - "description" : "products", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "string" - } - }, { - "name" : "productRoles", - "in" : "query", - "description" : "productRoles", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "string" - } } ], "responses" : { - "200" : { - "description" : "OK", + "201" : { + "description" : "Created", "content" : { "application/json" : { "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/RelationshipResult" - } + "$ref" : "#/components/schemas/InstitutionResponse" } } } @@ -1445,52 +1659,36 @@ } } } + }, + "409" : { + "description" : "Conflict", + "content" : { + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } } }, + "deprecated" : true, "security" : [ { "bearerAuth" : [ "global" ] } ] } }, - "/institutions" : { + "/institutions/{id}" : { "get" : { - "tags" : [ "Institution", "external-v2", "support" ], - "summary" : "Gets institutions filtering by taxCode and/or subunitCode", - "description" : "Gets institutions filtering by taxCode and/or subunitCode", - "operationId" : "getInstitutionsUsingGET", + "tags" : [ "Institution", "external-v2" ], + "summary" : "Gets the corresponding institution using internal institution id", + "description" : "Gets the corresponding institution using internal institution id", + "operationId" : "retrieveInstitutionByIdUsingGET", "parameters" : [ { - "name" : "taxCode", - "in" : "query", - "description" : "Institution's tax code", - "required" : false, - "style" : "form", - "schema" : { - "type" : "string" - } - }, { - "name" : "subunitCode", - "in" : "query", - "description" : "Institution's subunit code", - "required" : false, - "style" : "form", - "schema" : { - "type" : "string" - } - }, { - "name" : "origin", - "in" : "query", - "description" : "origin", - "required" : false, - "style" : "form", - "schema" : { - "type" : "string" - } - }, { - "name" : "originId", - "in" : "query", - "description" : "originId", - "required" : false, - "style" : "form", + "name" : "id", + "in" : "path", + "description" : "The internal identifier of the institution", + "required" : true, + "style" : "simple", "schema" : { "type" : "string" } @@ -1501,7 +1699,7 @@ "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/InstitutionsResponse" + "$ref" : "#/components/schemas/InstitutionResponse" } } } @@ -1531,23 +1729,33 @@ "bearerAuth" : [ "global" ] } ] }, - "post" : { + "put" : { "tags" : [ "Institution" ], - "summary" : "create an institution using external institution id without fetching data from party-registry or info-camere", - "description" : "create an institution using external institution id without fetching data from party-registry or info-camere", - "operationId" : "createInstitutionUsingPOST_1", + "summary" : "update institution data of given institution", + "description" : "update institution data of given institution", + "operationId" : "updateInstitutionUsingPUT", + "parameters" : [ { + "name" : "id", + "in" : "path", + "description" : "The internal identifier of the institution", + "required" : true, + "style" : "simple", + "schema" : { + "type" : "string" + } + } ], "requestBody" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/InstitutionRequest" + "$ref" : "#/components/schemas/InstitutionPut" } } } }, "responses" : { - "201" : { - "description" : "Created", + "200" : { + "description" : "OK", "content" : { "application/json" : { "schema" : { @@ -1566,8 +1774,8 @@ } } }, - "404" : { - "description" : "Not Found", + "403" : { + "description" : "Forbidden", "content" : { "application/problem+json" : { "schema" : { @@ -1576,8 +1784,8 @@ } } }, - "409" : { - "description" : "Conflict", + "404" : { + "description" : "Not Found", "content" : { "application/problem+json" : { "schema" : { @@ -1592,30 +1800,34 @@ } ] } }, - "/institutions/from-anac" : { - "post" : { + "/institutions/{id}/geotaxonomies" : { + "get" : { "tags" : [ "Institution" ], - "summary" : "${swagger.mscore.institution.create.from-anac}", - "description" : "${swagger.mscore.institution.create.from-anac}", - "operationId" : "createInstitutionFromAnacUsingPOST", - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/InstitutionRequest" - } - } + "summary" : "retrieves the geographic taxonomies this institution is related to", + "description" : "retrieves the geographic taxonomies this institution is related to", + "operationId" : "retrieveInstitutionGeoTaxonomiesUsingGET", + "parameters" : [ { + "name" : "id", + "in" : "path", + "description" : "The internal identifier of the institution", + "required" : true, + "style" : "simple", + "schema" : { + "type" : "string" } - }, + } ], "responses" : { - "201" : { - "description" : "Created", + "200" : { + "description" : "OK", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/InstitutionResponse" - } - } + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/GeographicTaxonomies" + } + } + } } }, "400" : { @@ -1637,16 +1849,6 @@ } } } - }, - "409" : { - "description" : "Conflict", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } } }, "security" : [ { @@ -1654,17 +1856,27 @@ } ] } }, - "/institutions/from-infocamere" : { + "/institutions/{id}/onboarding" : { "post" : { "tags" : [ "Institution" ], - "summary" : "create an institution from infocamere registry", - "description" : "create an institution from infocamere registry", - "operationId" : "createInstitutionFromInfocamereUsingPOST", + "summary" : "The service adds users to the registry if they are not present and associates them with the institution and product contained in the body", + "description" : "The service adds users to the registry if they are not present and associates them with the institution and product contained in the body", + "operationId" : "onboardingInstitutionUsingPOST", + "parameters" : [ { + "name" : "id", + "in" : "path", + "description" : "id", + "required" : true, + "style" : "simple", + "schema" : { + "type" : "string" + } + } ], "requestBody" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/InstitutionRequest" + "$ref" : "#/components/schemas/InstitutionOnboardingRequest" } } } @@ -1716,28 +1928,40 @@ } ] } }, - "/institutions/from-ipa" : { - "post" : { + "/institutions/{id}/products" : { + "get" : { "tags" : [ "Institution" ], - "summary" : "create an institution from ipa registry", - "description" : "create an institution from ipa registry", - "operationId" : "createInstitutionFromIpaUsingPOST", - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/InstitutionFromIpaPost" - } - } + "summary" : "retrieves the insistitution's related products.", + "description" : "retrieves the insistitution's related products.", + "operationId" : "retrieveInstitutionProductsUsingGET", + "parameters" : [ { + "name" : "id", + "in" : "path", + "description" : "The internal identifier of the institution", + "required" : true, + "style" : "simple", + "schema" : { + "type" : "string" } - }, + }, { + "name" : "states", + "in" : "query", + "description" : "List of Relationship state for filter products", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string", + "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ] + } + } ], "responses" : { - "201" : { - "description" : "Created", + "200" : { + "description" : "OK", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/InstitutionResponse" + "$ref" : "#/components/schemas/OnboardedProducts" } } } @@ -1761,16 +1985,6 @@ } } } - }, - "409" : { - "description" : "Conflict", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } } }, "security" : [ { @@ -1778,28 +1992,83 @@ } ] } }, - "/institutions/from-ivass" : { - "post" : { + "/institutions/{id}/relationships" : { + "get" : { "tags" : [ "Institution" ], - "summary" : "create an institution from ivass CSV", - "description" : "create an institution from ivass CSV", - "operationId" : "createInstitutionFromIvassUsingPOST", - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/InstitutionRequest" - } - } + "summary" : "returns the relationships related to the institution", + "description" : "returns the relationships related to the institution", + "operationId" : "getUserInstitutionRelationshipsUsingGET", + "parameters" : [ { + "name" : "id", + "in" : "path", + "description" : "The internal identifier of the institution", + "required" : true, + "style" : "simple", + "schema" : { + "type" : "string" } - }, + }, { + "name" : "personId", + "in" : "query", + "description" : "personId", + "required" : false, + "style" : "form", + "schema" : { + "type" : "string" + } + }, { + "name" : "roles", + "in" : "query", + "description" : "roles", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string", + "enum" : [ "DELEGATE", "MANAGER", "OPERATOR", "SUB_DELEGATE" ] + } + }, { + "name" : "states", + "in" : "query", + "description" : "states", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string", + "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ] + } + }, { + "name" : "products", + "in" : "query", + "description" : "products", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "productRoles", + "in" : "query", + "description" : "productRoles", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + } ], "responses" : { - "201" : { - "description" : "Created", + "200" : { + "description" : "OK", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/InstitutionResponse" + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/RelationshipResult" + } } } } @@ -1823,16 +2092,6 @@ } } } - }, - "409" : { - "description" : "Conflict", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } } }, "security" : [ { @@ -1840,31 +2099,34 @@ } ] } }, - "/institutions/from-pda" : { - "post" : { + "/institutions/{institutionId}/createdAt" : { + "put" : { "tags" : [ "Institution" ], - "summary" : "${swagger.mscore.institution.create.from-pda}", - "description" : "create an institution from ipa registry", - "operationId" : "createInstitutionFromPdaUsingPOST", + "summary" : "The service updates the createdAt field for the institution-product pair", + "description" : "The service updates the createdAt field for the institution-product pair", + "operationId" : "updateCreatedAtUsingPUT", + "parameters" : [ { + "name" : "institutionId", + "in" : "path", + "description" : "The internal identifier of the institution", + "required" : true, + "style" : "simple", + "schema" : { + "type" : "string" + } + } ], "requestBody" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/PdaInstitutionRequest" + "$ref" : "#/components/schemas/CreatedAtRequest" } } } }, "responses" : { - "201" : { - "description" : "Created", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/InstitutionResponse" - } - } - } + "200" : { + "description" : "OK" }, "400" : { "description" : "Bad Request", @@ -1876,8 +2138,8 @@ } } }, - "404" : { - "description" : "Not Found", + "403" : { + "description" : "Forbidden", "content" : { "application/problem+json" : { "schema" : { @@ -1886,8 +2148,8 @@ } } }, - "409" : { - "description" : "Conflict", + "404" : { + "description" : "Not Found", "content" : { "application/problem+json" : { "schema" : { @@ -1902,38 +2164,38 @@ } ] } }, - "/institutions/insert/{externalId}" : { - "post" : { - "tags" : [ "Institution" ], - "summary" : "create an institution using external institution id without fetching data from party-registry or info-camere", - "description" : "create an institution using external institution id without fetching data from party-registry or info-camere", - "operationId" : "createInstitutionRawUsingPOST", + "/institutions/{institutionId}/onboardings" : { + "get" : { + "tags" : [ "Institution", "external-v2" ], + "summary" : "Retrieve institution information", + "description" : "Retrieve institution information", + "operationId" : "getOnboardingsInstitutionUsingGET", "parameters" : [ { - "name" : "externalId", + "name" : "institutionId", "in" : "path", - "description" : "Institution's unique external identifier", + "description" : "The internal identifier of the institution", "required" : true, "style" : "simple", "schema" : { "type" : "string" } + }, { + "name" : "productId", + "in" : "query", + "description" : "productId", + "required" : false, + "style" : "form", + "schema" : { + "type" : "string" + } } ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/InstitutionRequest" - } - } - } - }, "responses" : { "200" : { "description" : "OK", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/InstitutionResponse" + "$ref" : "#/components/schemas/OnboardingsResponse" } } } @@ -1957,9 +2219,55 @@ } } } + } + }, + "security" : [ { + "bearerAuth" : [ "global" ] + } ] + } + }, + "/institutions/{institutionId}/users" : { + "get" : { + "tags" : [ "Institution", "support" ], + "summary" : "getInstitutionUsers", + "description" : "Retrieve institution's users", + "operationId" : "getInstitutionUsersUsingGET", + "parameters" : [ { + "name" : "institutionId", + "in" : "path", + "description" : "Institution's unique identifier", + "required" : true, + "style" : "simple", + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "OK", + "content" : { + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/UserInfoResponse" + } + } + } + } + }, + "400" : { + "description" : "Bad Request", + "content" : { + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } }, - "409" : { - "description" : "Conflict", + "404" : { + "description" : "Not Found", "content" : { "application/problem+json" : { "schema" : { @@ -1969,40 +2277,37 @@ } } }, - "deprecated" : true, "security" : [ { "bearerAuth" : [ "global" ] } ] } }, - "/institutions/onboarded/{productId}" : { - "post" : { + "/institutions/{productId}/brokers/{institutionType}" : { + "get" : { "tags" : [ "Institution" ], - "summary" : "Retrieve list of institution which logged user can onboard", - "description" : "Retrieve list of institution which logged user can onboard", - "operationId" : "getValidInstitutionToOnboardUsingPOST", + "summary" : "Retrieve institution brokers", + "description" : "Retrieve institution brokers", + "operationId" : "getInstitutionBrokersUsingGET", "parameters" : [ { "name" : "productId", "in" : "path", - "description" : "productId", + "description" : "Product's unique identifier", "required" : true, "style" : "simple", "schema" : { "type" : "string" } - } ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/InstitutionToOnboard" - } - } - } + }, { + "name" : "institutionType", + "in" : "path", + "description" : "Institution's type", + "required" : true, + "style" : "simple", + "schema" : { + "type" : "string", + "enum" : [ "AS", "CON", "GSP", "PA", "PG", "PSP", "PT", "REC", "SA", "SCP" ] } - }, + } ], "responses" : { "200" : { "description" : "OK", @@ -2011,7 +2316,7 @@ "schema" : { "type" : "array", "items" : { - "$ref" : "#/components/schemas/InstitutionToOnboard" + "$ref" : "#/components/schemas/BrokerResponse" } } } @@ -2036,16 +2341,6 @@ } } } - }, - "409" : { - "description" : "Conflict", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } } }, "security" : [ { @@ -2053,28 +2348,28 @@ } ] } }, - "/institutions/pg" : { + "/bulk/institutions" : { "post" : { - "tags" : [ "Institution" ], - "summary" : "create an institution (PG) using external institution id fetching data from info-camere", - "description" : "create an institution (PG) using external institution id fetching data from info-camere", - "operationId" : "createPgInstitutionUsingPOST", + "tags" : [ "Management" ], + "summary" : "Gets the corresponding institution using internal institution id", + "description" : "Gets the corresponding institution using internal institution id", + "operationId" : "retrieveInstitutionByIdsUsingPOST", "requestBody" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/CreatePgInstitutionRequest" + "$ref" : "#/components/schemas/BulkPartiesSeed" } } } }, "responses" : { - "201" : { - "description" : "Created", + "200" : { + "description" : "OK", "content" : { - "application/json" : { + "*/*" : { "schema" : { - "$ref" : "#/components/schemas/InstitutionResponse" + "$ref" : "#/components/schemas/BulkInstitutions" } } } @@ -2115,49 +2410,80 @@ } ] } }, - "/institutions/products/{productId}" : { + "/relationships" : { "get" : { - "tags" : [ "Institution" ], - "summary" : "Gets institutions filtering onboardings by product id", - "description" : "Gets institutions filtering onboardings by product id", - "operationId" : "findFromProductUsingGET", + "tags" : [ "Management" ], + "summary" : "Return a list of relationships", + "description" : "Return a list of relationships", + "operationId" : "getInstitutionRelationshipsUsingGET", "parameters" : [ { - "name" : "productId", - "in" : "path", - "description" : "Product's unique identifier", - "required" : true, - "style" : "simple", + "name" : "from", + "in" : "query", + "description" : "from", + "required" : false, + "style" : "form", "schema" : { "type" : "string" } }, { - "name" : "page", + "name" : "to", "in" : "query", - "description" : "${swagger.mscore.page.number}", + "description" : "to", "required" : false, "style" : "form", "schema" : { - "type" : "integer", - "format" : "int32" + "type" : "string" } }, { - "name" : "size", + "name" : "roles", "in" : "query", - "description" : "${swagger.mscore.page.size}", + "description" : "roles", "required" : false, "style" : "form", + "explode" : true, "schema" : { - "type" : "integer", - "format" : "int32" + "type" : "string", + "enum" : [ "DELEGATE", "MANAGER", "OPERATOR", "SUB_DELEGATE" ] + } + }, { + "name" : "states", + "in" : "query", + "description" : "states", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string", + "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ] + } + }, { + "name" : "products", + "in" : "query", + "description" : "products", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "productRoles", + "in" : "query", + "description" : "productRoles", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" } } ], "responses" : { - "200" : { - "description" : "OK", + "204" : { + "description" : "No Content", "content" : { - "application/json" : { + "*/*" : { "schema" : { - "$ref" : "#/components/schemas/InstitutionOnboardingListResponse" + "$ref" : "#/components/schemas/RelationshipsManagement" } } } @@ -2183,37 +2509,49 @@ } } }, + "deprecated" : true, "security" : [ { "bearerAuth" : [ "global" ] } ] } }, - "/institutions/{externalId}" : { - "post" : { - "tags" : [ "Institution" ], - "summary" : "create an institution (PA) using external institution id fetching data from party-registry", - "description" : "create an institution (PA) using external institution id fetching data from party-registry", - "operationId" : "createInstitutionByExternalIdUsingPOST", + "/onboarding" : { + "head" : { + "tags" : [ "Onboarding" ], + "summary" : "verify if onboardedProduct is already onboarded for institution", + "description" : "verify if onboardedProduct is already onboarded for institution", + "operationId" : "verifyOnboardingInfoUsingHEAD", "parameters" : [ { - "name" : "externalId", - "in" : "path", - "description" : "Institution's unique external identifier", + "name" : "taxCode", + "in" : "query", + "description" : "Institution's tax code", "required" : true, - "style" : "simple", + "style" : "form", + "schema" : { + "type" : "string" + } + }, { + "name" : "subunitCode", + "in" : "query", + "description" : "Institution's subunit code", + "required" : false, + "style" : "form", + "schema" : { + "type" : "string" + } + }, { + "name" : "productId", + "in" : "query", + "description" : "Product's unique identifier", + "required" : true, + "style" : "form", "schema" : { "type" : "string" } } ], "responses" : { - "201" : { - "description" : "Created", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/InstitutionResponse" - } - } - } + "204" : { + "description" : "No Content" }, "400" : { "description" : "Bad Request", @@ -2234,36 +2572,44 @@ } } } - }, - "409" : { - "description" : "Conflict", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } } }, - "deprecated" : true, "security" : [ { "bearerAuth" : [ "global" ] } ] } }, - "/institutions/{id}" : { + "/onboarding/info" : { "get" : { - "tags" : [ "Institution", "external-v2" ], - "summary" : "Gets the corresponding institution using internal institution id", - "description" : "Gets the corresponding institution using internal institution id", - "operationId" : "retrieveInstitutionByIdUsingGET", + "tags" : [ "Onboarding" ], + "summary" : "returns onboarding info", + "description" : "returns onboarding info", + "operationId" : "onboardingInfoUsingGET", "parameters" : [ { - "name" : "id", - "in" : "path", + "name" : "institutionId", + "in" : "query", "description" : "The internal identifier of the institution", - "required" : true, - "style" : "simple", + "required" : false, + "style" : "form", + "schema" : { + "type" : "string" + } + }, { + "name" : "institutionExternalId", + "in" : "query", + "description" : "Institution's unique external identifier", + "required" : false, + "style" : "form", + "schema" : { + "type" : "string" + } + }, { + "name" : "states", + "in" : "query", + "description" : "List of Relationship state for filter products", + "required" : false, + "style" : "form", + "explode" : true, "schema" : { "type" : "string" } @@ -2272,9 +2618,9 @@ "200" : { "description" : "OK", "content" : { - "application/json" : { + "*/*" : { "schema" : { - "$ref" : "#/components/schemas/InstitutionResponse" + "$ref" : "#/components/schemas/OnboardingInfoResponse" } } } @@ -2303,27 +2649,74 @@ "security" : [ { "bearerAuth" : [ "global" ] } ] - }, - "put" : { - "tags" : [ "Institution" ], - "summary" : "update institution data of given institution", - "description" : "update institution data of given institution", - "operationId" : "updateInstitutionUsingPUT", + } + }, + "/onboarding/institution/{externalId}/products/{productId}" : { + "head" : { + "tags" : [ "Onboarding" ], + "summary" : "verify if onboardedProduct is already onboarded for institution", + "description" : "verify if onboardedProduct is already onboarded for institution", + "operationId" : "verifyOnboardingInfoUsingHEAD_1", "parameters" : [ { - "name" : "id", + "name" : "externalId", "in" : "path", - "description" : "The internal identifier of the institution", + "description" : "Institution's unique external identifier", + "required" : true, + "style" : "simple", + "schema" : { + "type" : "string" + } + }, { + "name" : "productId", + "in" : "path", + "description" : "Product's unique identifier", "required" : true, "style" : "simple", "schema" : { "type" : "string" } } ], + "responses" : { + "204" : { + "description" : "No Content" + }, + "400" : { + "description" : "Bad Request", + "content" : { + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + }, + "404" : { + "description" : "Not Found", + "content" : { + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + } + }, + "security" : [ { + "bearerAuth" : [ "global" ] + } ] + } + }, + "/onboarding/operators" : { + "post" : { + "tags" : [ "Onboarding" ], + "summary" : "performs operators onboarding on an already existing institution", + "description" : "performs operators onboarding on an already existing institution", + "operationId" : "onboardingInstitutionOperatorsUsingPOST", "requestBody" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/InstitutionPut" + "$ref" : "#/components/schemas/OnboardingInstitutionOperatorsRequest" } } } @@ -2332,9 +2725,12 @@ "200" : { "description" : "OK", "content" : { - "application/json" : { + "*/*" : { "schema" : { - "$ref" : "#/components/schemas/InstitutionResponse" + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/RelationshipResult" + } } } } @@ -2349,8 +2745,8 @@ } } }, - "403" : { - "description" : "Forbidden", + "404" : { + "description" : "Not Found", "content" : { "application/problem+json" : { "schema" : { @@ -2359,8 +2755,8 @@ } } }, - "404" : { - "description" : "Not Found", + "409" : { + "description" : "Conflict", "content" : { "application/problem+json" : { "schema" : { @@ -2373,16 +2769,18 @@ "security" : [ { "bearerAuth" : [ "global" ] } ] - }, - "head" : { - "tags" : [ "Management" ], - "summary" : "verify if Institution exists for a given ID", - "description" : "verify if Institution exists for a given ID", - "operationId" : "verifyInstitutionUsingHEAD", + } + }, + "/onboarding/relationship/{relationshipId}/document" : { + "get" : { + "tags" : [ "Onboarding" ], + "summary" : "retrieve the contractDocument related to a relationship", + "description" : "retrieve the contractDocument related to a relationship", + "operationId" : "getOnboardingDocumentUsingGET", "parameters" : [ { - "name" : "id", + "name" : "relationshipId", "in" : "path", - "description" : "The internal identifier of the institution", + "description" : "UserBinding's unique identifier", "required" : true, "style" : "simple", "schema" : { @@ -2390,8 +2788,16 @@ } } ], "responses" : { - "204" : { - "description" : "No Content" + "200" : { + "description" : "OK", + "content" : { + "*/*" : { + "schema" : { + "type" : "string", + "format" : "byte" + } + } + } }, "400" : { "description" : "Bad Request", @@ -2414,37 +2820,35 @@ } } }, - "deprecated" : true, "security" : [ { "bearerAuth" : [ "global" ] } ] } }, - "/institutions/{id}/geotaxonomies" : { - "get" : { - "tags" : [ "Institution" ], - "summary" : "retrieves the geographic taxonomies this institution is related to", - "description" : "retrieves the geographic taxonomies this institution is related to", - "operationId" : "retrieveInstitutionGeoTaxonomiesUsingGET", - "parameters" : [ { - "name" : "id", - "in" : "path", - "description" : "The internal identifier of the institution", - "required" : true, - "style" : "simple", - "schema" : { - "type" : "string" + "/onboarding/subdelegates" : { + "post" : { + "tags" : [ "Onboarding" ], + "summary" : "performs subdelegates onboarding on an already existing institution", + "description" : "performs subdelegates onboarding on an already existing institution", + "operationId" : "onboardingInstitutionSubDelegateUsingPOST", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/OnboardingInstitutionOperatorsRequest" + } + } } - } ], + }, "responses" : { "200" : { "description" : "OK", "content" : { - "application/json" : { + "*/*" : { "schema" : { "type" : "array", "items" : { - "$ref" : "#/components/schemas/GeographicTaxonomies" + "$ref" : "#/components/schemas/RelationshipResult" } } } @@ -2469,6 +2873,16 @@ } } } + }, + "409" : { + "description" : "Conflict", + "content" : { + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } } }, "security" : [ { @@ -2476,38 +2890,31 @@ } ] } }, - "/institutions/{id}/onboarding" : { + "/onboarding/users" : { "post" : { - "tags" : [ "Institution" ], + "tags" : [ "Onboarding", "support" ], "summary" : "The service adds users to the registry if they are not present and associates them with the institution and product contained in the body", "description" : "The service adds users to the registry if they are not present and associates them with the institution and product contained in the body", - "operationId" : "onboardingInstitutionUsingPOST", - "parameters" : [ { - "name" : "id", - "in" : "path", - "description" : "id", - "required" : true, - "style" : "simple", - "schema" : { - "type" : "string" - } - } ], + "operationId" : "onboardingInstitutionUsersUsingPOST", "requestBody" : { "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/InstitutionOnboardingRequest" + "$ref" : "#/components/schemas/OnboardingInstitutionUsersRequest" } } } }, "responses" : { - "201" : { - "description" : "Created", + "200" : { + "description" : "OK", "content" : { - "application/json" : { + "*/*" : { "schema" : { - "$ref" : "#/components/schemas/InstitutionResponse" + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/RelationshipResult" + } } } } @@ -2548,43 +2955,70 @@ } ] } }, - "/institutions/{id}/products" : { - "get" : { - "tags" : [ "Institution" ], - "summary" : "retrieves the insistitution's related products.", - "description" : "retrieves the insistitution's related products.", - "operationId" : "retrieveInstitutionProductsUsingGET", + "/onboarding/verify" : { + "head" : { + "tags" : [ "Onboarding" ], + "summary" : "verify if onboardedProduct is already onboarded for institution", + "description" : "verify if onboardedProduct is already onboarded for institution", + "operationId" : "verifyOnboardingInfoByFiltersUsingHEAD", "parameters" : [ { - "name" : "id", - "in" : "path", - "description" : "The internal identifier of the institution", + "name" : "productId", + "in" : "query", + "description" : "Product's unique identifier", "required" : true, - "style" : "simple", + "style" : "form", "schema" : { "type" : "string" } }, { - "name" : "states", + "name" : "externalId", "in" : "query", - "description" : "List of Relationship state for filter products", + "description" : "Institution's unique external identifier", "required" : false, "style" : "form", - "explode" : true, "schema" : { - "type" : "string", - "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ] + "type" : "string" } - } ], - "responses" : { - "200" : { - "description" : "OK", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/OnboardedProducts" - } - } - } + }, { + "name" : "taxCode", + "in" : "query", + "description" : "Institution's tax code", + "required" : false, + "style" : "form", + "schema" : { + "type" : "string" + } + }, { + "name" : "origin", + "in" : "query", + "description" : "Institution's origin", + "required" : false, + "style" : "form", + "schema" : { + "type" : "string" + } + }, { + "name" : "originId", + "in" : "query", + "description" : "Institution's id in the relative origin open data", + "required" : false, + "style" : "form", + "schema" : { + "type" : "string" + } + }, { + "name" : "subunitCode", + "in" : "query", + "description" : "Institution's subunit code", + "required" : false, + "style" : "form", + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "204" : { + "description" : "No Content" }, "400" : { "description" : "Bad Request", @@ -2612,89 +3046,47 @@ } ] } }, - "/institutions/{id}/relationships" : { - "get" : { - "tags" : [ "Institution" ], - "summary" : "returns the relationships related to the institution", - "description" : "returns the relationships related to the institution", - "operationId" : "getUserInstitutionRelationshipsUsingGET", + "/notification-event/contracts" : { + "put" : { + "tags" : [ "kafka" ], + "summary" : "resendContractsByInstitutionIdAndTokenId", + "description" : "Function to send a specific onboarding using institutionId and tokenId ", + "operationId" : "resendContractsByInstitutionIdAndTokenIdUsingPUT", "parameters" : [ { - "name" : "id", - "in" : "path", - "description" : "The internal identifier of the institution", - "required" : true, - "style" : "simple", - "schema" : { - "type" : "string" - } - }, { - "name" : "personId", - "in" : "query", - "description" : "personId", - "required" : false, - "style" : "form", - "schema" : { - "type" : "string" - } - }, { - "name" : "roles", - "in" : "query", - "description" : "roles", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "string", - "enum" : [ "DELEGATE", "MANAGER", "OPERATOR", "SUB_DELEGATE" ] - } - }, { - "name" : "states", - "in" : "query", - "description" : "states", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "string", - "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ] - } - }, { - "name" : "products", + "name" : "tokenId", "in" : "query", - "description" : "products", - "required" : false, + "description" : "tokenId", + "required" : true, "style" : "form", - "explode" : true, "schema" : { "type" : "string" } }, { - "name" : "productRoles", + "name" : "institutionId", "in" : "query", - "description" : "productRoles", - "required" : false, + "description" : "institutionId", + "required" : true, "style" : "form", - "explode" : true, "schema" : { "type" : "string" } } ], "responses" : { "200" : { - "description" : "OK", + "description" : "OK" + }, + "400" : { + "description" : "Bad Request", "content" : { - "application/json" : { + "application/problem+json" : { "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/RelationshipResult" - } + "$ref" : "#/components/schemas/Problem" } } } }, - "400" : { - "description" : "Bad Request", + "403" : { + "description" : "Forbidden", "content" : { "application/problem+json" : { "schema" : { @@ -2717,33 +3109,33 @@ "security" : [ { "bearerAuth" : [ "global" ] } ] - } - }, - "/institutions/{institutionId}/createdAt" : { - "put" : { - "tags" : [ "Institution" ], - "summary" : "The service updates the createdAt field for the institution-product pair", - "description" : "The service updates the createdAt field for the institution-product pair", - "operationId" : "updateCreatedAtUsingPUT", + }, + "post" : { + "tags" : [ "kafka" ], + "summary" : "resendContracts", + "description" : "Service to resend contract notifications on SC-Contracts topic", + "operationId" : "resendContractsUsingPOST", "parameters" : [ { - "name" : "institutionId", - "in" : "path", - "description" : "institutionId", + "name" : "size", + "in" : "query", + "description" : "size", + "required" : false, + "style" : "form", + "schema" : { + "type" : "integer", + "format" : "int32" + } + }, { + "name" : "productsFilter", + "in" : "query", + "description" : "productsFilter", "required" : true, - "style" : "simple", + "style" : "form", + "explode" : true, "schema" : { "type" : "string" } } ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/CreatedAtRequest" - } - } - } - }, "responses" : { "200" : { "description" : "OK" @@ -2758,8 +3150,8 @@ } } }, - "403" : { - "description" : "Forbidden", + "404" : { + "description" : "Not Found", "content" : { "application/problem+json" : { "schema" : { @@ -2768,8 +3160,8 @@ } } }, - "404" : { - "description" : "Not Found", + "409" : { + "description" : "Conflict", "content" : { "application/problem+json" : { "schema" : { @@ -2784,25 +3176,46 @@ } ] } }, - "/institutions/{institutionId}/onboardings" : { - "get" : { - "tags" : [ "Institution", "external-v2" ], - "summary" : "${swagger.mscore.institution.info}", - "description" : "${swagger.mscore.institution.info}", - "operationId" : "getOnboardingsInstitutionUsingGET", + "/notification-event/users" : { + "post" : { + "tags" : [ "kafka" ], + "summary" : "resendUsers", + "description" : "Service to resend old user onboardings to the SCUsers kafka queue, it can send the onboardings of a single user or also retrieve all the users for a given set of products in a paged manner by passing page and size", + "operationId" : "resendUsersUsingPOST", "parameters" : [ { - "name" : "institutionId", - "in" : "path", - "description" : "The internal identifier of the institution", + "name" : "size", + "in" : "query", + "description" : "size", + "required" : false, + "style" : "form", + "schema" : { + "type" : "integer", + "format" : "int32" + } + }, { + "name" : "page", + "in" : "query", + "description" : "page", + "required" : false, + "style" : "form", + "schema" : { + "type" : "integer", + "format" : "int32" + } + }, { + "name" : "productsFilter", + "in" : "query", + "description" : "productsFilter", "required" : true, - "style" : "simple", + "style" : "form", + "explode" : true, "schema" : { "type" : "string" } }, { - "name" : "productId", + "name" : "userId", "in" : "query", - "description" : "productId", + "description" : "userId", "required" : false, "style" : "form", "schema" : { @@ -2811,17 +3224,20 @@ } ], "responses" : { "200" : { - "description" : "OK", + "description" : "OK" + }, + "400" : { + "description" : "Bad Request", "content" : { - "application/json" : { + "application/problem+json" : { "schema" : { - "$ref" : "#/components/schemas/OnboardingsResponse" + "$ref" : "#/components/schemas/Problem" } } } }, - "400" : { - "description" : "Bad Request", + "404" : { + "description" : "Not Found", "content" : { "application/problem+json" : { "schema" : { @@ -2830,8 +3246,8 @@ } } }, - "404" : { - "description" : "Not Found", + "409" : { + "description" : "Conflict", "content" : { "application/problem+json" : { "schema" : { @@ -2846,32 +3262,19 @@ } ] } }, - "/institutions/{institutionId}/users" : { + "/notification-event/users/count" : { "get" : { - "tags" : [ "Institution", "support" ], - "summary" : "getInstitutionUsers", - "description" : "Retrieve institution's users", - "operationId" : "getInstitutionUsersUsingGET", - "parameters" : [ { - "name" : "institutionId", - "in" : "path", - "description" : "Institution's unique identifier", - "required" : true, - "style" : "simple", - "schema" : { - "type" : "string" - } - } ], + "tags" : [ "kafka" ], + "summary" : "countUsers", + "description" : "Users' Count for single product", + "operationId" : "countUsersUsingGET", "responses" : { "200" : { "description" : "OK", "content" : { - "application/json" : { + "*/*" : { "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/UserInfoResponse" - } + "$ref" : "#/components/schemas/ProductCountResponse" } } } @@ -2902,42 +3305,60 @@ } ] } }, - "/institutions/{productId}/brokers/{institutionType}" : { + "/tokens" : { "get" : { - "tags" : [ "Institution" ], - "summary" : "Retrieve institution brokers", - "description" : "${swagger.mscore.institutions.getInstitutionBrokers}", - "operationId" : "getInstitutionBrokersUsingGET", + "tags" : [ "Token" ], + "summary" : "Retrieve all token relationships", + "description" : "Retrieve all token relationships", + "operationId" : "getAllTokensUsingGET", "parameters" : [ { - "name" : "productId", - "in" : "path", - "description" : "Product's unique identifier", - "required" : true, - "style" : "simple", + "name" : "states", + "in" : "query", + "description" : "Token relationship's status", + "required" : false, + "style" : "form", + "explode" : true, "schema" : { - "type" : "string" + "type" : "string", + "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ] } }, { - "name" : "institutionType", - "in" : "path", - "description" : "Institution's type", - "required" : true, - "style" : "simple", + "name" : "page", + "in" : "query", + "description" : "Page number", + "required" : false, + "style" : "form", "schema" : { - "type" : "string", - "enum" : [ "AS", "CON", "GSP", "PA", "PG", "PSP", "PT", "REC", "SA", "SCP" ] + "type" : "integer", + "format" : "int32" + } + }, { + "name" : "size", + "in" : "query", + "description" : "Page size", + "required" : false, + "style" : "form", + "schema" : { + "type" : "integer", + "format" : "int32" + } + }, { + "name" : "productId", + "in" : "query", + "description" : "productId", + "required" : false, + "style" : "form", + "schema" : { + "type" : "string" } } ], "responses" : { "200" : { "description" : "OK", "content" : { - "application/json" : { + "*/*" : { "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/BrokerResponse" - } + "$ref" : "#/components/schemas/PaginatedTokenResponse" } } } @@ -2968,28 +3389,49 @@ } ] } }, - "/bulk/institutions" : { - "post" : { - "tags" : [ "Management" ], - "summary" : "Gets the corresponding institution using internal institution id", - "description" : "Gets the corresponding institution using internal institution id", - "operationId" : "retrieveInstitutionByIdsUsingPOST", - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/BulkPartiesSeed" - } - } + "/tokens/products/{productId}" : { + "get" : { + "tags" : [ "Token", "external-v2" ], + "summary" : "Retrieve all token from a product", + "description" : "Retrieve all token from a product", + "operationId" : "findFromProductUsingGET_1", + "parameters" : [ { + "name" : "productId", + "in" : "path", + "description" : "Product's unique identifier", + "required" : true, + "style" : "simple", + "schema" : { + "type" : "string" } - }, + }, { + "name" : "page", + "in" : "query", + "description" : "Page number", + "required" : false, + "style" : "form", + "schema" : { + "type" : "integer", + "format" : "int32" + } + }, { + "name" : "size", + "in" : "query", + "description" : "Page size", + "required" : false, + "style" : "form", + "schema" : { + "type" : "integer", + "format" : "int32" + } + } ], "responses" : { "200" : { "description" : "OK", "content" : { "*/*" : { "schema" : { - "$ref" : "#/components/schemas/BulkInstitutions" + "$ref" : "#/components/schemas/TokenListResponse" } } } @@ -3013,16 +3455,6 @@ } } } - }, - "409" : { - "description" : "Conflict", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } } }, "security" : [ { @@ -3030,29 +3462,37 @@ } ] } }, - "/external/institutions/product/{productId}" : { + "/tokens/token" : { "get" : { - "tags" : [ "Management" ], - "summary" : "Retrieves Institutions by product ID", - "description" : "Retrieves Institutions by product ID", - "operationId" : "getInstitutionByProductIdUsingGET", + "tags" : [ "Token" ], + "summary" : "Retrieve token given the institution's and product ids", + "operationId" : "getTokenUsingGET", "parameters" : [ { + "name" : "institutionId", + "in" : "query", + "description" : "Institution's unique internal identifier", + "required" : true, + "style" : "form", + "schema" : { + "type" : "string" + } + }, { "name" : "productId", - "in" : "path", + "in" : "query", "description" : "Product's unique identifier", "required" : true, - "style" : "simple", + "style" : "form", "schema" : { "type" : "string" } } ], "responses" : { - "204" : { - "description" : "No Content", + "200" : { + "description" : "OK", "content" : { "*/*" : { "schema" : { - "$ref" : "#/components/schemas/InstitutionListResponse" + "$ref" : "#/components/schemas/TokenResource" } } } @@ -3078,37 +3518,27 @@ } } }, - "deprecated" : true, "security" : [ { "bearerAuth" : [ "global" ] } ] } }, - "/institutions/bygeotaxonomies" : { + "/onboarded-users" : { "get" : { - "tags" : [ "Management" ], - "summary" : "Retrieves a collection of institutions having one or more geographic taxonomies", - "description" : "Retrieves a collection of institutions having one or more geographic taxonomies", - "operationId" : "getInstitutionByGeotaxonomiesUsingGET", + "tags" : [ "Persons" ], + "summary" : "Retrieve onboarded users according to identifiers in input", + "description" : "Retrieve onboarded users according to identifiers in input", + "operationId" : "getOnboardedUsersUsingGET", "parameters" : [ { - "name" : "geoTaxonomies", + "name" : "ids", "in" : "query", - "description" : "Comma separated list of the geographic taxonomies to search", + "description" : "Users unique identifiers", "required" : true, "style" : "form", + "explode" : true, "schema" : { "type" : "string" } - }, { - "name" : "searchMode", - "in" : "query", - "description" : "The search mode to perform, as default 'any'", - "required" : false, - "style" : "form", - "schema" : { - "type" : "string", - "enum" : [ "ALL", "ANY", "EXACT" ] - } } ], "responses" : { "204" : { @@ -3116,7 +3546,7 @@ "content" : { "*/*" : { "schema" : { - "$ref" : "#/components/schemas/InstitutionListResponse" + "$ref" : "#/components/schemas/OnboardedUsersResponse" } } } @@ -3142,22 +3572,21 @@ } } }, - "deprecated" : true, "security" : [ { "bearerAuth" : [ "global" ] } ] } }, - "/institutions/{id}/attributes" : { + "/relationships/{relationshipId}" : { "get" : { - "tags" : [ "Management" ], - "summary" : "returns the attributes of the identified institution, if any.", - "description" : "returns the attributes of the identified institution, if any.", - "operationId" : "getInstitutionAttributesUsingGET", + "tags" : [ "Persons" ], + "summary" : "Gets the corresponding relationship", + "description" : "Gets the corresponding relationship", + "operationId" : "getRelationshipUsingGET", "parameters" : [ { - "name" : "id", + "name" : "relationshipId", "in" : "path", - "description" : "The internal identifier of the institution", + "description" : "UserBinding's unique identifier", "required" : true, "style" : "simple", "schema" : { @@ -3165,15 +3594,12 @@ } } ], "responses" : { - "204" : { - "description" : "No Content", + "200" : { + "description" : "OK", "content" : { "*/*" : { "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/AttributesResponse" - } + "$ref" : "#/components/schemas/RelationshipResult" } } } @@ -3199,22 +3625,19 @@ } } }, - "deprecated" : true, "security" : [ { "bearerAuth" : [ "global" ] } ] - } - }, - "/management/external/institutions/{externalId}" : { - "get" : { - "tags" : [ "Management" ], - "summary" : "Gets institution using external institution id", - "description" : "Gets institution using external institution id", - "operationId" : "getInstitutionByExternalIdUsingGET", + }, + "delete" : { + "tags" : [ "Persons" ], + "summary" : "Given a relationship identifier, it deletes the corresponding relationship", + "description" : "Given a relationship identifier, it deletes the corresponding relationship", + "operationId" : "deleteRelationshipUsingDELETE", "parameters" : [ { - "name" : "externalId", + "name" : "relationshipId", "in" : "path", - "description" : "Institution's unique external identifier", + "description" : "UserBinding's unique identifier", "required" : true, "style" : "simple", "schema" : { @@ -3223,17 +3646,20 @@ } ], "responses" : { "204" : { - "description" : "No Content", + "description" : "No Content" + }, + "400" : { + "description" : "Bad Request", "content" : { - "*/*" : { + "application/problem+json" : { "schema" : { - "$ref" : "#/components/schemas/InstitutionManagementResponse" + "$ref" : "#/components/schemas/Problem" } } } }, - "400" : { - "description" : "Bad Request", + "404" : { + "description" : "Not Found", "content" : { "application/problem+json" : { "schema" : { @@ -3242,8 +3668,8 @@ } } }, - "404" : { - "description" : "Not Found", + "409" : { + "description" : "Conflict", "content" : { "application/problem+json" : { "schema" : { @@ -3253,22 +3679,21 @@ } } }, - "deprecated" : true, "security" : [ { "bearerAuth" : [ "global" ] } ] } }, - "/management/institutions/{id}" : { - "get" : { - "tags" : [ "Management" ], - "summary" : "Gets the corresponding institution using internal institution id", - "description" : "Gets the corresponding institution using internal institution id", - "operationId" : "getInstitutionByInternalIdUsingGET", + "/relationships/{relationshipId}/activate" : { + "post" : { + "tags" : [ "Persons" ], + "summary" : "Activate the relationship", + "description" : "Activate the relationship", + "operationId" : "activateRelationshipUsingPOST", "parameters" : [ { - "name" : "id", + "name" : "relationshipId", "in" : "path", - "description" : "The internal identifier of the institution", + "description" : "UserBinding's unique identifier", "required" : true, "style" : "simple", "schema" : { @@ -3277,17 +3702,20 @@ } ], "responses" : { "204" : { - "description" : "No Content", + "description" : "No Content" + }, + "400" : { + "description" : "Bad Request", "content" : { - "*/*" : { + "application/problem+json" : { "schema" : { - "$ref" : "#/components/schemas/InstitutionManagementResponse" + "$ref" : "#/components/schemas/Problem" } } } }, - "400" : { - "description" : "Bad Request", + "404" : { + "description" : "Not Found", "content" : { "application/problem+json" : { "schema" : { @@ -3296,8 +3724,8 @@ } } }, - "404" : { - "description" : "Not Found", + "409" : { + "description" : "Conflict", "content" : { "application/problem+json" : { "schema" : { @@ -3307,22 +3735,21 @@ } } }, - "deprecated" : true, "security" : [ { "bearerAuth" : [ "global" ] } ] } }, - "/persons/{id}" : { - "get" : { - "tags" : [ "Management" ], - "summary" : "Retrieves Person by ID", - "description" : "Retrieves Person by ID", - "operationId" : "getUserUsingGET", + "/relationships/{relationshipId}/suspend" : { + "post" : { + "tags" : [ "Persons" ], + "summary" : "Suspend the relationship", + "description" : "Suspend the relationship", + "operationId" : "suspendRelationshipUsingPOST", "parameters" : [ { - "name" : "id", + "name" : "relationshipId", "in" : "path", - "description" : "User's unique identifier (uuid)", + "description" : "UserBinding's unique identifier", "required" : true, "style" : "simple", "schema" : { @@ -3330,15 +3757,8 @@ } } ], "responses" : { - "200" : { - "description" : "OK", - "content" : { - "*/*" : { - "schema" : { - "$ref" : "#/components/schemas/PersonId" - } - } - } + "204" : { + "description" : "No Content" }, "400" : { "description" : "Bad Request", @@ -3359,44 +3779,9 @@ } } } - } - }, - "deprecated" : true, - "security" : [ { - "bearerAuth" : [ "global" ] - } ] - }, - "head" : { - "tags" : [ "Management" ], - "summary" : "verify if a Person exists for a given ID", - "description" : "verify if a Person exists for a given ID", - "operationId" : "verifyUserUsingHEAD", - "parameters" : [ { - "name" : "id", - "in" : "path", - "description" : "User's unique identifier (uuid)", - "required" : true, - "style" : "simple", - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "200" : { - "description" : "OK" - }, - "400" : { - "description" : "Bad Request", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } }, - "404" : { - "description" : "Not Found", + "409" : { + "description" : "Conflict", "content" : { "application/problem+json" : { "schema" : { @@ -3406,86 +3791,54 @@ } } }, - "deprecated" : true, "security" : [ { "bearerAuth" : [ "global" ] } ] } }, - "/relationships" : { + "/users" : { "get" : { - "tags" : [ "Management" ], - "summary" : "Return a list of relationships", - "description" : "Return a list of relationships", - "operationId" : "getInstitutionRelationshipsUsingGET", + "tags" : [ "Persons" ], + "summary" : "getUsers", + "description" : "Retrieve all users according to optional params in input", + "operationId" : "getUsersUsingGET", "parameters" : [ { - "name" : "from", - "in" : "query", - "description" : "from", - "required" : false, - "style" : "form", - "schema" : { - "type" : "string" - } - }, { - "name" : "to", - "in" : "query", - "description" : "to", - "required" : false, - "style" : "form", - "schema" : { - "type" : "string" - } - }, { - "name" : "roles", - "in" : "query", - "description" : "roles", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "string", - "enum" : [ "DELEGATE", "MANAGER", "OPERATOR", "SUB_DELEGATE" ] - } - }, { - "name" : "states", + "name" : "size", "in" : "query", - "description" : "states", + "description" : "size", "required" : false, "style" : "form", - "explode" : true, "schema" : { - "type" : "string", - "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ] + "type" : "integer", + "format" : "int32" } }, { - "name" : "products", + "name" : "page", "in" : "query", - "description" : "products", + "description" : "page", "required" : false, "style" : "form", - "explode" : true, "schema" : { - "type" : "string" + "type" : "integer", + "format" : "int32" } }, { - "name" : "productRoles", + "name" : "productId", "in" : "query", - "description" : "productRoles", + "description" : "productId", "required" : false, "style" : "form", - "explode" : true, "schema" : { "type" : "string" } } ], "responses" : { - "204" : { - "description" : "No Content", + "200" : { + "description" : "OK", "content" : { "*/*" : { "schema" : { - "$ref" : "#/components/schemas/RelationshipsManagement" + "$ref" : "#/components/schemas/UsersNotificationResponse" } } } @@ -3511,27 +3864,44 @@ } } }, - "deprecated" : true, "security" : [ { "bearerAuth" : [ "global" ] } ] } }, - "/tokens/{tokenId}" : { + "/users/{id}" : { "get" : { - "tags" : [ "Management" ], - "summary" : "retrieve a token relationship", - "description" : "retrieve a token relationship", - "operationId" : "getTokenUsingGET", + "tags" : [ "Persons", "external-v2", "support" ], + "summary" : "Retrieves user given userId and optional ProductId", + "description" : "Retrieves user given userId and optional ProductId", + "operationId" : "getUserInfoUsingGET", "parameters" : [ { - "name" : "tokenId", + "name" : "id", "in" : "path", - "description" : "contract's unique identifier", + "description" : "User's unique identifier", "required" : true, "style" : "simple", "schema" : { "type" : "string" } + }, { + "name" : "productId", + "in" : "query", + "description" : "Product's unique identifier", + "required" : false, + "style" : "form", + "schema" : { + "type" : "string" + } + }, { + "name" : "institutionId", + "in" : "query", + "description" : "The internal identifier of the institution", + "required" : false, + "style" : "form", + "schema" : { + "type" : "string" + } } ], "responses" : { "200" : { @@ -3539,7 +3909,7 @@ "content" : { "*/*" : { "schema" : { - "$ref" : "#/components/schemas/TokenResponse" + "$ref" : "#/components/schemas/UserResponse" } } } @@ -3565,31 +3935,30 @@ } } }, - "deprecated" : true, "security" : [ { "bearerAuth" : [ "global" ] } ] } }, - "/onboarding" : { - "head" : { - "tags" : [ "Onboarding" ], - "summary" : "verify if onboardedProduct is already onboarded for institution", - "description" : "verify if onboardedProduct is already onboarded for institution", - "operationId" : "verifyOnboardingInfoUsingHEAD", + "/users/{id}/status" : { + "put" : { + "tags" : [ "support" ], + "summary" : "Update user status with optional filter for institution, product, role and productRole", + "description" : "Update user status with optional filter for institution, product, role and productRole", + "operationId" : "updateUserStatusUsingPUT", "parameters" : [ { - "name" : "taxCode", - "in" : "query", - "description" : "Institution's tax code", + "name" : "id", + "in" : "path", + "description" : "User's unique identifier", "required" : true, - "style" : "form", + "style" : "simple", "schema" : { "type" : "string" } }, { - "name" : "subunitCode", + "name" : "institutionId", "in" : "query", - "description" : "Institution's subunit code", + "description" : "The internal identifier of the institution", "required" : false, "style" : "form", "schema" : { @@ -3599,11 +3968,40 @@ "name" : "productId", "in" : "query", "description" : "Product's unique identifier", - "required" : true, + "required" : false, + "style" : "form", + "schema" : { + "type" : "string" + } + }, { + "name" : "role", + "in" : "query", + "description" : "role", + "required" : false, + "style" : "form", + "schema" : { + "type" : "string", + "enum" : [ "DELEGATE", "MANAGER", "OPERATOR", "SUB_DELEGATE" ] + } + }, { + "name" : "productRole", + "in" : "query", + "description" : "productRole", + "required" : false, "style" : "form", "schema" : { "type" : "string" } + }, { + "name" : "status", + "in" : "query", + "description" : "status", + "required" : true, + "style" : "form", + "schema" : { + "type" : "string", + "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ] + } } ], "responses" : { "204" : { @@ -3619,6 +4017,16 @@ } } }, + "403" : { + "description" : "Forbidden", + "content" : { + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Problem" + } + } + } + }, "404" : { "description" : "Not Found", "content" : { @@ -3635,21 +4043,30 @@ } ] } }, - "/onboarding/approve/{tokenId}" : { + "/users/{id}/update" : { "post" : { - "tags" : [ "Onboarding" ], - "summary" : "approve an onboarding reuqest by an operator review", - "description" : "approve an onboarding reuqest by an operator review", - "operationId" : "approveOnboardingUsingPOST", + "tags" : [ "Persons" ], + "summary" : "Service to send notification when user data get's updated", + "description" : "Service to send notification when user data get's updated", + "operationId" : "updateUserUsingPOST", "parameters" : [ { - "name" : "tokenId", + "name" : "id", "in" : "path", - "description" : "contract's unique identifier", + "description" : "User's unique identifier", "required" : true, "style" : "simple", "schema" : { "type" : "string" } + }, { + "name" : "institutionId", + "in" : "query", + "description" : "The internal identifier of the institution", + "required" : true, + "style" : "form", + "schema" : { + "type" : "string" + } } ], "responses" : { "204" : { @@ -3691,1864 +4108,48 @@ } ] } }, - "/onboarding/complete/{tokenId}" : { - "post" : { - "tags" : [ "Onboarding" ], - "summary" : "complete an onboarding request", - "description" : "complete an onboarding request", - "operationId" : "completeOnboardingUsingPOST", + "/users/{userId}/institution-products" : { + "get" : { + "tags" : [ "Persons" ], + "summary" : "returns onboarding info", + "description" : "returns onboarding info", + "operationId" : "getInstitutionProductsInfoUsingGET", "parameters" : [ { - "name" : "tokenId", + "name" : "userId", "in" : "path", - "description" : "contract's unique identifier", + "description" : "UserBinding's unique identifier", "required" : true, "style" : "simple", "schema" : { "type" : "string" } + }, { + "name" : "institutionId", + "in" : "query", + "description" : "The internal identifier of the institution", + "required" : false, + "style" : "form", + "schema" : { + "type" : "string" + } + }, { + "name" : "states", + "in" : "query", + "description" : "List of Relationship state for filter products", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } } ], - "requestBody" : { - "content" : { - "multipart/form-data" : { - "schema" : { - "required" : [ "contract" ], - "type" : "object", - "properties" : { - "contract" : { - "type" : "string", - "description" : "contract", - "format" : "binary" - } - } - } - } - } - }, - "responses" : { - "204" : { - "description" : "No Content" - }, - "400" : { - "description" : "Bad Request", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "404" : { - "description" : "Not Found", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "409" : { - "description" : "Conflict", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "security" : [ { - "bearerAuth" : [ "global" ] - } ] - }, - "delete" : { - "tags" : [ "Onboarding" ], - "summary" : "invalidate an onboarding request", - "description" : "invalidate an onboarding request", - "operationId" : "invalidateOnboardingUsingDELETE", - "parameters" : [ { - "name" : "tokenId", - "in" : "path", - "description" : "contract's unique identifier", - "required" : true, - "style" : "simple", - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "204" : { - "description" : "No Content" - }, - "400" : { - "description" : "Bad Request", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "404" : { - "description" : "Not Found", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "409" : { - "description" : "Conflict", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "security" : [ { - "bearerAuth" : [ "global" ] - } ] - } - }, - "/onboarding/info" : { - "get" : { - "tags" : [ "Onboarding" ], - "summary" : "returns onboarding info", - "description" : "returns onboarding info", - "operationId" : "onboardingInfoUsingGET", - "parameters" : [ { - "name" : "institutionId", - "in" : "query", - "description" : "The internal identifier of the institution", - "required" : false, - "style" : "form", - "schema" : { - "type" : "string" - } - }, { - "name" : "institutionExternalId", - "in" : "query", - "description" : "Institution's unique external identifier", - "required" : false, - "style" : "form", - "schema" : { - "type" : "string" - } - }, { - "name" : "states", - "in" : "query", - "description" : "List of Relationship state for filter products", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "200" : { - "description" : "OK", - "content" : { - "*/*" : { - "schema" : { - "$ref" : "#/components/schemas/OnboardingInfoResponse" - } - } - } - }, - "400" : { - "description" : "Bad Request", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "404" : { - "description" : "Not Found", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "security" : [ { - "bearerAuth" : [ "global" ] - } ] - } - }, - "/onboarding/institution" : { - "post" : { - "tags" : [ "Onboarding" ], - "summary" : "Responsible for saving the association between an institution and a product. It also creates occurrences in the Users collection as part of this process.", - "description" : "Responsible for saving the association between an institution and a product. It also creates occurrences in the Users collection as part of this process.", - "operationId" : "onboardingInstitutionUsingPOST_1", - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/OnboardingInstitutionRequest" - } - } - } - }, - "responses" : { - "204" : { - "description" : "No Content" - }, - "400" : { - "description" : "Bad Request", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "404" : { - "description" : "Not Found", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "409" : { - "description" : "Conflict", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "security" : [ { - "bearerAuth" : [ "global" ] - } ] - } - }, - "/onboarding/institution/complete" : { - "post" : { - "tags" : [ "Onboarding" ], - "summary" : "update institution and users data without adding a new token", - "description" : "update institution and users data without adding a new token", - "operationId" : "onboardingInstitutionCompleteUsingPOST", - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/OnboardingInstitutionRequest" - } - } - } - }, - "responses" : { - "204" : { - "description" : "No Content" - }, - "400" : { - "description" : "Bad Request", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "404" : { - "description" : "Not Found", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "409" : { - "description" : "Conflict", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "security" : [ { - "bearerAuth" : [ "global" ] - } ] - } - }, - "/onboarding/institution/{externalId}/products/{productId}" : { - "head" : { - "tags" : [ "Onboarding" ], - "summary" : "verify if onboardedProduct is already onboarded for institution", - "description" : "verify if onboardedProduct is already onboarded for institution", - "operationId" : "verifyOnboardingInfoUsingHEAD_1", - "parameters" : [ { - "name" : "externalId", - "in" : "path", - "description" : "Institution's unique external identifier", - "required" : true, - "style" : "simple", - "schema" : { - "type" : "string" - } - }, { - "name" : "productId", - "in" : "path", - "description" : "Product's unique identifier", - "required" : true, - "style" : "simple", - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "204" : { - "description" : "No Content" - }, - "400" : { - "description" : "Bad Request", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "404" : { - "description" : "Not Found", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "security" : [ { - "bearerAuth" : [ "global" ] - } ] - } - }, - "/onboarding/legals" : { - "post" : { - "tags" : [ "Onboarding" ], - "summary" : "performs legals onboarding on an already existing institution", - "description" : "performs legals onboarding on an already existing institution", - "operationId" : "onboardingInstitutionLegalsUsingPOST", - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/OnboardingInstitutionLegalsRequest" - } - } - } - }, - "responses" : { - "204" : { - "description" : "No Content" - }, - "400" : { - "description" : "Bad Request", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "404" : { - "description" : "Not Found", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "409" : { - "description" : "Conflict", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "security" : [ { - "bearerAuth" : [ "global" ] - } ] - } - }, - "/onboarding/operators" : { - "post" : { - "tags" : [ "Onboarding" ], - "summary" : "performs operators onboarding on an already existing institution", - "description" : "performs operators onboarding on an already existing institution", - "operationId" : "onboardingInstitutionOperatorsUsingPOST", - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/OnboardingInstitutionOperatorsRequest" - } - } - } - }, - "responses" : { - "200" : { - "description" : "OK", - "content" : { - "*/*" : { - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/RelationshipResult" - } - } - } - } - }, - "400" : { - "description" : "Bad Request", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "404" : { - "description" : "Not Found", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "409" : { - "description" : "Conflict", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "security" : [ { - "bearerAuth" : [ "global" ] - } ] - } - }, - "/onboarding/reject/{tokenId}" : { - "delete" : { - "tags" : [ "Onboarding" ], - "summary" : "invalidate an onboarding request by an operator review", - "description" : "invalidate an onboarding request by an operator review", - "operationId" : "onboardingRejectUsingDELETE", - "parameters" : [ { - "name" : "tokenId", - "in" : "path", - "description" : "contract's unique identifier", - "required" : true, - "style" : "simple", - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "204" : { - "description" : "No Content" - }, - "400" : { - "description" : "Bad Request", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "404" : { - "description" : "Not Found", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "409" : { - "description" : "Conflict", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "security" : [ { - "bearerAuth" : [ "global" ] - } ] - } - }, - "/onboarding/relationship/{relationshipId}/document" : { - "get" : { - "tags" : [ "Onboarding" ], - "summary" : "retrieve the contractDocument related to a relationship", - "description" : "retrieve the contractDocument related to a relationship", - "operationId" : "getOnboardingDocumentUsingGET", - "parameters" : [ { - "name" : "relationshipId", - "in" : "path", - "description" : "UserBinding's unique identifier", - "required" : true, - "style" : "simple", - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "200" : { - "description" : "OK", - "content" : { - "*/*" : { - "schema" : { - "type" : "string", - "format" : "byte" - } - } - } - }, - "400" : { - "description" : "Bad Request", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "404" : { - "description" : "Not Found", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "security" : [ { - "bearerAuth" : [ "global" ] - } ] - } - }, - "/onboarding/subdelegates" : { - "post" : { - "tags" : [ "Onboarding" ], - "summary" : "performs subdelegates onboarding on an already existing institution", - "description" : "performs subdelegates onboarding on an already existing institution", - "operationId" : "onboardingInstitutionSubDelegateUsingPOST", - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/OnboardingInstitutionOperatorsRequest" - } - } - } - }, - "responses" : { - "200" : { - "description" : "OK", - "content" : { - "*/*" : { - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/RelationshipResult" - } - } - } - } - }, - "400" : { - "description" : "Bad Request", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "404" : { - "description" : "Not Found", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "409" : { - "description" : "Conflict", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "security" : [ { - "bearerAuth" : [ "global" ] - } ] - } - }, - "/onboarding/users" : { - "post" : { - "tags" : [ "Onboarding", "support" ], - "summary" : "The service adds users to the registry if they are not present and associates them with the institution and product contained in the body", - "description" : "The service adds users to the registry if they are not present and associates them with the institution and product contained in the body", - "operationId" : "onboardingInstitutionUsersUsingPOST", - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/OnboardingInstitutionUsersRequest" - } - } - } - }, - "responses" : { - "200" : { - "description" : "OK", - "content" : { - "*/*" : { - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/RelationshipResult" - } - } - } - } - }, - "400" : { - "description" : "Bad Request", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "404" : { - "description" : "Not Found", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "409" : { - "description" : "Conflict", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "security" : [ { - "bearerAuth" : [ "global" ] - } ] - } - }, - "/onboarding/{tokenId}/consume" : { - "post" : { - "tags" : [ "Onboarding" ], - "summary" : "Consume token onboarding request without digest verification ", - "description" : "Consume token onboarding request without digest verification ", - "operationId" : "consumeTokenUsingPOST", - "parameters" : [ { - "name" : "tokenId", - "in" : "path", - "description" : "contract's unique identifier", - "required" : true, - "style" : "simple", - "schema" : { - "type" : "string" - } - } ], - "requestBody" : { - "content" : { - "multipart/form-data" : { - "schema" : { - "required" : [ "contract" ], - "type" : "object", - "properties" : { - "contract" : { - "type" : "string", - "description" : "contract", - "format" : "binary" - } - } - } - } - } - }, - "responses" : { - "204" : { - "description" : "No Content" - }, - "400" : { - "description" : "Bad Request", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "404" : { - "description" : "Not Found", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "409" : { - "description" : "Conflict", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "security" : [ { - "bearerAuth" : [ "global" ] - } ] - } - }, - "/notification-event/contracts" : { - "post" : { - "tags" : [ "kafka" ], - "summary" : "resendContracts", - "description" : "Service to resend contract notifications on SC-Contracts topic", - "operationId" : "resendContractsUsingPOST", - "parameters" : [ { - "name" : "size", - "in" : "query", - "description" : "size", - "required" : false, - "style" : "form", - "schema" : { - "type" : "integer", - "format" : "int32" - } - }, { - "name" : "productsFilter", - "in" : "query", - "description" : "productsFilter", - "required" : true, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "200" : { - "description" : "OK" - }, - "400" : { - "description" : "Bad Request", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "404" : { - "description" : "Not Found", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "409" : { - "description" : "Conflict", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "security" : [ { - "bearerAuth" : [ "global" ] - } ] - } - }, - "/notification-event/users" : { - "post" : { - "tags" : [ "kafka" ], - "summary" : "resendUsers", - "description" : "Service to resend old user onboardings to the SCUsers kafka queue, it can send the onboardings of a single user or also retrieve all the users for a given set of products in a paged manner by passing page and size", - "operationId" : "resendUsersUsingPOST", - "parameters" : [ { - "name" : "size", - "in" : "query", - "description" : "size", - "required" : false, - "style" : "form", - "schema" : { - "type" : "integer", - "format" : "int32" - } - }, { - "name" : "page", - "in" : "query", - "description" : "page", - "required" : false, - "style" : "form", - "schema" : { - "type" : "integer", - "format" : "int32" - } - }, { - "name" : "productsFilter", - "in" : "query", - "description" : "productsFilter", - "required" : true, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "string" - } - }, { - "name" : "userId", - "in" : "query", - "description" : "userId", - "required" : false, - "style" : "form", - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "200" : { - "description" : "OK" - }, - "400" : { - "description" : "Bad Request", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "404" : { - "description" : "Not Found", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "409" : { - "description" : "Conflict", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "security" : [ { - "bearerAuth" : [ "global" ] - } ] - } - }, - "/tokens" : { - "get" : { - "tags" : [ "Token" ], - "summary" : "${swagger.mscore.tokens.getAll}", - "description" : "${swagger.mscore.tokens.getAll}", - "operationId" : "getAllTokensUsingGET", - "parameters" : [ { - "name" : "states", - "in" : "query", - "description" : "${swagger.mscore.token.model.states}", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "string", - "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ] - } - }, { - "name" : "page", - "in" : "query", - "description" : "${swagger.mscore.page.number}", - "required" : false, - "style" : "form", - "schema" : { - "type" : "integer", - "format" : "int32" - } - }, { - "name" : "size", - "in" : "query", - "description" : "${swagger.mscore.page.size}", - "required" : false, - "style" : "form", - "schema" : { - "type" : "integer", - "format" : "int32" - } - }, { - "name" : "productId", - "in" : "query", - "description" : "productId", - "required" : false, - "style" : "form", - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "200" : { - "description" : "OK", - "content" : { - "*/*" : { - "schema" : { - "$ref" : "#/components/schemas/PaginatedTokenResponse" - } - } - } - }, - "400" : { - "description" : "Bad Request", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "404" : { - "description" : "Not Found", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "security" : [ { - "bearerAuth" : [ "global" ] - } ] - } - }, - "/tokens/products/{productId}" : { - "get" : { - "tags" : [ "Token", "external-v2" ], - "summary" : "${swagger.mscore.tokens.findFromProduct}", - "description" : "${swagger.mscore.tokens.findFromProduct}", - "operationId" : "findFromProductUsingGET_1", - "parameters" : [ { - "name" : "productId", - "in" : "path", - "description" : "Product's unique identifier", - "required" : true, - "style" : "simple", - "schema" : { - "type" : "string" - } - }, { - "name" : "page", - "in" : "query", - "description" : "${swagger.mscore.page.number}", - "required" : false, - "style" : "form", - "schema" : { - "type" : "integer", - "format" : "int32" - } - }, { - "name" : "size", - "in" : "query", - "description" : "${swagger.mscore.page.size}", - "required" : false, - "style" : "form", - "schema" : { - "type" : "integer", - "format" : "int32" - } - } ], - "responses" : { - "200" : { - "description" : "OK", - "content" : { - "*/*" : { - "schema" : { - "$ref" : "#/components/schemas/TokenListResponse" - } - } - } - }, - "400" : { - "description" : "Bad Request", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "404" : { - "description" : "Not Found", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "security" : [ { - "bearerAuth" : [ "global" ] - } ] - } - }, - "/tokens/token" : { - "get" : { - "tags" : [ "Token" ], - "summary" : "Retrieve token given the institution's and product ids", - "operationId" : "getTokenUsingGET_1", - "parameters" : [ { - "name" : "institutionId", - "in" : "query", - "description" : "Institution's unique internal identifier", - "required" : true, - "style" : "form", - "schema" : { - "type" : "string" - } - }, { - "name" : "productId", - "in" : "query", - "description" : "Product's unique identifier", - "required" : true, - "style" : "form", - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "200" : { - "description" : "OK", - "content" : { - "*/*" : { - "schema" : { - "$ref" : "#/components/schemas/TokenResource" - } - } - } - }, - "400" : { - "description" : "Bad Request", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "404" : { - "description" : "Not Found", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "security" : [ { - "bearerAuth" : [ "global" ] - } ] - } - }, - "/tokens/{tokenId}/verify" : { - "post" : { - "tags" : [ "Token" ], - "summary" : "Verify if the token is already consumed", - "description" : "Verify if the token is already consumed", - "operationId" : "verifyTokenUsingPOST", - "parameters" : [ { - "name" : "tokenId", - "in" : "path", - "description" : "contract's unique identifier", - "required" : true, - "style" : "simple", - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "200" : { - "description" : "OK", - "content" : { - "*/*" : { - "schema" : { - "$ref" : "#/components/schemas/TokenResponse" - } - } - } - }, - "400" : { - "description" : "Bad Request", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "404" : { - "description" : "Not Found", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "409" : { - "description" : "Conflict", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "security" : [ { - "bearerAuth" : [ "global" ] - } ] - } - }, - "/onboarded-users" : { - "get" : { - "tags" : [ "Persons" ], - "summary" : "Retrieve onboarded users according to identifiers in input", - "description" : "Retrieve onboarded users according to identifiers in input", - "operationId" : "getOnboardedUsersUsingGET", - "parameters" : [ { - "name" : "ids", - "in" : "query", - "description" : "Users unique identifiers", - "required" : true, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "204" : { - "description" : "No Content", - "content" : { - "*/*" : { - "schema" : { - "$ref" : "#/components/schemas/OnboardedUsersResponse" - } - } - } - }, - "400" : { - "description" : "Bad Request", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "404" : { - "description" : "Not Found", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "security" : [ { - "bearerAuth" : [ "global" ] - } ] - } - }, - "/relationships/{relationshipId}" : { - "get" : { - "tags" : [ "Persons" ], - "summary" : "Gets the corresponding relationship", - "description" : "Gets the corresponding relationship", - "operationId" : "getRelationshipUsingGET", - "parameters" : [ { - "name" : "relationshipId", - "in" : "path", - "description" : "UserBinding's unique identifier", - "required" : true, - "style" : "simple", - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "200" : { - "description" : "OK", - "content" : { - "*/*" : { - "schema" : { - "$ref" : "#/components/schemas/RelationshipResult" - } - } - } - }, - "400" : { - "description" : "Bad Request", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "404" : { - "description" : "Not Found", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "security" : [ { - "bearerAuth" : [ "global" ] - } ] - }, - "delete" : { - "tags" : [ "Persons" ], - "summary" : "Given a relationship identifier, it deletes the corresponding relationship", - "description" : "Given a relationship identifier, it deletes the corresponding relationship", - "operationId" : "deleteRelationshipUsingDELETE", - "parameters" : [ { - "name" : "relationshipId", - "in" : "path", - "description" : "UserBinding's unique identifier", - "required" : true, - "style" : "simple", - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "204" : { - "description" : "No Content" - }, - "400" : { - "description" : "Bad Request", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "404" : { - "description" : "Not Found", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "409" : { - "description" : "Conflict", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "security" : [ { - "bearerAuth" : [ "global" ] - } ] - } - }, - "/relationships/{relationshipId}/activate" : { - "post" : { - "tags" : [ "Persons" ], - "summary" : "Activate the relationship", - "description" : "Activate the relationship", - "operationId" : "activateRelationshipUsingPOST", - "parameters" : [ { - "name" : "relationshipId", - "in" : "path", - "description" : "UserBinding's unique identifier", - "required" : true, - "style" : "simple", - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "204" : { - "description" : "No Content" - }, - "400" : { - "description" : "Bad Request", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "404" : { - "description" : "Not Found", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "409" : { - "description" : "Conflict", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "security" : [ { - "bearerAuth" : [ "global" ] - } ] - } - }, - "/relationships/{relationshipId}/suspend" : { - "post" : { - "tags" : [ "Persons" ], - "summary" : "Suspend the relationship", - "description" : "Suspend the relationship", - "operationId" : "suspendRelationshipUsingPOST", - "parameters" : [ { - "name" : "relationshipId", - "in" : "path", - "description" : "UserBinding's unique identifier", - "required" : true, - "style" : "simple", - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "204" : { - "description" : "No Content" - }, - "400" : { - "description" : "Bad Request", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "404" : { - "description" : "Not Found", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "409" : { - "description" : "Conflict", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "security" : [ { - "bearerAuth" : [ "global" ] - } ] - } - }, - "/users" : { - "get" : { - "tags" : [ "Persons" ], - "summary" : "getUsers", - "description" : "Retrieve all users according to optional params in input", - "operationId" : "getUsersUsingGET", - "parameters" : [ { - "name" : "size", - "in" : "query", - "description" : "size", - "required" : false, - "style" : "form", - "schema" : { - "type" : "integer", - "format" : "int32" - } - }, { - "name" : "page", - "in" : "query", - "description" : "page", - "required" : false, - "style" : "form", - "schema" : { - "type" : "integer", - "format" : "int32" - } - }, { - "name" : "productId", - "in" : "query", - "description" : "productId", - "required" : false, - "style" : "form", - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "200" : { - "description" : "OK", - "content" : { - "*/*" : { - "schema" : { - "$ref" : "#/components/schemas/UsersNotificationResponse" - } - } - } - }, - "400" : { - "description" : "Bad Request", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "404" : { - "description" : "Not Found", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "security" : [ { - "bearerAuth" : [ "global" ] - } ] - } - }, - "/users/{id}" : { - "get" : { - "tags" : [ "Persons", "external-v2", "support" ], - "summary" : "Retrieves user given userId and optional ProductId", - "description" : "Retrieves user given userId and optional ProductId", - "operationId" : "getUserInfoUsingGET", - "parameters" : [ { - "name" : "id", - "in" : "path", - "description" : "User's unique identifier", - "required" : true, - "style" : "simple", - "schema" : { - "type" : "string" - } - }, { - "name" : "productId", - "in" : "query", - "description" : "Product's unique identifier", - "required" : false, - "style" : "form", - "schema" : { - "type" : "string" - } - }, { - "name" : "institutionId", - "in" : "query", - "description" : "The internal identifier of the institution", - "required" : false, - "style" : "form", - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "200" : { - "description" : "OK", - "content" : { - "*/*" : { - "schema" : { - "$ref" : "#/components/schemas/UserResponse" - } - } - } - }, - "400" : { - "description" : "Bad Request", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "404" : { - "description" : "Not Found", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "security" : [ { - "bearerAuth" : [ "global" ] - } ] - } - }, - "/users/{id}/status" : { - "put" : { - "tags" : [ "support" ], - "summary" : "Update user status with optional filter for institution, product, role and productRole", - "description" : "Update user status with optional filter for institution, product, role and productRole", - "operationId" : "updateUserStatusUsingPUT", - "parameters" : [ { - "name" : "id", - "in" : "path", - "description" : "User's unique identifier", - "required" : true, - "style" : "simple", - "schema" : { - "type" : "string" - } - }, { - "name" : "institutionId", - "in" : "query", - "description" : "The internal identifier of the institution", - "required" : false, - "style" : "form", - "schema" : { - "type" : "string" - } - }, { - "name" : "productId", - "in" : "query", - "description" : "Product's unique identifier", - "required" : false, - "style" : "form", - "schema" : { - "type" : "string" - } - }, { - "name" : "role", - "in" : "query", - "description" : "role", - "required" : false, - "style" : "form", - "schema" : { - "type" : "string", - "enum" : [ "DELEGATE", "MANAGER", "OPERATOR", "SUB_DELEGATE" ] - } - }, { - "name" : "productRole", - "in" : "query", - "description" : "productRole", - "required" : false, - "style" : "form", - "schema" : { - "type" : "string" - } - }, { - "name" : "status", - "in" : "query", - "description" : "status", - "required" : true, - "style" : "form", - "schema" : { - "type" : "string", - "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ] - } - } ], - "responses" : { - "204" : { - "description" : "No Content" - }, - "400" : { - "description" : "Bad Request", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "403" : { - "description" : "Forbidden", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "404" : { - "description" : "Not Found", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "security" : [ { - "bearerAuth" : [ "global" ] - } ] - } - }, - "/users/{id}/update" : { - "post" : { - "tags" : [ "Persons" ], - "summary" : "Service to send notification when user data get's updated", - "description" : "Service to send notification when user data get's updated", - "operationId" : "updateUserUsingPOST", - "parameters" : [ { - "name" : "id", - "in" : "path", - "description" : "User's unique identifier", - "required" : true, - "style" : "simple", - "schema" : { - "type" : "string" - } - }, { - "name" : "institutionId", - "in" : "query", - "description" : "The internal identifier of the institution", - "required" : true, - "style" : "form", - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "204" : { - "description" : "No Content" - }, - "400" : { - "description" : "Bad Request", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "404" : { - "description" : "Not Found", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - }, - "409" : { - "description" : "Conflict", - "content" : { - "application/problem+json" : { - "schema" : { - "$ref" : "#/components/schemas/Problem" - } - } - } - } - }, - "security" : [ { - "bearerAuth" : [ "global" ] - } ] - } - }, - "/users/{userId}/institution-products" : { - "get" : { - "tags" : [ "Persons" ], - "summary" : "returns onboarding info", - "description" : "returns onboarding info", - "operationId" : "getInstitutionProductsInfoUsingGET", - "parameters" : [ { - "name" : "userId", - "in" : "path", - "description" : "UserBinding's unique identifier", - "required" : true, - "style" : "simple", - "schema" : { - "type" : "string" - } - }, { - "name" : "institutionId", - "in" : "query", - "description" : "The internal identifier of the institution", - "required" : false, - "style" : "form", - "schema" : { - "type" : "string" - } - }, { - "name" : "states", - "in" : "query", - "description" : "List of Relationship state for filter products", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "200" : { - "description" : "OK", - "content" : { - "*/*" : { - "schema" : { - "$ref" : "#/components/schemas/OnboardingInfoResponse" + "responses" : { + "200" : { + "description" : "OK", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/OnboardingInfoResponse" } } } @@ -5748,63 +4349,15 @@ "type" : "string" }, "ipa" : { - "type" : "boolean" - }, - "ipaCode" : { - "type" : "string" - }, - "otherNote" : { - "type" : "string" - }, - "regulatedMarketNote" : { - "type" : "string" - } - } - }, - "AdditionalInformationsRequest" : { - "title" : "AdditionalInformationsRequest", - "type" : "object", - "properties" : { - "agentOfPublicService" : { - "type" : "boolean" - }, - "agentOfPublicServiceNote" : { - "type" : "string" - }, - "belongRegulatedMarket" : { - "type" : "boolean" - }, - "establishedByRegulatoryProvision" : { - "type" : "boolean" - }, - "establishedByRegulatoryProvisionNote" : { - "type" : "string" - }, - "ipa" : { - "type" : "boolean" - }, - "ipaCode" : { - "type" : "string" - }, - "otherNote" : { - "type" : "string" - }, - "regulatedMarketNote" : { - "type" : "string" - } - } - }, - "Attributes" : { - "title" : "Attributes", - "type" : "object", - "properties" : { - "code" : { + "type" : "boolean" + }, + "ipaCode" : { "type" : "string" }, - "description" : { + "otherNote" : { "type" : "string" }, - "origin" : { + "regulatedMarketNote" : { "type" : "string" } } @@ -6025,18 +4578,6 @@ } } }, - "ContractRequest" : { - "title" : "ContractRequest", - "type" : "object", - "properties" : { - "path" : { - "type" : "string" - }, - "version" : { - "type" : "string" - } - } - }, "CreatePgInstitutionRequest" : { "title" : "CreatePgInstitutionRequest", "type" : "object", @@ -6130,6 +4671,10 @@ "title" : "DelegationRequest", "type" : "object", "properties" : { + "createdAt" : { + "type" : "string", + "format" : "date-time" + }, "from" : { "type" : "string" }, @@ -6142,12 +4687,20 @@ "productId" : { "type" : "string" }, + "status" : { + "type" : "string", + "enum" : [ "ACTIVE", "DELETED" ] + }, "to" : { "type" : "string" }, "type" : { "type" : "string", "enum" : [ "AOO", "PT" ] + }, + "updatedAt" : { + "type" : "string", + "format" : "date-time" } } }, @@ -6155,6 +4708,10 @@ "title" : "DelegationRequestFromTaxcode", "type" : "object", "properties" : { + "createdAt" : { + "type" : "string", + "format" : "date-time" + }, "fromSubunitCode" : { "type" : "string" }, @@ -6170,6 +4727,10 @@ "productId" : { "type" : "string" }, + "status" : { + "type" : "string", + "enum" : [ "ACTIVE", "DELETED" ] + }, "toSubunitCode" : { "type" : "string" }, @@ -6179,6 +4740,10 @@ "type" : { "type" : "string", "enum" : [ "AOO", "PT" ] + }, + "updatedAt" : { + "type" : "string", + "format" : "date-time" } } }, @@ -6283,126 +4848,6 @@ } } }, - "Institution" : { - "title" : "Institution", - "type" : "object", - "properties" : { - "address" : { - "type" : "string" - }, - "attributes" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/Attributes" - } - }, - "billing" : { - "$ref" : "#/components/schemas/Billing" - }, - "businessRegisterPlace" : { - "type" : "string" - }, - "city" : { - "type" : "string" - }, - "country" : { - "type" : "string" - }, - "county" : { - "type" : "string" - }, - "createdAt" : { - "type" : "string", - "format" : "date-time" - }, - "dataProtectionOfficer" : { - "$ref" : "#/components/schemas/DataProtectionOfficer" - }, - "delegation" : { - "type" : "boolean" - }, - "description" : { - "type" : "string" - }, - "digitalAddress" : { - "type" : "string" - }, - "externalId" : { - "type" : "string" - }, - "geographicTaxonomies" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/InstitutionGeographicTaxonomies" - } - }, - "id" : { - "type" : "string" - }, - "imported" : { - "type" : "boolean" - }, - "institutionType" : { - "type" : "string", - "enum" : [ "AS", "CON", "GSP", "PA", "PG", "PSP", "PT", "REC", "SA", "SCP" ] - }, - "istatCode" : { - "type" : "string" - }, - "onboarding" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/Onboarding" - } - }, - "origin" : { - "type" : "string" - }, - "originId" : { - "type" : "string" - }, - "paAttributes" : { - "$ref" : "#/components/schemas/PaAttributes" - }, - "parentDescription" : { - "type" : "string" - }, - "paymentServiceProvider" : { - "$ref" : "#/components/schemas/PaymentServiceProvider" - }, - "rea" : { - "type" : "string" - }, - "rootParentId" : { - "type" : "string" - }, - "shareCapital" : { - "type" : "string" - }, - "subunitCode" : { - "type" : "string" - }, - "subunitType" : { - "type" : "string" - }, - "supportEmail" : { - "type" : "string" - }, - "supportPhone" : { - "type" : "string" - }, - "taxCode" : { - "type" : "string" - }, - "updatedAt" : { - "type" : "string", - "format" : "date-time" - }, - "zipCode" : { - "type" : "string" - } - } - }, "InstitutionBillingResponse" : { "title" : "InstitutionBillingResponse", "type" : "object", @@ -6484,120 +4929,12 @@ }, "InstitutionGeographicTaxonomies" : { "title" : "InstitutionGeographicTaxonomies", - "type" : "object", - "properties" : { - "code" : { - "type" : "string" - }, - "desc" : { - "type" : "string" - } - } - }, - "InstitutionListResponse" : { - "title" : "InstitutionListResponse", - "type" : "object", - "properties" : { - "items" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/InstitutionManagementResponse" - } - } - } - }, - "InstitutionManagementResponse" : { - "title" : "InstitutionManagementResponse", - "type" : "object", - "properties" : { - "address" : { - "type" : "string" - }, - "aooParentCode" : { - "type" : "string" - }, - "attributes" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/AttributesResponse" - } - }, - "businessRegisterPlace" : { - "type" : "string" - }, - "createdAt" : { - "type" : "string", - "format" : "date-time" - }, - "dataProtectionOfficer" : { - "$ref" : "#/components/schemas/DataProtectionOfficerResponse" - }, - "description" : { - "type" : "string" - }, - "digitalAddress" : { - "type" : "string" - }, - "externalId" : { - "type" : "string" - }, - "geographicTaxonomies" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/GeoTaxonomies" - } - }, - "id" : { - "type" : "string" - }, - "imported" : { - "type" : "boolean" - }, - "institutionType" : { - "type" : "string", - "enum" : [ "AS", "CON", "GSP", "PA", "PG", "PSP", "PT", "REC", "SA", "SCP" ] - }, - "origin" : { - "type" : "string" - }, - "originId" : { - "type" : "string" - }, - "paymentServiceProvider" : { - "$ref" : "#/components/schemas/PaymentServiceProviderResponse" - }, - "products" : { - "type" : "object", - "additionalProperties" : { - "$ref" : "#/components/schemas/ProductsManagement" - } - }, - "rea" : { - "type" : "string" - }, - "shareCapital" : { - "type" : "string" - }, - "subunitCode" : { - "type" : "string" - }, - "subunitType" : { - "type" : "string" - }, - "supportEmail" : { - "type" : "string" - }, - "supportPhone" : { - "type" : "string" - }, - "taxCode" : { + "type" : "object", + "properties" : { + "code" : { "type" : "string" }, - "updatedAt" : { - "type" : "string", - "format" : "date-time" - }, - "zipCode" : { + "desc" : { "type" : "string" } } @@ -6660,6 +4997,10 @@ "title" : "InstitutionOnboardingRequest", "type" : "object", "properties" : { + "activatedAt" : { + "type" : "string", + "format" : "date-time" + }, "billing" : { "$ref" : "#/components/schemas/BillingRequest" }, @@ -7139,282 +5480,30 @@ "city" : { "type" : "string" }, - "country" : { - "type" : "string" - }, - "county" : { - "type" : "string" - }, - "dataProtectionOfficer" : { - "$ref" : "#/components/schemas/DataProtectionOfficer" - }, - "delegation" : { - "type" : "boolean" - }, - "description" : { - "type" : "string" - }, - "digitalAddress" : { - "type" : "string" - }, - "geographicTaxonomies" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/InstitutionGeographicTaxonomies" - } - }, - "imported" : { - "type" : "boolean" - }, - "institutionType" : { - "type" : "string", - "enum" : [ "AS", "CON", "GSP", "PA", "PG", "PSP", "PT", "REC", "SA", "SCP" ] - }, - "ivassCode" : { - "type" : "string" - }, - "paymentServiceProvider" : { - "$ref" : "#/components/schemas/PaymentServiceProvider" - }, - "rea" : { - "type" : "string" - }, - "shareCapital" : { - "type" : "string" - }, - "supportEmail" : { - "type" : "string" - }, - "supportPhone" : { - "type" : "string" - }, - "taxCode" : { - "type" : "string" - }, - "zipCode" : { - "type" : "string" - } - } - }, - "InstitutionUpdateRequest" : { - "title" : "InstitutionUpdateRequest", - "type" : "object", - "properties" : { - "additionalInformations" : { - "$ref" : "#/components/schemas/AdditionalInformationsRequest" - }, - "address" : { - "type" : "string" - }, - "businessRegisterPlace" : { - "type" : "string" - }, - "city" : { - "type" : "string" - }, - "country" : { - "type" : "string" - }, - "county" : { - "type" : "string" - }, - "dataProtectionOfficer" : { - "$ref" : "#/components/schemas/DataProtectionOfficerRequest" - }, - "description" : { - "type" : "string" - }, - "digitalAddress" : { - "type" : "string" - }, - "geographicTaxonomyCodes" : { - "type" : "array", - "items" : { - "type" : "string" - } - }, - "imported" : { - "type" : "boolean" - }, - "institutionType" : { - "type" : "string", - "enum" : [ "AS", "CON", "GSP", "PA", "PG", "PSP", "PT", "REC", "SA", "SCP" ] - }, - "ivassCode" : { - "type" : "string" - }, - "paymentServiceProvider" : { - "$ref" : "#/components/schemas/PaymentServiceProviderRequest" - }, - "rea" : { - "type" : "string" - }, - "shareCapital" : { - "type" : "string" - }, - "supportEmail" : { - "type" : "string" - }, - "supportPhone" : { - "type" : "string" - }, - "taxCode" : { - "type" : "string" - }, - "zipCode" : { - "type" : "string" - } - } - }, - "InstitutionUpdateResponse" : { - "title" : "InstitutionUpdateResponse", - "type" : "object", - "properties" : { - "address" : { - "type" : "string" - }, - "aooParentCode" : { - "type" : "string" - }, - "businessRegisterPlace" : { - "type" : "string" - }, - "city" : { - "type" : "string" - }, - "country" : { - "type" : "string" - }, - "county" : { - "type" : "string" - }, - "dataProtectionOfficer" : { - "$ref" : "#/components/schemas/DataProtectionOfficerResponse" - }, - "description" : { - "type" : "string" - }, - "digitalAddress" : { - "type" : "string" - }, - "geographicTaxonomyCodes" : { - "type" : "array", - "items" : { - "type" : "string" - } - }, - "imported" : { - "type" : "boolean" - }, - "institutionType" : { - "type" : "string", - "enum" : [ "AS", "CON", "GSP", "PA", "PG", "PSP", "PT", "REC", "SA", "SCP" ] - }, - "paymentServiceProvider" : { - "$ref" : "#/components/schemas/PaymentServiceProviderResponse" - }, - "rea" : { - "type" : "string" - }, - "shareCapital" : { - "type" : "string" - }, - "subunitCode" : { - "type" : "string" - }, - "subunitType" : { - "type" : "string" - }, - "supportEmail" : { - "type" : "string" - }, - "supportPhone" : { - "type" : "string" - }, - "taxCode" : { - "type" : "string" - }, - "zipCode" : { - "type" : "string" - } - } - }, - "InstitutionsResponse" : { - "title" : "InstitutionsResponse", - "type" : "object", - "properties" : { - "institutions" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/InstitutionResponse" - } - } - } - }, - "LegalsResponse" : { - "title" : "LegalsResponse", - "type" : "object", - "properties" : { - "env" : { - "type" : "string", - "enum" : [ "COLL", "DEV", "PROD", "ROOT" ] - }, - "partyId" : { - "type" : "string" - }, - "relationshipId" : { - "type" : "string" - }, - "role" : { - "type" : "string", - "enum" : [ "DELEGATE", "MANAGER", "OPERATOR", "SUB_DELEGATE" ] - } - } - }, - "MigrationInstitution" : { - "title" : "MigrationInstitution", - "type" : "object", - "properties" : { - "address" : { - "type" : "string" - }, - "attributes" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/Attributes" - } - }, - "billing" : { - "$ref" : "#/components/schemas/Billing" - }, - "businessRegisterPlace" : { + "country" : { "type" : "string" }, - "createdAt" : { - "type" : "string", - "format" : "date-time" + "county" : { + "type" : "string" }, "dataProtectionOfficer" : { "$ref" : "#/components/schemas/DataProtectionOfficer" }, + "delegation" : { + "type" : "boolean" + }, "description" : { "type" : "string" }, "digitalAddress" : { "type" : "string" }, - "externalId" : { - "type" : "string" - }, "geographicTaxonomies" : { "type" : "array", "items" : { "$ref" : "#/components/schemas/InstitutionGeographicTaxonomies" } }, - "id" : { - "type" : "string" - }, "imported" : { "type" : "boolean" }, @@ -7422,16 +5511,7 @@ "type" : "string", "enum" : [ "AS", "CON", "GSP", "PA", "PG", "PSP", "PT", "REC", "SA", "SCP" ] }, - "onboarding" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/Onboarding" - } - }, - "origin" : { - "type" : "string" - }, - "originId" : { + "ivassCode" : { "type" : "string" }, "paymentServiceProvider" : { @@ -7452,94 +5532,116 @@ "taxCode" : { "type" : "string" }, - "updatedAt" : { - "type" : "string", - "format" : "date-time" - }, "zipCode" : { "type" : "string" } } }, - "MigrationOnboardedUser" : { - "title" : "MigrationOnboardedUser", + "InstitutionUpdateResponse" : { + "title" : "InstitutionUpdateResponse", "type" : "object", "properties" : { - "bindings" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/UserBinding" - } + "address" : { + "type" : "string" }, - "createdAt" : { - "type" : "string", - "format" : "date-time" + "aooParentCode" : { + "type" : "string" }, - "id" : { + "businessRegisterPlace" : { "type" : "string" - } - } - }, - "MigrationToken" : { - "title" : "MigrationToken", - "type" : "object", - "properties" : { - "checksum" : { + }, + "city" : { "type" : "string" }, - "closedAt" : { - "type" : "string", - "format" : "date-time" + "country" : { + "type" : "string" }, - "contractSigned" : { + "county" : { "type" : "string" }, - "contractTemplate" : { + "dataProtectionOfficer" : { + "$ref" : "#/components/schemas/DataProtectionOfficerResponse" + }, + "description" : { "type" : "string" }, - "contractVersion" : { + "digitalAddress" : { "type" : "string" }, - "createdAt" : { - "type" : "string", - "format" : "date-time" + "geographicTaxonomyCodes" : { + "type" : "array", + "items" : { + "type" : "string" + } }, - "expiringDate" : { + "imported" : { + "type" : "boolean" + }, + "institutionType" : { "type" : "string", - "format" : "date-time" + "enum" : [ "AS", "CON", "GSP", "PA", "PG", "PSP", "PT", "REC", "SA", "SCP" ] }, - "id" : { + "paymentServiceProvider" : { + "$ref" : "#/components/schemas/PaymentServiceProviderResponse" + }, + "rea" : { "type" : "string" }, - "institutionId" : { + "shareCapital" : { "type" : "string" }, - "institutionUpdate" : { - "$ref" : "#/components/schemas/InstitutionUpdate" + "subunitCode" : { + "type" : "string" }, - "productId" : { + "subunitType" : { "type" : "string" }, - "status" : { - "type" : "string", - "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ] + "supportEmail" : { + "type" : "string" }, - "type" : { - "type" : "string", - "enum" : [ "INSTITUTION", "LEGALS" ] + "supportPhone" : { + "type" : "string" }, - "updatedAt" : { - "type" : "string", - "format" : "date-time" + "taxCode" : { + "type" : "string" }, - "users" : { + "zipCode" : { + "type" : "string" + } + } + }, + "InstitutionsResponse" : { + "title" : "InstitutionsResponse", + "type" : "object", + "properties" : { + "institutions" : { "type" : "array", "items" : { - "$ref" : "#/components/schemas/TokenUser" + "$ref" : "#/components/schemas/InstitutionResponse" } } } }, + "LegalsResponse" : { + "title" : "LegalsResponse", + "type" : "object", + "properties" : { + "env" : { + "type" : "string", + "enum" : [ "COLL", "DEV", "PROD", "ROOT" ] + }, + "partyId" : { + "type" : "string" + }, + "relationshipId" : { + "type" : "string" + }, + "role" : { + "type" : "string", + "enum" : [ "DELEGATE", "MANAGER", "OPERATOR", "SUB_DELEGATE" ] + } + } + }, "OnboardedInstitutionResponse" : { "title" : "OnboardedInstitutionResponse", "type" : "object", @@ -7620,137 +5722,22 @@ }, "subunitType" : { "type" : "string" - }, - "supportContact" : { - "$ref" : "#/components/schemas/SupportContact" - }, - "taxCode" : { - "type" : "string" - }, - "zipCode" : { - "type" : "string" - } - } - }, - "OnboardedProduct" : { - "title" : "OnboardedProduct", - "type" : "object", - "properties" : { - "contract" : { - "type" : "string" - }, - "createdAt" : { - "type" : "string", - "format" : "date-time" - }, - "env" : { - "type" : "string", - "enum" : [ "COLL", "DEV", "PROD", "ROOT" ] - }, - "productId" : { - "type" : "string" - }, - "productRole" : { - "type" : "string" - }, - "relationshipId" : { - "type" : "string" - }, - "role" : { - "type" : "string", - "enum" : [ "DELEGATE", "MANAGER", "OPERATOR", "SUB_DELEGATE" ] - }, - "status" : { - "type" : "string", - "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ] - }, - "tokenId" : { - "type" : "string" - }, - "updatedAt" : { - "type" : "string", - "format" : "date-time" - } - } - }, - "OnboardedProductResponse" : { - "title" : "OnboardedProductResponse", - "type" : "object", - "properties" : { - "billing" : { - "$ref" : "#/components/schemas/BillingResponse" - }, - "createdAt" : { - "type" : "string", - "format" : "date-time" - }, - "productId" : { - "type" : "string" - }, - "status" : { - "type" : "string", - "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ] - }, - "updatedAt" : { - "type" : "string", - "format" : "date-time" - } - } - }, - "OnboardedProducts" : { - "title" : "OnboardedProducts", - "type" : "object", - "properties" : { - "products" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/InstitutionProduct" - } - } - } - }, - "OnboardedUser" : { - "title" : "OnboardedUser", - "type" : "object", - "properties" : { - "bindings" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/UserBinding" - } - }, - "createdAt" : { - "type" : "string", - "format" : "date-time" - }, - "id" : { - "type" : "string" - } - } - }, - "OnboardedUsersResponse" : { - "title" : "OnboardedUsersResponse", - "type" : "object", - "properties" : { - "users" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/UserProductsResponse" - } + }, + "supportContact" : { + "$ref" : "#/components/schemas/SupportContact" + }, + "taxCode" : { + "type" : "string" + }, + "zipCode" : { + "type" : "string" } } }, - "Onboarding" : { - "title" : "Onboarding", + "OnboardedProduct" : { + "title" : "OnboardedProduct", "type" : "object", "properties" : { - "billing" : { - "$ref" : "#/components/schemas/Billing" - }, - "closedAt" : { - "type" : "string", - "format" : "date-time" - }, "contract" : { "type" : "string" }, @@ -7758,12 +5745,23 @@ "type" : "string", "format" : "date-time" }, - "pricingPlan" : { - "type" : "string" + "env" : { + "type" : "string", + "enum" : [ "COLL", "DEV", "PROD", "ROOT" ] }, "productId" : { "type" : "string" }, + "productRole" : { + "type" : "string" + }, + "relationshipId" : { + "type" : "string" + }, + "role" : { + "type" : "string", + "enum" : [ "DELEGATE", "MANAGER", "OPERATOR", "SUB_DELEGATE" ] + }, "status" : { "type" : "string", "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ] @@ -7777,131 +5775,82 @@ } } }, - "OnboardingImportContract" : { - "title" : "OnboardingImportContract", + "OnboardedProductResponse" : { + "title" : "OnboardedProductResponse", "type" : "object", "properties" : { - "activatedAt" : { - "type" : "string", - "format" : "date-time" - }, - "contractType" : { - "type" : "string" + "billing" : { + "$ref" : "#/components/schemas/BillingResponse" }, "createdAt" : { "type" : "string", "format" : "date-time" }, - "fileName" : { + "productId" : { "type" : "string" }, - "filePath" : { - "type" : "string" + "status" : { + "type" : "string", + "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ] + }, + "updatedAt" : { + "type" : "string", + "format" : "date-time" } } }, - "OnboardingInfoResponse" : { - "title" : "OnboardingInfoResponse", + "OnboardedProducts" : { + "title" : "OnboardedProducts", "type" : "object", "properties" : { - "institutions" : { + "products" : { "type" : "array", "items" : { - "$ref" : "#/components/schemas/OnboardedInstitutionResponse" + "$ref" : "#/components/schemas/InstitutionProduct" } - }, - "userId" : { - "type" : "string" } } }, - "OnboardingInstitutionLegalsRequest" : { - "title" : "OnboardingInstitutionLegalsRequest", + "OnboardedUsersResponse" : { + "title" : "OnboardedUsersResponse", "type" : "object", "properties" : { - "contract" : { - "$ref" : "#/components/schemas/ContractRequest" - }, - "institutionExternalId" : { - "type" : "string" - }, - "institutionId" : { - "type" : "string" - }, - "productId" : { - "type" : "string" - }, - "productName" : { - "type" : "string" - }, - "signContract" : { - "type" : "boolean" - }, "users" : { "type" : "array", "items" : { - "$ref" : "#/components/schemas/Person" + "$ref" : "#/components/schemas/UserProductsResponse" } } } }, - "OnboardingInstitutionOperatorsRequest" : { - "title" : "OnboardingInstitutionOperatorsRequest", + "OnboardingInfoResponse" : { + "title" : "OnboardingInfoResponse", "type" : "object", "properties" : { - "institutionId" : { - "type" : "string" - }, - "productId" : { - "type" : "string" - }, - "productTitle" : { - "type" : "string" - }, - "users" : { + "institutions" : { "type" : "array", "items" : { - "$ref" : "#/components/schemas/Person" + "$ref" : "#/components/schemas/OnboardedInstitutionResponse" } + }, + "userId" : { + "type" : "string" } } }, - "OnboardingInstitutionRequest" : { - "title" : "OnboardingInstitutionRequest", + "OnboardingInstitutionOperatorsRequest" : { + "title" : "OnboardingInstitutionOperatorsRequest", "type" : "object", "properties" : { - "billing" : { - "$ref" : "#/components/schemas/BillingRequest" - }, - "contract" : { - "$ref" : "#/components/schemas/ContractRequest" - }, - "contractImported" : { - "$ref" : "#/components/schemas/OnboardingImportContract" - }, - "institutionExternalId" : { - "type" : "string" - }, - "institutionUpdate" : { - "$ref" : "#/components/schemas/InstitutionUpdateRequest" - }, - "pricingPlan" : { + "institutionId" : { "type" : "string" }, "productId" : { "type" : "string" }, - "productName" : { + "productTitle" : { "type" : "string" }, - "sendCompleteOnboardingEmail" : { - "type" : "boolean", - "description" : "Parameter that allows you to specify whether following completion of onboarding you want to receive an email", - "example" : false - }, - "signContract" : { - "type" : "boolean" - }, "users" : { "type" : "array", "items" : { @@ -8037,15 +5986,6 @@ } } }, - "PaAttributes" : { - "title" : "PaAttributes", - "type" : "object", - "properties" : { - "aooParentCode" : { - "type" : "string" - } - } - }, "PaginatedTokenResponse" : { "title" : "PaginatedTokenResponse", "type" : "object", @@ -8174,15 +6114,6 @@ } } }, - "PersonId" : { - "title" : "PersonId", - "type" : "object", - "properties" : { - "id" : { - "type" : "string" - } - } - }, "Problem" : { "title" : "Problem", "type" : "object", @@ -8241,6 +6172,31 @@ } } }, + "ProductCount" : { + "title" : "ProductCount", + "type" : "object", + "properties" : { + "count" : { + "type" : "integer", + "format" : "int32" + }, + "productId" : { + "type" : "string" + } + } + }, + "ProductCountResponse" : { + "title" : "ProductCountResponse", + "type" : "object", + "properties" : { + "products" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/ProductCount" + } + } + } + }, "ProductInfo" : { "title" : "ProductInfo", "type" : "object", @@ -8260,21 +6216,6 @@ } } }, - "ProductsManagement" : { - "title" : "ProductsManagement", - "type" : "object", - "properties" : { - "billing" : { - "$ref" : "#/components/schemas/BillingResponse" - }, - "pricingPlan" : { - "type" : "string" - }, - "product" : { - "type" : "string" - } - } - }, "RelationshipResult" : { "title" : "RelationshipResult", "type" : "object", @@ -8427,73 +6368,6 @@ } } }, - "Token" : { - "title" : "Token", - "type" : "object", - "properties" : { - "activatedAt" : { - "type" : "string", - "format" : "date-time" - }, - "checksum" : { - "type" : "string" - }, - "contentType" : { - "type" : "string" - }, - "contractSigned" : { - "type" : "string" - }, - "contractTemplate" : { - "type" : "string" - }, - "contractVersion" : { - "type" : "string" - }, - "createdAt" : { - "type" : "string", - "format" : "date-time" - }, - "deletedAt" : { - "type" : "string", - "format" : "date-time" - }, - "expiringDate" : { - "type" : "string", - "format" : "date-time" - }, - "id" : { - "type" : "string" - }, - "institutionId" : { - "type" : "string" - }, - "institutionUpdate" : { - "$ref" : "#/components/schemas/InstitutionUpdate" - }, - "productId" : { - "type" : "string" - }, - "status" : { - "type" : "string", - "enum" : [ "ACTIVE", "DELETED", "PENDING", "REJECTED", "SUSPENDED", "TOBEVALIDATED" ] - }, - "type" : { - "type" : "string", - "enum" : [ "INSTITUTION", "LEGALS" ] - }, - "updatedAt" : { - "type" : "string", - "format" : "date-time" - }, - "users" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/TokenUser" - } - } - } - }, "TokenListResponse" : { "title" : "TokenListResponse", "type" : "object", @@ -8644,27 +6518,6 @@ } } }, - "UserBinding" : { - "title" : "UserBinding", - "type" : "object", - "properties" : { - "institutionId" : { - "type" : "string" - }, - "institutionName" : { - "type" : "string" - }, - "institutionRootName" : { - "type" : "string" - }, - "products" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/OnboardedProduct" - } - } - } - }, "UserInfoResponse" : { "title" : "UserInfoResponse", "type" : "object", diff --git a/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/CoreConnectorImpl.java b/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/CoreConnectorImpl.java index c9cb21743..ef0647f77 100644 --- a/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/CoreConnectorImpl.java +++ b/connector/rest/src/main/java/it/pagopa/selfcare/dashboard/connector/rest/CoreConnectorImpl.java @@ -11,13 +11,12 @@ import it.pagopa.selfcare.dashboard.connector.model.delegation.Delegation; import it.pagopa.selfcare.dashboard.connector.model.delegation.DelegationId; import it.pagopa.selfcare.dashboard.connector.model.delegation.DelegationRequest; +import it.pagopa.selfcare.dashboard.connector.model.delegation.GetDelegationParameters; import it.pagopa.selfcare.dashboard.connector.model.institution.*; -import it.pagopa.selfcare.dashboard.connector.model.institution.Institution; import it.pagopa.selfcare.dashboard.connector.model.product.PartyProduct; import it.pagopa.selfcare.dashboard.connector.model.user.CreateUserDto; import it.pagopa.selfcare.dashboard.connector.model.user.RoleInfo; import it.pagopa.selfcare.dashboard.connector.model.user.UserInfo; -import it.pagopa.selfcare.dashboard.connector.onboarding.OnboardingRequestInfo; import it.pagopa.selfcare.dashboard.connector.rest.client.*; import it.pagopa.selfcare.dashboard.connector.rest.model.ProductState; import it.pagopa.selfcare.dashboard.connector.rest.model.mapper.BrokerMapper; @@ -207,10 +206,20 @@ public List findInstitutionsByProductAndType(String productId, Strin } @Override - public List getDelegations(String from, String to, String productId) { + public List getDelegations(GetDelegationParameters delegationParameters) { log.trace("getDelegations start"); - log.debug("getDelegations productId = {}, type = {}", from, productId); - List delegationsResponse = coreDelegationApiRestClient._getDelegationsUsingGET(from, to, productId, null).getBody(); + log.debug("getDelegations productId = {}, type = {}", delegationParameters.getFrom(), delegationParameters.getProductId()); + List delegationsResponse = coreDelegationApiRestClient._getDelegationsUsingGET( + delegationParameters.getFrom(), + delegationParameters.getTo(), + delegationParameters.getProductId(), + delegationParameters.getSearch(), + delegationParameters.getTaxCode(), + delegationParameters.getMode(), + delegationParameters.getOrder(), + delegationParameters.getPage(), + delegationParameters.getSize()) + .getBody(); if (Objects.isNull(delegationsResponse)) return List.of(); @@ -414,61 +423,6 @@ public void delete(String relationshipId) { log.trace("delete end"); } - @Override - public OnboardingRequestInfo getOnboardingRequestInfo(String tokenId) { - log.trace("getOnboardingRequestInfo start"); - log.debug("getOnboardingRequestInfo tokenId = {}", tokenId); - Assert.hasText(tokenId, REQUIRED_TOKEN_ID_MESSAGE); - final OnboardingRequestInfo onboardingRequestInfo = new OnboardingRequestInfo(); - onboardingRequestInfo.setAdmins(new ArrayList<>()); - TokenResponse tokenInfo = coreManagementApiRestClient._getTokenUsingGET(tokenId).getBody(); - if (tokenInfo != null) { - onboardingRequestInfo.setProductId(tokenInfo.getProductId()); - tokenInfo.getLegals().forEach(relationshipBinding -> { - final UserInfo userInfo = new UserInfo(); - userInfo.setId(relationshipBinding.getPartyId()); - userInfo.setStatus(relationshipBinding.getRole().toString()); - userInfo.setRole(relationshipBinding.getRole().equals(LegalsResponse.RoleEnum.OPERATOR) ? SelfCareAuthority.LIMITED : SelfCareAuthority.ADMIN); - if (LegalsResponse.RoleEnum.MANAGER.equals(relationshipBinding.getRole())) { - onboardingRequestInfo.setManager(userInfo); - } else { - onboardingRequestInfo.getAdmins().add(userInfo); - } - }); - InstitutionResponse institutionResponse = coreInstitutionApiRestClient._retrieveInstitutionByIdUsingGET(tokenInfo.getInstitutionId()).getBody(); - InstitutionInfo institutionInfo = institutionMapper.toInstitutionInfo(institutionResponse, tokenInfo.getInstitutionUpdate()); - institutionInfo.setStatus(RelationshipState.valueOf(tokenInfo.getStatus().name())); - if (institutionResponse != null && !CollectionUtils.isEmpty(institutionResponse.getOnboarding())) { - institutionResponse.getOnboarding().stream() - .filter(onboarding -> onboarding.getProductId().equals(tokenInfo.getProductId())) - .findFirst() - .ifPresent(onboardedProductResponse -> institutionInfo.setBilling(institutionMapper.toBilling(onboardedProductResponse.getBilling()))); - } - onboardingRequestInfo.setInstitutionInfo(institutionInfo); - log.debug("getOnboardingRequestInfo result = {}", onboardingRequestInfo); - log.trace("getOnboardingRequestInfo end"); - } - return onboardingRequestInfo; - } - - @Override - public void approveOnboardingRequest(String tokenId) { - log.trace("approveOnboardingRequest start"); - log.debug("approveOnboardingRequest tokenId = {}", tokenId); - Assert.hasText(tokenId, REQUIRED_TOKEN_ID_MESSAGE); - coreOnboardingApiRestClient._approveOnboardingUsingPOST(tokenId); - log.trace("retrieveOnboardingRequest end"); - } - - @Override - public void rejectOnboardingRequest(String tokenId) { - log.trace("rejectOnboardingRequest start"); - log.debug("rejectOnboardingRequest tokenId = {}", tokenId); - Assert.hasText(tokenId, REQUIRED_TOKEN_ID_MESSAGE); - coreOnboardingApiRestClient._onboardingRejectUsingDELETE(tokenId); - log.trace("rejectOnboardingRequest end"); - } - @Override public List getInstitutionProducts(String institutionId) { log.trace("getInstitutionProducts start"); diff --git a/connector/rest/src/test/java/it/pagopa/selfcare/dashboard/connector/rest/CoreConnectorImplTest.java b/connector/rest/src/test/java/it/pagopa/selfcare/dashboard/connector/rest/CoreConnectorImplTest.java index c9dd068c5..8c42229b6 100644 --- a/connector/rest/src/test/java/it/pagopa/selfcare/dashboard/connector/rest/CoreConnectorImplTest.java +++ b/connector/rest/src/test/java/it/pagopa/selfcare/dashboard/connector/rest/CoreConnectorImplTest.java @@ -7,38 +7,26 @@ import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; - import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import it.pagopa.selfcare.commons.base.security.PartyRole; import it.pagopa.selfcare.commons.base.security.SelfCareAuthority; -import it.pagopa.selfcare.core.generated.openapi.v1.dto.DelegationResponse; -import it.pagopa.selfcare.core.generated.openapi.v1.dto.InstitutionProducts; -import it.pagopa.selfcare.core.generated.openapi.v1.dto.UserProductsResponse; import it.pagopa.selfcare.core.generated.openapi.v1.dto.*; import it.pagopa.selfcare.dashboard.connector.model.auth.AuthInfo; import it.pagopa.selfcare.dashboard.connector.model.backoffice.BrokerInfo; -import it.pagopa.selfcare.dashboard.connector.model.delegation.Delegation; - -import it.pagopa.selfcare.dashboard.connector.model.delegation.DelegationId; import it.pagopa.selfcare.dashboard.connector.model.delegation.DelegationRequest; -import it.pagopa.selfcare.dashboard.connector.model.delegation.DelegationType; +import it.pagopa.selfcare.dashboard.connector.model.delegation.*; import it.pagopa.selfcare.dashboard.connector.model.institution.*; -import it.pagopa.selfcare.dashboard.connector.model.institution.Institution; import it.pagopa.selfcare.dashboard.connector.model.product.PartyProduct; import it.pagopa.selfcare.dashboard.connector.model.user.CreateUserDto; import it.pagopa.selfcare.dashboard.connector.model.user.ProductInfo; import it.pagopa.selfcare.dashboard.connector.model.user.RoleInfo; import it.pagopa.selfcare.dashboard.connector.model.user.UserInfo; -import it.pagopa.selfcare.dashboard.connector.onboarding.OnboardingRequestInfo; -import it.pagopa.selfcare.dashboard.connector.rest.client.CoreDelegationApiRestClient; -import it.pagopa.selfcare.dashboard.connector.rest.client.CoreUserApiRestClient; import it.pagopa.selfcare.dashboard.connector.rest.client.*; import it.pagopa.selfcare.dashboard.connector.rest.model.ProductState; import it.pagopa.selfcare.dashboard.connector.rest.model.mapper.BrokerMapper; import it.pagopa.selfcare.dashboard.connector.rest.model.mapper.DelegationRestClientMapperImpl; import it.pagopa.selfcare.dashboard.connector.rest.model.mapper.InstitutionMapperImpl; -import it.pagopa.selfcare.dashboard.connector.rest.model.relationship.Relationship; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.function.Executable; @@ -50,7 +38,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.mock.mockito.MockBean; - import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.util.ResourceUtils; @@ -63,11 +50,10 @@ import static it.pagopa.selfcare.commons.base.security.SelfCareAuthority.ADMIN; import static it.pagopa.selfcare.commons.base.security.SelfCareAuthority.LIMITED; -import static it.pagopa.selfcare.commons.utils.TestUtils.checkNotNullFields; -import static it.pagopa.selfcare.commons.utils.TestUtils.mockInstance; import static it.pagopa.selfcare.commons.utils.TestUtils.*; import static it.pagopa.selfcare.dashboard.connector.model.institution.RelationshipState.*; -import static it.pagopa.selfcare.dashboard.connector.rest.CoreConnectorImpl.*; +import static it.pagopa.selfcare.dashboard.connector.rest.CoreConnectorImpl.REQUIRED_GEOGRAPHIC_TAXONOMIES_MESSAGE; +import static it.pagopa.selfcare.dashboard.connector.rest.CoreConnectorImpl.REQUIRED_INSTITUTION_ID_MESSAGE; import static java.util.Collections.singletonList; import static org.junit.jupiter.api.Assertions.*; import static org.mockito.ArgumentMatchers.*; @@ -300,14 +286,14 @@ void getDelegationUsingFrom_shouldGetData() { List delegationResponseList = new ArrayList<>(); delegationResponseList.add(delegationResponse); ResponseEntity> delegationResponseEntity = new ResponseEntity<>(delegationResponseList, null, HttpStatus.OK); - Delegation delegation = dummyDelegation(); + GetDelegationParameters parameters = dummyDelegationParameters(); - when(coreDelegationApiRestClient._getDelegationsUsingGET(any(), any(), any(), any())) + when(coreDelegationApiRestClient._getDelegationsUsingGET(any(), any(), any(), any(), any(), any(), any(), any(), any())) .thenReturn(delegationResponseEntity); // when - List delegationList = msCoreConnector.getDelegations(delegation.getInstitutionId(), delegation.getBrokerId(), delegation.getProductId()); + List delegationList = msCoreConnector.getDelegations(dummyDelegationParameters()); // then assertNotNull(delegationList); assertEquals(1, delegationList.size()); @@ -321,7 +307,7 @@ void getDelegationUsingFrom_shouldGetData() { assertEquals(delegationResponseList.get(0).getBrokerName(), delegationList.get(0).getBrokerName()); verify(coreDelegationApiRestClient, times(1)) - ._getDelegationsUsingGET(delegation.getInstitutionId(), delegation.getBrokerId(), delegation.getProductId(), null); + ._getDelegationsUsingGET(parameters.getFrom(), parameters.getTo(), parameters.getProductId(), parameters.getSearch(), parameters.getTaxCode(), parameters.getMode(), parameters.getOrder(), parameters.getPage(), parameters.getSize()); verifyNoMoreInteractions(coreDelegationApiRestClient); } @@ -329,22 +315,22 @@ void getDelegationUsingFrom_shouldGetData() { void getDelegationUsingFrom_shouldGetEmptyData() { // given ResponseEntity> delegationResponseEntity = mock(ResponseEntity.class); - Delegation delegation = dummyDelegation(); + GetDelegationParameters parameters = dummyDelegationParameters(); when(delegationResponseEntity.getBody()).thenReturn(null); - when(coreDelegationApiRestClient._getDelegationsUsingGET(any(), any(), any(), any())) + when(coreDelegationApiRestClient._getDelegationsUsingGET(any(), any(), any(), any(), any(), any(), any(), any(), any())) .thenReturn(delegationResponseEntity); // when - List delegationList = msCoreConnector.getDelegations(delegation.getInstitutionId(), delegation.getBrokerId(), delegation.getProductId()); + List delegationList = msCoreConnector.getDelegations(dummyDelegationParameters()); // then assertNotNull(delegationList); assertEquals(0, delegationList.size()); verify(coreDelegationApiRestClient, times(1)) - ._getDelegationsUsingGET(delegation.getInstitutionId(), delegation.getBrokerId(), delegation.getProductId(), null); + ._getDelegationsUsingGET(parameters.getFrom(), parameters.getTo(), parameters.getProductId(), parameters.getSearch(), parameters.getTaxCode(), parameters.getMode(), parameters.getOrder(), parameters.getPage(), parameters.getSize()); verifyNoMoreInteractions(coreDelegationApiRestClient); } @@ -361,17 +347,6 @@ private DelegationResponse dummyDelegationResponse() { return delegationResponse; } - private Delegation dummyDelegation() { - Delegation delegation = new Delegation(); - delegation.setInstitutionId("from"); - delegation.setBrokerId("to"); - delegation.setId("setId"); - delegation.setProductId("setProductId"); - delegation.setType(DelegationType.PT); - delegation.setInstitutionName("setInstitutionFromName"); - return delegation; - } - @Test void updateUser() { //given @@ -1432,100 +1407,6 @@ void delete() { verifyNoMoreInteractions(coreUserApiRestClientMock); } - @Test - void getOnboardingRequestInfo() { - // given - final TokenResponse tokenInfoMock = mockInstance(new TokenResponse(), "setId", "setLegals"); - InstitutionResponse institutionMock = mockInstance(new InstitutionResponse()); - institutionMock.setOnboarding(List.of()); - tokenInfoMock.setId(UUID.randomUUID().toString()); - final LegalsResponse managerLegalsResponse = mockInstance(new LegalsResponse(), "setRole"); - managerLegalsResponse.setRole(LegalsResponse.RoleEnum.valueOf(PartyRole.MANAGER.name())); - final LegalsResponse adminLegalsResponse = mockInstance(new LegalsResponse(), "setRole"); - adminLegalsResponse.setRole(LegalsResponse.RoleEnum.valueOf(PartyRole.DELEGATE.name())); - tokenInfoMock.setLegals(List.of(managerLegalsResponse, adminLegalsResponse)); - when(coreManagementApiRestClient._getTokenUsingGET(any())) - .thenReturn(ResponseEntity.ok(tokenInfoMock)); - when(coreInstitutionApiRestClient._retrieveInstitutionByIdUsingGET(any())).thenReturn(ResponseEntity.ok(institutionMock)); - final Relationship managerRelationshipMock = mockInstance(new Relationship()); - // when - final OnboardingRequestInfo result = msCoreConnector.getOnboardingRequestInfo(tokenInfoMock.getId()); - // then - assertNotNull(result); - assertNotNull(result.getInstitutionInfo()); - assertNotNull(result.getManager()); - assertEquals(managerLegalsResponse.getPartyId(), result.getManager().getId()); - assertEquals(ADMIN, result.getManager().getRole()); - assertNotNull(result.getAdmins()); - assertEquals(1, result.getAdmins().size()); - assertEquals(adminLegalsResponse.getPartyId(), result.getAdmins().get(0).getId()); - assertEquals(ADMIN, result.getAdmins().get(0).getRole()); - verify(coreManagementApiRestClient, times(1)) - ._getTokenUsingGET(tokenInfoMock.getId()); - verifyNoMoreInteractions(coreManagementApiRestClient); - } - - @Test - void getOnboardingRequestInfo_hasNullToken() { - // given - String tokenId = null; - // when - Executable executable = () -> msCoreConnector.getOnboardingRequestInfo(tokenId); - // then - IllegalArgumentException e = assertThrows(IllegalArgumentException.class, executable); - assertEquals(REQUIRED_TOKEN_ID_MESSAGE, e.getMessage()); - verifyNoInteractions(coreManagementApiRestClient, coreInstitutionApiRestClient); - } - - @Test - void approveOnboardingRequest() { - // given - String tokenId = UUID.randomUUID().toString(); - when(coreOnboardingApiRestClient._approveOnboardingUsingPOST(anyString())).thenReturn(ResponseEntity.ok().build()); - // when - msCoreConnector.approveOnboardingRequest(tokenId); - // then - verify(coreOnboardingApiRestClient, times(1)) - ._approveOnboardingUsingPOST(tokenId); - verifyNoMoreInteractions(coreOnboardingApiRestClient); - } - - @Test - void approveOnboardingRequest_hasNullToken() { - // given - String tokenId = null; - // when - Executable executable = () -> msCoreConnector.approveOnboardingRequest(tokenId); - // then - IllegalArgumentException e = assertThrows(IllegalArgumentException.class, executable); - assertEquals(REQUIRED_TOKEN_ID_MESSAGE, e.getMessage()); - verifyNoInteractions(coreOnboardingApiRestClient); - } - - @Test - void rejectOnboardingRequest() { - // given - String tokenId = UUID.randomUUID().toString(); - when(coreOnboardingApiRestClient._onboardingRejectUsingDELETE(anyString())).thenReturn(ResponseEntity.ok().build()); - // when - msCoreConnector.rejectOnboardingRequest(tokenId); - // then - verify(coreOnboardingApiRestClient, times(1)) - ._onboardingRejectUsingDELETE(tokenId); - verifyNoMoreInteractions(coreOnboardingApiRestClient); - } - - @Test - void rejectOnboardingRequest_hasNullToken() { - // given - String tokenId = null; - // when - Executable executable = () -> msCoreConnector.rejectOnboardingRequest(tokenId); - // then - IllegalArgumentException e = assertThrows(IllegalArgumentException.class, executable); - assertEquals(REQUIRED_TOKEN_ID_MESSAGE, e.getMessage()); - verifyNoInteractions(coreOnboardingApiRestClient); - } @Test void getGeographicTaxonomyList_nullInstitutionId() { @@ -1657,4 +1538,17 @@ void checkExistingRelationshipRoles_userExistingNoConflict () { ._getUserInstitutionRelationshipsUsingGET(anyString(), any(), any(), any(), any(), any()); } + private GetDelegationParameters dummyDelegationParameters() { + return GetDelegationParameters.builder() + .to("to") + .productId("setProductId") + .taxCode("taxCode") + .search("name") + .mode(GetDelegationsMode.FULL.name()) + .order(Order.ASC.name()) + .page(0) + .size(1000) + .build(); + } + } \ No newline at end of file diff --git a/core/src/main/java/it/pagopa/selfcare/dashboard/core/DelegationService.java b/core/src/main/java/it/pagopa/selfcare/dashboard/core/DelegationService.java index f48656b44..400c6002c 100644 --- a/core/src/main/java/it/pagopa/selfcare/dashboard/core/DelegationService.java +++ b/core/src/main/java/it/pagopa/selfcare/dashboard/core/DelegationService.java @@ -3,6 +3,7 @@ import it.pagopa.selfcare.dashboard.connector.model.delegation.Delegation; import it.pagopa.selfcare.dashboard.connector.model.delegation.DelegationId; import it.pagopa.selfcare.dashboard.connector.model.delegation.DelegationRequest; +import it.pagopa.selfcare.dashboard.connector.model.delegation.GetDelegationParameters; import java.util.List; @@ -10,6 +11,6 @@ public interface DelegationService { DelegationId createDelegation(DelegationRequest delegation); - List getDelegations(String from, String to, String productId); + List getDelegations(GetDelegationParameters delegationParameters); } diff --git a/core/src/main/java/it/pagopa/selfcare/dashboard/core/DelegationServiceImpl.java b/core/src/main/java/it/pagopa/selfcare/dashboard/core/DelegationServiceImpl.java index 1222118ef..e408ff752 100644 --- a/core/src/main/java/it/pagopa/selfcare/dashboard/core/DelegationServiceImpl.java +++ b/core/src/main/java/it/pagopa/selfcare/dashboard/core/DelegationServiceImpl.java @@ -5,6 +5,7 @@ import it.pagopa.selfcare.dashboard.connector.model.delegation.Delegation; import it.pagopa.selfcare.dashboard.connector.model.delegation.DelegationId; import it.pagopa.selfcare.dashboard.connector.model.delegation.DelegationRequest; +import it.pagopa.selfcare.dashboard.connector.model.delegation.GetDelegationParameters; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -34,10 +35,9 @@ public DelegationId createDelegation(DelegationRequest delegation) { } @Override - public List getDelegations(String from, String to, String productId) { + public List getDelegations(GetDelegationParameters delegationParameters) { log.trace("getDelegations start"); - log.debug("getDelegations from = {}, to = {}, productId = {}", from, to, productId); - List result = msCoreConnector.getDelegations(from, to, productId); + List result = msCoreConnector.getDelegations(delegationParameters); log.debug("getDelegations result = {}", result); log.trace("getDelegations end"); return result; diff --git a/core/src/main/java/it/pagopa/selfcare/dashboard/core/InstitutionService.java b/core/src/main/java/it/pagopa/selfcare/dashboard/core/InstitutionService.java index 8519a2023..98dcece12 100644 --- a/core/src/main/java/it/pagopa/selfcare/dashboard/core/InstitutionService.java +++ b/core/src/main/java/it/pagopa/selfcare/dashboard/core/InstitutionService.java @@ -6,7 +6,6 @@ import it.pagopa.selfcare.dashboard.connector.model.user.CreateUserDto; import it.pagopa.selfcare.dashboard.connector.model.user.UserId; import it.pagopa.selfcare.dashboard.connector.model.user.UserInfo; -import it.pagopa.selfcare.dashboard.connector.onboarding.OnboardingRequestInfo; import java.util.Collection; import java.util.List; @@ -41,12 +40,6 @@ public interface InstitutionService { void addUserProductRoles(String institutionId, String productId, String userId, CreateUserDto dto); - OnboardingRequestInfo getOnboardingRequestInfo(String tokenId); - - void approveOnboardingRequest(String tokenId); - - void rejectOnboardingRequest(String tokenId); - Institution updateInstitutionDescription(String institutionId, UpdateInstitutionResource updatePnPGInstitutionResource); Institution findInstitutionById(String institutionId); diff --git a/core/src/main/java/it/pagopa/selfcare/dashboard/core/InstitutionServiceImpl.java b/core/src/main/java/it/pagopa/selfcare/dashboard/core/InstitutionServiceImpl.java index 10f3c8978..85043137d 100644 --- a/core/src/main/java/it/pagopa/selfcare/dashboard/core/InstitutionServiceImpl.java +++ b/core/src/main/java/it/pagopa/selfcare/dashboard/core/InstitutionServiceImpl.java @@ -5,15 +5,16 @@ import it.pagopa.selfcare.commons.base.security.ProductGrantedAuthority; import it.pagopa.selfcare.commons.base.security.SelfCareAuthority; import it.pagopa.selfcare.commons.base.security.SelfCareGrantedAuthority; -import it.pagopa.selfcare.commons.base.utils.InstitutionType; import it.pagopa.selfcare.dashboard.connector.api.MsCoreConnector; import it.pagopa.selfcare.dashboard.connector.api.ProductsConnector; import it.pagopa.selfcare.dashboard.connector.api.UserRegistryConnector; import it.pagopa.selfcare.dashboard.connector.exception.ResourceNotFoundException; import it.pagopa.selfcare.dashboard.connector.model.institution.*; -import it.pagopa.selfcare.dashboard.connector.model.product.*; +import it.pagopa.selfcare.dashboard.connector.model.product.PartyProduct; +import it.pagopa.selfcare.dashboard.connector.model.product.Product; +import it.pagopa.selfcare.dashboard.connector.model.product.ProductRoleInfo; +import it.pagopa.selfcare.dashboard.connector.model.product.ProductTree; import it.pagopa.selfcare.dashboard.connector.model.user.*; -import it.pagopa.selfcare.dashboard.connector.onboarding.OnboardingRequestInfo; import it.pagopa.selfcare.dashboard.core.exception.InvalidProductRoleException; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -293,40 +294,6 @@ public void addUserProductRoles(String institutionId, String productId, String u log.trace("addProductUser end"); } - - @Override - public OnboardingRequestInfo getOnboardingRequestInfo(String tokenId) { - log.trace("getOnboardingRequestInfo start"); - log.debug("getOnboardingRequestInfo tokenId = {}", tokenId); - final OnboardingRequestInfo onboardingRequestInfo = msCoreConnector.getOnboardingRequestInfo(tokenId); - // In case of PT onboarding, the field manager is empty - if(Objects.nonNull(onboardingRequestInfo.getInstitutionInfo()) && !InstitutionType.PT.equals(onboardingRequestInfo.getInstitutionInfo().getInstitutionType())) { - onboardingRequestInfo.getManager().setUser(userRegistryConnector.getUserByInternalId(onboardingRequestInfo.getManager().getId(), USER_FIELD_LIST_ENHANCED)); - } - onboardingRequestInfo.getAdmins().forEach(userInfo -> userInfo.setUser(userRegistryConnector.getUserByInternalId(userInfo.getId(), USER_FIELD_LIST_ENHANCED))); - log.debug(LogUtils.CONFIDENTIAL_MARKER, "getOnboardingRequestInfo result = {}", onboardingRequestInfo); - log.trace("getOnboardingRequestInfo end"); - return onboardingRequestInfo; - } - - @Override - public void approveOnboardingRequest(String tokenId) { - log.trace("approveOnboardingRequest start"); - log.debug("approveOnboardingRequest tokenId = {}", tokenId); - Assert.hasText(tokenId, REQUIRED_TOKEN_ID_MESSAGE); - msCoreConnector.approveOnboardingRequest(tokenId); - log.trace("approveOnboardingRequest end"); - } - - @Override - public void rejectOnboardingRequest(String tokenId) { - log.trace("rejectOnboardingRequest start"); - log.debug("rejectOnboardingRequest tokenId = {}", tokenId); - Assert.hasText(tokenId, REQUIRED_TOKEN_ID_MESSAGE); - msCoreConnector.rejectOnboardingRequest(tokenId); - log.trace("rejectOnboardingRequest end"); - } - @Override public Institution updateInstitutionDescription(String institutionId, UpdateInstitutionResource updateInstitutionResource) { log.trace("updateInstitutionDescription start"); diff --git a/core/src/test/java/it/pagopa/selfcare/dashboard/core/DelegationServiceImplTest.java b/core/src/test/java/it/pagopa/selfcare/dashboard/core/DelegationServiceImplTest.java index 508a40a88..8ba1c6779 100644 --- a/core/src/test/java/it/pagopa/selfcare/dashboard/core/DelegationServiceImplTest.java +++ b/core/src/test/java/it/pagopa/selfcare/dashboard/core/DelegationServiceImplTest.java @@ -1,10 +1,7 @@ package it.pagopa.selfcare.dashboard.core; import it.pagopa.selfcare.dashboard.connector.api.MsCoreConnector; -import it.pagopa.selfcare.dashboard.connector.model.delegation.Delegation; -import it.pagopa.selfcare.dashboard.connector.model.delegation.DelegationId; -import it.pagopa.selfcare.dashboard.connector.model.delegation.DelegationRequest; -import it.pagopa.selfcare.dashboard.connector.model.delegation.DelegationType; +import it.pagopa.selfcare.dashboard.connector.model.delegation.*; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; @@ -49,17 +46,17 @@ void getDelegations() { Delegation delegation = dummyDelegation(); List delegationList = new ArrayList<>(); delegationList.add(delegation); - when(delegationConnector.getDelegations(any(),any(),any())).thenReturn(delegationList); + when(delegationConnector.getDelegations(any())).thenReturn(delegationList); //when - delegationList = delegationServiceImpl.getDelegations(delegation.getInstitutionId(), delegation.getBrokerId(), delegation.getProductId()); + delegationList = delegationServiceImpl.getDelegations(dummyDelegationParametersTo()); //then assertNotNull(delegationList); assertNotNull(delegationList.getClass()); assertEquals(1, delegationList.size()); verify(delegationConnector, times(1)) - .getDelegations(delegation.getInstitutionId(), delegation.getBrokerId(), delegation.getProductId()); + .getDelegations(dummyDelegationParametersTo()); verifyNoMoreInteractions(delegationConnector); } @@ -74,4 +71,17 @@ private Delegation dummyDelegation() { return delegation; } + private GetDelegationParameters dummyDelegationParametersTo() { + return GetDelegationParameters.builder() + .to("to") + .productId("product-io") + .taxCode("taxCode") + .search("name") + .mode(GetDelegationsMode.FULL.name()) + .order(Order.ASC.name()) + .page(0) + .size(1000) + .build(); + } + } \ No newline at end of file diff --git a/core/src/test/java/it/pagopa/selfcare/dashboard/core/InstitutionServiceImplTest.java b/core/src/test/java/it/pagopa/selfcare/dashboard/core/InstitutionServiceImplTest.java index e4ea1326c..7fe45cd74 100644 --- a/core/src/test/java/it/pagopa/selfcare/dashboard/core/InstitutionServiceImplTest.java +++ b/core/src/test/java/it/pagopa/selfcare/dashboard/core/InstitutionServiceImplTest.java @@ -9,12 +9,13 @@ import it.pagopa.selfcare.dashboard.connector.api.ProductsConnector; import it.pagopa.selfcare.dashboard.connector.api.UserRegistryConnector; import it.pagopa.selfcare.dashboard.connector.exception.ResourceNotFoundException; -import it.pagopa.selfcare.dashboard.connector.model.institution.*; import it.pagopa.selfcare.dashboard.connector.model.institution.OnboardedProduct; -import it.pagopa.selfcare.dashboard.connector.model.product.*; +import it.pagopa.selfcare.dashboard.connector.model.institution.*; +import it.pagopa.selfcare.dashboard.connector.model.product.Product; +import it.pagopa.selfcare.dashboard.connector.model.product.ProductRoleInfo; +import it.pagopa.selfcare.dashboard.connector.model.product.ProductTree; import it.pagopa.selfcare.dashboard.connector.model.user.*; import it.pagopa.selfcare.dashboard.connector.model.user.User.Fields; -import it.pagopa.selfcare.dashboard.connector.onboarding.OnboardingRequestInfo; import it.pagopa.selfcare.dashboard.core.config.CoreTestConfig; import it.pagopa.selfcare.dashboard.core.exception.InvalidProductRoleException; import org.junit.jupiter.api.Assertions; @@ -46,7 +47,6 @@ import static it.pagopa.selfcare.dashboard.connector.model.institution.RelationshipState.SUSPENDED; import static it.pagopa.selfcare.dashboard.connector.model.user.User.Fields.*; import static it.pagopa.selfcare.dashboard.core.InstitutionServiceImpl.REQUIRED_GEOGRAPHIC_TAXONOMIES; -import static it.pagopa.selfcare.dashboard.core.InstitutionServiceImpl.REQUIRED_TOKEN_ID_MESSAGE; import static it.pagopa.selfcare.dashboard.core.PnPGInstitutionServiceImpl.REQUIRED_INSTITUTION_MESSAGE; import static it.pagopa.selfcare.dashboard.core.PnPGInstitutionServiceImpl.REQUIRED_UPDATE_RESOURCE_MESSAGE; import static org.junit.jupiter.api.Assertions.*; @@ -1120,99 +1120,6 @@ void addUserProductRoles(PartyRole partyRole) { verifyNoMoreInteractions(productsConnectorMock); } - @Test - void getOnboardingRequestInfo() { - // given - final String tokenId = "tokenId"; - final OnboardingRequestInfo onboardingRequestInfoMock = mockInstance(new OnboardingRequestInfo(), "setAdmins"); - final UserInfo adminMock = mockInstance(new UserInfo()); - onboardingRequestInfoMock.setAdmins(List.of(adminMock)); - when(msCoreConnectorMock.getOnboardingRequestInfo(any())) - .thenReturn(onboardingRequestInfoMock); - User userMock = mockInstance(new User(), "setId"); - WorkContact contact = mockInstance(new WorkContact()); - Map workContact = new HashMap<>(); - workContact.put(onboardingRequestInfoMock.getInstitutionInfo().getId(), contact); - userMock.setWorkContacts(workContact); - when(userRegistryConnector.getUserByInternalId(any(), any())) - .thenAnswer(invocation -> { - userMock.setId(invocation.getArgument(0, String.class)); - return userMock; - }); - // when - final OnboardingRequestInfo result = institutionService.getOnboardingRequestInfo(tokenId); - // then - assertNotNull(result); - assertNotNull(result.getManager().getUser()); - assertEquals(result.getManager().getId(), result.getManager().getUser().getId()); - assertNotNull(result.getAdmins().get(0).getUser()); - assertEquals(result.getAdmins().get(0).getId(), result.getAdmins().get(0).getUser().getId()); - verify(msCoreConnectorMock, times(1)) - .getOnboardingRequestInfo(tokenId); - ArgumentCaptor userIdCaptor = ArgumentCaptor.forClass(String.class); - ArgumentCaptor> filedsCaptor = ArgumentCaptor.forClass(EnumSet.class); - verify(userRegistryConnector, times(2)) - .getUserByInternalId(userIdCaptor.capture(), filedsCaptor.capture()); - EnumSet capturedFields = filedsCaptor.getValue(); - List userIds = userIdCaptor.getAllValues(); - assertEquals(userIds, List.of(onboardingRequestInfoMock.getManager().getId(), onboardingRequestInfoMock.getAdmins().get(0).getId())); - assertTrue(capturedFields.contains(name)); - assertTrue(capturedFields.contains(familyName)); - assertTrue(capturedFields.contains(workContacts)); - assertTrue(capturedFields.contains(fiscalCode)); - } - - @Test - void approveOnboardingRequest() { - // given - String tokenId = UUID.randomUUID().toString(); - Mockito.doNothing() - .when(msCoreConnectorMock).approveOnboardingRequest(anyString()); - // when - institutionService.approveOnboardingRequest(tokenId); - // then - verify(msCoreConnectorMock, times(1)) - .approveOnboardingRequest(tokenId); - verifyNoMoreInteractions(msCoreConnectorMock); - } - - @Test - void approveOnboardingRequest_hasNullToken() { - // given - String tokenId = null; - // when - Executable executable = () -> institutionService.approveOnboardingRequest(tokenId); - // then - IllegalArgumentException e = assertThrows(IllegalArgumentException.class, executable); - assertEquals(REQUIRED_TOKEN_ID_MESSAGE, e.getMessage()); - verifyNoInteractions(msCoreConnectorMock); - } - - @Test - void rejectOnboardingRequest() { - // given - String tokenId = UUID.randomUUID().toString(); - Mockito.doNothing() - .when(msCoreConnectorMock).rejectOnboardingRequest(anyString()); - // when - institutionService.rejectOnboardingRequest(tokenId); - // then - verify(msCoreConnectorMock, times(1)).rejectOnboardingRequest(tokenId); - verifyNoMoreInteractions(msCoreConnectorMock); - } - - @Test - void rejectOnboardingRequest_hasNullToken() { - // given - String tokenId = null; - // when - Executable executable = () -> institutionService.rejectOnboardingRequest(tokenId); - // then - IllegalArgumentException e = assertThrows(IllegalArgumentException.class, executable); - assertEquals(REQUIRED_TOKEN_ID_MESSAGE, e.getMessage()); - verifyNoMoreInteractions(msCoreConnectorMock); - } - @Test void updateInstitutionDescription() { // given diff --git a/web/src/main/java/it/pagopa/selfcare/dashboard/web/controller/InstitutionController.java b/web/src/main/java/it/pagopa/selfcare/dashboard/web/controller/InstitutionController.java index 0f2fd5579..83548bfa8 100644 --- a/web/src/main/java/it/pagopa/selfcare/dashboard/web/controller/InstitutionController.java +++ b/web/src/main/java/it/pagopa/selfcare/dashboard/web/controller/InstitutionController.java @@ -6,6 +6,9 @@ import it.pagopa.selfcare.commons.base.logging.LogUtils; import it.pagopa.selfcare.commons.base.security.SelfCareAuthority; import it.pagopa.selfcare.commons.base.security.SelfCareUser; +import it.pagopa.selfcare.dashboard.connector.model.delegation.GetDelegationParameters; +import it.pagopa.selfcare.dashboard.connector.model.delegation.GetDelegationsMode; +import it.pagopa.selfcare.dashboard.connector.model.delegation.Order; import it.pagopa.selfcare.dashboard.connector.model.institution.GeographicTaxonomyList; import it.pagopa.selfcare.dashboard.connector.model.institution.Institution; import it.pagopa.selfcare.dashboard.connector.model.institution.InstitutionInfo; @@ -35,10 +38,7 @@ import javax.validation.Valid; import java.io.IOException; -import java.util.Collection; -import java.util.List; -import java.util.Optional; -import java.util.Set; +import java.util.*; import java.util.stream.Collectors; @Slf4j @@ -344,9 +344,14 @@ public ResponseEntity> getDelegationsUsingFrom(@ApiPara @RequestParam(name = "productId", required = false) String productId) { log.trace("getDelegationsUsingFrom start"); log.debug("getDelegationsUsingFrom institutionId = {}, institutionDto{}", institutionId, productId); - ResponseEntity> result = ResponseEntity.status(HttpStatus.OK).body(delegationService.getDelegations(institutionId, null, productId).stream() + GetDelegationParameters delegationParameters = GetDelegationParameters.builder() + .from(institutionId) + .productId(productId) + .build(); + + ResponseEntity> result = ResponseEntity.status(HttpStatus.OK).body(delegationService.getDelegations(delegationParameters).stream() .map(delegationMapper::toDelegationResource) - .collect(Collectors.toList())); + .toList()); log.debug("getDelegationsUsingFrom result = {}", result); log.trace("getDelegationsUsingFrom end"); return result; @@ -368,12 +373,34 @@ public ResponseEntity> getDelegationsUsingFrom(@ApiPara public ResponseEntity> getDelegationsUsingTo(@ApiParam("${swagger.dashboard.delegation.model.to}") @PathVariable("institutionId") String institutionId, @ApiParam("${swagger.dashboard.delegation.model.productId}") - @RequestParam(name = "productId", required = false) String productId) { + @RequestParam(name = "productId", required = false) String productId, + @ApiParam("${swagger.dashboard.delegation.model.description}") + @RequestParam(name = "search", required = false) String search, + @ApiParam("${swagger.dashboard.delegation.model.taxCode}") + @RequestParam(name = "taxCode", required = false) String taxCode, + @ApiParam("${swagger.dashboard.delegation.delegations.mode}") + @RequestParam(name = "mode", required = false) GetDelegationsMode mode, + @ApiParam("${swagger.dashboard.delegation.delegations.order}") + @RequestParam(name = "order", required = false) Order order, + @RequestParam(name = "page", required = false) Integer page, + @RequestParam(name = "size", required = false) Integer size) { log.trace("getDelegationsUsingTo start"); log.debug("getDelegationsUsingTo institutionId = {}, institutionDto{}", institutionId, productId); - ResponseEntity> result = ResponseEntity.status(HttpStatus.OK).body(delegationService.getDelegations(null, institutionId, productId).stream() + + GetDelegationParameters delegationParameters = GetDelegationParameters.builder() + .to(institutionId) + .productId(productId) + .search(search) + .taxCode(taxCode) + .mode(Objects.nonNull(mode) ? mode.name() : null) + .order(Objects.nonNull(order) ? order.name() : null) + .page(page) + .size(size) + .build(); + + ResponseEntity> result = ResponseEntity.status(HttpStatus.OK).body(delegationService.getDelegations(delegationParameters).stream() .map(delegationMapper::toDelegationResource) - .collect(Collectors.toList())); + .toList()); log.debug("getDelegationsUsingTo result = {}", result); log.trace("getDelegationsUsingTo end"); return result; diff --git a/web/src/main/java/it/pagopa/selfcare/dashboard/web/controller/OnboardingController.java b/web/src/main/java/it/pagopa/selfcare/dashboard/web/controller/OnboardingController.java deleted file mode 100644 index a63f2d378..000000000 --- a/web/src/main/java/it/pagopa/selfcare/dashboard/web/controller/OnboardingController.java +++ /dev/null @@ -1,71 +0,0 @@ -package it.pagopa.selfcare.dashboard.web.controller; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import it.pagopa.selfcare.dashboard.connector.onboarding.OnboardingRequestInfo; -import it.pagopa.selfcare.dashboard.core.InstitutionService; -import it.pagopa.selfcare.dashboard.web.model.mapper.OnboardingRequestMapper; -import it.pagopa.selfcare.dashboard.web.model.onboarding.OnboardingRequestResource; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.*; - -import java.util.UUID; - -@Slf4j -@RestController -@RequestMapping(value = "/v1/onboarding-requests", produces = MediaType.APPLICATION_JSON_VALUE) -@Api(tags = "onboarding") -public class OnboardingController { - - private final InstitutionService institutionService; - - - @Autowired - public OnboardingController(InstitutionService institutionService) { - this.institutionService = institutionService; - } - - - @GetMapping(value = "/{tokenId}") - @ResponseStatus(HttpStatus.OK) - @ApiOperation(value = "", notes = "${swagger.dashboard.onboarding-requests.api.retrieveOnboardingRequest}") - public OnboardingRequestResource retrieveOnboardingRequest(@ApiParam("${swagger.dashboard.onboarding-requests.model.tokenId}") - @PathVariable("tokenId") - UUID tokenId) { - log.trace("retrieveOnboardingRequest start"); - log.debug("retrieveOnboardingRequest tokenId = {}", tokenId); - final OnboardingRequestInfo onboardingRequestInfo = institutionService.getOnboardingRequestInfo(tokenId.toString()); - OnboardingRequestResource result = OnboardingRequestMapper.toResource(onboardingRequestInfo); - log.debug("retrieveOnboardingRequest result = {}", result); - log.trace("retrieveOnboardingRequest end"); - return result; - } - - @PostMapping(value = "/approve/{tokenId}") - @ResponseStatus(HttpStatus.OK) - @ApiOperation(value = "", notes = "${swagger.dashboard.onboarding-requests.api.approveOnboardingRequest}") - public void approveOnboardingRequest(@ApiParam("${swagger.dashboard.onboarding-requests.model.tokenId}") - @PathVariable("tokenId") - UUID tokenId) { - log.trace("approveOnboardingRequest start"); - log.debug("approveOnboardingRequest tokenId = {}", tokenId); - institutionService.approveOnboardingRequest(tokenId.toString()); - log.trace("approveOnboardingRequest end"); - } - - @DeleteMapping(value = "/reject/{tokenId}") - @ResponseStatus(HttpStatus.OK) - @ApiOperation(value = "", notes = "${swagger.dashboard.onboarding-requests.api.rejectOnboardingRequest}") - public void rejectOnboardingRequest(@ApiParam("${swagger.dashboard.onboarding-requests.model.tokenId}") - @PathVariable("tokenId") - UUID tokenId){ - log.trace("rejectOnboardingRequest start"); - log.debug("rejectOnboardingRequest tokenId = {}", tokenId); - institutionService.rejectOnboardingRequest(tokenId.toString()); - log.trace("rejectOnboardingRequest end"); - } -} diff --git a/web/src/main/resources/swagger/swagger_en.properties b/web/src/main/resources/swagger/swagger_en.properties index c1dc8c072..1722ac749 100644 --- a/web/src/main/resources/swagger/swagger_en.properties +++ b/web/src/main/resources/swagger/swagger_en.properties @@ -171,6 +171,10 @@ swagger.dashboard.delegation.model.id=Delegation's unique identifier swagger.dashboard.delegation.model.from=Institution's identifier swagger.dashboard.delegation.model.to=Technical partner's identifier swagger.dashboard.delegation.model.productId=Product's identifier +swagger.dashboard.delegation.model.description=Institution's name to search +swagger.dashboard.delegation.model.taxCode=Institution's tax code +swagger.dashboard.delegation.delegations.mode=Mode (full or normal) to retrieve institution's delegations +swagger.dashboard.delegation.delegations.order=Order to show response NONE, ASC, DESC swagger.dashboard.delegation.model.type=Delegation type swagger.dashboard.delegation.model.institutionFromName=Institution's name swagger.dashboard.support.api.sendRequest=Service to retrieve Support contact's form diff --git a/web/src/test/java/it/pagopa/selfcare/dashboard/web/controller/InstitutionControllerTest.java b/web/src/test/java/it/pagopa/selfcare/dashboard/web/controller/InstitutionControllerTest.java index 8f02d3c6f..af77d33ea 100644 --- a/web/src/test/java/it/pagopa/selfcare/dashboard/web/controller/InstitutionControllerTest.java +++ b/web/src/test/java/it/pagopa/selfcare/dashboard/web/controller/InstitutionControllerTest.java @@ -5,8 +5,7 @@ import it.pagopa.selfcare.commons.base.security.SelfCareAuthority; import it.pagopa.selfcare.commons.base.security.SelfCareUser; import it.pagopa.selfcare.dashboard.connector.exception.ResourceNotFoundException; -import it.pagopa.selfcare.dashboard.connector.model.delegation.Delegation; -import it.pagopa.selfcare.dashboard.connector.model.delegation.DelegationType; +import it.pagopa.selfcare.dashboard.connector.model.delegation.*; import it.pagopa.selfcare.dashboard.connector.model.institution.*; import it.pagopa.selfcare.dashboard.connector.model.product.Product; import it.pagopa.selfcare.dashboard.connector.model.product.ProductTree; @@ -557,7 +556,7 @@ void getDelegationsUsingFrom_shouldGetData() throws Exception { // Given Delegation expectedDelegation = dummyDelegation(); - when(delegationService.getDelegations(any(), any(), any())).thenReturn(List.of(expectedDelegation)); + when(delegationService.getDelegations(any())).thenReturn(List.of(expectedDelegation)); // When MvcResult result = mvc @@ -581,7 +580,7 @@ void getDelegationsUsingFrom_shouldGetData() throws Exception { assertThat(actual.getInstitutionId()).isEqualTo(expectedDelegation.getInstitutionId()); verify(delegationService, times(1)) - .getDelegations(expectedDelegation.getInstitutionId(), null, expectedDelegation.getProductId()); + .getDelegations(dummyDelegationParametersFrom()); verifyNoMoreInteractions(delegationService); } @@ -592,13 +591,16 @@ void getDelegationsUsingFrom_shouldGetData() throws Exception { void getDelegationsUsingTo_shouldGetData() throws Exception { // Given Delegation expectedDelegation = dummyDelegation(); + GetDelegationParameters delegationParameters = dummyDelegationParametersTo(); - when(delegationService.getDelegations(any(), any(), any())).thenReturn(List.of(expectedDelegation)); + when(delegationService.getDelegations(any())).thenReturn(List.of(expectedDelegation)); // When MvcResult result = mvc .perform(MockMvcRequestBuilders - .get(BASE_URL + "/{institutionId}/institutions?productId={productId}", expectedDelegation.getBrokerId(), expectedDelegation.getProductId())) + .get(BASE_URL + "/{institutionId}/institutions?productId={productId}&search={search}&taxCode={taxCode}&mode=FULL&order=ASC&page={page}&size={size}", + delegationParameters.getTo(), delegationParameters.getProductId(), delegationParameters.getSearch(), + delegationParameters.getTaxCode(), delegationParameters.getPage(), delegationParameters.getSize())) .andExpect(MockMvcResultMatchers.status().isOk()) .andExpect(MockMvcResultMatchers.content().contentType("application/json")) .andReturn(); @@ -617,7 +619,45 @@ void getDelegationsUsingTo_shouldGetData() throws Exception { assertThat(actual.getInstitutionId()).isEqualTo(expectedDelegation.getInstitutionId()); verify(delegationService, times(1)) - .getDelegations(null, expectedDelegation.getBrokerId(), expectedDelegation.getProductId()); + .getDelegations(dummyDelegationParametersTo()); + verifyNoMoreInteractions(delegationService); + } + + @Test + void getDelegationsUsingTo_shouldGetDataWithoutFilters() throws Exception { + // Given + Delegation expectedDelegation = dummyDelegation(); + + GetDelegationParameters delegationParameters = GetDelegationParameters.builder() + .to("to") + .build(); + + when(delegationService.getDelegations(any())).thenReturn(List.of(expectedDelegation)); + // When + + MvcResult result = mvc + .perform(MockMvcRequestBuilders + .get(BASE_URL + "/{institutionId}/institutions", expectedDelegation.getBrokerId())) + .andExpect(MockMvcResultMatchers.status().isOk()) + .andExpect(MockMvcResultMatchers.content().contentType("application/json")) + .andReturn(); + + List resource = objectMapper.readValue( + result.getResponse().getContentAsString(), new TypeReference<>() {}); + // Then + assertThat(resource).isNotNull(); + org.assertj.core.api.Assertions.assertThat(resource).hasSize(1); + DelegationResource actual = resource.get(0); + assertThat(actual.getId()).isEqualTo(expectedDelegation.getId()); + assertThat(actual.getInstitutionName()).isEqualTo(expectedDelegation.getInstitutionName()); + assertThat(actual.getInstitutionRootName()).isEqualTo(expectedDelegation.getInstitutionRootName()); + assertThat(actual.getBrokerName()).isEqualTo(expectedDelegation.getBrokerName()); + assertThat(actual.getBrokerId()).isEqualTo(expectedDelegation.getBrokerId()); + assertThat(actual.getProductId()).isEqualTo(expectedDelegation.getProductId()); + assertThat(actual.getInstitutionId()).isEqualTo(expectedDelegation.getInstitutionId()); + + verify(delegationService, times(1)) + .getDelegations(delegationParameters); verifyNoMoreInteractions(delegationService); } @@ -632,4 +672,24 @@ private Delegation dummyDelegation() { return delegation; } + private GetDelegationParameters dummyDelegationParametersTo() { + return GetDelegationParameters.builder() + .to("to") + .productId("setProductId") + .taxCode("taxCode") + .search("name") + .mode(GetDelegationsMode.FULL.name()) + .order(Order.ASC.name()) + .page(0) + .size(1000) + .build(); + } + + private GetDelegationParameters dummyDelegationParametersFrom() { + return GetDelegationParameters.builder() + .from("from") + .productId("setProductId") + .build(); + } + } \ No newline at end of file diff --git a/web/src/test/java/it/pagopa/selfcare/dashboard/web/controller/OnboardingControllerTest.java b/web/src/test/java/it/pagopa/selfcare/dashboard/web/controller/OnboardingControllerTest.java deleted file mode 100644 index 64d9ee1db..000000000 --- a/web/src/test/java/it/pagopa/selfcare/dashboard/web/controller/OnboardingControllerTest.java +++ /dev/null @@ -1,143 +0,0 @@ -package it.pagopa.selfcare.dashboard.web.controller; - -import com.fasterxml.jackson.databind.ObjectMapper; -import it.pagopa.selfcare.dashboard.connector.model.user.WorkContact; -import it.pagopa.selfcare.dashboard.connector.onboarding.OnboardingRequestInfo; -import it.pagopa.selfcare.dashboard.core.InstitutionService; -import it.pagopa.selfcare.dashboard.web.config.WebTestConfig; -import it.pagopa.selfcare.dashboard.web.handler.DashboardExceptionsHandler; -import org.junit.jupiter.api.Test; -import org.mockito.Mockito; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; -import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; -import org.springframework.boot.test.mock.mockito.MockBean; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.web.servlet.MockMvc; -import org.springframework.test.web.servlet.MvcResult; -import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; - -import java.util.List; -import java.util.Map; -import java.util.UUID; - -import static it.pagopa.selfcare.commons.utils.TestUtils.mockInstance; -import static org.hamcrest.Matchers.notNullValue; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.*; -import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -@WebMvcTest(value = {OnboardingController.class}, excludeAutoConfiguration = SecurityAutoConfiguration.class) -@ContextConfiguration(classes = {OnboardingController.class, WebTestConfig.class, DashboardExceptionsHandler.class}) -class OnboardingControllerTest { - - private static final String BASE_URL = "/v1/onboarding-requests"; - - @Autowired - protected MockMvc mvc; - - @Autowired - protected ObjectMapper objectMapper; - - @MockBean - private InstitutionService institutionServiceMock; - - - @Test - void retrieveOnboardingRequest() throws Exception { - // given - String tokenId = UUID.randomUUID().toString(); - final OnboardingRequestInfo dto = mockInstance(new OnboardingRequestInfo()); - dto.getManager().getUser().setId(UUID.randomUUID().toString()); - dto.getManager().getUser().setWorkContacts(Map.of(dto.getInstitutionInfo().getId(), mockInstance(new WorkContact()))); - dto.setAdmins(List.of(dto.getManager())); - when(institutionServiceMock.getOnboardingRequestInfo(any())) - .thenReturn(dto); - // when - mvc.perform(MockMvcRequestBuilders - .get(BASE_URL + "/{tokenId}", tokenId) - .contentType(APPLICATION_JSON_VALUE) - .accept(APPLICATION_JSON_VALUE)) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.status", notNullValue())) - .andExpect(jsonPath("$.institutionInfo", notNullValue())) - .andExpect(jsonPath("$.institutionInfo.id", notNullValue())) - .andExpect(jsonPath("$.institutionInfo.name", notNullValue())) - .andExpect(jsonPath("$.institutionInfo.institutionType", notNullValue())) - .andExpect(jsonPath("$.institutionInfo.address", notNullValue())) - .andExpect(jsonPath("$.institutionInfo.zipCode", notNullValue())) - .andExpect(jsonPath("$.institutionInfo.mailAddress", notNullValue())) - .andExpect(jsonPath("$.institutionInfo.fiscalCode", notNullValue())) - .andExpect(jsonPath("$.institutionInfo.vatNumber", notNullValue())) - .andExpect(jsonPath("$.institutionInfo.recipientCode", notNullValue())) - .andExpect(jsonPath("$.institutionInfo.pspData", notNullValue())) - .andExpect(jsonPath("$.institutionInfo.pspData.businessRegisterNumber", notNullValue())) - .andExpect(jsonPath("$.institutionInfo.pspData.legalRegisterName", notNullValue())) - .andExpect(jsonPath("$.institutionInfo.pspData.legalRegisterNumber", notNullValue())) - .andExpect(jsonPath("$.institutionInfo.pspData.abiCode", notNullValue())) - .andExpect(jsonPath("$.institutionInfo.pspData.vatNumberGroup", notNullValue())) - .andExpect(jsonPath("$.institutionInfo.dpoData", notNullValue())) - .andExpect(jsonPath("$.institutionInfo.dpoData.address", notNullValue())) - .andExpect(jsonPath("$.institutionInfo.dpoData.pec", notNullValue())) - .andExpect(jsonPath("$.institutionInfo.dpoData.email", notNullValue())) - .andExpect(jsonPath("$.manager", notNullValue())) - .andExpect(jsonPath("$.manager.id", notNullValue())) - .andExpect(jsonPath("$.manager.name", notNullValue())) - .andExpect(jsonPath("$.manager.surname", notNullValue())) - .andExpect(jsonPath("$.manager.email", notNullValue())) - .andExpect(jsonPath("$.manager.fiscalCode", notNullValue())) - .andExpect(jsonPath("$.admins", notNullValue())) - .andExpect(jsonPath("$.admins[0].id", notNullValue())) - .andExpect(jsonPath("$.admins[0].name", notNullValue())) - .andExpect(jsonPath("$.admins[0].surname", notNullValue())) - .andExpect(jsonPath("$.admins[0].email", notNullValue())) - .andExpect(jsonPath("$.admins[0].fiscalCode", notNullValue())); - // then - verify(institutionServiceMock, times(1)) - .getOnboardingRequestInfo(tokenId); - verifyNoMoreInteractions(institutionServiceMock); - } - - - @Test - void approveOnboardingRequest() throws Exception { - // given - String tokenId = UUID.randomUUID().toString(); - Mockito.doNothing() - .when(institutionServiceMock).approveOnboardingRequest(anyString()); - // when - MvcResult result = mvc.perform(MockMvcRequestBuilders - .post(BASE_URL + "/approve/" + tokenId) - .contentType(APPLICATION_JSON_VALUE) - .accept(APPLICATION_JSON_VALUE)) - .andExpect(status().isOk()) - .andReturn(); - // then - assertEquals("", result.getResponse().getContentAsString()); - verify(institutionServiceMock, times(1)).approveOnboardingRequest(tokenId); - verifyNoMoreInteractions(institutionServiceMock); - } - - @Test - void rejectOnboardingRequest() throws Exception { - // given - String tokenId = UUID.randomUUID().toString(); - Mockito.doNothing() - .when(institutionServiceMock).rejectOnboardingRequest(anyString()); - // when - MvcResult result = mvc.perform(MockMvcRequestBuilders - .delete(BASE_URL + "/reject/" + tokenId) - .contentType(APPLICATION_JSON_VALUE) - .accept(APPLICATION_JSON_VALUE)) - .andExpect(status().isOk()) - .andReturn(); - // then - assertEquals("", result.getResponse().getContentAsString()); - verify(institutionServiceMock, times(1)).rejectOnboardingRequest(tokenId); - verifyNoMoreInteractions(institutionServiceMock); - } - -} \ No newline at end of file