diff --git a/docker-compose.yml b/docker-compose.yml index c40f1391..3ab02a7c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -90,7 +90,6 @@ services: volumes: # override the default values with our own - this is because the KAFKA_HOST env variable is ignored for some reason - ./docker/ml-api-adapter/default.json:/opt/app/config/default.json - # TODO: we should be able to remove this - I think the image command is broken command: - "node" - "src/api/index.js" diff --git a/scripts/_wait4_all.js b/scripts/_wait4_all.js index b608d33a..f0e81a12 100644 --- a/scripts/_wait4_all.js +++ b/scripts/_wait4_all.js @@ -88,8 +88,6 @@ async function updateServiceStatus (waitingMap) { const startingServices = getServicesForStatus(waitingMap, 'starting') Promise.all(startingServices.map(async serviceName => { - // TODO: This info may be useful in future! - // const currentStatus = waitingMap[serviceName] const progress = await getProgress(serviceName) waitingMap[serviceName] = progress })) diff --git a/src/constants.js b/src/constants.js index f9b85bab..51805cb0 100644 --- a/src/constants.js +++ b/src/constants.js @@ -13,7 +13,6 @@ const HEADERS = Object.freeze({ fspiopSignature: 'FSPIOP-Signature', fspiopUri: 'FSPIOP-URI' }) -// todo: think, if it's better to use all headers keys in lowercase const ERROR_MESSAGES = { CALLBACK_UNSUCCESSFUL_HTTP_RESPONSE: 'Got non-success response sending error callback', diff --git a/src/lib/http.js b/src/lib/http.js index ea0ae2fe..60a3dc58 100644 --- a/src/lib/http.js +++ b/src/lib/http.js @@ -44,9 +44,6 @@ const { getStackOrInspect } = require('../lib/util') axios.defaults.httpAgent = new http.Agent({ keepAlive: true }) axios.defaults.httpAgent.toJSON = () => ({}) -// TODO: where httpRequest is called, there's a pretty common pattern of obtaining an endpoint from -// the database, specialising a template string with that endpoint, then calling httpRequest. Is -// there common functionality in these places than can reasonably be factored out? /** * Encapsulates making an HTTP request and translating any error response into a domain-specific * error type. diff --git a/src/lib/util.js b/src/lib/util.js index 672e5133..e949d28a 100644 --- a/src/lib/util.js +++ b/src/lib/util.js @@ -194,7 +194,6 @@ function generateRequestHeadersForJWS ( const ret = Object.fromEntries( Object.entries(mappedHeaders).map(([key, value]) => [key.toLowerCase(), value]) ) - // todo: clarify if we need additionalHeaders here (see generateRequestHeaders fn) return removeEmptyKeys(ret) } diff --git a/src/model/index.js b/src/model/index.js index 458afd71..cc1023f5 100644 --- a/src/model/index.js +++ b/src/model/index.js @@ -2,7 +2,6 @@ const QuotesModel = require('./quotes') const BulkQuotesModel = require('./bulkQuotes') const FxQuotesModel = require('./fxQuotes') -// todo: get models only through these factories module.exports = (db, proxyClient) => ({ quotesModelFactory: (requestId) => new QuotesModel({ db, requestId, proxyClient }), bulkQuotesModelFactory: (requestId) => new BulkQuotesModel({ db, requestId, proxyClient }), diff --git a/src/model/quotes.js b/src/model/quotes.js index 7c90d4dc..fdbd2213 100644 --- a/src/model/quotes.js +++ b/src/model/quotes.js @@ -666,22 +666,10 @@ class QuotesModel { txn, quoteUpdateRequest.extensionList.extension, quoteId, null, refs.quoteResponseId) } - // todo: create any additional quoteParties e.g. for fees, comission etc... - await txn.commit() this.writeLog(`create quote update transaction committed to db: ${util.inspect(refs)}`) /// if we got here, all entities have been created in db correctly to record the quote request - - // check quote response rules - // let test = { ...quoteUpdateRequest }; - - // const failures = await quoteRules.getFailures(test); - // if (failures && failures.length > 0) { - // quote broke business rules, queue up an error callback to the caller - // this.writeLog(`Rules failed for quoteId ${refs.quoteId}: ${util.inspect(failures)}`); - // todo: make error callback - // } } // if we got here rules passed, so we can forward the quote on to the recipient dfsp const childSpan = handleQuoteUpdateSpan.getChild('qs_quote_forwardQuoteUpdate') diff --git a/src/server.js b/src/server.js index 9321b7a3..7dfda972 100644 --- a/src/server.js +++ b/src/server.js @@ -145,18 +145,6 @@ const initServer = async function (config, topicNames) { ops: { interval: 1000 } - // TODO: hapi good is deprecated per https://www.npmjs.com/package/@hapi/good/v/9.0.1 and is - // suggesting we consider another plugin from https://hapi.dev/plugins/#logging - // reporters: { - // console: [{ - // module: 'good-squeeze', - // name: 'Squeeze', - // args: [{ log: '*', response: '*' }] - // }, { - // module: 'good-console', - // args: [{ format: '' }] - // }, 'stdout'] - // } } }, { @@ -171,7 +159,6 @@ const initServer = async function (config, topicNames) { ]) server.route(Routes.APIRoutes(api)) - // TODO: follow instructions https://github.com/anttiviljami/openapi-backend/blob/master/DOCS.md#postresponsehandler-handler // start the server await server.start()