Skip to content

Commit

Permalink
removed fspiop protocol specific properties, added invalid fulfilment…
Browse files Browse the repository at this point in the history
… error message
  • Loading branch information
ruirochawork committed Jul 17, 2024
1 parent a48d5a6 commit ffdb00e
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 5 deletions.
25 changes: 25 additions & 0 deletions packages/public-messages-lib/src/transfers-bc/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1250,3 +1250,28 @@ export class TransfersBCOperatorErrorEvent extends DomainErrorEventMsg {
// TODO: NOT IMPLEMENTED
}
}

export type TransferFulfilmentValidationFailedEvtPayload = {
payerFspId: string;
transferId: string;
errorCode: string;
}
export class TransferFulfilmentValidationFailedEvt extends DomainErrorEventMsg {
boundedContextName: string = TRANSFERS_BOUNDED_CONTEXT_NAME;
aggregateId: string;
aggregateName: string = TRANSFERS_AGGREGATE_NAME;
msgKey: string;
msgTopic: string = TransfersBCTopics.DomainEvents;
payload: TransferFulfilmentValidationFailedEvtPayload;

constructor (payload: TransferFulfilmentValidationFailedEvtPayload) {
super();

this.aggregateId = this.msgKey = payload.transferId;
this.payload = payload;
}

validatePayload(): void {
// TODO: NOT IMPLEMENTED
}
}
17 changes: 15 additions & 2 deletions packages/public-messages-lib/src/transfers-bc/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ import { TRANSFERS_BOUNDED_CONTEXT_NAME, TRANSFERS_AGGREGATE_NAME, TransfersBCTo


export type TransferPrepareRequestedEvtPayload = {
requesterFspId: string;
destinationFspId: string;
transferId: string;
payeeFsp: string;
payerFsp: string;
Expand All @@ -44,6 +46,10 @@ export type TransferPrepareRequestedEvtPayload = {
payerIdType: string;
payeeIdType: string;
transferType: string;
extensions: {
key: string;
value: string;
}[];
}

export class TransferPrepareRequestedEvt extends DomainEventMsg {
Expand All @@ -67,9 +73,10 @@ export class TransferPrepareRequestedEvt extends DomainEventMsg {
}

export type TransferFulfilRequestedEvtPayload = {
requesterFspId: string;
destinationFspId: string;
transferId: string;
transferState: "PENDING" | "ACCEPTED" | "PROCESSING" | "COMPLETED" | "REJECTED",
fulfilment: string | null,
completedTimestamp: number,
notifyPayee: boolean;
}
Expand All @@ -95,6 +102,8 @@ export class TransferFulfilRequestedEvt extends DomainEventMsg {
}

export type TransferRejectRequestedEvtPayload = {
requesterFspId: string;
destinationFspId: string;
transferId: string;
errorInformation: {
errorCode: string;
Expand Down Expand Up @@ -178,6 +187,7 @@ export type BulkTransferPrepareRequestedEvtPayload = {
bulkQuoteId: string;
payeeFsp: string;
payerFsp: string;
expiration: number;
individualTransfers: {
transferId: string;
transferAmount: {
Expand All @@ -187,8 +197,11 @@ export type BulkTransferPrepareRequestedEvtPayload = {
payerIdType: string;
payeeIdType: string;
transferType: string;
extensions: {
key: string;
value: string;
}[];
}[];
expiration: number;
}

export class BulkTransferPrepareRequestedEvt extends DomainEventMsg {
Expand Down
3 changes: 0 additions & 3 deletions packages/public-messages-lib/src/transfers-bc/responses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ export class TransferPreparedEvt extends DomainEventMsg {

export type TransferFulfiledEvtPayload = {
transferId: string;
fulfilment: string | null,
completedTimestamp: number,
// for settlements
payeeFspId: string;
Expand Down Expand Up @@ -162,7 +161,6 @@ export class TransferRejectRequestProcessedEvt extends DomainEventMsg {
export type TransferQueryResponseEvtPayload = {
transferId: string;
transferState: string;
fulfilment: string | null;
completedTimestamp: number | null;
}

Expand Down Expand Up @@ -290,7 +288,6 @@ export type BulkTransferQueryResponseEvtPayload = {
bulkTransferState: string;
individualTransferResults: {
transferId: string;
fulfilment: string | null;
errorInformation: {
errorCode: string;
errorDescription: string;
Expand Down

0 comments on commit ffdb00e

Please sign in to comment.