Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: #2103 fix subid functionality in POST quotes request #264

Merged
merged 4 commits into from
May 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions audit-resolve.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"decisions": {
"1500|@mojaloop/central-services-shared>widdershins>yargs>yargs-parser": {
"decision": "ignore",
"madeAt": 1613503685058,
"expiresAt": 1616095674581
"decision": "postpone",
"madeAt": 1620065930143
}
},
"rules": {},
Expand Down
29 changes: 24 additions & 5 deletions docker/central-ledger/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@
"API": {
"DISABLED": false
},
"CRON": {
"DISABLED": false,
"TIMEXP": "*/10 * * * * *",
"TIMEZONE": "UTC"
},
"TIMEOUT": {
"DISABLED": false,
"TIMEXP": "*/15 * * * * *",
Expand Down Expand Up @@ -89,6 +84,7 @@
"MAX_BYTE_SIZE": 10000000,
"EXPIRES_IN_MS": 1000
},
"API_DOC_ENDPOINTS_ENABLED": true,
"KAFKA": {
"TOPIC_TEMPLATES": {
"PARTICIPANT_TOPIC_TEMPLATE": {
Expand Down Expand Up @@ -170,6 +166,29 @@
"auto.offset.reset": "earliest"
}
}
},
"GET": {
"config": {
"options": {
"mode": 2,
"batchSize": 1,
"pollFrequency": 10,
"recursiveTimeout": 100,
"messageCharset": "utf8",
"messageAsJSON": true,
"sync": true,
"consumeTimeout": 1000
},
"rdkafkaConf": {
"client.id": "cl-con-bulk-get",
"group.id": "cl-group-bulk-get",
"metadata.broker.list": "kafka:9092",
"socket.keepalive.enable": true
},
"topicConf": {
"auto.offset.reset": "earliest"
}
}
}
},
"TRANSFER": {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "quoting-service",
"description": "Quoting Service hosted by a scheme",
"license": "Apache-2.0",
"version": "12.0.0",
"version": "12.0.1",
"author": "ModusBox",
"contributors": [
"Georgi Georgiev <georgi.georgiev@modusbox.com>",
Expand Down
8 changes: 2 additions & 6 deletions src/data/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -470,13 +470,9 @@ class Database {
refs.transferParticipantRoleTypeId = enumVals[3]
refs.ledgerEntryTypeId = enumVals[4]

// todo: possibly push this subIdType lookup onto the array that gets awaited async...
// otherwise requests that have a subIdType will be a little slower due to the extra wait time
// TODO: this will not work as the partyIdentifierType table only caters for the 8 main partyTypes
// discuss adding a partyIdSubType database table to perform this lookup against
if (party.partyIdInfo.partySubIdOrType) {
// TODO: review method signature
refs.partySubIdOrTypeId = await this.getPartyIdentifierType(party.partyIdInfo.partySubIdOrType)
// subIdOrTypeId value need not be one in the partyIdentifierType list as per the specification.
refs.partySubIdOrTypeId = party.partyIdInfo.partySubIdOrType
}

// insert a new quote party
Expand Down
3 changes: 1 addition & 2 deletions test/unit/data/database.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,6 @@ describe('/database', () => {
}
database.getPartyIdentifierType = jest.fn()
.mockResolvedValueOnce('testPartyIdentifierTypeId')
.mockResolvedValueOnce('testPartySubIdOrTypeId')
const mockList = mockKnexBuilder(
mockKnex,
['12345'],
Expand All @@ -1143,7 +1142,7 @@ describe('/database', () => {
partyTypeId: 'testPartyTypeId',
partyIdentifierTypeId: 'testPartyIdentifierTypeId',
partyIdentifierValue: 'testPartyIdentifier',
partySubIdOrTypeId: 'testPartySubIdOrTypeId',
partySubIdOrTypeId: 'testSubId',
fspId: 'payeeFsp',
participantId: 'testParticipantId',
merchantClassificationCode: '0',
Expand Down