From 3ef5400a759406f86f817c24749367ebeae1a655 Mon Sep 17 00:00:00 2001 From: Rui Rocha Date: Thu, 19 Sep 2024 21:38:46 +0100 Subject: [PATCH] feat: moved extension list to messages payload and changed its extensionList consistency for the switch internal logic --- .../src/account-lookup-bc/requests.ts | 18 +++++- .../src/account-lookup-bc/responses.ts | 16 +++++ .../src/quoting-bc/requests.ts | 40 +++++++++++- .../src/quoting-bc/responses.ts | 62 +++++++++++++++++-- .../src/transfers-bc/requests.ts | 30 ++++++++- .../src/transfers-bc/responses.ts | 46 +++++++++++++- 6 files changed, 200 insertions(+), 12 deletions(-) diff --git a/packages/public-messages-lib/src/account-lookup-bc/requests.ts b/packages/public-messages-lib/src/account-lookup-bc/requests.ts index 049e2b5..714d50e 100644 --- a/packages/public-messages-lib/src/account-lookup-bc/requests.ts +++ b/packages/public-messages-lib/src/account-lookup-bc/requests.ts @@ -34,7 +34,7 @@ "use strict"; -import {DomainEventMsg, MessageInboundProtocol} from "@mojaloop/platform-shared-lib-messaging-types-lib"; +import { DomainEventMsg } from "@mojaloop/platform-shared-lib-messaging-types-lib"; import { ACCOUNT_LOOKUP_BOUNDED_CONTEXT_NAME, ACCOUNT_LOOKUP_AGGREGATE_NAME, AccountLookupBCTopics } from "."; export type ParticipantAssociationRequestReceivedEvtPayload = { @@ -43,6 +43,10 @@ export type ParticipantAssociationRequestReceivedEvtPayload = { partyType: string; partySubType: string | null; currency: string | null; // optional currency, ISO format + extensions: { + key: string; + value: string; + }[]; } @@ -213,6 +217,10 @@ export type PartyInfoAvailableEvtPayload = { partyDoB: Date | null; kycInfo: string | null; supportedCurrencies: string[] | null; + extensions: { + key: string; + value: string; + }[]; } export class PartyInfoAvailableEvt extends DomainEventMsg { @@ -258,6 +266,10 @@ export type PartyRejectedEvtPayload = { errorInformation: { errorCode: string; errorDescription: string; + extensions: { + key: string; + value: string; + }[]; } } @@ -299,6 +311,10 @@ export type ParticipantRejectedEvtPayload = { errorInformation: { errorCode: string; errorDescription: string; + extensions: { + key: string; + value: string; + }[]; } } diff --git a/packages/public-messages-lib/src/account-lookup-bc/responses.ts b/packages/public-messages-lib/src/account-lookup-bc/responses.ts index 9c70111..a928481 100644 --- a/packages/public-messages-lib/src/account-lookup-bc/responses.ts +++ b/packages/public-messages-lib/src/account-lookup-bc/responses.ts @@ -42,6 +42,10 @@ export type ParticipantAssociationCreatedEvtPayload = { partyId: string; partyType: string; partySubType: string | null; + extensions: { + key: string; + value: string; + }[]; } export class ParticipantAssociationCreatedEvt extends DomainEventMsg { @@ -202,6 +206,10 @@ export type PartyQueryResponseEvtPayload = { partyDoB: Date | null; kycInfo: string | null; supportedCurrencies: string[] | null; + extensions: { + key: string; + value: string; + }[]; } export class PartyQueryResponseEvt extends DomainEventMsg { @@ -246,6 +254,10 @@ export type PartyRejectedResponseEvtPayload = { errorInformation: { errorCode: string; errorDescription: string; + extensions: { + key: string; + value: string; + }[]; } } export class PartyRejectedResponseEvt extends DomainEventMsg { @@ -276,6 +288,10 @@ export type ParticipantRejectedResponseEvtPayload = { errorInformation: { errorCode: string; errorDescription: string; + extensions: { + key: string; + value: string; + }[]; } } export class ParticipantRejectedResponseEvt extends DomainEventMsg { diff --git a/packages/public-messages-lib/src/quoting-bc/requests.ts b/packages/public-messages-lib/src/quoting-bc/requests.ts index 55bf8a3..50fbee4 100644 --- a/packages/public-messages-lib/src/quoting-bc/requests.ts +++ b/packages/public-messages-lib/src/quoting-bc/requests.ts @@ -119,6 +119,10 @@ export type QuoteRequestReceivedEvtPayload = { } | null; note: string | null; expiration: string | null; + extensions: { + key: string; + value: string; + }[]; } export class QuoteRequestReceivedEvt extends DomainEventMsg { @@ -196,6 +200,10 @@ export type QuoteResponseReceivedEvtPayload = { latitude: string; longitude: string; } | null; + extensions: { + key: string; + value: string; + }[]; } export class QuoteResponseReceivedEvt extends DomainEventMsg { @@ -268,6 +276,10 @@ export type QuoteRejectedEvtPayload = { errorInformation: { errorCode: string; errorDescription: string; + extensions: { + key: string; + value: string; + }[]; } } @@ -402,6 +414,14 @@ export type BulkQuoteRequestedEvtPayload = { balanceOfPayments: string | null }; note: string | null; + extensions: { + key: string; + value: string; + }[]; + }[]; + extensions: { + key: string; + value: string; }[]; } @@ -484,12 +504,24 @@ export type BulkQuotePendingReceivedEvtPayload = { currency: string; amount: string; } | null; + extensions: { + key: string; + value: string; + }[]; errorInformation: { - errorCode: string, - errorDescription: string, + errorCode: string; + errorDescription: string; + extensions: { + key: string; + value: string; + }[]; } | null; }[]; expiration: string | null; + extensions: { + key: string; + value: string; + }[]; } export class BulkQuotePendingReceivedEvt extends DomainEventMsg { @@ -536,6 +568,10 @@ export type BulkQuoteRejectedEvtPayload = { errorInformation: { errorCode: string; errorDescription: string; + extensions: { + key: string; + value: string; + }[]; } } diff --git a/packages/public-messages-lib/src/quoting-bc/responses.ts b/packages/public-messages-lib/src/quoting-bc/responses.ts index 3e0e284..8cdc5b9 100644 --- a/packages/public-messages-lib/src/quoting-bc/responses.ts +++ b/packages/public-messages-lib/src/quoting-bc/responses.ts @@ -119,6 +119,10 @@ export type QuoteRequestAcceptedEvtPayload = { } | null; note: string | null; expiration: string | null; + extensions: { + key: string; + value: string; + }[]; } export class QuoteRequestAcceptedEvt extends DomainEventMsg { @@ -195,9 +199,13 @@ export type QuoteResponseAcceptedEvtPayload = { latitude: string; longitude: string; } | null; + extensions: { + key: string; + value: string; + }[]; } -export class QuoteResponseAccepted extends DomainEventMsg { +export class QuoteResponseAcceptedEvt extends DomainEventMsg { boundedContextName: string = QUOTING_BOUNDED_CONTEXT_NAME; aggregateId: string; aggregateName: string = QUOTING_AGGREGATE_NAME; @@ -253,6 +261,10 @@ export type QuoteQueryResponseEvtPayload = { latitude: string; longitude: string; } | null; + extensions: { + key: string; + value: string; + }[]; } export class QuoteQueryResponseEvt extends DomainEventMsg { @@ -292,6 +304,10 @@ export type QuoteRejectedResponseEvtPayload = { errorInformation: { errorCode: string; errorDescription: string; + extensions: { + key: string; + value: string; + }[]; } } export class QuoteRejectedResponseEvt extends DomainEventMsg { @@ -389,6 +405,14 @@ export type BulkQuoteReceivedEvtPayload = { balanceOfPayments: string | null }; note: string | null; + extensions: { + key: string; + value: string; + }[]; + }[]; + extensions: { + key: string; + value: string; }[]; } @@ -469,12 +493,24 @@ export type BulkQuoteAcceptedEvtPayload = { currency: string; amount: string; } | null; + extensions: { + key: string; + value: string; + }[]; errorInformation: { - errorCode: string, - errorDescription: string, + errorCode: string; + errorDescription: string; + extensions: { + key: string; + value: string; + }[]; } | null; }[]; expiration: string | null; + extensions: { + key: string; + value: string; + }[]; } export class BulkQuoteAcceptedEvt extends DomainEventMsg { @@ -554,12 +590,24 @@ export type BulkQuoteQueryResponseEvtPayload = { currency: string; amount: string; } | null; + extensions: { + key: string; + value: string; + }[]; errorInformation: { - errorCode: string, - errorDescription: string, + errorCode: string; + errorDescription: string; + extensions: { + key: string; + value: string; + }[]; } | null; }[]; expiration: string | null; + extensions: { + key: string; + value: string; + }[]; } export class BulkQuoteQueryResponseEvt extends DomainEventMsg { @@ -600,6 +648,10 @@ export type BulkQuoteRejectedResponseEvtPayload = { errorInformation: { errorCode: string; errorDescription: string; + extensions: { + key: string; + value: string; + }[]; } } export class BulkQuoteRejectedResponseEvt extends DomainEventMsg { diff --git a/packages/public-messages-lib/src/transfers-bc/requests.ts b/packages/public-messages-lib/src/transfers-bc/requests.ts index d9d171c..772c64a 100644 --- a/packages/public-messages-lib/src/transfers-bc/requests.ts +++ b/packages/public-messages-lib/src/transfers-bc/requests.ts @@ -79,6 +79,10 @@ export type TransferFulfilRequestedEvtPayload = { transferState: "PENDING" | "ACCEPTED" | "PROCESSING" | "COMPLETED" | "REJECTED", completedTimestamp: number, notifyPayee: boolean; + extensions: { + key: string; + value: string; + }[]; } export class TransferFulfilRequestedEvt extends DomainEventMsg { @@ -108,6 +112,10 @@ export type TransferRejectRequestedEvtPayload = { errorInformation: { errorCode: string; errorDescription: string; + extensions: { + key: string; + value: string; + }[]; } } @@ -204,6 +212,10 @@ export type BulkTransferPrepareRequestedEvtPayload = { value: string; }[]; }[]; + extensions: { + key: string; + value: string; + }[]; } export class BulkTransferPrepareRequestedEvt extends DomainEventMsg { @@ -234,10 +246,22 @@ export type BulkTransferFulfilRequestedEvtPayload = { individualTransferResults: { transferId: string; fulfilment: string | null; + extensions: { + key: string; + value: string; + }[]; errorInformation: { errorCode: string; errorDescription: string; - } + extensions: { + key: string; + value: string; + }[]; + } | null; + }[]; + extensions: { + key: string; + value: string; }[]; } @@ -267,6 +291,10 @@ export type BulkTransferRejectRequestedEvtPayload = { errorInformation: { errorCode: string; errorDescription: string; + extensions: { + key: string; + value: string; + }[]; } } diff --git a/packages/public-messages-lib/src/transfers-bc/responses.ts b/packages/public-messages-lib/src/transfers-bc/responses.ts index 591d5d0..baf94c6 100644 --- a/packages/public-messages-lib/src/transfers-bc/responses.ts +++ b/packages/public-messages-lib/src/transfers-bc/responses.ts @@ -43,6 +43,10 @@ export type TransferPreparedEvtPayload = { expiration: number; settlementModel: string; preparedAt: number; + extensions: { + key: string; + value: string; + }[]; } export class TransferPreparedEvt extends DomainEventMsg { @@ -76,6 +80,10 @@ export type TransferFulfiledEvtPayload = { settlementModel: string; notifyPayee: boolean; fulfiledAt: number; + extensions: { + key: string; + value: string; + }[]; } export class TransferFulfiledEvt extends DomainEventMsg { @@ -135,6 +143,10 @@ export type TransferRejectRequestProcessedEvtPayload = { errorInformation: { errorCode: string; errorDescription: string; + extensions: { + key: string; + value: string; + }[]; } } @@ -162,6 +174,10 @@ export type TransferQueryResponseEvtPayload = { transferId: string; transferState: string; completedTimestamp: number | null; + extensions: { + key: string; + value: string; + }[]; } export class TransferQueryResponseEvt extends DomainEventMsg { @@ -195,6 +211,10 @@ export type BulkTransferPreparedEvtPayload = { amount: string; currencyCode: string; }[]; + extensions: { + key: string; + value: string; + }[]; } export class BulkTransferPreparedEvt extends DomainEventMsg { @@ -225,11 +245,23 @@ export type BulkTransferFulfiledEvtPayload = { individualTransferResults: { transferId: string; fulfilment: string | null; - errorInformation: { + extensions: { + key: string; + value: string; + }[]; + errorInformation: { errorCode: string; errorDescription: string; - } + extensions: { + key: string; + value: string; + }[]; + } | null; }[]; + extensions: { + key: string; + value: string; + }[]; } export class BulkTransferFulfiledEvt extends DomainEventMsg { @@ -259,6 +291,10 @@ export type BulkTransferRejectRequestProcessedEvtPayload = { errorInformation: { errorCode: string; errorDescription: string; + extensions: { + key: string; + value: string; + }[]; } } @@ -291,7 +327,11 @@ export type BulkTransferQueryResponseEvtPayload = { errorInformation: { errorCode: string; errorDescription: string; - } + extensions: { + key: string; + value: string; + }[]; + } | null; }[]; }