Skip to content

Commit

Permalink
Merge pull request #44 from mojaloop/feat/refactoring-required-only-e…
Browse files Browse the repository at this point in the history
…vent-fields

feat/refactoring required only event fields
  • Loading branch information
ruirochawork authored Jul 17, 2024
2 parents 34894a6 + ffdb00e commit 661c171
Show file tree
Hide file tree
Showing 8 changed files with 9,453 additions and 329 deletions.
9,397 changes: 9,397 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

18 changes: 0 additions & 18 deletions packages/public-messages-lib/src/account-lookup-bc/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,6 @@ export type PartyInfoAvailableEvtPayload = {
middleName: string;
lastName: string;
partyDoB: Date | null;
extensionList: {
extension: {
key: string;
value: string;
}[]
} | null;
kycInfo: string | null;
supportedCurrencies: string[] | null;
}
Expand Down Expand Up @@ -263,12 +257,6 @@ export type PartyRejectedEvtPayload = {
errorInformation: {
errorCode: string;
errorDescription: string;
extensionList: {
extension: {
key: string;
value: string;
}[]
} | null;
}
}

Expand Down Expand Up @@ -310,12 +298,6 @@ export type ParticipantRejectedEvtPayload = {
errorInformation: {
errorCode: string;
errorDescription: string;
extensionList: {
extension: {
key: string;
value: string;
}[]
} | null;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,6 @@ export type PartyQueryResponseEvtPayload = {
middleName: string;
lastName: string;
partyDoB: Date | null;
extensionList: {
extension: {
key: string;
value: string;
}[]
} | null;
kycInfo: string | null;
supportedCurrencies: string[] | null;
}
Expand Down
82 changes: 15 additions & 67 deletions packages/public-messages-lib/src/quoting-bc/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,6 @@ export type QuoteRequestReceivedEvtPayload = {
} | null;
note: string | null;
expiration: string | null;
extensionList: {
extension: {
key: string;
value: string;
}[]
} | null;
}

export class QuoteRequestReceivedEvt extends DomainEventMsg {
Expand Down Expand Up @@ -177,14 +171,14 @@ export class QuoteRequestReceivedEvt extends DomainEventMsg {
}

export type QuoteResponseReceivedEvtPayload = {
requesterFspId: string;
destinationFspId: string | null;
quoteId: string;
transferAmount: {
currency: string;
amount: string;
};
expiration: string;
ilpPacket: string;
condition: string;
payeeReceiveAmount: {
currency: string;
amount: string;
Expand All @@ -201,12 +195,6 @@ export type QuoteResponseReceivedEvtPayload = {
latitude: string;
longitude: string;
} | null;
extensionList: {
extension: {
key: string;
value: string;
}[]
} | null;
}

export class QuoteResponseReceivedEvt extends DomainEventMsg {
Expand All @@ -225,7 +213,7 @@ export class QuoteResponseReceivedEvt extends DomainEventMsg {
}

validatePayload (): void {
const { quoteId, transferAmount, expiration, ilpPacket, condition } = this.payload;
const { quoteId, transferAmount, expiration } = this.payload;

if (!quoteId) {
throw new Error("quoteId is required.");
Expand All @@ -238,18 +226,12 @@ export class QuoteResponseReceivedEvt extends DomainEventMsg {
if (!expiration) {
throw new Error("expiration is required.");
}

if (!ilpPacket) {
throw new Error("ilpPacket is required.");
}

if (!condition) {
throw new Error("condition is required.");
}
}
}

export type QuoteQueryReceivedEvtPayload = {
requesterFspId: string;
destinationFspId: string | null;
quoteId: string;
}

Expand Down Expand Up @@ -279,16 +261,12 @@ export class QuoteQueryReceivedEvt extends DomainEventMsg {
}

export type QuoteRejectedEvtPayload = {
requesterFspId: string;
destinationFspId: string | null;
quoteId: string,
errorInformation: {
errorCode: string;
errorDescription: string;
extensionList: {
extension: {
key: string;
value: string;
}[]
} | null;
}
}

Expand Down Expand Up @@ -319,6 +297,8 @@ export class QuoteRejectedEvt extends DomainEventMsg {


export type BulkQuoteQueryReceivedEvtPayload = {
requesterFspId: string;
destinationFspId: string | null;
bulkQuoteId: string;
}

Expand Down Expand Up @@ -348,6 +328,8 @@ export class BulkQuoteQueryReceivedEvt extends DomainEventMsg {
}

export type BulkQuoteRequestedEvtPayload = {
requesterFspId: string;
destinationFspId: string | null;
bulkQuoteId: string;
payer: {
partyIdInfo: {
Expand Down Expand Up @@ -419,19 +401,7 @@ export type BulkQuoteRequestedEvtPayload = {
balanceOfPayments: string | null
};
note: string | null;
extensionList: {
extension: {
key: string;
value: string;
}[]
} | null;
}[];
extensionList: {
extension: {
key: string;
value: string;
}[]
} | null;
}

export class BulkQuoteRequestedEvt extends DomainEventMsg {
Expand Down Expand Up @@ -472,6 +442,8 @@ export class BulkQuoteRequestedEvt extends DomainEventMsg {
}

export type BulkQuotePendingReceivedEvtPayload = {
requesterFspId: string;
destinationFspId: string | null;
bulkQuoteId: string;
individualQuoteResults: {
quoteId: string;
Expand Down Expand Up @@ -511,32 +483,12 @@ export type BulkQuotePendingReceivedEvtPayload = {
currency: string;
amount: string;
} | null;
ilpPacket: string;
condition: string;
errorInformation: {
errorCode: string,
errorDescription: string,
extensionList: {
extension: {
key: string;
value: string;
}[]
};
} | null;
extensionList: {
extension: {
key: string;
value: string;
}[]
} | null;
}[];
expiration: string | null;
extensionList: {
extension: {
key: string;
value: string;
}[]
} | null;
}

export class BulkQuotePendingReceivedEvt extends DomainEventMsg {
Expand Down Expand Up @@ -577,16 +529,12 @@ export class BulkQuotePendingReceivedEvt extends DomainEventMsg {
}

export type BulkQuoteRejectedEvtPayload = {
requesterFspId: string;
destinationFspId: string | null;
bulkQuoteId: string,
errorInformation: {
errorCode: string;
errorDescription: string;
extensionList: {
extension: {
key: string;
value: string;
}[]
} | null;
}
}

Expand Down
Loading

0 comments on commit 661c171

Please sign in to comment.