diff --git a/package.json b/package.json index f48796ba..bef742d6 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "api_cdc": "https://raw.githubusercontent.com/pagopa/io-app/master/assets/CdcSwagger.yml", "api_fci": "https://raw.githubusercontent.com/pagopa/io-backend/v14.3.0-RELEASE/api_io_sign.yaml", "api_pn": "https://raw.githubusercontent.com/pagopa/io-backend/v14.3.0-RELEASE/api_pn.yaml", - "api_idpay": "https://raw.githubusercontent.com/pagopa/cstar-infrastructure/v6.5.0/src/domains/idpay-app/api/idpay_appio_full/openapi.appio.full.yml", + "api_idpay": "https://raw.githubusercontent.com/pagopa/cstar-infrastructure/v8.25.1/src/domains/idpay-app/api/idpay_appio_full/openapi.appio.full.yml", "api_fast_login": "https://raw.githubusercontent.com/pagopa/io-auth-n-identity-domain/io-session-manager@1.0.0/apps/io-session-manager/api/fast-login.yaml", "api_trial_system": "https://raw.githubusercontent.com/pagopa/io-backend/v14.3.0-RELEASE/api_trial_system.yaml", "api_pagopa_walletv3": "https://raw.githubusercontent.com/pagopa/pagopa-infra/v1.64.0/src/domains/pay-wallet-app/api/io-payment-wallet/v1/_openapi.json.tpl", diff --git a/src/payloads/features/idpay/get-timeline-detail.ts b/src/payloads/features/idpay/get-timeline-detail.ts index f3a89509..7b3858b9 100644 --- a/src/payloads/features/idpay/get-timeline-detail.ts +++ b/src/payloads/features/idpay/get-timeline-detail.ts @@ -24,7 +24,7 @@ const generateRandomOperationDetailDTO = ( case "TRANSACTION": return { ...operation, - accrued: operation.accrued || faker.datatype.number(100), + accruedCents: operation.accruedCents || faker.datatype.number(10000), idTrxAcquirer: ulid(), idTrxIssuer: ulid() }; diff --git a/src/persistence/idpay.ts b/src/persistence/idpay.ts index af2597f9..9cb9e450 100644 --- a/src/persistence/idpay.ts +++ b/src/persistence/idpay.ts @@ -65,19 +65,19 @@ const { idPay: walletConfig } = ioDevServerConfig.wallet; const pagoPaWallet: WalletV2 = getWalletV2()[0]; const generateRandomInitiativeDTO = (): InitiativeDTO => { - const amount = faker.datatype.number({ min: 50, max: 200, precision: 10 }); - const accrued = faker.datatype.number({ max: 200, precision: 10 }); - const refunded = faker.datatype.number({ max: accrued, precision: 10 }); + const amountCents = faker.datatype.number({ min: 5000, max: 20000 }); + const accruedCents = faker.datatype.number({ max: 20000 }); + const refundedCents = faker.datatype.number({ max: accruedCents }); return { initiativeId: ulid(), initiativeName: faker.company.name(), status: getRandomEnumValue(InitiativeStatus), endDate: faker.date.future(1), - amount, - accrued, + amountCents, + accruedCents, initiativeRewardType: getRandomEnumValue(InitiativeRewardTypeEnum), - refunded, + refundedCents, lastCounterUpdate: faker.date.recent(1), iban: faker.helpers.arrayElement(ibanList)?.iban || "", nInstr: 1, @@ -107,8 +107,8 @@ const generateRandomTransactionOperationDTO = ( operationType: getRandomEnumValue(TransactionOperationTypeEnum), operationDate: new Date(), operationId: ulid(), - accrued: faker.datatype.number({ min: 5, max: 25 }), - amount: faker.datatype.number({ min: 50, max: 100 }), + accruedCents: faker.datatype.number({ min: 500, max: 2500 }), + amountCents: faker.datatype.number({ min: 5000, max: 10000 }), brand, circuitType: "01", brandLogo, @@ -128,7 +128,7 @@ const generateRandomRefundOperationDTO = ( operationDate: new Date(), operationId: ulid(), eventId: ulid(), - amount: faker.datatype.number({ min: 5, max: 100 }), + amountCents: faker.datatype.number({ min: 500, max: 10000 }), ...withInfo }); @@ -525,8 +525,8 @@ range(0, walletConfig.discountCount).forEach(() => { status: InitiativeStatus.REFUNDABLE, iban: undefined, nInstr: 0, - accrued: 0, - refunded: 0 + accruedCents: 0, + refundedCents: 0 }; const { initiativeId } = initiative; diff --git a/src/routers/features/idpay/payment.ts b/src/routers/features/idpay/payment.ts index 44fc0727..cbbe69a1 100644 --- a/src/routers/features/idpay/payment.ts +++ b/src/routers/features/idpay/payment.ts @@ -16,8 +16,8 @@ import { addIdPayHandler } from "./router"; const generateRandomAuthPaymentResponseDTO = (): AuthPaymentResponseDTO => { const amount = faker.datatype.number({ - min: 100, - max: 10000 + min: 10000, + max: 1000000 }); return { @@ -25,12 +25,12 @@ const generateRandomAuthPaymentResponseDTO = (): AuthPaymentResponseDTO => { initiativeId: Object.values(initiatives)[0]?.initiativeId ?? ulid(), status: getRandomEnumValue(PaymentStatusEnum), trxCode: faker.datatype.string(), - reward: amount, + rewardCents: amount, amountCents: amount, businessName: faker.commerce.productName(), initiativeName: faker.company.name(), trxDate: faker.date.recent(0), - residualBudget: faker.datatype.number({ + residualBudgetCents: faker.datatype.number({ min: 1000, max: 20000 })