diff --git a/src/core/api/party_management/getOrganizationById_policy.xml b/src/core/api/party_management/getOrganizationById_policy.xml
new file mode 100644
index 000000000..172bae3f9
--- /dev/null
+++ b/src/core/api/party_management/getOrganizationById_policy.xml
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+ application/json
+
+
+ {
+ "id": "97c0f418-bcb3-48d4-825a-fe8b29ae68e5",
+ "institutionId": "aoo=c_f205,o=c_f205,c=it",
+ "description": "AGENCY X",
+ "digitalAddress": "email@pec.mail.org",
+ "attributes": [
+ "string"
+ ]
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/core/api/party_management/party-management.yml.tpl b/src/core/api/party_management/party-management.yml.tpl
new file mode 100644
index 000000000..b1330555b
--- /dev/null
+++ b/src/core/api/party_management/party-management.yml.tpl
@@ -0,0 +1,818 @@
+openapi: 3.0.3
+info:
+ title: Party Management Micro Service
+ description: This service is the party manager
+ version: 'v1'
+ contact:
+ name: API Support
+ url: 'http://www.example.com/support'
+ email: support@example.com
+ termsOfService: 'http://swagger.io/terms/'
+ x-api-id: an x-api-id
+ x-summary: an x-summary
+servers:
+ - url: 'https://${host}/${basePath}'
+ description: This service is the party manager
+tags:
+ - name: party
+ description: Manipulate party information
+ externalDocs:
+ description: Find out more
+ url: 'http://swagger.io'
+ - name: health
+ description: Verify service status
+ externalDocs:
+ description: Find out more
+ url: 'http://swagger.io'
+paths:
+ '/persons/{id}':
+ get:
+ summary: Retrieves Person by ID
+ tags:
+ - party
+ operationId: getPersonById
+ description: 'returns the identified person, if any.'
+ parameters:
+ - name: id
+ in: path
+ schema:
+ type: string
+ format: uuid
+ required: true
+ description: Person ID
+ responses:
+ '200':
+ description: Person
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Person'
+ '400':
+ description: Bad Request
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+ '404':
+ description: Person not found
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+ head:
+ tags:
+ - party
+ summary: Verify if a Person exists for a given ID
+ description: Return ok
+ operationId: existsPersonById
+ parameters:
+ - name: id
+ in: path
+ description: The ID of the Person to check
+ required: true
+ schema:
+ description: The Person ID.
+ type: string
+ format: uuid
+ example: e72dd279-5f52-4039-afbe-2b7e432c490e
+ responses:
+ '200':
+ description: Person exists
+ '404':
+ description: Person not found
+ /persons:
+ post:
+ # security:
+ # - bearerAuth: [ ]
+ tags:
+ - party
+ summary: Create a new person
+ description: Return ok
+ operationId: createPerson
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/PersonSeed'
+ responses:
+ '201':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Person'
+ '400':
+ description: Invalid ID supplied
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+ /organizations:
+ post:
+ # security:
+ # - bearerAuth: [ ]
+ tags:
+ - party
+ summary: Create an organization
+ description: Return ok
+ operationId: createOrganization
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OrganizationSeed'
+ responses:
+ '201':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Organization'
+ '400':
+ description: Invalid ID supplied
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+ /organizations/{id}:
+ get:
+ summary: Retrieves Organization by ID
+ tags:
+ - party
+ operationId: getOrganizationById
+ description: 'returns the identified organization, if any.'
+ parameters:
+ - schema:
+ type: string
+ format: uuid
+ name: id
+ in: path
+ required: true
+ description: Organization ID
+ responses:
+ '200':
+ description: Organization
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Organization'
+ '400':
+ description: Bad Request
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+ '404':
+ description: Organization not found
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+ head:
+ # security:
+ # - bearerAuth: [ ]
+ tags:
+ - party
+ summary: Verify if an organization exists for a given organizationId
+ description: Return ok
+ operationId: existsOrganizationById
+ parameters:
+ - name: id
+ in: path
+ description: The ID of the Organization to check
+ required: true
+ schema:
+ description: to be defined
+ type: string
+ format: uuid
+ example: e72dd279-5f52-4039-afbe-2b7e432c490e
+ responses:
+ '200':
+ description: successful operation
+ '404':
+ description: Organization not found
+ /organizations/{id}/attributes:
+ parameters:
+ - schema:
+ type: string
+ format: uuid
+ example: e72dd279-5f52-4039-afbe-2b7e432c490e
+ name: id
+ in: path
+ required: true
+ description: Organization ID
+ get:
+ summary: Retrieves attributes
+ tags:
+ - party
+ responses:
+ '200':
+ description: Party Attributes
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Attributes'
+ '400':
+ description: Bad Request
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+ '404':
+ description: Party not found
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+ operationId: getPartyAttributes
+ description: 'returns the attributes of the identified party, if any.'
+ patch:
+ # security:
+ # - bearerAuth: [ ]
+ tags:
+ - party
+ summary: Retrieve the organization attributes for the given organizationId
+ description: Return ok
+ operationId: addOrganizationAttributes
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Attributes'
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Organization'
+ '404':
+ description: Organization not found
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+ /relationships:
+ post:
+ # security:
+ # - bearerAuth: [ ]
+ tags:
+ - party
+ summary: Create a new relationship between a Person and an Organization
+ description: Return ok
+ operationId: createRelationship
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/RelationshipSeed'
+ responses:
+ '201':
+ description: Created Relationship
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Relationship'
+ '400':
+ description: Invalid ID supplied
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+ get:
+ # security:
+ # - bearerAuth: [ ]
+ tags:
+ - party
+ summary: Return a list of relationships
+ description: Return ok
+ operationId: getRelationships
+ parameters:
+ - in: query
+ name: from
+ schema:
+ type: string
+ - in: query
+ name: to
+ schema:
+ type: string
+ - in: query
+ name: platformRole
+ schema:
+ type: string
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Relationships'
+ '400':
+ description: Invalid ID supplied
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+ /relationships/{relationshipId}:
+ get:
+ tags:
+ - party
+ summary: Retrieve the relationship for the given relationshipId
+ description: Return relationship
+ operationId: getRelationshipById
+ parameters:
+ - name: relationshipId
+ in: path
+ description: The ID of the Relationship to retrieve
+ required: true
+ schema:
+ type: string
+ format: uuid
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Relationship'
+ '400':
+ description: Bad Request
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+ '404':
+ description: Relationship not found
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+ '/relationships/{relationshipId}/suspend':
+ parameters:
+ - schema:
+ type: string
+ format: uuid
+ name: relationshipId
+ in: path
+ required: true
+ description: Relationship ID
+ post:
+ summary: Suspend Relationship by ID
+ tags:
+ - party
+ responses:
+ '204':
+ description: Relationship suspended
+ '404':
+ description: Relationship not found
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+ operationId: suspendPartyRelationshipById
+ description: 'Suspend relationship by ID'
+ '/relationships/{relationshipId}/activate':
+ parameters:
+ - schema:
+ type: string
+ format: uuid
+ name: relationshipId
+ in: path
+ required: true
+ description: Relationship ID
+ post:
+ summary: Activate Relationship by plaftorm ID
+ tags:
+ - party
+ responses:
+ '204':
+ description: Relationship activated
+ '404':
+ description: Relationship not found
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+ operationId: activatePartyRelationshipById
+ description: 'Activate Relationship by ID'
+ /tokens:
+ post:
+ # security:
+ # - bearerAuth: [ ]
+ tags:
+ - party
+ summary: Create a new token
+ description: Return ok
+ operationId: createToken
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/TokenSeed'
+ responses:
+ '201':
+ description: successful operation
+ content:
+ application/octet-stream:
+ schema:
+ $ref: '#/components/schemas/TokenText'
+ '400':
+ description: Invalid ID supplied
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+ /tokens/{token}:
+ head:
+ # security:
+ # - bearerAuth: [ ]
+ tags:
+ - party
+ summary: Retrieve token info
+ description: Return ok
+ operationId: verifyToken
+ parameters:
+ - name: token
+ in: path
+ description: The token to verify
+ required: true
+ schema:
+ description: to be defined
+ type: string
+ responses:
+ '200':
+ description: successful operation
+ '404':
+ description: Token not found
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+ '400':
+ description: Invalid ID supplied
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+ post:
+ # security:
+ # - bearerAuth: [ ]
+ tags:
+ - party
+ summary: Consume a token
+ description: Return ok
+ operationId: consumeToken
+ parameters:
+ - name: token
+ in: path
+ description: The token to consume
+ required: true
+ schema:
+ description: to be defined
+ type: string
+ requestBody:
+ description: onboarding signed document
+ content:
+ multipart/form-data:
+ schema:
+ type: object
+ required:
+ - doc
+ properties:
+ doc:
+ type: string
+ format: binary
+ required: true
+ responses:
+ '201':
+ description: successful operation
+ '400':
+ description: Invalid ID supplied
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+ delete:
+ # security:
+ # - bearerAuth: [ ]
+ tags:
+ - party
+ summary: Invalidate a token
+ description: Return ok
+ operationId: invalidateToken
+ parameters:
+ - name: token
+ in: path
+ description: The token to invalidate
+ required: true
+ schema:
+ type: string
+ responses:
+ '200':
+ description: successful operation
+ '400':
+ description: Invalid ID supplied
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+ /status:
+ get:
+ # security:
+ # - bearerAuth: [ ]
+ tags:
+ - health
+ summary: Health status endpoint
+ description: Return ok
+ operationId: getStatus
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+ '/bulk/organizations':
+ post:
+ summary: Retrieves a collection of organizations
+ tags:
+ - party
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/BulkPartiesSeed'
+ responses:
+ '200':
+ description: collection of organizations
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/BulkOrganizations'
+ '400':
+ description: Bad Request
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+ '404':
+ description: Organizations not found
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+ operationId: bulkOrganizations
+ description: 'returns a collection of all the parties for the corresponding identifiers.'
+components:
+ schemas:
+ PersonSeed:
+ type: object
+ properties:
+ id:
+ description: Internal id.
+ type: string
+ format: uuid
+ required:
+ - id
+ additionalProperties: false
+ Person:
+ type: object
+ properties:
+ id:
+ type: string
+ format: uuid
+ example: 97c0f418-bcb3-48d4-825a-fe8b29ae68e5
+ required:
+ - id
+ additionalProperties: false
+ OrganizationSeed:
+ type: object
+ properties:
+ institutionId:
+ description: DN
+ example: 'aoo=c_f205,o=c_f205,c=it'
+ type: string
+ description:
+ type: string
+ example: AGENCY X
+ digitalAddress:
+ example: email@pec.mail.org
+ format: email
+ type: string
+ attributes:
+ $ref: '#/components/schemas/Attributes'
+ required:
+ - institutionId
+ - description
+ - digitalAddress
+ - attributes
+ additionalProperties: false
+ Organization:
+ type: object
+ properties:
+ id:
+ type: string
+ format: uuid
+ example: 97c0f418-bcb3-48d4-825a-fe8b29ae68e5
+ institutionId:
+ description: DN
+ example: 'aoo=c_f205,o=c_f205,c=it'
+ type: string
+ description:
+ type: string
+ example: AGENCY X
+ digitalAddress:
+ example: email@pec.mail.org
+ format: email
+ type: string
+ attributes:
+ $ref: '#/components/schemas/Attributes'
+ required:
+ - id
+ - institutionId
+ - description
+ - digitalAddress
+ - attributes
+ additionalProperties: false
+ BulkOrganizations:
+ type: object
+ required:
+ - found
+ - notFound
+ properties:
+ found:
+ type: array
+ description: the collection of organizations found.
+ items:
+ $ref: '#/components/schemas/Organization'
+ notFound:
+ type: array
+ items:
+ type: string
+ description: the identifiers of organizations not found.
+ BulkPartiesSeed:
+ type: object
+ required:
+ - partyIdentifiers
+ properties:
+ partyIdentifiers:
+ type: array
+ items:
+ type: string
+ format: uuid
+ description: the identifiers of party
+ Attributes:
+ type: array
+ items:
+ type: string
+ RelationshipSeed:
+ type: object
+ properties:
+ from:
+ type: string
+ format: uuid
+ description: person ID
+ to:
+ type: string
+ format: uuid
+ description: organization ID
+ role:
+ type: string
+ description: represents the generic available role types for the relationship
+ enum:
+ - Manager
+ - Delegate
+ - Operator
+ platformRole:
+ type: string
+ description: 'user role in the application context (e.g.: administrator, security user). This MUST belong to the configured set of application specific platform roles'
+ additionalProperties: false
+ required:
+ - from
+ - to
+ - role
+ - platformRole
+ Relationship:
+ type: object
+ properties:
+ id:
+ type: string
+ format: uuid
+ from:
+ type: string
+ format: uuid
+ description: person ID
+ to:
+ type: string
+ format: uuid
+ description: organization ID
+ filePath:
+ type: string
+ description: path of the file containing the signed onboarding document
+ fileName:
+ type: string
+ description: name of the file containing the signed onboarding document
+ contentType:
+ type: string
+ description: content type of the file containing the signed onboarding document
+ role:
+ type: string
+ description: represents the generic available role types for the relationship
+ enum:
+ - Manager
+ - Delegate
+ - Operator
+ platformRole:
+ type: string
+ description: 'user role in the application context (e.g.: administrator, security user). This MUST belong to the configured set of application specific platform roles'
+ status:
+ type: string
+ enum:
+ - Pending
+ - Active
+ - Suspended
+ additionalProperties: false
+ required:
+ - id
+ - from
+ - to
+ - role
+ - platformRole
+ - status
+ Relationships:
+ type: object
+ properties:
+ items:
+ type: array
+ items:
+ $ref: '#/components/schemas/Relationship'
+ additionalProperties: false
+ required:
+ - items
+ RelationshipsSeed:
+ type: object
+ properties:
+ items:
+ type: array
+ items:
+ $ref: '#/components/schemas/RelationshipSeed'
+ additionalProperties: false
+ required:
+ - items
+ TokenSeed:
+ type: object
+ properties:
+ seed:
+ type: string
+ example: 97c0f418-bcb3-48d4-825a-fe8b29ae68e5
+ relationships:
+ $ref: '#/components/schemas/RelationshipsSeed'
+ checksum:
+ type: string
+ additionalProperties: false
+ required:
+ - seed
+ - relationships
+ - checksum
+ TokenText:
+ properties:
+ token:
+ type: string
+ additionalProperties: false
+ required:
+ - token
+ Problem:
+ properties:
+ detail:
+ description: A human readable explanation specific to this occurrence of the problem.
+ example: Request took too long to complete.
+ type: string
+ status:
+ description: The HTTP status code generated by the origin server for this occurrence of the problem.
+ example: 503
+ exclusiveMaximum: true
+ format: int32
+ maximum: 600
+ minimum: 100
+ type: integer
+ title:
+ description:
+ A short, summary of the problem type. Written in english and readable
+ example: Service Unavailable
+ type: string
+ additionalProperties: false
+ required:
+ - status
+ - title
+# securitySchemes:
+# bearerAuth:
+# type: http
+# description: A bearer token in the format of a JWS and comformed to the specifications included in [RFC8725](https://tools.ietf.org/html/RFC8725).
+# scheme: bearer
+# bearerFormat: JWTly in the editor.
diff --git a/src/core/api/party_process/createLegals_policy.xml b/src/core/api/party_process/createLegals_policy.xml
new file mode 100644
index 000000000..a227a685f
--- /dev/null
+++ b/src/core/api/party_process/createLegals_policy.xml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+ application/json
+
+
+ {
+ "detail": "Request took too long to complete.",
+ "status": 503,
+ "title": "Service Unavailable"
+ }
+
+
+
+
+
+
+
+ application/json
+
+
+ {
+ "token": "string",
+ "document": "string"
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/core/api/party_process/getOnBoardingInfo_policy.xml b/src/core/api/party_process/getOnBoardingInfo_policy.xml
new file mode 100644
index 000000000..9c7278907
--- /dev/null
+++ b/src/core/api/party_process/getOnBoardingInfo_policy.xml
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+ application/json
+
+
+ {
+ "person": {
+ "name": "name",
+ "surname": "surname",
+ "taxCode": "AAAAAA00A00A000A"
+ },
+ "institutions": [
+ {
+ "institutionId": "institutionId",
+ "description": "description",
+ "digitalAddress": "digitalAddress",
+ "status": "active",
+ "role": "Manager",
+ "platformRole": "admin",
+ "attributes": [
+ "string"
+ ]
+ }
+ ]
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/core/api/party_process/party-process.yml.tpl b/src/core/api/party_process/party-process.yml.tpl
new file mode 100644
index 000000000..d23e30b78
--- /dev/null
+++ b/src/core/api/party_process/party-process.yml.tpl
@@ -0,0 +1,608 @@
+openapi: 3.0.3
+info:
+ title: Party Process Micro Service
+ description: This service is the party process
+ version: 'v1'
+ contact:
+ name: API Support
+ url: 'http://www.example.com/support'
+ email: support@example.com
+ termsOfService: 'http://swagger.io/terms/'
+ x-api-id: an x-api-id
+ x-summary: an x-summary
+servers:
+ - url: 'https://${host}/${basePath}'
+ description: This service is the party process
+security:
+ - bearerAuth: []
+tags:
+ - name: process
+ description: Implements party process
+ externalDocs:
+ description: Find out more
+ url: 'http://swagger.io'
+ - name: platform
+ description: Implements platform endpoints
+ externalDocs:
+ description: Find out more
+ url: 'http://swagger.io'
+ - name: health
+ description: Verify service status
+ externalDocs:
+ description: Find out more
+ url: 'http://swagger.io'
+paths:
+ '/onboarding/info/{taxCode}':
+ get:
+ security:
+ - bearerAuth: []
+ tags:
+ - process
+ summary: get on boarding info
+ description: Return ok
+ operationId: getOnBoardingInfo
+ parameters:
+ - name: taxCode
+ in: path
+ description: The tax code to get onboarding info
+ required: true
+ schema:
+ type: string
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OnBoardingInfo'
+ '400':
+ description: Invalid ID supplied
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+ /onboarding/legals:
+ post:
+ security:
+ - bearerAuth: []
+ tags:
+ - process
+ summary: create an onboarding entry
+ description: Return ok
+ operationId: createLegals
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OnBoardingRequest'
+ responses:
+ '201':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OnBoardingResponse'
+ '400':
+ description: Invalid ID supplied
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+ /onboarding/operators:
+ post:
+ security:
+ - bearerAuth: []
+ tags:
+ - process
+ summary: create an onboarding entry
+ description: Return ok
+ operationId: createOperators
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OnBoardingRequest'
+ responses:
+ '201':
+ description: successful operation
+ '400':
+ description: Invalid ID supplied
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+ /institutions/{institutionId}/relationships:
+ get:
+ security:
+ - bearerAuth: [ ]
+ tags:
+ - process
+ summary: returns the relationships related to the institution
+ description: Return ok
+ operationId: getInstitutionRelationships
+ parameters:
+ - name: institutionId
+ in: path
+ description: The identifier of the institution
+ required: true
+ schema:
+ type: string
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/RelationshipsResponse'
+ '400':
+ description: Invalid institution id supplied
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+ /institutions/{institutionId}/relationships/{taxCode}:
+ get:
+ security:
+ - bearerAuth: [ ]
+ tags:
+ - process
+ summary: returns the relationship related to the institution and tax code
+ description: Return ok
+ operationId: getInstitutionTaxCodeRelationship
+ parameters:
+ - name: institutionId
+ in: path
+ description: The identifier of the institution
+ required: true
+ schema:
+ type: string
+ - name: taxCode
+ in: path
+ description: The identifier of the operator
+ required: true
+ schema:
+ type: string
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/RelationshipsResponse'
+ '400':
+ description: Invalid institution id supplied
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+ /institutions/{institutionId}/relationships/{taxCode}/activate:
+ post:
+ security:
+ - bearerAuth: [ ]
+ tags:
+ - process
+ summary: Activate the relationship related to the institution and tax code
+ description: Activate relationship
+ operationId: activateRelationshipByInstitutionTaxCode
+ parameters:
+ - name: institutionId
+ in: path
+ description: The identifier of the institution
+ required: true
+ schema:
+ type: string
+ - name: taxCode
+ in: path
+ description: The identifier of the operator
+ required: true
+ schema:
+ type: string
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ActivationRequest'
+ responses:
+ '204':
+ description: Successful operation
+ '400':
+ description: Invalid id supplied
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+ '404':
+ description: Not found
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+ /institutions/{institutionId}/relationships/{taxCode}/suspend:
+ post:
+ security:
+ - bearerAuth: [ ]
+ tags:
+ - process
+ summary: Suspend the relationship related to the institution and tax code
+ description: Suspend relationship
+ operationId: suspendRelationshipByInstitutionTaxCode
+ parameters:
+ - name: institutionId
+ in: path
+ description: The identifier of the institution
+ required: true
+ schema:
+ type: string
+ - name: taxCode
+ in: path
+ description: The identifier of the operator
+ required: true
+ schema:
+ type: string
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ActivationRequest'
+ responses:
+ '204':
+ description: Successful operation
+ '400':
+ description: Invalid id supplied
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+ '404':
+ description: Not found
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+ '/onboarding/complete/{token}':
+ post:
+ security:
+ - bearerAuth: []
+ tags:
+ - process
+ summary: create an onboarding entry
+ description: Return ok
+ operationId: confirmOnBoarding
+ parameters:
+ - name: token
+ in: path
+ description: the token containing the onboardind information
+ required: true
+ schema:
+ type: string
+ requestBody:
+ description: A E-Service seed
+ content:
+ multipart/form-data:
+ schema:
+ type: object
+ required:
+ - contract
+ properties:
+ contract:
+ type: string
+ format: binary
+ encoding:
+ contract:
+ contentType: application/octet-stream
+ required: true
+ responses:
+ '200':
+ description: successful operation
+ '400':
+ description: Invalid ID supplied
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+ delete:
+ security:
+ - bearerAuth: []
+ tags:
+ - process
+ summary: invalidate an onboarding request
+ description: Return ok
+ operationId: invalidateOnboarding
+ parameters:
+ - name: token
+ in: path
+ description: The token to invalidate
+ required: true
+ schema:
+ type: string
+ responses:
+ '200':
+ description: successful operation
+ '400':
+ description: Invalid ID supplied
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+ /onboarding/relationship/{relationshipId}/document:
+ get:
+ security:
+ - bearerAuth: [ ]
+ tags:
+ - process
+ summary: Get an onboarding document
+ operationId: getOnboardingDocument
+ parameters:
+ - name: relationshipId
+ in: path
+ description: the relationship id
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Signed onboarding document retrieved
+ content:
+ application/octet-stream:
+ schema:
+ type: string
+ format: binary
+ "404":
+ description: Document not found
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+ "400":
+ description: Bad request
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+ /status:
+ get:
+ security:
+ - bearerAuth: []
+ tags:
+ - health
+ summary: Health status endpoint
+ description: Return ok
+ operationId: getStatus
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+ /platform/roles:
+ get:
+ summary: Get Platform Roles
+ tags:
+ - platform
+ responses:
+ '200':
+ description: Available platform roles' bindings.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/PlatformRolesResponse'
+ '400':
+ description: Bad Request
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+ operationId: getPlatformRoles
+ description: Returns all the available bindings between roles and platform roles.
+components:
+ schemas:
+ OnBoardingRequest:
+ properties:
+ users:
+ type: array
+ items:
+ $ref: '#/components/schemas/User'
+ institutionId:
+ type: string
+ additionalProperties: false
+ required:
+ - users
+ - institutionId
+ OnBoardingResponse:
+ properties:
+ token:
+ type: string
+ document:
+ type: string
+ format: binary
+ additionalProperties: false
+ required:
+ - token
+ - document
+ TokenRequest:
+ properties:
+ legals:
+ type: array
+ items:
+ $ref: '#/components/schemas/User'
+ institutionId:
+ type: string
+ additionalProperties: false
+ required:
+ - legals
+ - institutionId
+ RelationshipInfo:
+ type: object
+ properties:
+ from:
+ type: string
+ description: tax code
+ role:
+ type: string
+ description: represents the generic available role types for the relationship
+ enum:
+ - Manager
+ - Delegate
+ - Operator
+ platformRole:
+ type: string
+ description: 'user role in the application context (e.g.: administrator, security user). This MUST belong to the configured set of application specific platform roles'
+ status:
+ type: string
+ enum:
+ - pending
+ - active
+ - inactive
+ additionalProperties: false
+ required:
+ - from
+ - role
+ - platformRole
+ - status
+ RelationshipsResponse:
+ type: array
+ items:
+ $ref: '#/components/schemas/RelationshipInfo'
+ User:
+ properties:
+ name:
+ type: string
+ surname:
+ type: string
+ taxCode:
+ type: string
+ role:
+ type: string
+ enum:
+ - Manager
+ - Delegate
+ - Operator
+ platformRole:
+ type: string
+ additionalProperties: false
+ required:
+ - name
+ - surname
+ - taxCode
+ - role
+ - platformRole
+ PersonInfo:
+ properties:
+ name:
+ type: string
+ surname:
+ type: string
+ taxCode:
+ type: string
+ additionalProperties: false
+ required:
+ - name
+ - surname
+ - taxCode
+ InstitutionInfo:
+ properties:
+ institutionId:
+ type: string
+ description:
+ type: string
+ digitalAddress:
+ type: string
+ status:
+ type: string
+ role:
+ type: string
+ platformRole:
+ type: string
+ attributes:
+ type: array
+ description: certified attributes bound to this institution
+ items:
+ type: string
+ additionalProperties: false
+ required:
+ - institutionId
+ - description
+ - digitalAddress
+ - status
+ - role
+ - platformRole
+ - attributes
+ OnBoardingInfo:
+ properties:
+ person:
+ $ref: '#/components/schemas/PersonInfo'
+ institutions:
+ type: array
+ items:
+ $ref: '#/components/schemas/InstitutionInfo'
+ additionalProperties: false
+ required:
+ - person
+ - institutions
+ ActivationRequest:
+ properties:
+ platformRole:
+ type: string
+ required:
+ - platformRole
+ PlatformRolesResponse:
+ title: PlatformRolesResponse
+ type: object
+ description: This payload contains the currently defined bindings between roles and platform roles.
+ properties:
+ managerRoles:
+ type: array
+ description: binding between manager and its platform roles
+ items:
+ type: string
+ delegateRoles:
+ type: array
+ description: binding between delegate and its platform roles
+ items:
+ type: string
+ operatorRoles:
+ type: array
+ description: binding between operator and its platform roles
+ items:
+ type: string
+ required:
+ - managerRoles
+ - delegateRoles
+ - operatorRoles
+ Problem:
+ properties:
+ detail:
+ description: A human readable explanation specific to this occurrence of the problem.
+ example: Request took too long to complete.
+ maxLength: 4096
+ pattern: '^.{0,1024}$'
+ type: string
+ status:
+ description: The HTTP status code generated by the origin server for this occurrence of the problem.
+ example: 503
+ exclusiveMaximum: true
+ format: int32
+ maximum: 600
+ minimum: 100
+ type: integer
+ title:
+ description: 'A short, summary of the problem type. Written in english and readable'
+ example: Service Unavailable
+ maxLength: 64
+ pattern: '^[ -~]{0,64}$'
+ type: string
+ additionalProperties: false
+ required:
+ - status
+ - title
+ securitySchemes:
+ bearerAuth:
+ type: http
+ description: 'A bearer token in the format of a JWS and comformed to the specifications included in [RFC8725](https://tools.ietf.org/html/RFC8725).'
+ scheme: bearer
+ bearerFormat: JWT
diff --git a/src/core/api/party_registry_proxy/party-registry-proxy.yml.tpl b/src/core/api/party_registry_proxy/party-registry-proxy.yml.tpl
new file mode 100644
index 000000000..92ce29740
--- /dev/null
+++ b/src/core/api/party_registry_proxy/party-registry-proxy.yml.tpl
@@ -0,0 +1,279 @@
+openapi: 3.0.3
+info:
+ title: Party Registry Proxy Server
+ description: This service is the proxy to the party registry
+ version: 'v1'
+ contact:
+ name: API Support
+ url: http://www.example.com/support
+ email: support@example.com
+ termsOfService: http://localhost/terms
+ x-api-id: an x-api-id
+ x-summary: an x-summary
+servers:
+ - url: 'https://${host}/${basePath}'
+ description: This service is the proxy to the party registry
+tags:
+ - name: institution
+ description: Retrieve information about institution
+ externalDocs:
+ description: Find out more
+ url: http://swagger.io
+ - name: health
+ description: Verify service status
+ externalDocs:
+ description: Find out more
+ url: http://swagger.io
+
+paths:
+ /institutions/{institutionId}:
+ get:
+ tags:
+ - institution
+ summary: Find institution by ID
+ description: Returns a single institution
+ operationId: getInstitutionById
+ parameters:
+ - name: institutionId
+ in: path
+ description: ID of institution to return
+ required: true
+ schema:
+ type: string
+ maxLength: 32
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Institution'
+ '400':
+ description: Invalid ID supplied
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+ '404':
+ description: Institution not found
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+ /institutions:
+ get:
+ tags:
+ - institution
+ summary: Find institution by ID
+ description: Returns a single institution
+ operationId: searchInstitution
+ parameters:
+ - in: query
+ name: search
+ required: true
+ schema:
+ type: string
+ - in: query
+ name: page
+ required: true
+ schema:
+ type: integer
+ format: int32
+ - in: query
+ name: limit
+ required: true
+ schema:
+ type: integer
+ format: int32
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Institutions'
+ '400':
+ description: Invalid ID supplied
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+ '404':
+ description: Institution not found
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+ /catergories:
+ get:
+ tags:
+ - institution
+ summary: Get all ipa categories
+ description: Returns the ipa categories list
+ operationId: getCategories
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Categories'
+ /status:
+ get:
+ tags:
+ - health
+ summary: Health status endpoint
+ description: Return ok
+ operationId: getStatus
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/problem+json:
+ schema:
+ $ref: '#/components/schemas/Problem'
+components:
+ schemas:
+ Institution:
+ type: object
+ additionalProperties: false
+ properties:
+ id:
+ type: string
+ description: iPA code
+ example: age
+ pattern: '^[a-z]{1,12}$'
+ maxLength: 12
+ o:
+ type: string
+ description: o
+ example: age
+ pattern: '^[a-z]{1,12}$'
+ maxLength: 12
+ ou:
+ type: string
+ description: ou
+ example: age
+ pattern: '^[a-z]{1,12}$'
+ maxLength: 12
+ aoo:
+ type: string
+ description: aoo
+ example: age
+ pattern: '^[a-z]{1,12}$'
+ maxLength: 12
+ taxCode:
+ type: string
+ description: institution tax code
+ example: '00000000000'
+ pattern: '[\d]{10,13}'
+ maxLength: 13
+ administrationCode:
+ type: string
+ description: institution tax code
+ example: '00000000000'
+ pattern: '[\d]{10,13}'
+ maxLength: 13
+ category:
+ type: string
+ description: institution category
+ example: 'c7'
+ pattern: '[a-zA-Z\d]{1,12}'
+ maxLength: 13
+ # managerTaxCode:
+ # type: string
+ # description: manager tax code
+ # example: RSSMRA75L01H501A
+ # pattern: '^(?:(?:[B-DF-HJ-NP-TV-Z]|[AEIOU])[AEIOU][AEIOUX]|[B-DF-HJ-NP-TV-Z]{2}[A-Z]){2}[\dLMNP-V]{2}(?:[A-EHLMPR-T](?:[04LQ][1-9MNP-V]|[1256LMRS][\dLMNP-V])|[DHPS][37PT][0L]|[ACELMRT][37PT][01LM])(?:[A-MZ][1-9MNP-V][\dLMNP-V]{2}|[A-M][0L](?:[1-9MNP-V][\dLMNP-V]|[0L][1-9MNP-V]))[A-Z]$'
+ # maxLength: 16
+ managerName:
+ type: string
+ description: manager name
+ example: Mario
+ format: '^[A-Za-z èàòùìÈÀÒÙÌ]{2,30}$'
+ maxLength: 30
+ managerSurname:
+ type: string
+ description: manager surname
+ example: Rossi
+ format: '^[A-Za-z èàòùìÈÀÒÙÌ]{2,30}$'
+ maxLength: 30
+ description:
+ type: string
+ description: institution description
+ example: AGENCY X
+ format: '^[A-Za-z èàòùìÈÀÒÙÌ]{2,30}$'
+ maxLength: 30
+ digitalAddress:
+ type: string
+ description: digital institution address
+ example: mail@pec.mail.org
+ format: mail
+ maxLength: 20
+ required:
+ - id
+ - description
+ Institutions:
+ properties:
+ items:
+ type: array
+ items:
+ $ref: '#/components/schemas/Institution'
+ count:
+ type: integer
+ format: int64
+ required:
+ - items
+ - count
+ Category:
+ type: object
+ additionalProperties: false
+ properties:
+ code:
+ type: string
+ name:
+ type: string
+ kind:
+ type: string
+ required:
+ - code
+ - kind
+ - name
+ Categories:
+ properties:
+ items:
+ type: array
+ items:
+ $ref: '#/components/schemas/Category'
+ required:
+ - items
+ Problem:
+ properties:
+ detail:
+ description:
+ A human readable explanation specific to this occurrence of the problem.
+ example: Request took too long to complete.
+ maxLength: 4096
+ pattern: '^.{0,1024}$'
+ type: string
+ status:
+ description:
+ The HTTP status code generated by the origin server for this occurrence
+ of the problem.
+ example: 503
+ exclusiveMaximum: true
+ format: int32
+ maximum: 600
+ minimum: 100
+ type: integer
+ title:
+ description:
+ A short, summary of the problem type. Written in english and readable
+ example: Service Unavailable
+ maxLength: 64
+ pattern: '^[ -~]{0,64}$'
+ type: string
+ additionalProperties: false
+ required:
+ - status
+ - title
diff --git a/src/core/api/party_registry_proxy/searchInstitution_policy.xml b/src/core/api/party_registry_proxy/searchInstitution_policy.xml
new file mode 100644
index 000000000..b65d7615b
--- /dev/null
+++ b/src/core/api/party_registry_proxy/searchInstitution_policy.xml
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+ application/json
+
+
+ {
+ "items": [
+ {
+ "id": "id",
+ "o": "o",
+ "ou": "ou",
+ "aoo": "aoo",
+ "taxCode": "00000000000",
+ "administrationCode": "00000000000",
+ "category": "c7",
+ "managerName": "Mario",
+ "managerSurname": "Rossi",
+ "description": "AGENCY X",
+ "digitalAddress": "mail@pec.mail.org"
+ },
+ {
+ "id": "error",
+ "o": "errorO",
+ "ou": "errorUu",
+ "aoo": "errorAoo",
+ "taxCode": "00000000000",
+ "administrationCode": "00000000000",
+ "category": "c7",
+ "managerName": "Mario",
+ "managerSurname": "Rossi",
+ "description": "AGENCY X",
+ "digitalAddress": "mail2@pec.mail.org"
+ }
+ ],
+ "count": 0
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/core/apim.tf b/src/core/apim.tf
index d1f5d50b6..608b43d6a 100644
--- a/src/core/apim.tf
+++ b/src/core/apim.tf
@@ -136,3 +136,103 @@ module "apim_hub_spid_login_api" {
subscription_required = false
}
+
+module "pdnd_interop_party_prc" {
+ source = "git::https://github.com/pagopa/azurerm.git//api_management_api?ref=v1.0.58"
+ name = format("%s-party-prc-api", local.project)
+ api_management_name = module.apim.name
+ resource_group_name = azurerm_resource_group.rg_api.name
+
+ description = "This service is the party process"
+ display_name = "Party Process Micro Service"
+ path = "party-process/v1"
+ protocols = ["https"]
+
+ service_url = format("http://%s/pdnd-interop-uservice-party-process-client", var.reverse_proxy_ip)
+
+ content_format = "openapi"
+ content_value = templatefile("./api/party_process/party-process.yml.tpl", {
+ host = azurerm_api_management_custom_domain.api_custom_domain.proxy[0].host_name
+ basePath = "party-process/v1"
+ })
+
+ xml_content = file("./api/base_policy.xml")
+
+ subscription_required = false
+
+ // TODO these are mocks! remove me after integration
+ api_operation_policies = [
+ {
+ operation_id = "getOnBoardingInfo"
+ xml_content = file("./api/party_process/getOnBoardingInfo_policy.xml")
+ },
+ {
+ operation_id = "createLegals"
+ xml_content = file("./api/party_process/createLegals_policy.xml")
+ }
+ ]
+}
+
+module "apim_pdnd_interop_party_mgmt" {
+ source = "git::https://github.com/pagopa/azurerm.git//api_management_api?ref=v1.0.58"
+ name = format("%s-party-mgmt-api", local.project)
+ api_management_name = module.apim.name
+ resource_group_name = azurerm_resource_group.rg_api.name
+
+ description = "This service is the party manager"
+ display_name = "Party Management Micro Service"
+ path = "party-management/v1"
+ protocols = ["https"]
+
+ service_url = format("http://%s/pdnd-interop-uservice-party-management-client", var.reverse_proxy_ip)
+
+ content_format = "openapi"
+ content_value = templatefile("./api/party_management/party-management.yml.tpl", {
+ host = azurerm_api_management_custom_domain.api_custom_domain.proxy[0].host_name
+ basePath = "party-management/v1"
+ })
+
+ xml_content = file("./api/base_policy.xml")
+
+ subscription_required = false
+
+ // TODO these are mocks! remove me after integration
+ api_operation_policies = [
+ {
+ operation_id = "getOrganizationById"
+ xml_content = file("./api/party_management/getOrganizationById_policy.xml")
+ }
+ ]
+}
+
+module "pdnd_interop_party_reg_proxy" {
+ source = "git::https://github.com/pagopa/azurerm.git//api_management_api?ref=v1.0.58"
+ name = format("%s-party-reg-proxy-api", local.project)
+ api_management_name = module.apim.name
+ resource_group_name = azurerm_resource_group.rg_api.name
+
+ description = "This service is the proxy to the party registry"
+ display_name = "Party Registry Proxy Server"
+ path = "party-registry-proxy/v1"
+ protocols = ["https"]
+
+ service_url = format("http://%s/pdnd-interop-uservice-party-registry-proxy", var.reverse_proxy_ip)
+
+ content_format = "openapi"
+ content_value = templatefile("./api/party_registry_proxy/party-registry-proxy.yml.tpl", {
+ host = azurerm_api_management_custom_domain.api_custom_domain.proxy[0].host_name
+ basePath = "party-registry-proxy/v1"
+ })
+
+ xml_content = file("./api/base_policy.xml")
+
+ subscription_required = false
+
+ // TODO these are mocks! remove me after integration
+ api_operation_policies = [
+ {
+ operation_id = "searchInstitution"
+ xml_content = file("./api/party_registry_proxy/searchInstitution_policy.xml")
+ }
+ ]
+}