Skip to content

Commit

Permalink
Merge pull request #50 from mojaloop/feature/moving-extension-list-to…
Browse files Browse the repository at this point in the history
…-main-payload-logic

feat: moved extension list to messages payload and changed its extensionList consistency for the switch internal logic
  • Loading branch information
ruirochawork authored Sep 20, 2024
2 parents a899a85 + 3ef5400 commit a676990
Show file tree
Hide file tree
Showing 6 changed files with 200 additions and 12 deletions.
18 changes: 17 additions & 1 deletion packages/public-messages-lib/src/account-lookup-bc/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -43,6 +43,10 @@ export type ParticipantAssociationRequestReceivedEvtPayload = {
partyType: string;
partySubType: string | null;
currency: string | null; // optional currency, ISO format
extensions: {
key: string;
value: string;
}[];
}


Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -258,6 +266,10 @@ export type PartyRejectedEvtPayload = {
errorInformation: {
errorCode: string;
errorDescription: string;
extensions: {
key: string;
value: string;
}[];
}
}

Expand Down Expand Up @@ -299,6 +311,10 @@ export type ParticipantRejectedEvtPayload = {
errorInformation: {
errorCode: string;
errorDescription: string;
extensions: {
key: string;
value: string;
}[];
}
}

Expand Down
16 changes: 16 additions & 0 deletions packages/public-messages-lib/src/account-lookup-bc/responses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ export type ParticipantAssociationCreatedEvtPayload = {
partyId: string;
partyType: string;
partySubType: string | null;
extensions: {
key: string;
value: string;
}[];
}

export class ParticipantAssociationCreatedEvt extends DomainEventMsg {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -246,6 +254,10 @@ export type PartyRejectedResponseEvtPayload = {
errorInformation: {
errorCode: string;
errorDescription: string;
extensions: {
key: string;
value: string;
}[];
}
}
export class PartyRejectedResponseEvt extends DomainEventMsg {
Expand Down Expand Up @@ -276,6 +288,10 @@ export type ParticipantRejectedResponseEvtPayload = {
errorInformation: {
errorCode: string;
errorDescription: string;
extensions: {
key: string;
value: string;
}[];
}
}
export class ParticipantRejectedResponseEvt extends DomainEventMsg {
Expand Down
40 changes: 38 additions & 2 deletions packages/public-messages-lib/src/quoting-bc/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ export type QuoteRequestReceivedEvtPayload = {
} | null;
note: string | null;
expiration: string | null;
extensions: {
key: string;
value: string;
}[];
}

export class QuoteRequestReceivedEvt extends DomainEventMsg {
Expand Down Expand Up @@ -196,6 +200,10 @@ export type QuoteResponseReceivedEvtPayload = {
latitude: string;
longitude: string;
} | null;
extensions: {
key: string;
value: string;
}[];
}

export class QuoteResponseReceivedEvt extends DomainEventMsg {
Expand Down Expand Up @@ -268,6 +276,10 @@ export type QuoteRejectedEvtPayload = {
errorInformation: {
errorCode: string;
errorDescription: string;
extensions: {
key: string;
value: string;
}[];
}
}

Expand Down Expand Up @@ -402,6 +414,14 @@ export type BulkQuoteRequestedEvtPayload = {
balanceOfPayments: string | null
};
note: string | null;
extensions: {
key: string;
value: string;
}[];
}[];
extensions: {
key: string;
value: string;
}[];
}

Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -536,6 +568,10 @@ export type BulkQuoteRejectedEvtPayload = {
errorInformation: {
errorCode: string;
errorDescription: string;
extensions: {
key: string;
value: string;
}[];
}
}

Expand Down
62 changes: 57 additions & 5 deletions packages/public-messages-lib/src/quoting-bc/responses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ export type QuoteRequestAcceptedEvtPayload = {
} | null;
note: string | null;
expiration: string | null;
extensions: {
key: string;
value: string;
}[];
}

export class QuoteRequestAcceptedEvt extends DomainEventMsg {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -253,6 +261,10 @@ export type QuoteQueryResponseEvtPayload = {
latitude: string;
longitude: string;
} | null;
extensions: {
key: string;
value: string;
}[];
}

export class QuoteQueryResponseEvt extends DomainEventMsg {
Expand Down Expand Up @@ -292,6 +304,10 @@ export type QuoteRejectedResponseEvtPayload = {
errorInformation: {
errorCode: string;
errorDescription: string;
extensions: {
key: string;
value: string;
}[];
}
}
export class QuoteRejectedResponseEvt extends DomainEventMsg {
Expand Down Expand Up @@ -389,6 +405,14 @@ export type BulkQuoteReceivedEvtPayload = {
balanceOfPayments: string | null
};
note: string | null;
extensions: {
key: string;
value: string;
}[];
}[];
extensions: {
key: string;
value: string;
}[];
}

Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -600,6 +648,10 @@ export type BulkQuoteRejectedResponseEvtPayload = {
errorInformation: {
errorCode: string;
errorDescription: string;
extensions: {
key: string;
value: string;
}[];
}
}
export class BulkQuoteRejectedResponseEvt extends DomainEventMsg {
Expand Down
30 changes: 29 additions & 1 deletion packages/public-messages-lib/src/transfers-bc/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -108,6 +112,10 @@ export type TransferRejectRequestedEvtPayload = {
errorInformation: {
errorCode: string;
errorDescription: string;
extensions: {
key: string;
value: string;
}[];
}
}

Expand Down Expand Up @@ -204,6 +212,10 @@ export type BulkTransferPrepareRequestedEvtPayload = {
value: string;
}[];
}[];
extensions: {
key: string;
value: string;
}[];
}

export class BulkTransferPrepareRequestedEvt extends DomainEventMsg {
Expand Down Expand Up @@ -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;
}[];
}

Expand Down Expand Up @@ -267,6 +291,10 @@ export type BulkTransferRejectRequestedEvtPayload = {
errorInformation: {
errorCode: string;
errorDescription: string;
extensions: {
key: string;
value: string;
}[];
}
}

Expand Down
Loading

0 comments on commit a676990

Please sign in to comment.