diff --git a/.github/workflows/create_release_branch.yml b/.github/workflows/create_release_branch.yml new file mode 100644 index 00000000..40f2b7e5 --- /dev/null +++ b/.github/workflows/create_release_branch.yml @@ -0,0 +1,44 @@ +name: Create Release branch + +on: + workflow_dispatch: + inputs: + version-bump: + required: false + type: choice + options: + - major + - minor + - patch + default: patch + description: 'Major, Minor, or Patch version bump' + +jobs: + create_branch: + name: 'Create Release Branch' + runs-on: ubuntu-20.04 + permissions: + contents: write + actions: write + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + steps: + + - name: Create Release Branch + id: create_branch + uses: pagopa/selfcare-commons/github-actions-template/create-release@main + with: + version_bump: ${{ inputs.version-bump }} + github_path_token: ${{ secrets.GH_PAT_VARIABLES }} + + - name: Trigger release ms UAT Release + run: | + gh workflow run release_ms.yml \ + --ref ${{ steps.create_branch.outputs.new_branch_name }} + + - name: Trigger PNPG release ms UAT Release + run: | + gh workflow run release_ms_pnpg.yml \ + --ref ${{ steps.create_branch.outputs.new_branch_name }} + diff --git a/.github/workflows/release_ms.yml b/.github/workflows/release_ms.yml index 81b1fb8f..fbf48115 100644 --- a/.github/workflows/release_ms.yml +++ b/.github/workflows/release_ms.yml @@ -54,4 +54,14 @@ jobs: with: environment: prod tf_environment: prod - dir: 'infra/container_apps' \ No newline at end of file + dir: 'infra/container_apps' + + promote_release: + name: 'Promote prerelase release' + runs-on: ubuntu-20.04 + needs: [release_prod] + steps: + - uses: pagopa/selfcare-commons/github-actions-template/promote-release@main + with: + github_path_token: ${{ secrets.GH_PAT_VARIABLES }} + release_version: ${{ vars.CURRENT_UAT_VERSION }} \ No newline at end of file diff --git a/.github/workflows/release_open_api.yml b/.github/workflows/release_open_api.yml index 65a2b628..ea2f1cf1 100644 --- a/.github/workflows/release_open_api.yml +++ b/.github/workflows/release_open_api.yml @@ -1,46 +1,21 @@ -name: Swagger Update +name: Swagger Detect Conflict and Update on: pull_request: branches: - release-dev types: [ opened, synchronize, reopened ] - workflow_dispatch: #allow to run github action manually + permissions: contents: write + jobs: - build: - runs-on: ubuntu-latest + swagger_conflict_update: + runs-on: ubuntu-20.04 permissions: write-all - #if: github.event.pull_request.merged == true + name: Swagger Detect Conflict and Update steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - java-version: '17' - distribution: 'temurin' - cache: maven - - name: Check out HEAD revision - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - with: - ref: ${{ github.head_ref }} - path: head - - name: Check out BASE revision - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - with: - ref: release-dev - path: base - - name: Build with Maven - run: mvn test -Dtest=SwaggerConfigTest#swaggerSpringPlugin -DfailIfNoTests=false - - name: Run OpenAPI Diff (from HEAD revision) - uses: mvegter/openapi-diff-action@72cde50f8d3a75f770f08e23b815d5ebe69ff757 - with: - head-spec: head/app/src/main/resources/swagger/api-docs.json - base-spec: base/app/src/main/resources/swagger/api-docs.json - - name: Commit api-docs - run: | - git ls-files ./app** | grep 'api-docs*' | xargs git add - git config --global user.email "selfcare-github@pagopa.it" - git config --global user.name "selfcare-github-bot" - git commit -m "Update Swagger documentation" || exit 0 - git push origin ${{ github.ref_name}} \ No newline at end of file + - id: swagger-conflict-update + uses: pagopa/selfcare-commons/github-actions-template/swagger-detect-conflict-spring@main + with: + path_openapi_docs: app/src/main/resources/swagger/api-docs.json + branch_ref: release-dev \ No newline at end of file diff --git a/helm/pnpg/values-dev.yaml b/helm/pnpg/values-dev.yaml index 337857c9..f0a5a824 100644 --- a/helm/pnpg/values-dev.yaml +++ b/helm/pnpg/values-dev.yaml @@ -1,3 +1,5 @@ +replicaCount: 0 + image: repository: selcdcommonacr.azurecr.io/selfcaremspartyregistryproxy @@ -16,8 +18,8 @@ ingress: autoscaling: enabled: false - minReplicas: 1 - maxReplicas: 100 + minReplicas: 0 + maxReplicas: 0 targetCPUUtilizationPercentage: 80 # targetMemoryUtilizationPercentage: 80 diff --git a/helm/pnpg/values-uat.yaml b/helm/pnpg/values-uat.yaml index ec31d61a..609e7aa4 100644 --- a/helm/pnpg/values-uat.yaml +++ b/helm/pnpg/values-uat.yaml @@ -1,3 +1,5 @@ +replicaCount: 0 + image: repository: selcucommonacr.azurecr.io/selfcaremspartyregistryproxy tag: 0.0.1-SNAPSHOT @@ -17,8 +19,8 @@ ingress: autoscaling: enabled: false - minReplicas: 1 - maxReplicas: 100 + minReplicas: 0 + maxReplicas: 0 targetCPUUtilizationPercentage: 80 # targetMemoryUtilizationPercentage: 80 diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index 58367575..1db70e40 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -1,4 +1,4 @@ -replicaCount: 2 +replicaCount: 0 image: repository: selcdacr.azurecr.io/selfcaremspartyregistryproxy @@ -26,8 +26,8 @@ resources: autoscaling: enabled: false - minReplicas: 1 - maxReplicas: 100 + minReplicas: 0 + maxReplicas: 0 targetCPUUtilizationPercentage: 80 # targetMemoryUtilizationPercentage: 80 diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index 9a300531..eaba4ee5 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -1,4 +1,4 @@ -replicaCount: 2 +replicaCount: 0 image: repository: selcuacr.azurecr.io/selfcaremspartyregistryproxy @@ -27,8 +27,8 @@ resources: autoscaling: enabled: false - minReplicas: 1 - maxReplicas: 100 + minReplicas: 0 + maxReplicas: 0 targetCPUUtilizationPercentage: 80 # targetMemoryUtilizationPercentage: 80 diff --git a/infra/container_apps/apim.tf b/infra/container_apps/apim.tf index 5f561c94..ae697060 100644 --- a/infra/container_apps/apim.tf +++ b/infra/container_apps/apim.tf @@ -33,7 +33,7 @@ module "apim_api_bff_proxy" { service_url = format("https://%s", var.private_dns_name) content_format = "openapi+json" - content_value = templatefile("../../app/src/main/resources/swagger/api-docs.json", { + content_value = templatefile("./apim_api_bff_proxy.json", { url = format("%s.%s", var.api_dns_zone_prefix, var.external_domain) basePath = "/party-registry-proxy/v1" }) diff --git a/infra/container_apps/apim_api_bff_proxy.json b/infra/container_apps/apim_api_bff_proxy.json new file mode 100644 index 00000000..a5bcb825 --- /dev/null +++ b/infra/container_apps/apim_api_bff_proxy.json @@ -0,0 +1,1801 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "selc-party-registry-proxy", + "description": "Party Registry Proxy API documentation", + "version": "0.0.1-SNAPSHOT" + }, + "servers": [ + { + "url": "{url}:{port}{basePath}", + "variables": { + "url": { + "default": "http://localhost" + }, + "port": { + "default": "80" + }, + "basePath": { + "default": "" + } + } + } + ], + "tags": [ + { + "name": "GeographicTaxonomies", + "description": "Geographic Taxonomies Controller" + }, + { + "name": "aoo", + "description": "AOO Controller" + }, + { + "name": "category", + "description": "Category operations" + }, + { + "name": "infocamere", + "description": "Info Camere Controller" + }, + { + "name": "institution", + "description": "Institution operations" + }, + { + "name": "insurance-companies", + "description": "Ivass Controller" + }, + { + "name": "nationalRegistries", + "description": "National Registries Controller" + }, + { + "name": "stations", + "description": "Station Controller" + }, + { + "name": "uo", + "description": "UO Controller" + } + ], + "paths": { + "/aoo": { + "get": { + "tags": [ + "aoo" + ], + "summary": "Retrieve all AOO from IPA", + "description": "Returns the AOO list", + "operationId": "findAllUsingGET", + "parameters": [ + { + "name": "page", + "in": "query", + "description": "Desired page number for result pagination. It is optional, and the default value is 1 when not specified", + "required": false, + "style": "form", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Maximum number of items per page. It is optional, and the default value is 10 when not specified", + "required": false, + "style": "form", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AOOsResource" + } + } + } + }, + "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" + ] + } + ] + } + }, + "/aoo/{codiceUniAoo}": { + "get": { + "tags": [ + "aoo" + ], + "summary": "Retrieve an AOO given its code", + "description": "Returns an AOO", + "operationId": "findByUnicodeUsingGET", + "parameters": [ + { + "name": "codiceUniAoo", + "in": "path", + "description": "AOO unique identifier, the same of Id", + "required": true, + "style": "simple", + "schema": { + "type": "string" + } + }, + { + "name": "categories", + "in": "query", + "description": "Filter from origin category", + "required": false, + "style": "form", + "explode": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AOOResource" + } + } + } + }, + "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" + ] + } + ] + } + }, + "/geotaxonomies": { + "get": { + "tags": [ + "GeographicTaxonomies" + ], + "summary": "retrieves the geographic taxonomies by description", + "description": "retrieves the geographic taxonomies by description", + "operationId": "retrieveGeoTaxonomiesByDescriptionUsingGET", + "parameters": [ + { + "name": "description", + "in": "query", + "description": "geographic taxonomy description", + "required": true, + "style": "form", + "schema": { + "type": "string" + } + }, + { + "name": "offset", + "in": "query", + "description": "identifies the page 0-based index, default to 0", + "required": false, + "style": "form", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "identifies the number of entries in a page, default to 10", + "required": false, + "style": "form", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GeographicTaxonomyResource" + } + } + } + } + }, + "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" + ] + } + ] + } + }, + "/geotaxonomies/{geotaxId}": { + "get": { + "tags": [ + "GeographicTaxonomies" + ], + "summary": "retrieves the geographic taxonomy by code", + "description": "retrieves the geographic taxonomy by code", + "operationId": "retrieveGeoTaxonomiesByCodeUsingGET", + "parameters": [ + { + "name": "geotaxId", + "in": "path", + "description": "Geographic taxonomy unique identifier ", + "required": true, + "style": "simple", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeographicTaxonomyResource" + } + } + } + }, + "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" + ] + } + ] + } + }, + "/institutions": { + "get": { + "tags": [ + "institution" + ], + "summary": "Search institutions", + "description": "Returns a list of Institutions.", + "operationId": "searchUsingGET", + "parameters": [ + { + "name": "search", + "in": "query", + "description": "if passed, the result is filtered based on the contained value.", + "required": false, + "style": "form", + "schema": { + "type": "string" + } + }, + { + "name": "page", + "in": "query", + "description": "Desired page number for result pagination. It is optional, and the default value is 1 when not specified", + "required": false, + "style": "form", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Maximum number of items per page. It is optional, and the default value is 10 when not specified", + "required": false, + "style": "form", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "categories", + "in": "query", + "description": "Filter from origin category", + "required": false, + "style": "form", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InstitutionsResource" + } + } + } + }, + "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" + ] + } + ] + } + }, + "/institutions/{id}": { + "get": { + "tags": [ + "institution" + ], + "summary": "Find institution by ID", + "description": "Returns a single institution. If 'origin' param is filled, the ID to find is treated as 'originId' ($ref: '#/components/schemas/Institution'); otherwise is treated as 'id' ($ref: '#/components/schemas/Institution') ", + "operationId": "findInstitutionUsingGET", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The institution ID. It change semantic based on the origin param value (see notes)", + "required": true, + "style": "simple", + "schema": { + "type": "string" + } + }, + { + "name": "origin", + "in": "query", + "description": "Describes which is the source of data", + "required": false, + "style": "form", + "schema": { + "type": "string", + "enum": [ + "ANAC", + "INFOCAMERE", + "IPA", + "IVASS", + "static" + ] + } + }, + { + "name": "categories", + "in": "query", + "description": "Filter from origin category", + "required": false, + "style": "form", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InstitutionResource" + } + } + } + }, + "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" + ] + } + ] + } + }, + "/insurance-companies": { + "get": { + "tags": [ + "insurance-companies" + ], + "summary": "Search insurance company", + "description": "Returns a list of insurance companies", + "operationId": "searchUsingGET_1", + "parameters": [ + { + "name": "search", + "in": "query", + "description": "Optional search field. Users can provide a search string to filter results", + "required": false, + "style": "form", + "schema": { + "type": "string" + } + }, + { + "name": "page", + "in": "query", + "description": "Desired page number for result pagination. It is optional, and the default value is 1 when not specified", + "required": false, + "style": "form", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Maximum number of items per page. It is optional, and the default value is 10 when not specified", + "required": false, + "style": "form", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InsuranceCompaniesResource" + } + } + } + }, + "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" + ] + } + ] + } + }, + "/insurance-companies/{taxId}": { + "get": { + "tags": [ + "insurance-companies" + ], + "summary": "Search insurance company by its taxCode", + "description": "Returns only one insurance company.", + "operationId": "searchByTaxCodeUsingGET", + "parameters": [ + { + "name": "taxId", + "in": "path", + "description": "taxCode of insurance company", + "required": true, + "style": "simple", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InsuranceCompanyResource" + } + } + } + }, + "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" + ] + } + ] + } + }, + "/stations": { + "get": { + "tags": [ + "stations" + ], + "summary": "Search station", + "description": "Returns a list of station.", + "operationId": "searchUsingGET_2", + "parameters": [ + { + "name": "search", + "in": "query", + "description": "Optional search field. Users can provide a search string to filter results", + "required": false, + "style": "form", + "schema": { + "type": "string" + } + }, + { + "name": "page", + "in": "query", + "description": "Desired page number for result pagination. It is optional, and the default value is 1 when not specified", + "required": false, + "style": "form", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Maximum number of items per page. It is optional, and the default value is 10 when not specified", + "required": false, + "style": "form", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StationsResource" + } + } + } + }, + "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" + ] + } + ] + } + }, + "/stations/{taxId}": { + "get": { + "tags": [ + "stations" + ], + "summary": "Search station by its taxCode", + "description": "Returns only one station.", + "operationId": "searchByTaxCodeUsingGET_1", + "parameters": [ + { + "name": "taxId", + "in": "path", + "description": "taxCode of station", + "required": true, + "style": "simple", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StationResource" + } + } + } + }, + "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" + ] + } + ] + } + }, + "/uo": { + "get": { + "tags": [ + "uo" + ], + "summary": "Retrieve all UO from IPA", + "description": "Returns the UO list", + "operationId": "findAllUsingGET_1", + "parameters": [ + { + "name": "page", + "in": "query", + "description": "Desired page number for result pagination. It is optional, and the default value is 1 when not specified", + "required": false, + "style": "form", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "limit", + "in": "query", + "description": "Maximum number of items per page. It is optional, and the default value is 10 when not specified", + "required": false, + "style": "form", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UOsResource" + } + } + } + }, + "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" + ] + } + ] + } + }, + "/uo/{codiceUniAoo}": { + "get": { + "tags": [ + "uo" + ], + "summary": "Retrieve a UO given its code", + "description": "Returns a UO", + "operationId": "findByUnicodeUsingGET_1", + "parameters": [ + { + "name": "codiceUniAoo", + "in": "path", + "description": "UO unique identifier, the same of Id", + "required": true, + "style": "simple", + "schema": { + "type": "string" + } + }, + { + "name": "categories", + "in": "query", + "description": "Filter from origin category", + "required": false, + "style": "form", + "explode": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UOResource" + } + } + } + }, + "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" + ] + } + ] + } + } + }, + "components": { + "schemas": { + "AOOResource": { + "title": "AOOResource", + "type": "object", + "properties": { + "cap": { + "type": "string" + }, + "codAoo": { + "type": "string", + "description": "AOO code" + }, + "codiceCatastaleComune": { + "type": "string", + "description": "AOO land registry code" + }, + "codiceComuneISTAT": { + "type": "string", + "description": "AOO istat code" + }, + "codiceFiscaleEnte": { + "type": "string", + "description": "AOO fiscal code" + }, + "codiceIpa": { + "type": "string", + "description": "AOO ipa code" + }, + "codiceUniAoo": { + "type": "string", + "description": "AOO unique identifier, the same of Id" + }, + "cognomeResponsabile": { + "type": "string", + "description": "AOO manager lastname" + }, + "dataAggiornamento": { + "type": "string", + "description": "Identifies date of last update on the specific AOO" + }, + "dataIstituzione": { + "type": "string", + "description": "Identifies date of first creation for AOO" + }, + "denominazioneAoo": { + "type": "string", + "description": "AOO description" + }, + "denominazioneEnte": { + "type": "string", + "description": "AOO parent description" + }, + "fax": { + "type": "string", + "description": "AOO fax" + }, + "id": { + "type": "string" + }, + "indirizzo": { + "type": "string", + "description": "AOO address" + }, + "mail1": { + "type": "string" + }, + "mailResponsabile": { + "type": "string", + "description": "AOO manager email" + }, + "nomeResponsabile": { + "type": "string", + "description": "AOO manager firstname" + }, + "origin": { + "type": "string", + "description": "{swagger.model.*.origin}", + "enum": [ + "ANAC", + "INFOCAMERE", + "IPA", + "IVASS", + "static" + ] + }, + "protocolloInformatico": { + "type": "string", + "description": "AOO IT protocol" + }, + "telefono": { + "type": "string", + "description": "AOO phone number" + }, + "telefonoResponsabile": { + "type": "string", + "description": "AOO manager phone number" + }, + "tipoMail1": { + "type": "string" + }, + "uriprotocolloInformatico": { + "type": "string" + } + } + }, + "AOOsResource": { + "title": "AOOsResource", + "required": [ + "count", + "items" + ], + "type": "object", + "properties": { + "count": { + "type": "integer", + "description": "Total count of items", + "format": "int64" + }, + "items": { + "type": "array", + "description": "List of AOO resource", + "items": { + "$ref": "#/components/schemas/AOOResource" + } + } + } + }, + "GeographicTaxonomyResource": { + "title": "GeographicTaxonomyResource", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Geographic taxonomy unique identifier " + }, + "country": { + "type": "string", + "description": "Geographic taxonomy country" + }, + "country_abbreviation": { + "type": "string", + "description": "Geographic taxonomy country abbreviation" + }, + "desc": { + "type": "string", + "description": "Geographic taxonomy description" + }, + "enabled": { + "type": "boolean", + "description": "Geographic taxonomy enabled", + "example": false + }, + "istat_code": { + "type": "string", + "description": "Geographic taxonomy istat code" + }, + "province_abbreviation": { + "type": "string", + "description": "Geographic taxonomy province abbreviation" + }, + "province_id": { + "type": "string", + "description": "Geographic taxonomy province unique identifier" + }, + "region_id": { + "type": "string", + "description": "Geographic taxonomy region unique identifier" + } + } + }, + "InstitutionResource": { + "title": "InstitutionResource", + "type": "object", + "properties": { + "address": { + "type": "string", + "description": "Institution address" + }, + "aoo": { + "type": "string", + "description": "Area organizzativa omogenea" + }, + "category": { + "type": "string", + "description": "Institution category" + }, + "description": { + "type": "string", + "description": "Institution description" + }, + "digitalAddress": { + "type": "string", + "description": "Institution digital address" + }, + "id": { + "type": "string", + "description": "Semantic id to recognize a party between origins (or externalId)" + }, + "istatCode": { + "type": "string", + "description": "Institution istat Code" + }, + "o": { + "type": "string", + "description": "o" + }, + "origin": { + "type": "string", + "description": "Describes which is the source of data", + "enum": [ + "ANAC", + "INFOCAMERE", + "IPA", + "IVASS", + "static" + ] + }, + "originId": { + "type": "string", + "description": "Id of the institution from its origin" + }, + "ou": { + "type": "string", + "description": "ou" + }, + "taxCode": { + "type": "string", + "description": "Institution fiscal code" + }, + "zipCode": { + "type": "string", + "description": "Institution zipCode" + } + } + }, + "InstitutionsResource": { + "title": "InstitutionsResource", + "required": [ + "count", + "items" + ], + "type": "object", + "properties": { + "count": { + "type": "integer", + "format": "int64" + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InstitutionResource" + } + } + } + }, + "InsuranceCompaniesResource": { + "title": "InsuranceCompaniesResource", + "required": [ + "count", + "items" + ], + "type": "object", + "properties": { + "count": { + "type": "integer", + "description": "list of companies resource size", + "format": "int64" + }, + "items": { + "type": "array", + "description": "list of insurance companies resource", + "items": { + "$ref": "#/components/schemas/InsuranceCompanyResource" + } + } + } + }, + "InsuranceCompanyResource": { + "title": "InsuranceCompanyResource", + "type": "object", + "properties": { + "address": { + "type": "string", + "description": "Identifies legal address of insurance company" + }, + "description": { + "type": "string", + "description": "insurance company's name" + }, + "digitalAddress": { + "type": "string", + "description": "insurance company's mail address" + }, + "id": { + "type": "string", + "description": "insurance company's unique identifier" + }, + "origin": { + "type": "string", + "description": "Describes which is the source of data", + "enum": [ + "ANAC", + "INFOCAMERE", + "IPA", + "IVASS", + "static" + ] + }, + "originId": { + "type": "string", + "description": "insurance company's IVASS unique identifier" + }, + "registerType": { + "type": "string", + "description": "Identifies register type for company" + }, + "taxCode": { + "type": "string", + "description": "taxCode of insurance company" + }, + "workType": { + "type": "string", + "description": "Identifies work type for company" + } + } + }, + "InvalidParam": { + "title": "InvalidParam", + "required": [ + "name", + "reason" + ], + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Invalid parameter name." + }, + "reason": { + "type": "string", + "description": "Invalid parameter reason." + } + } + }, + "Problem": { + "title": "Problem", + "required": [ + "status", + "title" + ], + "type": "object", + "properties": { + "detail": { + "type": "string", + "description": "Human-readable description of this specific problem." + }, + "instance": { + "type": "string", + "description": "A URI that describes where the problem occurred." + }, + "invalidParams": { + "type": "array", + "description": "A list of invalid parameters details.", + "items": { + "$ref": "#/components/schemas/InvalidParam" + } + }, + "status": { + "type": "integer", + "description": "The HTTP status code.", + "format": "int32", + "example": 500 + }, + "title": { + "type": "string", + "description": "Short human-readable summary of the problem." + }, + "type": { + "type": "string", + "description": "A URL to a page with more details regarding the problem." + } + }, + "description": "A \"problem detail\" as a way to carry machine-readable details of errors (https://datatracker.ietf.org/doc/html/rfc7807)" + }, + "StationResource": { + "title": "StationResource", + "type": "object", + "properties": { + "anacEnabled": { + "type": "boolean", + "description": "Identifies if ANAC station is enabled", + "example": false + }, + "anacEngaged": { + "type": "boolean", + "description": "Identifies if ANAC station is engaged", + "example": false + }, + "description": { + "type": "string", + "description": "station's name" + }, + "digitalAddress": { + "type": "string", + "description": "station's mail address" + }, + "id": { + "type": "string", + "description": "station's unique identifier" + }, + "origin": { + "type": "string", + "description": "Describes which is the source of data", + "enum": [ + "ANAC", + "INFOCAMERE", + "IPA", + "IVASS", + "static" + ] + }, + "originId": { + "type": "string", + "description": "station's anac unique identifier" + }, + "taxCode": { + "type": "string", + "description": "taxCode of station" + } + } + }, + "StationsResource": { + "title": "StationsResource", + "required": [ + "count", + "items" + ], + "type": "object", + "properties": { + "count": { + "type": "integer", + "description": "list of station resource size", + "format": "int64" + }, + "items": { + "type": "array", + "description": "list of station resource", + "items": { + "$ref": "#/components/schemas/StationResource" + } + } + } + }, + "UOResource": { + "title": "UOResource", + "type": "object", + "properties": { + "cap": { + "type": "string" + }, + "codiceCatastaleComune": { + "type": "string", + "description": "UO land registry code" + }, + "codiceComuneISTAT": { + "type": "string", + "description": "UO istat code" + }, + "codiceFiscaleEnte": { + "type": "string", + "description": "UO fiscal code" + }, + "codiceIpa": { + "type": "string", + "description": "UO ipa code" + }, + "codiceUniAoo": { + "type": "string", + "description": "AOO unique identifier, the same of Id" + }, + "codiceUniUo": { + "type": "string", + "description": "UO unique identifier, the same of Id" + }, + "codiceUniUoPadre": { + "type": "string", + "description": "UO parent code" + }, + "cognomeResponsabile": { + "type": "string", + "description": "UO manager lastname" + }, + "dataAggiornamento": { + "type": "string", + "description": "Identifies date of last update on the specific UO" + }, + "dataIstituzione": { + "type": "string", + "description": "Identifies date of first creation for UO" + }, + "denominazioneEnte": { + "type": "string", + "description": "UO parent description" + }, + "descrizioneUo": { + "type": "string", + "description": "UO description" + }, + "fax": { + "type": "string", + "description": "UO fax" + }, + "id": { + "type": "string" + }, + "indirizzo": { + "type": "string", + "description": "UO address" + }, + "mail1": { + "type": "string" + }, + "mailResponsabile": { + "type": "string", + "description": "UO manager email" + }, + "nomeResponsabile": { + "type": "string", + "description": "UO manager firstname" + }, + "origin": { + "type": "string", + "description": "Describes which is the source of data", + "enum": [ + "ANAC", + "INFOCAMERE", + "IPA", + "IVASS", + "static" + ] + }, + "telefono": { + "type": "string", + "description": "UO phone number" + }, + "telefonoResponsabile": { + "type": "string", + "description": "UO manager phone number" + }, + "tipoMail1": { + "type": "string" + }, + "url": { + "type": "string", + "description": "UO url" + } + } + }, + "UOsResource": { + "title": "UOsResource", + "required": [ + "count", + "items" + ], + "type": "object", + "properties": { + "count": { + "type": "integer", + "description": "Total count of items", + "format": "int64" + }, + "items": { + "type": "array", + "description": "List of UO resource", + "items": { + "$ref": "#/components/schemas/UOResource" + } + } + } + } + }, + "securitySchemes": { + "bearerAuth": { + "type": "http", + "description": "A bearer token in the format of a JWS and conformed to the specifications included in [RFC8725](https://tools.ietf.org/html/RFC8725)", + "scheme": "bearer", + "bearerFormat": "JWT" + } + } + } +} \ No newline at end of file diff --git a/infra/container_apps/env/dev/terraform.tfvars b/infra/container_apps/env/dev/terraform.tfvars index a174f547..b3e7fd61 100644 --- a/infra/container_apps/env/dev/terraform.tfvars +++ b/infra/container_apps/env/dev/terraform.tfvars @@ -79,6 +79,30 @@ app_settings = [ { name = "ANAC_FTP_DIRECTORY" value = "/mnt/RegistroGestoriPiattaforme/Collaudo/" + }, + { + name = "LUCENE_INDEX_INSTITUTIONS_FOLDER" + value = "index/institutions" + }, + { + name = "LUCENE_INDEX_CATEGORIES_FOLDER" + value = "index/categories" + }, + { + name = "LUCENE_INDEX_AOOS_FOLDER" + value = "index/aoos" + }, + { + name = "LUCENE_INDEX_UOS_FOLDER" + value = "index/uos" + }, + { + name = "LUCENE_INDEX_ANAC_FOLDER" + value = "index/anac" + }, + { + name = "LUCENE_INDEX_IVASS_FOLDER" + value = "index/ivass" } ] @@ -87,5 +111,8 @@ secrets_names = { "NATIONAL_REGISTRY_API_KEY" = "national-registry-api-key" "APPLICATIONINSIGHTS_CONNECTION_STRING" = "appinsights-connection-string" "JWT_TOKEN_PUBLIC_KEY" = "jwt-public-key" + "GEOTAXONOMY_API_KEY" = "geotaxonomy-api-key" + "ANAC_FTP_PASSWORD" = "anac-ftp-password" + "ANAC_FTP_KNOWN_HOST" = "anac-ftp-known-host" } diff --git a/infra/container_apps/env/prod/terraform.tfvars b/infra/container_apps/env/prod/terraform.tfvars index 557ada9c..65783a86 100644 --- a/infra/container_apps/env/prod/terraform.tfvars +++ b/infra/container_apps/env/prod/terraform.tfvars @@ -80,6 +80,30 @@ app_settings = [ { name = "ANAC_FTP_DIRECTORY" value = "/mnt/RegistroGestoriPiattaforme/Collaudo/" + }, + { + name = "LUCENE_INDEX_INSTITUTIONS_FOLDER" + value = "index/institutions" + }, + { + name = "LUCENE_INDEX_CATEGORIES_FOLDER" + value = "index/categories" + }, + { + name = "LUCENE_INDEX_AOOS_FOLDER" + value = "index/aoos" + }, + { + name = "LUCENE_INDEX_UOS_FOLDER" + value = "index/uos" + }, + { + name = "LUCENE_INDEX_ANAC_FOLDER" + value = "index/anac" + }, + { + name = "LUCENE_INDEX_IVASS_FOLDER" + value = "index/ivass" } ] @@ -88,4 +112,7 @@ secrets_names = { "NATIONAL_REGISTRY_API_KEY" = "national-registry-api-key" "APPLICATIONINSIGHTS_CONNECTION_STRING" = "appinsights-connection-string" "JWT_TOKEN_PUBLIC_KEY" = "jwt-public-key" + "GEOTAXONOMY_API_KEY" = "geotaxonomy-api-key" + "ANAC_FTP_PASSWORD" = "anac-ftp-password" + "ANAC_FTP_KNOWN_HOST" = "anac-ftp-known-host" } \ No newline at end of file diff --git a/infra/container_apps/env/uat/terraform.tfvars b/infra/container_apps/env/uat/terraform.tfvars index 6502b5d9..da0901be 100644 --- a/infra/container_apps/env/uat/terraform.tfvars +++ b/infra/container_apps/env/uat/terraform.tfvars @@ -67,6 +67,30 @@ app_settings = [ { name = "ANAC_FTP_DIRECTORY" value = "/mnt/RegistroGestoriPiattaforme/Collaudo/" + }, + { + name = "LUCENE_INDEX_INSTITUTIONS_FOLDER" + value = "index/institutions" + }, + { + name = "LUCENE_INDEX_CATEGORIES_FOLDER" + value = "index/categories" + }, + { + name = "LUCENE_INDEX_AOOS_FOLDER" + value = "index/aoos" + }, + { + name = "LUCENE_INDEX_UOS_FOLDER" + value = "index/uos" + }, + { + name = "LUCENE_INDEX_ANAC_FOLDER" + value = "index/anac" + }, + { + name = "LUCENE_INDEX_IVASS_FOLDER" + value = "index/ivass" } ] @@ -75,4 +99,7 @@ secrets_names = { "NATIONAL_REGISTRY_API_KEY" = "national-registry-api-key" "APPLICATIONINSIGHTS_CONNECTION_STRING" = "appinsights-connection-string" "JWT_TOKEN_PUBLIC_KEY" = "jwt-public-key" + "GEOTAXONOMY_API_KEY" = "geotaxonomy-api-key" + "ANAC_FTP_PASSWORD" = "anac-ftp-password" + "ANAC_FTP_KNOWN_HOST" = "anac-ftp-known-host" } diff --git a/infra/container_apps/variables.tf b/infra/container_apps/variables.tf index 68a6cb88..d0421d77 100644 --- a/infra/container_apps/variables.tf +++ b/infra/container_apps/variables.tf @@ -58,6 +58,7 @@ variable "secrets_names" { variable "private_dns_name" { type = string + default = "selc-d-party-reg-proxy-ca.gentleflower-c63e62fe.westeurope.azurecontainerapps.io" description = "Container Apps private DNS record" }