Skip to content

Commit

Permalink
ALS GetOracle get endpoints without currency does not return entry bu…
Browse files Browse the repository at this point in the history
…gfix (#15)

* Initial Commit.

* Upload domain/participant test.

* Upload domain/participant test.

* fixes for getParticipantsByTypeId test failing. now functioning properly
removed validator file as it isn't used may be required in MSISDN oracle as it validated mobile number formats

* Checking in testing code.

* removal of vscode config

* updated gitignore

* fixes for stubbing issues

* fix for bug mojaloop/project#797
Fixes for sonarQube code sanity i.e removing function names that aren't needed, changing let to const, reordering functions in file
Changed unique constraint on oracleEndpoint which is now working correctly

* fix for only retrieving default entries
return undefined for currency when it is not available

* fix for returning null for valid oracle lookup

* correct database port

* removal of isOracle for header validation
  • Loading branch information
rmothilal authored Jun 18, 2019
1 parent 2dbe78f commit 3cd85b1
Show file tree
Hide file tree
Showing 47 changed files with 2,317 additions and 1,937 deletions.
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,11 @@ typings/
# next.js build output
.next

\.idea/
# --------------- #
# IntelliJ #
# --------------- #
.idea/
**/*.iml

# VSCode directory
.vscode
4 changes: 2 additions & 2 deletions migrations/01_currency.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

'use strict'

exports.up = (knex, Promise) => {
exports.up = (knex) => {
return knex.schema.hasTable('currency').then(function(exists) {
if (!exists) {
return knex.schema.createTable('currency', (t) => {
Expand All @@ -37,6 +37,6 @@ exports.up = (knex, Promise) => {
})
}

exports.down = function (knex, Promise) {
exports.down = function (knex) {
return knex.schema.dropTableIfExists('currency')
}
4 changes: 2 additions & 2 deletions migrations/02_endpointType.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

'use strict'

exports.up = (knex, Promise) => {
exports.up = (knex) => {
return knex.schema.hasTable('endpointType').then(function (exists) {
if (!exists) {
return knex.schema.createTable('endpointType', (t) => {
Expand All @@ -38,6 +38,6 @@ exports.up = (knex, Promise) => {
})
}

exports.down = function (knex, Promise) {
exports.down = function (knex) {
return knex.schema.dropTableIfExists('endpointType')
}
4 changes: 2 additions & 2 deletions migrations/03_endpointType-indexes.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@

'use strict'

exports.up = function (knex, Promise) {
exports.up = function (knex) {
return knex.schema.table('endpointType', (t) => {
t.unique('type')
})
}

exports.down = function (knex, Promise) {
exports.down = function (knex) {
return knex.schema.table('endpointType', (t) => {
t.dropUnique('type')
})
Expand Down
4 changes: 2 additions & 2 deletions migrations/04_partyIdType.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

'use strict'

exports.up = function (knex, Promise) {
exports.up = function (knex) {
return knex.schema.hasTable('partyIdType').then(function (exists) {
if (!exists) {
return knex.schema.createTable('partyIdType', (t) => {
Expand All @@ -38,6 +38,6 @@ exports.up = function (knex, Promise) {
})
}

exports.down = function (knex, Promise) {
exports.down = function (knex) {
return knex.schema.dropTableIfExists('partyIdType')
}
4 changes: 2 additions & 2 deletions migrations/05_partyIdType-indexes.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@

'use strict'

exports.up = function (knex, Promise) {
exports.up = function (knex) {
return knex.schema.table('partyIdType', (t) => {
t.unique('name')
})
}

exports.down = function (knex, Promise) {
exports.down = function (knex) {
return knex.schema.table('partyIdType', (t) => {
t.dropUnique('name')
})
Expand Down
4 changes: 2 additions & 2 deletions migrations/08_oracleEndpoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

'use strict'

exports.up = (knex, Promise) => {
exports.up = (knex) => {
return knex.schema.hasTable('oracleEndpoint').then(function (exists) {
if (!exists) {
return knex.schema.createTable('oracleEndpoint', (t) => {
Expand All @@ -46,6 +46,6 @@ exports.up = (knex, Promise) => {
})
}

exports.down = function (knex, Promise) {
exports.down = function (knex) {
return knex.schema.dropTableIfExists('oracleEndpoint')
}
6 changes: 3 additions & 3 deletions migrations/09_oracleEndpoint-indexes.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@

'use strict'

exports.up = function (knex, Promise) {
exports.up = function (knex) {
return knex.schema.table('oracleEndpoint', (t) => {
t.index('partyIdTypeId')
t.index('endpointTypeId')
t.unique(['partyIdTypeId', 'currencyId', 'isDefault'])
t.unique(['partyIdTypeId', 'isDefault'])
})
}

exports.down = function (knex, Promise) {
exports.down = function (knex) {
return knex.schema.table('oracleEndpoint', (t) => {
t.dropIndex('partyIdTypeId')
t.dropIndex('endpointTypeId')
Expand Down
Loading

0 comments on commit 3cd85b1

Please sign in to comment.