From c4a9c8055f88352e30bb2834d40923047c215409 Mon Sep 17 00:00:00 2001 From: pawelPrzywara Date: Mon, 26 Jan 2026 17:59:03 +0100 Subject: [PATCH] chore: update idpay api version --- scripts/generate-api-models.sh | 2 +- src/payloads/features/idpay/check-prerequisites.ts | 9 ++++++--- src/payloads/features/idpay/get-timeline.ts | 11 ++++++----- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/scripts/generate-api-models.sh b/scripts/generate-api-models.sh index d30e7400..981c74f0 100755 --- a/scripts/generate-api-models.sh +++ b/scripts/generate-api-models.sh @@ -26,7 +26,7 @@ declare -a noParams=( declare -a noStrict=( "./generated/definitions/fci https://raw.githubusercontent.com/pagopa/io-backend/$IO_BACKEND_VERSION/api_io_sign.yaml" - "./generated/definitions/idpay https://raw.githubusercontent.com/pagopa/cstar-securehub-infra-api-spec/refs/tags/v2.47.6/src/idpay/apim/api/idpay_appio_full/openapi.appio.full.yml" + "./generated/definitions/idpay https://raw.githubusercontent.com/pagopa/cstar-securehub-infra-api-spec/refs/tags/v3.10.2/src/idpay/apim/api/idpay_appio_full/openapi.appio.full.yml" "./generated/definitions/services https://raw.githubusercontent.com/pagopa/io-backend/$IO_BACKEND_VERSION/api_services_app_backend.yaml" ) diff --git a/src/payloads/features/idpay/check-prerequisites.ts b/src/payloads/features/idpay/check-prerequisites.ts index 9678ca64..49290a83 100644 --- a/src/payloads/features/idpay/check-prerequisites.ts +++ b/src/payloads/features/idpay/check-prerequisites.ts @@ -69,15 +69,18 @@ const familyUnityOnlyAutomatedCriteria: ReadonlyArray = [ const criterionArray: ReadonlyArray = [ { description: "Criterion 1", - subDescription: "Subtitle criterion 1" + subDescription: "Subtitle criterion 1", + value: "1" }, { description: "Criterion 2", - subDescription: "Subtitle criterion 2" + subDescription: "Subtitle criterion 2", + value: "2" }, { description: "Criterion 3", - subDescription: "Subtitle criterion 3" + subDescription: "Subtitle criterion 3", + value: "3" } ]; const selfDeclarationMulti: ReadonlyArray = [ diff --git a/src/payloads/features/idpay/get-timeline.ts b/src/payloads/features/idpay/get-timeline.ts index d414edf3..a4f58b8e 100644 --- a/src/payloads/features/idpay/get-timeline.ts +++ b/src/payloads/features/idpay/get-timeline.ts @@ -14,18 +14,19 @@ export const getTimelineResponse = ( initiativeTimeline[initiativeId], O.fromNullable, O.map(timeline => { - const totalElements = timeline.length; - const totalPages = Math.ceil(totalElements / pageSize); + // limits defined by TimelineDTO + const totalElements = Math.min(timeline.length, 10); + const totalPages = Math.min(Math.ceil(totalElements / pageSize), 200); - const startIndex = (pageNo - 1) * pageSize; + const startIndex = pageNo * pageSize; const endIndex = startIndex + pageSize; const operationList = _.slice(timeline, startIndex, endIndex); return { lastUpdate: faker.date.recent({ days: 0.05 }), operationList, - pageNo, - pageSize, + pageNo: Math.min(pageNo, 200), + pageSize: Math.min(pageSize, 50), totalElements, totalPages } as TimelineDTO;