Skip to content

Commit

Permalink
feat!: update backend simulator api (#156)
Browse files Browse the repository at this point in the history
* chore: update api

* chore: dep audit

* chore: api

* chore(snapshot): 13.1.3-snapshot.0

* chore(snapshot): 13.1.3-snapshot.1

* chore(snapshot): 13.1.3-snapshot.2

* chore: ilppacket change

* chore(snapshot): 13.1.3-snapshot.3

* chore: resolve diverging sub id name

* chore(snapshot): 13.1.3-snapshot.4

* chore: dep

* chore: diable image-scan for fast builds

* chore(snapshot): 13.1.3-snapshot.5

* chore: fix names and variables

* chore(snapshot): 13.1.3-snapshot.6

* chore: reenable image scan
  • Loading branch information
kleyow committed Dec 16, 2022
1 parent 98bdcfa commit ff253a5
Show file tree
Hide file tree
Showing 11 changed files with 2,230 additions and 2,462 deletions.
7 changes: 6 additions & 1 deletion audit-resolve.json
Original file line number Diff line number Diff line change
Expand Up @@ -744,8 +744,13 @@
"1070377|00unidentified>00unidentified>sqlite3>node-gyp>tar": {
"decision": "postpone",
"madeAt": 1652793825482
},
"1085139|formidable>qs": {
"decision": "ignore",
"madeAt": 1671122793845,
"expiresAt": 1673714790497
}
},
"rules": {},
"version": 1
}
}
170 changes: 94 additions & 76 deletions package-lock.json

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mojaloop-simulator",
"version": "13.1.2",
"version": "13.1.3-snapshot.6",
"description": "A canonical test example implementation of the parties, transfers and quotes resources of the Mojaloop FSP Interoperability API",
"license": "Apache-2.0",
"main": "src/index.js",
Expand Down Expand Up @@ -58,33 +58,33 @@
"joi": "17.7.0",
"json-rules-engine": "^6.1.2",
"json-schema-ref-parser": "^9.0.9",
"koa": "2.13.4",
"koa": "2.14.1",
"koa-body": "6.0.1",
"mustache": "4.2.0",
"node-fetch": "^2.6.6",
"openapi-jsonschema-parameters": "12.0.2",
"openapi-jsonschema-parameters": "12.1.0",
"random-word-slugs": "^0.1.6",
"sqlite": "4.1.2",
"sqlite3": "5.1.2",
"sqlite3": "5.1.4",
"yamljs": "0.3.0"
},
"devDependencies": {
"@types/jest": "^29.2.3",
"@types/jest": "^29.2.4",
"ava": "^3.15.0",
"axios": "^1.2.0",
"axios": "^1.2.1",
"eslint": "^7.32.0",
"eslint-config-airbnb-base": "15.0.0",
"eslint-plugin-ava": "^13.2.0",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-jest": "^27.1.6",
"eslint-plugin-jest": "^27.1.7",
"husky": "8.0.2",
"jest": "^29.3.1",
"jest-junit": "^15.0.0",
"npm-audit-resolver": "^3.0.0-0",
"npm-check-updates": "16.4.3",
"npm-check-updates": "16.6.0",
"npm-run-all": "4.1.5",
"nyc": "15.1.0",
"sinon": "^14.0.2",
"sinon": "^15.0.1",
"standard-version": "^9.5.0",
"tap-xunit": "2.4.1",
"uuid": "9.0.0"
Expand Down
18 changes: 9 additions & 9 deletions src/models/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,35 +40,35 @@ CREATE TABLE IF NOT EXISTS ${partyTable} (
dateOfBirth TEXT,
idType TEXT,
idValue TEXT NOT NULL,
subIdValue TEXT,
idSubValue TEXT,
CHECK(idValue <> '')
)
`;

// below index is a workaround to avoid the duplicates since sqlite treats every null as a unique value
// thus allowing to insert multiple records for same the idValue having subIdValue as NULL
// thus allowing to insert multiple records for same the idValue having idSubValue as NULL
const createPartyTableUniqueIndex = `
CREATE UNIQUE INDEX IF NOT EXISTS idx_party_unique ON ${partyTable} (
idValue,
IFNULL(subIdValue, '')
IFNULL(idSubValue, '')
)
`;

const createPartyExtensionTable = `
CREATE TABLE IF NOT EXISTS ${partyExtensionTable} (
idValue TEXT NOT NULL,
subIdValue TEXT,
idSubValue TEXT,
key TEXT NOT NULL,
value TEXT NOT NULL
)
`;

// below index is a workaround to avoid the duplicates since sqlite treats every null as a unique value
// thus allowing to insert multiple records for same the idValue/key having subIdValue as NULL
// thus allowing to insert multiple records for same the idValue/key having idSubValue as NULL
const createPartyExtensionTableUniqueIndex = `
CREATE UNIQUE INDEX IF NOT EXISTS idx_party_extension_unique ON ${partyExtensionTable} (
idValue,
IFNULL(subIdValue, ''),
IFNULL(idSubValue, ''),
key
)
`;
Expand Down Expand Up @@ -127,16 +127,16 @@ CREATE TABLE IF NOT EXISTS ${partyAccountsTable} (
currency TEXT NOT NULL,
description TEXT NOT NULL,
idValue TEXT NOT NULL,
subIdValue TEXT
idSubValue TEXT
)
`;

// below index is a workaround to avoid the duplicates since sqlite treats every null as a unique value
// thus allowing to insert multiple records for same the idValue/key having subIdValue as NULL
// thus allowing to insert multiple records for same the idValue/key having idSubValue as NULL
const createAccountTableUniqueIndex = `
CREATE UNIQUE INDEX IF NOT EXISTS idx_party_account_unique ON ${partyAccountsTable} (
idValue,
IFNULL(subIdValue, ''),
IFNULL(idSubValue, ''),
address
)
`;
Expand Down
Loading

0 comments on commit ff253a5

Please sign in to comment.