Skip to content

Commit

Permalink
feat(mojaloop/3018): [SDK-Scheme-Adapter] TransactionId is being used…
Browse files Browse the repository at this point in the history
… instead of TransferId

feat(mojaloop/3018): [SDK-Scheme-Adapter] TransactionId is being used instead of TransferId - mojaloop/project#3018
- bumped api-snippets to v17.0.0-snapshot.0 --> TODO: Upgrade this to final version once PR (mojaloop/api-snippets#148) has been merged
- updated applicable events to include the transferId
- updated aggregate handlers to correctly map the transferId instead of the transactionId
- updated TTK API definitions for SDK Outbound API specifications (copied from API-Snippets)
- updated TTK Test Case "bulk_happy_path_dynamic" to correctly use the transferId instead of the transactionId

chore: improvements to docker-compose for debugging
- added "start:debug" to each of the modules to start with debugging enabled
- updated docker-compose to use the "start:debug" command to be able to attach and debug issues
  • Loading branch information
mdebarros committed Nov 11, 2022
1 parent 824d45d commit 0c27bbb
Show file tree
Hide file tree
Showing 17 changed files with 4,303 additions and 1,692 deletions.
3 changes: 2 additions & 1 deletion modules/api-svc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
},
"scripts": {
"start": "node src/index.js",
"start:debug": "node --inspect=0.0.0.0:9229 src/index.js",
"build": "yarn run build:openapi",
"build:openapi": "yarn run build:openapi:inbound",
"build:openapi:inbound": "openapi bundle --output ./src/InboundServer/api.yaml --ext yaml ./src/InboundServer/api_template.yaml",
Expand Down Expand Up @@ -60,7 +61,7 @@
},
"dependencies": {
"@koa/cors": "^4.0.0",
"@mojaloop/api-snippets": "^16.0.6",
"@mojaloop/api-snippets": "17.0.0-snapshot.0",
"@mojaloop/central-services-error-handling": "^12.0.5",
"@mojaloop/central-services-logger": "^11.0.1",
"@mojaloop/central-services-metrics": "^12.0.5",
Expand Down
4 changes: 3 additions & 1 deletion modules/outbound-command-event-handler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
],
"scripts": {
"start": "yarn run service",
"start:debug": "yarn run service:debug",
"start:dev": "ts-node src/application/index.ts",
"service": "node dist/application/index.js",
"service:debug": "node --inspect=0.0.0.0:9229 dist/application/index.js",
"build": "tsc && yarn run copy-files",
"watch": "tsc -w",
"dev": "nodemon",
Expand All @@ -39,7 +41,7 @@
"snapshot": "standard-version --no-verify --skip.changelog --prerelease snapshot --releaseCommitMessageFormat 'chore(snapshot): {{currentTag}}'"
},
"dependencies": {
"@mojaloop/api-snippets": "^16.0.6",
"@mojaloop/api-snippets": "17.0.0-snapshot.0",
"@mojaloop/central-services-shared": "^17.3.1",
"@mojaloop/logging-bc-client-lib": "^0.1.16",
"@mojaloop/logging-bc-public-types-lib": "^0.1.13",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ export async function handleProcessBulkQuotesCallbackCmdEvt(

individualTransferResults.push({
homeTransactionId: individualTransfer.request.homeTransactionId,
transferId: individualTransfer.id,
transactionId: individualTransfer.transactionId,
quoteResponse: individualTransfer.quoteResponse,
lastError: individualTransfer.lastError && {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import { ILogger } from '@mojaloop/logging-bc-public-types-lib';
import {
CommandEvent,
IndividualTransferEntity,
IndividualTransferInternalState,
ProcessPartyInfoCallbackCmdEvt,
PartyInfoCallbackProcessedDmEvt,
Expand Down Expand Up @@ -150,7 +149,8 @@ export async function handleProcessPartyInfoCallbackCmdEvt(
// set. `transactionId` and `homeTransaction` still need to be set.
individualTransferResults.push({
homeTransactionId: individualTransferData.request.homeTransactionId,
transactionId: individualTransferData.id,
transferId: individualTransferData.id,
transactionId: individualTransferData.transactionId, // NOTE: This is not available at this time as batches have not been generated yet.
to: individualTransferData.partyResponse?.party,
lastError,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ export async function handleProcessSDKOutboundBulkAcceptPartyInfoCmdEvt(
try {
// TODO: Confirm the field name transactionId in the individualTransfer from the message
individualTransfer =
await bulkTransactionAgg.getIndividualTransferById(individualTransferFromMessage.transactionId);
await bulkTransactionAgg.getIndividualTransferById(individualTransferFromMessage.transferId);
} catch {
logger.warn(`Can not find the individual transfer with id ${individualTransferFromMessage.transactionId} in bulk transaction`);
logger.warn(`Can not find the individual transfer with id ${individualTransferFromMessage.transferId} in bulk transaction`);
continue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ export async function handleProcessSDKOutboundBulkAcceptQuoteCmdEvt(
try {
// TODO: Confirm the field name transactionId in the individualTransfer from the message
individualTransfer =
await bulkTransactionAgg.getIndividualTransferById(individualTransferFromMessage.transactionId);
await bulkTransactionAgg.getIndividualTransferById(individualTransferFromMessage.transferId);
} catch {
logger.warn(`Can not find the individual transfer with id ${individualTransferFromMessage.transactionId} in bulk transaction`);
logger.warn(`Can not find the individual transfer with id ${individualTransferFromMessage.transferId} in bulk transaction`);
continue;
}

Expand Down
4 changes: 3 additions & 1 deletion modules/outbound-domain-event-handler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
],
"scripts": {
"start": "yarn run service",
"start:debug": "yarn run service:debug",
"start:dev": "ts-node src/application/index.ts",
"service": "node dist/application/index.js",
"service:debug": "node --inspect=0.0.0.0:9229 dist/application/index.js",
"build": "tsc && yarn run copy-files",
"watch": "tsc -w",
"dev": "nodemon",
Expand All @@ -39,7 +41,7 @@
"snapshot": "standard-version --no-verify --skip.changelog --prerelease snapshot --releaseCommitMessageFormat 'chore(snapshot): {{currentTag}}'"
},
"dependencies": {
"@mojaloop/api-snippets": "^16.0.6",
"@mojaloop/api-snippets": "17.0.0-snapshot.0",
"@mojaloop/logging-bc-client-lib": "^0.1.16",
"@mojaloop/logging-bc-public-types-lib": "^0.1.13",
"@mojaloop/sdk-scheme-adapter-private-shared-lib": "workspace:^",
Expand Down
2 changes: 1 addition & 1 deletion modules/private-shared-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"snapshot": "standard-version --no-verify --skip.changelog --prerelease snapshot --releaseCommitMessageFormat 'chore(snapshot): {{currentTag}}'"
},
"dependencies": {
"@mojaloop/api-snippets": "^16.0.6",
"@mojaloop/api-snippets": "17.0.0-snapshot.0",
"@mojaloop/central-services-shared": "^17.3.1",
"@mojaloop/logging-bc-public-types-lib": "^0.1.13",
"@mojaloop/platform-shared-lib-messaging-types-lib": "^0.2.18",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { IndividualTransferError } from '@module-domain';

export type CoreConnectorBulkAcceptPartyInfoRequestIndividualTransferResult = {
homeTransactionId: SDKSchemeAdapter.V2_0_0.Outbound.Types.bulkTransactionIndividualTransfer['homeTransactionId'];
transferId: string;
transactionId: string;
to?: SDKSchemeAdapter.V2_0_0.Outbound.Types.Party;
lastError: IndividualTransferError
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import { IndividualTransferError } from '@module-domain';
// For now we are defining these types here.
export type CoreConnectorBulkAcceptQuoteRequestIndividualTransferResult = {
homeTransactionId: SDKSchemeAdapter.V2_0_0.Outbound.Types.bulkTransactionIndividualTransfer['homeTransactionId'];
transferId: string,
transactionId: string;
quoteResponse?: SDKSchemeAdapter.V2_0_0.Outbound.Types.individualQuoteResult;
lastError: IndividualTransferError
Expand Down
Loading

0 comments on commit 0c27bbb

Please sign in to comment.