From e363ce6a5b96ab5a941a3361f5b4eef9a15ecafb Mon Sep 17 00:00:00 2001 From: EMELIGMWW Date: Thu, 5 Feb 2026 16:51:25 +0100 Subject: [PATCH 01/23] Swagger getMerchantTransactionsReport --- .../api/idpay_merchant/openapi.merchant.yml | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) diff --git a/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml b/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml index 6873d048..b82a5ac0 100644 --- a/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml +++ b/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml @@ -462,6 +462,65 @@ paths: description: Too many requests "500": description: Server error + /{merchantId}/initiative/{initiativeId}/transactions/report: + get: + tags: + - merchant-transactions + summary: Generates a report with all transactions associated with a merchant and a reference period and returns the data from the created file + description: "ENG: Generates a report with all transactions associated with a merchant and a reference period and returns the data from the created file
IT: Genera un report con tutte le transazioni associate ad un esercente e ad un periodo di riferimento e ritorna i dati del file creato" + operationId: getMerchantTransactionsReport + parameters: + - name: merchantId + in: path + description: The merchant ID + required: true + schema: + type: string + - name: initiativeId + in: path + description: The initiative ID + required: true + schema: + type: string + - name: startPeriod + in: query + description: start date of the reference period + required: true + schema: + type: string + format: date-time + - name: endPeriod + in: query + description: end date of the reference period + required: true + schema: + type: string + format: date-time + - name: rewardBatchAssignee + in: query + description: Invitalia operator level + required: false + schema: + type: string + enum: + - L1 + - L2 + - L3 + responses: + "200": + description: Ok + content: + application/json: + schema: + $ref: "#/components/schemas/MerchantReportDTO" + "401": + description: Autentication failed + "404": + description: Merchant not found + "429": + description: Too many requests + "500": + description: Server error /initiatives/{initiativeId}/reward-batches/{rewardBatchId}/transactions/rejected: post: tags: @@ -2069,6 +2128,53 @@ components: type: integer format: int32 description: "ENG: The total number of the pages
IT: Il numero totale delle pagine" + MerchantReportDTO: + type: object + properties: + initiativeId: + type: string + description: "ENG: The ID of the initiative
IT: L'ID' dell'iniziativa" + initiativeName: + type: string + description: "ENG: The name of the initiative
IT: Il nome dell'iniziativa" + state: + type: string + enum: + - CREATED + - FAILED + description: "ENG: Report status
IT: Stato del report" + fileName: + type: string + description: "ENG: Name of the report
IT: Nome del report" + requestDate: + type: string + format: date-time + description: "ENG: Report request date
IT: Data di richiesta del report" + elaborationDate: + type: string + format: date-time + description: "ENG: Report processing end date
IT: Data di fine elaborazione del report" + startPeriod: + type: string + format: date-time + description: "ENG: Start date of the reference period
IT: Data di inizio del periodo di riferimento" + endPeriod: + type: string + format: date-time + description: "ENG: End date of the reference period
IT: Data di fine del periodo di riferimento" + merchantId: + type: string + description: "ENG: Merchant ID
IT: L'ID dell'esercente" + businessName: + type: string + description: "ENG: The name of the merchant
IT: La ragione sociale dell'esercente" + rewardBatchAssignee: + type: string + enum: + - L1 + - L2 + - L3 + description: "ENG: Invitalia operator level
IT: Livello dell'operatore Invitalia" PointOfSaleErrorDTO: type: object required: From d825d55a978ae5af0a16f5e400827afc09b39b16 Mon Sep 17 00:00:00 2001 From: EMELIGMWW Date: Fri, 6 Feb 2026 15:42:35 +0100 Subject: [PATCH 02/23] Swagger getMerchantTransactionsReport --- src/idpay/21_apim_api_portal_merchants.tf | 7 ++++ .../api/idpay_merchant/openapi.merchant.yml | 28 +++++++++------- ...erchant-transactions-report-policy.xml.tpl | 33 +++++++++++++++++++ 3 files changed, 56 insertions(+), 12 deletions(-) create mode 100644 src/idpay/apim/api/idpay_merchants_portal/get-merchant-transactions-report-policy.xml.tpl diff --git a/src/idpay/21_apim_api_portal_merchants.tf b/src/idpay/21_apim_api_portal_merchants.tf index 9180f654..aaac9bad 100644 --- a/src/idpay/21_apim_api_portal_merchants.tf +++ b/src/idpay/21_apim_api_portal_merchants.tf @@ -178,6 +178,13 @@ module "idpay_itn_merchants_portal" { ingress_load_balancer_hostname = local.domain_aks_ingress_hostname }) }, + { + operation_id = "getMerchantTransactionsReport" + + xml_content = templatefile("./apim/api/idpay_merchants_portal/get-merchant-transactions-report-policy.xml.tpl", { + ingress_load_balancer_hostname = local.domain_aks_ingress_hostname + }) + }, { operation_id = "getProcessedTransactionStatuses" xml_content = templatefile("./apim/api/idpay_merchants_portal/get-merchant-transactions-processed-statuses-policy.xml.tpl", { diff --git a/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml b/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml index b82a5ac0..abcfa597 100644 --- a/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml +++ b/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml @@ -462,23 +462,23 @@ paths: description: Too many requests "500": description: Server error - /{merchantId}/initiative/{initiativeId}/transactions/report: - get: + /initiative/{initiativeId}/transactions/report: + post: tags: - merchant-transactions summary: Generates a report with all transactions associated with a merchant and a reference period and returns the data from the created file description: "ENG: Generates a report with all transactions associated with a merchant and a reference period and returns the data from the created file
IT: Genera un report con tutte le transazioni associate ad un esercente e ad un periodo di riferimento e ritorna i dati del file creato" operationId: getMerchantTransactionsReport parameters: - - name: merchantId + - name: initiativeId in: path - description: The merchant ID + description: The initiative ID required: true schema: type: string - - name: initiativeId - in: path - description: The initiative ID + - name: merchantId + in: query + description: The merchant ID required: true schema: type: string @@ -2131,16 +2131,20 @@ components: MerchantReportDTO: type: object properties: + id: + type: string + description: "ENG: Report ID
IT: ID del report" + maxLength: 64 + pattern: .* initiativeId: type: string description: "ENG: The ID of the initiative
IT: L'ID' dell'iniziativa" - initiativeName: - type: string - description: "ENG: The name of the initiative
IT: Il nome dell'iniziativa" - state: + merchantReportStatus: type: string enum: - - CREATED + - INSERTED + - IN_PROGRESS + - GENERATED - FAILED description: "ENG: Report status
IT: Stato del report" fileName: diff --git a/src/idpay/apim/api/idpay_merchants_portal/get-merchant-transactions-report-policy.xml.tpl b/src/idpay/apim/api/idpay_merchants_portal/get-merchant-transactions-report-policy.xml.tpl new file mode 100644 index 00000000..d9831891 --- /dev/null +++ b/src/idpay/apim/api/idpay_merchants_portal/get-merchant-transactions-report-policy.xml.tpl @@ -0,0 +1,33 @@ + + + + + + @(context.Request.Query.GetValueOrDefault("merchantId")) + + + + + + + + + + + + + + + + From ca739108f5097e2699a1f2917ee91d9bc879074c Mon Sep 17 00:00:00 2001 From: EMELIGMWW Date: Fri, 6 Feb 2026 16:09:37 +0100 Subject: [PATCH 03/23] Swagger getMerchantTransactionsReport --- src/idpay/21_apim_api_portal_merchants.tf | 4 ++-- src/idpay/apim/api/idpay_merchant/openapi.merchant.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/idpay/21_apim_api_portal_merchants.tf b/src/idpay/21_apim_api_portal_merchants.tf index aaac9bad..0911cfb6 100644 --- a/src/idpay/21_apim_api_portal_merchants.tf +++ b/src/idpay/21_apim_api_portal_merchants.tf @@ -179,9 +179,9 @@ module "idpay_itn_merchants_portal" { }) }, { - operation_id = "getMerchantTransactionsReport" + operation_id = "generateMerchantTransactionsReport" - xml_content = templatefile("./apim/api/idpay_merchants_portal/get-merchant-transactions-report-policy.xml.tpl", { + xml_content = templatefile("./apim/api/idpay_merchants_portal/generate-merchant-transactions-report-policy.xml.tpl", { ingress_load_balancer_hostname = local.domain_aks_ingress_hostname }) }, diff --git a/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml b/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml index abcfa597..d77dbc64 100644 --- a/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml +++ b/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml @@ -468,7 +468,7 @@ paths: - merchant-transactions summary: Generates a report with all transactions associated with a merchant and a reference period and returns the data from the created file description: "ENG: Generates a report with all transactions associated with a merchant and a reference period and returns the data from the created file
IT: Genera un report con tutte le transazioni associate ad un esercente e ad un periodo di riferimento e ritorna i dati del file creato" - operationId: getMerchantTransactionsReport + operationId: generateMerchantTransactionsReport parameters: - name: initiativeId in: path From f18a56b5eaf7a6d2b2765a2a14d368506972a84e Mon Sep 17 00:00:00 2001 From: EMELIGMWW Date: Fri, 6 Feb 2026 16:11:14 +0100 Subject: [PATCH 04/23] Swagger getMerchantTransactionsReport --- src/idpay/apim/api/idpay_merchant/openapi.merchant.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml b/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml index d77dbc64..2f5a0f24 100644 --- a/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml +++ b/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml @@ -479,7 +479,7 @@ paths: - name: merchantId in: query description: The merchant ID - required: true + required: false schema: type: string - name: startPeriod From 3e84e1522f2777e360d13f812c8d1b38139861a2 Mon Sep 17 00:00:00 2001 From: EMELIGMWW Date: Fri, 6 Feb 2026 16:17:46 +0100 Subject: [PATCH 05/23] Swagger getMerchantTransactionsReport policy --- ...erchant-transactions-report-policy.xml.tpl | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/idpay/apim/api/idpay_merchants_portal/get-merchant-transactions-report-policy.xml.tpl b/src/idpay/apim/api/idpay_merchants_portal/get-merchant-transactions-report-policy.xml.tpl index d9831891..c1cf2f6b 100644 --- a/src/idpay/apim/api/idpay_merchants_portal/get-merchant-transactions-report-policy.xml.tpl +++ b/src/idpay/apim/api/idpay_merchants_portal/get-merchant-transactions-report-policy.xml.tpl @@ -13,21 +13,18 @@ - - @(context.Request.Query.GetValueOrDefault("merchantId")) - + + + + + @(context.Request.Query.GetValueOrDefault("merchantId")) + + + + - - - - - - - - - - + From 0e901544f0a315bc0e1a4445ca49258f26fdf411 Mon Sep 17 00:00:00 2001 From: EMELIGMWW Date: Fri, 6 Feb 2026 17:38:48 +0100 Subject: [PATCH 06/23] Swagger getMerchantTransactionsReport tag --- src/idpay/apim/api/idpay_merchant/openapi.merchant.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml b/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml index 2f5a0f24..b7b6e1ed 100644 --- a/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml +++ b/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml @@ -465,7 +465,7 @@ paths: /initiative/{initiativeId}/transactions/report: post: tags: - - merchant-transactions + - merchant-report summary: Generates a report with all transactions associated with a merchant and a reference period and returns the data from the created file description: "ENG: Generates a report with all transactions associated with a merchant and a reference period and returns the data from the created file
IT: Genera un report con tutte le transazioni associate ad un esercente e ad un periodo di riferimento e ritorna i dati del file creato" operationId: generateMerchantTransactionsReport From aa9a998045058998ca8baea259823b7c9747aa4e Mon Sep 17 00:00:00 2001 From: v1tt0ri0Alt Date: Fri, 6 Feb 2026 17:57:18 +0100 Subject: [PATCH 07/23] added get for list of reports and post for reports download --- .../api/idpay_merchant/openapi.merchant.yml | 205 +++++++++++++++++- 1 file changed, 203 insertions(+), 2 deletions(-) diff --git a/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml b/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml index b7b6e1ed..5b82019c 100644 --- a/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml +++ b/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml @@ -462,7 +462,7 @@ paths: description: Too many requests "500": description: Server error - /initiative/{initiativeId}/transactions/report: + /initiative/{initiativeId}/transactions/reports: post: tags: - merchant-report @@ -521,6 +521,100 @@ paths: description: Too many requests "500": description: Server error + get: + tags: + - merchant-report + summary: Retrieve the list of generated reports + description: "ENG: Retrieves the paginated list of reports generated for a merchant or Invitalia operator, ordered by request creation date descending.
IT: Recupera la lista paginata dei report generati per un merchant o per un operatore Invitalia, ordinata per data di richiesta in ordine decrescente." + operationId: getMerchantTransactionsReports + parameters: + - name: initiativeId + in: path + description: The initiative ID + required: true + schema: + type: string + - name: merchantId + in: query + description: The merchant ID + required: false + schema: + type: string + - name: rewardBatchAssignee + in: query + description: Invitalia operator level + required: false + schema: + type: string + enum: + - L1 + - L2 + - L3 + - name: page + in: query + required: false + schema: + type: integer + default: 0 + minimum: 0 + - name: size + in: query + required: false + schema: + type: integer + default: 10 + minimum: 1 + maximum: 100 + responses: + "200": + description: Ok + content: + application/json: + schema: + $ref: "#/components/schemas/MerchantReportPageDTO" + "401": + description: Authentication failed + "404": + description: Merchant not found + "429": + description: Too many requests + "500": + description: Server error + /initiative/{initiativeId}/transactions/reports/{reportId}/download: + get: + tags: + - merchant-report + summary: Download the generated transactions report file + description: "ENG: This service allows downloading the file associated with a previously generated transactions report.
IT: Questo servizio consente di scaricare il file associato a un report di transazioni precedentemente generato." + operationId: downloadTransactionsReport + parameters: + - name: initiativeId + in: path + required: true + schema: + type: string + - name: merchantId + in: query + description: The merchant ID + required: false + schema: + type: string + - name: reportId + in: path + required: true + schema: + type: string + responses: + "200": + $ref: "#/components/responses/GET_download_transactions_report_200_Response" + "400": + $ref: "#/components/responses/GET_download_transactions_report_400_Response" + "401": + $ref: "#/components/responses/GET_download_transactions_report_401_Response" + "429": + $ref: "#/components/responses/GET_download_transactions_report_429_Response" + "500": + $ref: "#/components/responses/GET_download_transactions_report_500_Response" /initiatives/{initiativeId}/reward-batches/{rewardBatchId}/transactions/rejected: post: tags: @@ -1144,6 +1238,82 @@ components: maxLength: 36 pattern: .* responses: + GET_download_transactions_report_200_Response: + description: Ok + headers: + Access-Control-Allow-Origin: + $ref: "#/components/headers/Access-Control-Allow-Origin" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Reset: + $ref: "#/components/headers/X-RateLimit-Reset" + content: + text/csv: + schema: + type: string + format: binary + GET_download_transactions_report_400_Response: + description: Bad request + headers: + Access-Control-Allow-Origin: + $ref: "#/components/headers/Access-Control-Allow-Origin" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Reset: + $ref: "#/components/headers/X-RateLimit-Reset" + content: + application/json: + schema: + $ref: "#/components/schemas/TransactionErrorDTO" + GET_download_transactions_report_401_Response: + description: Authentication failed + headers: + Access-Control-Allow-Origin: + $ref: "#/components/headers/Access-Control-Allow-Origin" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Reset: + $ref: "#/components/headers/X-RateLimit-Reset" + content: + application/json: + schema: + $ref: "#/components/schemas/TransactionErrorDTO" + GET_download_transactions_report_429_Response: + description: Too many requests + headers: + Access-Control-Allow-Origin: + $ref: "#/components/headers/Access-Control-Allow-Origin" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Reset: + $ref: "#/components/headers/X-RateLimit-Reset" + content: + application/json: + schema: + $ref: "#/components/schemas/TransactionErrorDTO" + GET_download_transactions_report_500_Response: + description: Server error + headers: + Access-Control-Allow-Origin: + $ref: "#/components/headers/Access-Control-Allow-Origin" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Reset: + $ref: "#/components/headers/X-RateLimit-Reset" + content: + application/json: + schema: + $ref: "#/components/schemas/TransactionErrorDTO" GET_download_invoice_file_200_Response: description: Ok headers: @@ -2139,7 +2309,7 @@ components: initiativeId: type: string description: "ENG: The ID of the initiative
IT: L'ID' dell'iniziativa" - merchantReportStatus: + reportStatus: type: string enum: - INSERTED @@ -2208,6 +2378,37 @@ components: description: "ENG: URL to download the approved batch file - IT: URL per scaricare il file del lotto approvato" required: - approvedBatchUrl + MerchantReportPageDTO: + type: object + description: "ENG: Paginated list of generated transaction reports.
IT: Lista paginata dei report di transazioni generati." + properties: + content: + type: array + description: > + ENG: List of generated reports for the requested page.
+ IT: Elenco dei report generati per la pagina richiesta. + items: + $ref: "#/components/schemas/MerchantReportDTO" + page: + type: integer + description: > + ENG: Current page number (0-based).
+ IT: Numero della pagina corrente (partendo da 0). + size: + type: integer + description: > + ENG: Number of elements per page.
+ IT: Numero di elementi per pagina. + totalElements: + type: integer + description: > + ENG: Total number of available reports.
+ IT: Numero totale dei report disponibili. + totalPages: + type: integer + description: > + ENG: Total number of available pages.
+ IT: Numero totale delle pagine disponibili. securitySchemes: Bearer: type: apiKey From cf3315e4aa306e325b52a7106e38e4885fb4ac1a Mon Sep 17 00:00:00 2001 From: v1tt0ri0Alt Date: Mon, 9 Feb 2026 12:25:12 +0100 Subject: [PATCH 08/23] added responses for /reports (Get-Post) --- .../api/idpay_merchant/openapi.merchant.yml | 229 ++++++++++++++++-- 1 file changed, 211 insertions(+), 18 deletions(-) diff --git a/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml b/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml index 5b82019c..33d449ea 100644 --- a/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml +++ b/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml @@ -508,19 +508,17 @@ paths: - L3 responses: "200": - description: Ok - content: - application/json: - schema: - $ref: "#/components/schemas/MerchantReportDTO" + $ref: "#/components/responses/POST_generate_transactions_report_200_Response" + "400": + $ref: "#/components/responses/POST_generate_transactions_report_400_Response" "401": - description: Autentication failed + $ref: "#/components/responses/POST_generate_transactions_report_401_Response" "404": - description: Merchant not found + $ref: "#/components/responses/POST_generate_transactions_report_404_Response" "429": - description: Too many requests + $ref: "#/components/responses/POST_generate_transactions_report_429_Response" "500": - description: Server error + $ref: "#/components/responses/POST_generate_transactions_report_500_Response" get: tags: - merchant-report @@ -567,19 +565,17 @@ paths: maximum: 100 responses: "200": - description: Ok - content: - application/json: - schema: - $ref: "#/components/schemas/MerchantReportPageDTO" + $ref: "#/components/responses/GET_list_transactions_reports_200_Response" + "400": + $ref: "#/components/responses/GET_list_transactions_reports_400_Response" "401": - description: Authentication failed + $ref: "#/components/responses/GET_list_transactions_reports_401_Response" "404": - description: Merchant not found + $ref: "#/components/responses/GET_list_transactions_reports_404_Response" "429": - description: Too many requests + $ref: "#/components/responses/GET_list_transactions_reports_429_Response" "500": - description: Server error + $ref: "#/components/responses/GET_list_transactions_reports_500_Response" /initiative/{initiativeId}/transactions/reports/{reportId}/download: get: tags: @@ -611,6 +607,8 @@ paths: $ref: "#/components/responses/GET_download_transactions_report_400_Response" "401": $ref: "#/components/responses/GET_download_transactions_report_401_Response" + "404": + $ref: "#/components/responses/GET_download_transactions_report_404_Response" "429": $ref: "#/components/responses/GET_download_transactions_report_429_Response" "500": @@ -1284,6 +1282,21 @@ components: application/json: schema: $ref: "#/components/schemas/TransactionErrorDTO" + GET_download_transactions_report_404_Response: + description: Resource not found + headers: + Access-Control-Allow-Origin: + $ref: "#/components/headers/Access-Control-Allow-Origin" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Reset: + $ref: "#/components/headers/X-RateLimit-Reset" + content: + application/json: + schema: + $ref: "#/components/schemas/TransactionErrorDTO" GET_download_transactions_report_429_Response: description: Too many requests headers: @@ -1314,6 +1327,186 @@ components: application/json: schema: $ref: "#/components/schemas/TransactionErrorDTO" + POST_generate_transactions_report_200_Response: + description: Ok + headers: + Access-Control-Allow-Origin: + $ref: "#/components/headers/Access-Control-Allow-Origin" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Reset: + $ref: "#/components/headers/X-RateLimit-Reset" + content: + application/json: + schema: + $ref: "#/components/schemas/MerchantReportDTO" + POST_generate_transactions_report_400_Response: + description: Bad request + headers: + Access-Control-Allow-Origin: + $ref: "#/components/headers/Access-Control-Allow-Origin" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Reset: + $ref: "#/components/headers/X-RateLimit-Reset" + content: + application/json: + schema: + $ref: "#/components/schemas/TransactionErrorDTO" + POST_generate_transactions_report_401_Response: + description: Authentication failed + headers: + Access-Control-Allow-Origin: + $ref: "#/components/headers/Access-Control-Allow-Origin" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Reset: + $ref: "#/components/headers/X-RateLimit-Reset" + content: + application/json: + schema: + $ref: "#/components/schemas/TransactionErrorDTO" + POST_generate_transactions_report_404_Response: + description: Resource not found + headers: + Access-Control-Allow-Origin: + $ref: "#/components/headers/Access-Control-Allow-Origin" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Reset: + $ref: "#/components/headers/X-RateLimit-Reset" + content: + application/json: + schema: + $ref: "#/components/schemas/TransactionErrorDTO" + POST_generate_transactions_report_429_Response: + description: Too many requests + headers: + Access-Control-Allow-Origin: + $ref: "#/components/headers/Access-Control-Allow-Origin" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Reset: + $ref: "#/components/headers/X-RateLimit-Reset" + content: + application/json: + schema: + $ref: "#/components/schemas/TransactionErrorDTO" + POST_generate_transactions_report_500_Response: + description: Server error + headers: + Access-Control-Allow-Origin: + $ref: "#/components/headers/Access-Control-Allow-Origin" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Reset: + $ref: "#/components/headers/X-RateLimit-Reset" + content: + application/json: + schema: + $ref: "#/components/schemas/TransactionErrorDTO" + GET_list_transactions_reports_200_Response: + description: Ok + headers: + Access-Control-Allow-Origin: + $ref: "#/components/headers/Access-Control-Allow-Origin" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Reset: + $ref: "#/components/headers/X-RateLimit-Reset" + content: + application/json: + schema: + $ref: "#/components/schemas/MerchantReportPageDTO" + GET_list_transactions_reports_400_Response: + description: Bad request + headers: + Access-Control-Allow-Origin: + $ref: "#/components/headers/Access-Control-Allow-Origin" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Reset: + $ref: "#/components/headers/X-RateLimit-Reset" + content: + application/json: + schema: + $ref: "#/components/schemas/TransactionErrorDTO" + GET_list_transactions_reports_401_Response: + description: Authentication failed + headers: + Access-Control-Allow-Origin: + $ref: "#/components/headers/Access-Control-Allow-Origin" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Reset: + $ref: "#/components/headers/X-RateLimit-Reset" + content: + application/json: + schema: + $ref: "#/components/schemas/TransactionErrorDTO" + GET_list_transactions_reports_404_Response: + description: Resource not found + headers: + Access-Control-Allow-Origin: + $ref: "#/components/headers/Access-Control-Allow-Origin" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Reset: + $ref: "#/components/headers/X-RateLimit-Reset" + content: + application/json: + schema: + $ref: "#/components/schemas/TransactionErrorDTO" + GET_list_transactions_reports_429_Response: + description: Too many requests + headers: + Access-Control-Allow-Origin: + $ref: "#/components/headers/Access-Control-Allow-Origin" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Reset: + $ref: "#/components/headers/X-RateLimit-Reset" + content: + application/json: + schema: + $ref: "#/components/schemas/TransactionErrorDTO" + GET_list_transactions_reports_500_Response: + description: Server error + headers: + Access-Control-Allow-Origin: + $ref: "#/components/headers/Access-Control-Allow-Origin" + X-RateLimit-Limit: + $ref: "#/components/headers/X-RateLimit-Limit" + X-RateLimit-Remaining: + $ref: "#/components/headers/X-RateLimit-Remaining" + X-RateLimit-Reset: + $ref: "#/components/headers/X-RateLimit-Reset" + content: + application/json: + schema: + $ref: "#/components/schemas/TransactionErrorDTO" GET_download_invoice_file_200_Response: description: Ok headers: From ca892677ee53e729fbccefb01451b4ccead5b20e Mon Sep 17 00:00:00 2001 From: "stefano.delia" Date: Mon, 9 Feb 2026 12:40:50 +0100 Subject: [PATCH 09/23] fix: pre-commit --- .../get-merchant-transactions-report-policy.xml.tpl | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/idpay/apim/api/idpay_merchants_portal/get-merchant-transactions-report-policy.xml.tpl b/src/idpay/apim/api/idpay_merchants_portal/get-merchant-transactions-report-policy.xml.tpl index c1cf2f6b..5bb3266b 100644 --- a/src/idpay/apim/api/idpay_merchants_portal/get-merchant-transactions-report-policy.xml.tpl +++ b/src/idpay/apim/api/idpay_merchants_portal/get-merchant-transactions-report-policy.xml.tpl @@ -26,5 +26,3 @@ - - From ca3aded271e562c822a1deedb03721835b0650c5 Mon Sep 17 00:00:00 2001 From: EMELIGMWW Date: Thu, 12 Feb 2026 13:58:13 +0100 Subject: [PATCH 10/23] Swagger getMerchantTransactionsReport reportDTO --- src/idpay/21_apim_api_portal_merchants.tf | 2 +- .../api/idpay_merchant/openapi.merchant.yml | 27 ++++++++++++++----- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/idpay/21_apim_api_portal_merchants.tf b/src/idpay/21_apim_api_portal_merchants.tf index 1107457e..09d94bfa 100644 --- a/src/idpay/21_apim_api_portal_merchants.tf +++ b/src/idpay/21_apim_api_portal_merchants.tf @@ -179,7 +179,7 @@ module "idpay_itn_merchants_portal" { }) }, { - operation_id = "generateMerchantTransactionsReport" + operation_id = "generateReport" xml_content = templatefile("./apim/api/idpay_merchants_portal/generate-merchant-transactions-report-policy.xml.tpl", { ingress_load_balancer_hostname = local.domain_aks_ingress_hostname diff --git a/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml b/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml index 33d449ea..9379f867 100644 --- a/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml +++ b/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml @@ -468,7 +468,7 @@ paths: - merchant-report summary: Generates a report with all transactions associated with a merchant and a reference period and returns the data from the created file description: "ENG: Generates a report with all transactions associated with a merchant and a reference period and returns the data from the created file
IT: Genera un report con tutte le transazioni associate ad un esercente e ad un periodo di riferimento e ritorna i dati del file creato" - operationId: generateMerchantTransactionsReport + operationId: generateReport parameters: - name: initiativeId in: path @@ -496,6 +496,15 @@ paths: schema: type: string format: date-time + - name: reportType + in: query + description: type of the report + required: true + schema: + type: string + enum: + - MERCHANT_TRANSACTIONS + default: MERCHANT_TRANSACTIONS - name: rewardBatchAssignee in: query description: Invitalia operator level @@ -1341,7 +1350,7 @@ components: content: application/json: schema: - $ref: "#/components/schemas/MerchantReportDTO" + $ref: "#/components/schemas/ReportDTO" POST_generate_transactions_report_400_Response: description: Bad request headers: @@ -1431,7 +1440,7 @@ components: content: application/json: schema: - $ref: "#/components/schemas/MerchantReportPageDTO" + $ref: "#/components/schemas/ReportListDTO" GET_list_transactions_reports_400_Response: description: Bad request headers: @@ -2491,7 +2500,7 @@ components: type: integer format: int32 description: "ENG: The total number of the pages
IT: Il numero totale delle pagine" - MerchantReportDTO: + ReportDTO: type: object properties: id: @@ -2535,13 +2544,17 @@ components: businessName: type: string description: "ENG: The name of the merchant
IT: La ragione sociale dell'esercente" - rewardBatchAssignee: + operatorLevel: type: string enum: - L1 - L2 - L3 description: "ENG: Invitalia operator level
IT: Livello dell'operatore Invitalia" + reportType: + type: string + enum: + - MERCHANT_TRANSACTIONS PointOfSaleErrorDTO: type: object required: @@ -2571,7 +2584,7 @@ components: description: "ENG: URL to download the approved batch file - IT: URL per scaricare il file del lotto approvato" required: - approvedBatchUrl - MerchantReportPageDTO: + ReportListDTO: type: object description: "ENG: Paginated list of generated transaction reports.
IT: Lista paginata dei report di transazioni generati." properties: @@ -2581,7 +2594,7 @@ components: ENG: List of generated reports for the requested page.
IT: Elenco dei report generati per la pagina richiesta. items: - $ref: "#/components/schemas/MerchantReportDTO" + $ref: "#/components/schemas/ReportDTO" page: type: integer description: > From 63937cd29389aa285e947baa8dae46510110f8c3 Mon Sep 17 00:00:00 2001 From: EMELIGMWW Date: Thu, 12 Feb 2026 17:20:16 +0100 Subject: [PATCH 11/23] Swagger getMerchantTransactionsReport reportDTO --- src/idpay/21_apim_api_portal_merchants.tf | 7 --- ...rchant-transactions-report-policy.xml.tpl} | 0 .../api/idpay_merchant/openapi.merchant.yml | 58 ++++++++----------- 3 files changed, 25 insertions(+), 40 deletions(-) rename src/idpay/apim/api/{idpay_merchants_portal/get-merchant-transactions-report-policy.xml.tpl => idpay_merchant/generate-merchant-transactions-report-policy.xml.tpl} (100%) diff --git a/src/idpay/21_apim_api_portal_merchants.tf b/src/idpay/21_apim_api_portal_merchants.tf index 09d94bfa..25322c8b 100644 --- a/src/idpay/21_apim_api_portal_merchants.tf +++ b/src/idpay/21_apim_api_portal_merchants.tf @@ -178,13 +178,6 @@ module "idpay_itn_merchants_portal" { ingress_load_balancer_hostname = local.domain_aks_ingress_hostname }) }, - { - operation_id = "generateReport" - - xml_content = templatefile("./apim/api/idpay_merchants_portal/generate-merchant-transactions-report-policy.xml.tpl", { - ingress_load_balancer_hostname = local.domain_aks_ingress_hostname - }) - }, { operation_id = "getProcessedTransactionStatuses" xml_content = templatefile("./apim/api/idpay_merchants_portal/get-merchant-transactions-processed-statuses-policy.xml.tpl", { diff --git a/src/idpay/apim/api/idpay_merchants_portal/get-merchant-transactions-report-policy.xml.tpl b/src/idpay/apim/api/idpay_merchant/generate-merchant-transactions-report-policy.xml.tpl similarity index 100% rename from src/idpay/apim/api/idpay_merchants_portal/get-merchant-transactions-report-policy.xml.tpl rename to src/idpay/apim/api/idpay_merchant/generate-merchant-transactions-report-policy.xml.tpl diff --git a/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml b/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml index 9379f867..2958fafe 100644 --- a/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml +++ b/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml @@ -482,39 +482,12 @@ paths: required: false schema: type: string - - name: startPeriod - in: query - description: start date of the reference period - required: true - schema: - type: string - format: date-time - - name: endPeriod - in: query - description: end date of the reference period - required: true - schema: - type: string - format: date-time - - name: reportType - in: query - description: type of the report - required: true - schema: - type: string - enum: - - MERCHANT_TRANSACTIONS - default: MERCHANT_TRANSACTIONS - - name: rewardBatchAssignee - in: query - description: Invitalia operator level - required: false - schema: - type: string - enum: - - L1 - - L2 - - L3 + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/ReportRequest" responses: "200": $ref: "#/components/responses/POST_generate_transactions_report_200_Response" @@ -2615,6 +2588,25 @@ components: description: > ENG: Total number of available pages.
IT: Numero totale delle pagine disponibili. + ReportRequest: + type: object + properties: + startPeriod: + type: string + format: date-time + description: "ENG: Start date of the reference period
IT: Data di inizio del periodo di riferimento" + endPeriod: + type: string + format: date-time + description: "ENG: End date of the reference period
IT: Data di fine del periodo di riferimento" + reportType: + type: string + enum: + - MERCHANT_TRANSACTIONS + required: + - startPeriod + - endPeriod + - reportType securitySchemes: Bearer: type: apiKey From c17b46f8c3c949e31bd286e8ef3e611b1e5e071e Mon Sep 17 00:00:00 2001 From: EMELIGMWW Date: Thu, 12 Feb 2026 17:31:56 +0100 Subject: [PATCH 12/23] Swagger getMerchantTransactionsReport reportDTO --- .../apim/api/idpay_merchant/openapi.merchant.yml | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml b/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml index 2958fafe..4f527c68 100644 --- a/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml +++ b/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml @@ -462,7 +462,7 @@ paths: description: Too many requests "500": description: Server error - /initiative/{initiativeId}/transactions/reports: + /initiative/{initiativeId}/reports: post: tags: - merchant-report @@ -520,16 +520,6 @@ paths: required: false schema: type: string - - name: rewardBatchAssignee - in: query - description: Invitalia operator level - required: false - schema: - type: string - enum: - - L1 - - L2 - - L3 - name: page in: query required: false @@ -558,7 +548,7 @@ paths: $ref: "#/components/responses/GET_list_transactions_reports_429_Response" "500": $ref: "#/components/responses/GET_list_transactions_reports_500_Response" - /initiative/{initiativeId}/transactions/reports/{reportId}/download: + /initiative/{initiativeId}/reports/{reportId}/download: get: tags: - merchant-report @@ -2603,10 +2593,10 @@ components: type: string enum: - MERCHANT_TRANSACTIONS + default: MERCHANT_TRANSACTIONS required: - startPeriod - endPeriod - - reportType securitySchemes: Bearer: type: apiKey From cbefee9f134fa3e362fc62fb9e650c78d9c009cb Mon Sep 17 00:00:00 2001 From: EMELIGMWW Date: Thu, 12 Feb 2026 21:32:42 +0100 Subject: [PATCH 13/23] Swagger getMerchantTransactionsReport reportDTO --- src/idpay/20_apim_api_portal.tf | 7 +++++++ ...eport-policy.xml.tpl => generate-report-policy.xml.tpl} | 0 2 files changed, 7 insertions(+) rename src/idpay/apim/api/idpay_merchant/{generate-merchant-transactions-report-policy.xml.tpl => generate-report-policy.xml.tpl} (100%) diff --git a/src/idpay/20_apim_api_portal.tf b/src/idpay/20_apim_api_portal.tf index d5126030..038b9807 100644 --- a/src/idpay/20_apim_api_portal.tf +++ b/src/idpay/20_apim_api_portal.tf @@ -569,6 +569,13 @@ module "idpay_itn_merchant_portal" { ingress_load_balancer_hostname = local.domain_aks_ingress_hostname }) }, + { + operation_id = "generateReport" + + xml_content = templatefile("./apim/api/idpay_merchants_portal/generate-report-policy.xml.tpl", { + ingress_load_balancer_hostname = local.domain_aks_ingress_hostname + }) + }, { operation_id = "getRewardBatches" diff --git a/src/idpay/apim/api/idpay_merchant/generate-merchant-transactions-report-policy.xml.tpl b/src/idpay/apim/api/idpay_merchant/generate-report-policy.xml.tpl similarity index 100% rename from src/idpay/apim/api/idpay_merchant/generate-merchant-transactions-report-policy.xml.tpl rename to src/idpay/apim/api/idpay_merchant/generate-report-policy.xml.tpl From 7c369b22f2bd4c1035bd360a38e2ad05fd51b0a9 Mon Sep 17 00:00:00 2001 From: EMELIGMWW Date: Thu, 12 Feb 2026 23:01:24 +0100 Subject: [PATCH 14/23] Swagger getMerchantTransactionsReport reportDTO --- .../apim/api/idpay_merchant/generate-report-policy.xml.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/idpay/apim/api/idpay_merchant/generate-report-policy.xml.tpl b/src/idpay/apim/api/idpay_merchant/generate-report-policy.xml.tpl index 5bb3266b..d2f73c0d 100644 --- a/src/idpay/apim/api/idpay_merchant/generate-report-policy.xml.tpl +++ b/src/idpay/apim/api/idpay_merchant/generate-report-policy.xml.tpl @@ -23,6 +23,6 @@ - + From 4d745a5e63fc3faf17fc6e4e15078815aaaca206 Mon Sep 17 00:00:00 2001 From: dariopelliccioli Date: Fri, 13 Feb 2026 10:48:38 +0100 Subject: [PATCH 15/23] fix generate report policy path --- src/idpay/20_apim_api_portal.tf | 2 +- ...eport-policy.xml.tpl => post-generate-report-policy.xml.tpl} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename src/idpay/apim/api/idpay_merchant/{generate-report-policy.xml.tpl => post-generate-report-policy.xml.tpl} (100%) diff --git a/src/idpay/20_apim_api_portal.tf b/src/idpay/20_apim_api_portal.tf index 038b9807..870a6ffe 100644 --- a/src/idpay/20_apim_api_portal.tf +++ b/src/idpay/20_apim_api_portal.tf @@ -572,7 +572,7 @@ module "idpay_itn_merchant_portal" { { operation_id = "generateReport" - xml_content = templatefile("./apim/api/idpay_merchants_portal/generate-report-policy.xml.tpl", { + xml_content = templatefile("./apim/api/idpay_merchant/post-generate-report-policy.xml.tpl", { ingress_load_balancer_hostname = local.domain_aks_ingress_hostname }) }, diff --git a/src/idpay/apim/api/idpay_merchant/generate-report-policy.xml.tpl b/src/idpay/apim/api/idpay_merchant/post-generate-report-policy.xml.tpl similarity index 100% rename from src/idpay/apim/api/idpay_merchant/generate-report-policy.xml.tpl rename to src/idpay/apim/api/idpay_merchant/post-generate-report-policy.xml.tpl From 2bf9dab45b358f7a5b093de528371b2aba6167e3 Mon Sep 17 00:00:00 2001 From: dariopelliccioli Date: Fri, 13 Feb 2026 10:48:57 +0100 Subject: [PATCH 16/23] add api for patch report called by data factory --- src/idpay/20_apim_api_data_factory.tf | 45 +++++++++++++++++++ .../patch-report-policy.xml.tpl | 28 ++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 src/idpay/20_apim_api_data_factory.tf create mode 100644 src/idpay/apim/api/idpay_data_factory/patch-report-policy.xml.tpl diff --git a/src/idpay/20_apim_api_data_factory.tf b/src/idpay/20_apim_api_data_factory.tf new file mode 100644 index 00000000..b77dab92 --- /dev/null +++ b/src/idpay/20_apim_api_data_factory.tf @@ -0,0 +1,45 @@ +# # +# # IDPAY API for internal use from data factory +# # +# + +resource "azurerm_api_management_api" "idpay_data_factory" { + name = "${var.env_short}-idpay-itn-data-factory" + api_management_name = data.azurerm_api_management.apim_core.name + resource_group_name = data.azurerm_resource_group.apim_rg.name + + revision = "1" + display_name = "IDPAY ITN Data Factory" + path = "idpay-itn/df" + subscription_required = false + #service_url = "" + protocols = ["https"] + +} + +resource "azurerm_api_management_api_operation" "idpay_df_report_patch" { + operation_id = "idpay-df-report-patch" + api_name = azurerm_api_management_api.idpay_data_factory.name + api_management_name = data.azurerm_api_management.apim_core.name + resource_group_name = data.azurerm_resource_group.apim_rg.name + display_name = "IDPAY DF Report Patch" + method = "PATCH" + url_template = "/report/{reportId}" + template_parameter { + name = "reportId" + type = "string" + required = true + } + description = "Endpoint for DF in order to perform a report patch for update the status" +} + +resource "azurerm_api_management_api_operation_policy" "idpay_df_report_patch_policy" { + api_name = azurerm_api_management_api_operation.idpay_df_report_patch.api_name + api_management_name = azurerm_api_management_api_operation.idpay_df_report_patch.api_management_name + resource_group_name = azurerm_api_management_api_operation.idpay_df_report_patch.resource_group_name + operation_id = azurerm_api_management_api_operation.idpay_df_report_patch.operation_id + + xml_content = templatefile("./apim/api/idpay_data_factory/patch-report-policy.xml.tpl", { + ingress_load_balancer_hostname = local.domain_aks_ingress_hostname + }) +} diff --git a/src/idpay/apim/api/idpay_data_factory/patch-report-policy.xml.tpl b/src/idpay/apim/api/idpay_data_factory/patch-report-policy.xml.tpl new file mode 100644 index 00000000..2865c1ab --- /dev/null +++ b/src/idpay/apim/api/idpay_data_factory/patch-report-policy.xml.tpl @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + From 6c89f86cb13d20e83b54f30519e611383076fa1c Mon Sep 17 00:00:00 2001 From: dariopelliccioli Date: Fri, 13 Feb 2026 13:03:49 +0100 Subject: [PATCH 17/23] fix policy for report api --- src/idpay/20_apim_api_portal.tf | 14 +++++++ .../get-report-download-policy.xml.tpl | 37 +++++++++++++++++++ .../get-report-list-policy.xml.tpl | 37 +++++++++++++++++++ .../post-generate-report-policy.xml.tpl | 15 ++++++-- 4 files changed, 100 insertions(+), 3 deletions(-) create mode 100644 src/idpay/apim/api/idpay_merchant/get-report-download-policy.xml.tpl create mode 100644 src/idpay/apim/api/idpay_merchant/get-report-list-policy.xml.tpl diff --git a/src/idpay/20_apim_api_portal.tf b/src/idpay/20_apim_api_portal.tf index 870a6ffe..d511539f 100644 --- a/src/idpay/20_apim_api_portal.tf +++ b/src/idpay/20_apim_api_portal.tf @@ -576,6 +576,20 @@ module "idpay_itn_merchant_portal" { ingress_load_balancer_hostname = local.domain_aks_ingress_hostname }) }, + { + operation_id = "getMerchantTransactionsReports" + + xml_content = templatefile("./apim/api/idpay_merchant/get-report-list-policy.xml.tpl", { + ingress_load_balancer_hostname = local.domain_aks_ingress_hostname + }) + }, + { + operation_id = "downloadTransactionsReport" + + xml_content = templatefile("./apim/api/idpay_merchant/get-report-download-policy.xml.tpl", { + ingress_load_balancer_hostname = local.domain_aks_ingress_hostname + }) + }, { operation_id = "getRewardBatches" diff --git a/src/idpay/apim/api/idpay_merchant/get-report-download-policy.xml.tpl b/src/idpay/apim/api/idpay_merchant/get-report-download-policy.xml.tpl new file mode 100644 index 00000000..0b802627 --- /dev/null +++ b/src/idpay/apim/api/idpay_merchant/get-report-download-policy.xml.tpl @@ -0,0 +1,37 @@ + + + + + + + + + @(context.Request.MatchedParameters["merchantId"]) + + + + + + + + + + + + + + + + + diff --git a/src/idpay/apim/api/idpay_merchant/get-report-list-policy.xml.tpl b/src/idpay/apim/api/idpay_merchant/get-report-list-policy.xml.tpl new file mode 100644 index 00000000..63c4604f --- /dev/null +++ b/src/idpay/apim/api/idpay_merchant/get-report-list-policy.xml.tpl @@ -0,0 +1,37 @@ + + + + + + + + + @(context.Request.MatchedParameters["merchantId"]) + + + + + + + + + + + + + + + + + diff --git a/src/idpay/apim/api/idpay_merchant/post-generate-report-policy.xml.tpl b/src/idpay/apim/api/idpay_merchant/post-generate-report-policy.xml.tpl index d2f73c0d..63c4604f 100644 --- a/src/idpay/apim/api/idpay_merchant/post-generate-report-policy.xml.tpl +++ b/src/idpay/apim/api/idpay_merchant/post-generate-report-policy.xml.tpl @@ -17,12 +17,21 @@ - @(context.Request.Query.GetValueOrDefault("merchantId")) + @(context.Request.MatchedParameters["merchantId"]) - + - + + + + + + + + + + From a9230be51450273e442413870d51356801ecd5c3 Mon Sep 17 00:00:00 2001 From: dariopelliccioli Date: Fri, 13 Feb 2026 13:44:55 +0100 Subject: [PATCH 18/23] fix get report policy --- .../api/idpay_merchant/get-report-list-policy.xml.tpl | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/idpay/apim/api/idpay_merchant/get-report-list-policy.xml.tpl b/src/idpay/apim/api/idpay_merchant/get-report-list-policy.xml.tpl index 63c4604f..463e9bc7 100644 --- a/src/idpay/apim/api/idpay_merchant/get-report-list-policy.xml.tpl +++ b/src/idpay/apim/api/idpay_merchant/get-report-list-policy.xml.tpl @@ -14,14 +14,6 @@ - - - - @(context.Request.MatchedParameters["merchantId"]) - - - - From f3cba1d22253bc958fa51970d6d4483d9e9059a8 Mon Sep 17 00:00:00 2001 From: dariopelliccioli Date: Fri, 13 Feb 2026 14:53:03 +0100 Subject: [PATCH 19/23] fix url_template for data factory api --- src/idpay/20_apim_api_data_factory.tf | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/idpay/20_apim_api_data_factory.tf b/src/idpay/20_apim_api_data_factory.tf index b77dab92..a4162c71 100644 --- a/src/idpay/20_apim_api_data_factory.tf +++ b/src/idpay/20_apim_api_data_factory.tf @@ -24,7 +24,12 @@ resource "azurerm_api_management_api_operation" "idpay_df_report_patch" { resource_group_name = data.azurerm_resource_group.apim_rg.name display_name = "IDPAY DF Report Patch" method = "PATCH" - url_template = "/report/{reportId}" + url_template = "/initiatives/{initiativeId}/reports/{reportId}" + template_parameter { + name = "initiativeId" + type = "string" + required = true + } template_parameter { name = "reportId" type = "string" From c8b44ea5186068651523c764285d1c2d3b64b8a5 Mon Sep 17 00:00:00 2001 From: dariopelliccioli Date: Fri, 13 Feb 2026 15:09:55 +0100 Subject: [PATCH 20/23] fix policy download report --- .../api/idpay_merchant/get-report-download-policy.xml.tpl | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/idpay/apim/api/idpay_merchant/get-report-download-policy.xml.tpl b/src/idpay/apim/api/idpay_merchant/get-report-download-policy.xml.tpl index 0b802627..e2247bfd 100644 --- a/src/idpay/apim/api/idpay_merchant/get-report-download-policy.xml.tpl +++ b/src/idpay/apim/api/idpay_merchant/get-report-download-policy.xml.tpl @@ -14,14 +14,6 @@ - - - - @(context.Request.MatchedParameters["merchantId"]) - - - - From 7da2fecda9d697297d64b3c388e58b3c17dcf18c Mon Sep 17 00:00:00 2001 From: EMELIGMWW Date: Fri, 13 Feb 2026 16:18:33 +0100 Subject: [PATCH 21/23] Swagger report --- .../apim/api/idpay_merchant/openapi.merchant.yml | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml b/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml index 4f527c68..0498113f 100644 --- a/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml +++ b/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml @@ -514,12 +514,6 @@ paths: required: true schema: type: string - - name: merchantId - in: query - description: The merchant ID - required: false - schema: - type: string - name: page in: query required: false @@ -561,12 +555,6 @@ paths: required: true schema: type: string - - name: merchantId - in: query - description: The merchant ID - required: false - schema: - type: string - name: reportId in: path required: true @@ -2593,10 +2581,10 @@ components: type: string enum: - MERCHANT_TRANSACTIONS - default: MERCHANT_TRANSACTIONS required: - startPeriod - endPeriod + - reportType securitySchemes: Bearer: type: apiKey From b4a8fb30daa01c7c5e9b5cc0d1f5877e09ef1b9b Mon Sep 17 00:00:00 2001 From: dariopelliccioli Date: Fri, 13 Feb 2026 16:48:59 +0100 Subject: [PATCH 22/23] fix generate report policy --- .../apim/api/idpay_merchant/post-generate-report-policy.xml.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/idpay/apim/api/idpay_merchant/post-generate-report-policy.xml.tpl b/src/idpay/apim/api/idpay_merchant/post-generate-report-policy.xml.tpl index 63c4604f..f61f524d 100644 --- a/src/idpay/apim/api/idpay_merchant/post-generate-report-policy.xml.tpl +++ b/src/idpay/apim/api/idpay_merchant/post-generate-report-policy.xml.tpl @@ -17,7 +17,7 @@ - @(context.Request.MatchedParameters["merchantId"]) + @(context.Request.Url.Query.GetValueOrDefault("merchantId","")) From df4fc26b629ef43ad6edc0e381a329d99761ee9c Mon Sep 17 00:00:00 2001 From: EMELIGMWW Date: Fri, 13 Feb 2026 16:56:57 +0100 Subject: [PATCH 23/23] Swagger report --- .../apim/api/idpay_merchant/openapi.merchant.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml b/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml index 0498113f..e7916f65 100644 --- a/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml +++ b/src/idpay/apim/api/idpay_merchant/openapi.merchant.yml @@ -1208,10 +1208,9 @@ components: X-RateLimit-Reset: $ref: "#/components/headers/X-RateLimit-Reset" content: - text/csv: + application/json: schema: - type: string - format: binary + $ref: "#/components/schemas/DownloadReportResponseDTO" GET_download_transactions_report_400_Response: description: Bad request headers: @@ -2535,6 +2534,15 @@ components: description: "ENG: URL to download the approved batch file - IT: URL per scaricare il file del lotto approvato" required: - approvedBatchUrl + DownloadReportResponseDTO: + type: object + properties: + reportUrl: + type: string + maxLength: 10000 + description: "ENG: URL to download the report file - IT: URL per scaricare il file del report" + required: + - reportUrl ReportListDTO: type: object description: "ENG: Paginated list of generated transaction reports.
IT: Lista paginata dei report di transazioni generati."