quoting-service 17.0.4 → 17.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [17.1.0](https://github.com/mojaloop/quoting-service/compare/v17.0.5...v17.1.0) (2025-01-30)
6
+
7
+
8
+ ### Features
9
+
10
+ * **csi-927:** fixed db error - ER_BAD_FIELD_ERROR: Unknown column 'NaN' in 'field list' ([#390](https://github.com/mojaloop/quoting-service/issues/390)) ([c9fb641](https://github.com/mojaloop/quoting-service/commit/c9fb64148a626890a973ce6b47515c1b61931196))
11
+
12
+ ### [17.0.5](https://github.com/mojaloop/quoting-service/compare/v17.0.4...v17.0.5) (2025-01-29)
13
+
14
+
15
+ ### Tests
16
+
17
+ * **csi-1130:** api and db lib tests ([#389](https://github.com/mojaloop/quoting-service/issues/389)) ([d57e428](https://github.com/mojaloop/quoting-service/commit/d57e4284b523def6970d8688ad57280502de9b4a))
18
+
5
19
  ### [17.0.4](https://github.com/mojaloop/quoting-service/compare/v17.0.3...v17.0.4) (2025-01-28)
6
20
 
7
21
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "quoting-service",
3
3
  "description": "Quoting Service hosted by a scheme",
4
4
  "license": "Apache-2.0",
5
- "version": "17.0.4",
5
+ "version": "17.1.0",
6
6
  "author": "ModusBox",
7
7
  "contributors": [
8
8
  "Georgi Georgiev <georgi.georgiev@modusbox.com>",
@@ -114,12 +114,12 @@
114
114
  "@mojaloop/central-services-health": "15.0.2",
115
115
  "@mojaloop/central-services-logger": "11.5.4",
116
116
  "@mojaloop/central-services-metrics": "12.4.4",
117
- "@mojaloop/central-services-shared": "18.16.2",
117
+ "@mojaloop/central-services-shared": "18.17.0",
118
118
  "@mojaloop/central-services-stream": "11.4.3",
119
119
  "@mojaloop/event-sdk": "14.1.3",
120
120
  "@mojaloop/inter-scheme-proxy-cache-lib": "2.3.1",
121
121
  "@mojaloop/ml-number": "11.2.6",
122
- "@mojaloop/ml-schema-transformer-lib": "^2.5.1",
122
+ "@mojaloop/ml-schema-transformer-lib": "^2.5.2",
123
123
  "@mojaloop/sdk-standard-components": "^19.6.4",
124
124
  "ajv": "8.17.1",
125
125
  "ajv-keywords": "5.1.0",
@@ -49,11 +49,12 @@ const LOCAL_ENUM = require('../lib/enum')
49
49
  * Abstracts operations against the database
50
50
  */
51
51
  class Database {
52
- constructor (config, log) {
52
+ constructor (config, log, queryBuilder) {
53
53
  this.config = config
54
54
  this.log = log || logger.child({
55
55
  context: this.constructor.name
56
56
  })
57
+ this.queryBuilder = queryBuilder
57
58
  }
58
59
 
59
60
  /**
@@ -62,7 +63,7 @@ class Database {
62
63
  * @returns {promise}
63
64
  */
64
65
  async connect () {
65
- this.queryBuilder = new Knex(this.config.database)
66
+ this.queryBuilder = this.queryBuilder || new Knex(this.config.database)
66
67
 
67
68
  return this
68
69
  }
@@ -72,14 +73,14 @@ class Database {
72
73
  }
73
74
 
74
75
  /**
75
- * async utility for getting a transaction object from knex
76
- *
77
- * @returns {undefined}
78
- */
76
+ * async utility for getting a transaction object from knex
77
+ *
78
+ * @returns {undefined}
79
+ */
79
80
  async newTransaction () {
80
81
  return new Promise((resolve, reject) => {
81
82
  try {
82
- this.queryBuilder.transaction(txn => {
83
+ return this.queryBuilder.transaction(txn => {
83
84
  return resolve(txn)
84
85
  })
85
86
  } catch (err) {
@@ -593,7 +593,7 @@ class FxQuotesModel {
593
593
 
594
594
  // persist the error
595
595
  await this.db.createFxQuoteError(txn, conversionRequestId, {
596
- errorCode: Number(error.errorCode),
596
+ errorCode: Number(error.errorCode) || 2001, // Internal Server Error: https://github.com/mojaloop/central-services-error-handling/blob/master/src/errors.js#L29
597
597
  errorDescription: error.errorDescription
598
598
  })
599
599
 
@@ -607,7 +607,7 @@ class FxQuotesModel {
607
607
  histTimer({ success: true, queryName: 'handleFxQuoteError' })
608
608
  } catch (err) {
609
609
  histTimer({ success: false, queryName: 'handleFxQuoteError' })
610
- this.log.error('error in handleFxQuoteError', err)
610
+ this.log.child({ headers, conversionRequestId, error }).error('error in handleFxQuoteError', err)
611
611
  if (txn) {
612
612
  await txn.rollback().catch(() => {})
613
613
  }