-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Temp sidecar and token fix * Delete deprecated and update first 3 scripts * Migration scripts 9-11 * Migration scripts 12-14 * Migration scripts 15-16 * Migration scripts 22-24 * Migration scripts 17-21 * Migration scripts 17-21 * Migration scripts 17-21 * Migration scripts 25-27 * Migration scripts 34 and review fixes to ilpPacket * Migration scripts 29 * fixed ilpCondition spelling error * Migration scripts 31 * Migration scripts 28, 30 * Migration scripts 32-33 * Corrections and cleanup * npm run migrate FIXES * Fix /participant; Remove /charge, /party, /role, /fee * Refactor: Move from domain to model & camelCase * domain/transfer/models to models/transfer, seeds * Changed transfer facade getById * Transfer Prepare * Transfer Commit * Pre- tests clean * Test files maintenance * Additional clean up * added unit test cases * fixed dependancies into few tests * Adding placeholder unit test files * Fixed admin/index.js unit test * Added tests for transferFulfilment and transferParticipant * Tests for transferFulfilment * Sinon.createSandbox * Unit testing for transferExtension * added test cases * Unit tests for ilpPacket * Unit tests for transfer/facade init - WIP * added test cases * fixes for tests and tweaks (#1) * merged projections * merged projections second attempt * Feature/db model changes georgi (#2) * fixes for tests and tweaks * removed unused test and fixed position test * some fixes but still broken tests * Standard fixes * Disable failing test scripts * projection fixed * deleted transform.test.js * unit/models/transfer/facade.test.js * fixed testPI2/unit/domain/participant/index.test.js * testPI2/unit/handlers/transfers/handler.test.js * unit/handlers/transfers/handler.test.js * Integration tests fix Part 1 * Fix & merge rmothilal * Disable broken integration tests * Feature/db model changes georgi (#5) * fixes for tests and tweaks * removed unused test and fixed position test * some fixes but still broken tests * fixes for producer and consumer. need to test properly * add producer to list made some addons * updated dependencies * Feature/db model changes georgi (#3) * fixes for tests and tweaks * removed unused test and fixed position test * some fixes but still broken tests * fixes for producer and consumer * add producer to list * updated dependencies * positions model layer * updating migration scripts to new knex standards for table creation * disconnect topicName * Feature/#355integrations @vgenev integration tests fixes * Cleaning up code and renaming integration test file names * Changes according to rmothilal PR review
- Loading branch information
Showing
304 changed files
with
4,433 additions
and
5,040 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
'use strict' | ||
|
||
exports.up = async (knex, Promise) => { | ||
return await knex.schema.hasTable('event').then(function(exists) { | ||
if (!exists) { | ||
return knex.schema.createTable('event', (t) => { | ||
t.increments('eventId').primary().notNullable() | ||
t.string('name', 128).notNullable() | ||
t.string('description', 512).defaultTo(null).nullable() | ||
t.dateTime('createdDate').defaultTo(knex.fn.now()).notNullable() | ||
}) | ||
} | ||
}) | ||
} | ||
|
||
exports.down = function (knex, Promise) { | ||
return knex.schema.dropTableIfExists('event') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
'use strict' | ||
|
||
exports.up = async (knex, Promise) => { | ||
return await knex.schema.hasTable('contactType').then(function(exists) { | ||
if (!exists) { | ||
return knex.schema.createTable('contactType', (t) => { | ||
t.increments('contactTypeId').primary().notNullable() | ||
t.string('name', 50).notNullable() | ||
t.string('description', 512).defaultTo(null).nullable() | ||
t.boolean('isActive').defaultTo(true).notNullable() | ||
t.dateTime('createdDate').defaultTo(knex.fn.now()).notNullable() | ||
}) | ||
} | ||
}) | ||
} | ||
|
||
exports.down = function (knex, Promise) { | ||
return knex.schema.dropTableIfExists('contactType') | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
'use strict' | ||
|
||
exports.up = async (knex, Promise) => { | ||
return await knex.schema.hasTable('currency').then(function(exists) { | ||
if (!exists) { | ||
return knex.schema.createTable('currency', (t) => { | ||
t.string('currencyId', 3).primary().notNullable() | ||
t.string('name', 128).defaultTo(null).nullable() | ||
t.boolean('isActive').defaultTo(true).notNullable() | ||
t.dateTime('createdDate').defaultTo(knex.fn.now()).notNullable() | ||
}) | ||
} | ||
}) | ||
} | ||
|
||
exports.down = function (knex, Promise) { | ||
return knex.schema.dropTableIfExists('currency') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
'use strict' | ||
|
||
exports.up = async (knex, Promise) => { | ||
return await knex.schema.hasTable('endpointType').then(function(exists) { | ||
if (!exists) { | ||
return knex.schema.createTable('endpointType', (t) => { | ||
t.increments('endpointTypeId').primary().notNullable() | ||
t.string('name', 50).notNullable() | ||
t.string('description', 512).defaultTo(null).nullable() | ||
t.boolean('isActive').defaultTo(true).notNullable() | ||
t.dateTime('createdDate').defaultTo(knex.fn.now()).notNullable() | ||
}) | ||
} | ||
}) | ||
} | ||
|
||
exports.down = function (knex, Promise) { | ||
return knex.schema.dropTableIfExists('endpointType') | ||
} |
4 changes: 2 additions & 2 deletions
4
.../20180418100301_add-party-type-indexes.js → migrations/110301_endpointType-indexes.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
'use strict' | ||
|
||
exports.up = function (knex, Promise) { | ||
return knex.schema.table('partyType', (t) => { | ||
return knex.schema.table('endpointType', (t) => { | ||
t.unique('name') | ||
}) | ||
} | ||
|
||
exports.down = function (knex, Promise) { | ||
return knex.schema.table('partyType', (t) => { | ||
return knex.schema.table('endpointType', (t) => { | ||
t.dropUnique('name') | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
'use strict' | ||
|
||
exports.up = async (knex, Promise) => { | ||
return await knex.schema.hasTable('ledgerEntryType').then(function(exists) { | ||
if (!exists) { | ||
return knex.schema.createTable('ledgerEntryType', (t) => { | ||
t.increments('ledgerEntryTypeId').primary().notNullable() | ||
t.string('name', 50).notNullable() | ||
t.string('description', 512).defaultTo(null).nullable() | ||
t.boolean('isActive').defaultTo(true).notNullable() | ||
t.dateTime('createdDate').defaultTo(knex.fn.now()).notNullable() | ||
}) | ||
} | ||
}) | ||
} | ||
|
||
exports.down = function (knex, Promise) { | ||
return knex.schema.dropTableIfExists('ledgerEntryType') | ||
} |
4 changes: 2 additions & 2 deletions
4
...ns/20180418100201_add-currency-indexes.js → migrations/110401_ledgerEntryType-indexes.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
'use strict' | ||
|
||
exports.up = function (knex, Promise) { | ||
return knex.schema.table('currency', (t) => { | ||
return knex.schema.table('ledgerEntryType', (t) => { | ||
t.unique('name') | ||
}) | ||
} | ||
|
||
exports.down = function (knex, Promise) { | ||
return knex.schema.table('currency', (t) => { | ||
return knex.schema.table('ledgerEntryType', (t) => { | ||
t.dropUnique('name') | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
'use strict' | ||
|
||
exports.up = async (knex, Promise) => { | ||
return await knex.schema.hasTable('participantLimitType').then(function(exists) { | ||
if (!exists) { | ||
return knex.schema.createTable('participantLimitType', (t) => { | ||
t.increments('participantLimitTypeId').primary().notNullable() | ||
t.string('name', 50).notNullable() | ||
t.string('description', 512).defaultTo(null).nullable() | ||
t.boolean('isActive').defaultTo(true).notNullable() | ||
t.dateTime('createdDate').defaultTo(knex.fn.now()).notNullable() | ||
}) | ||
} | ||
}) | ||
} | ||
|
||
exports.down = function (knex, Promise) { | ||
return knex.schema.dropTableIfExists('participantLimitType') | ||
} |
4 changes: 2 additions & 2 deletions
4
...0401_add-party-identifier-type-indexes.js → ...ns/110501_participantLimitType-indexes.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
'use strict' | ||
|
||
exports.up = function (knex, Promise) { | ||
return knex.schema.table('partyIdentifierType', (t) => { | ||
return knex.schema.table('participantLimitType', (t) => { | ||
t.unique('name') | ||
}) | ||
} | ||
|
||
exports.down = function (knex, Promise) { | ||
return knex.schema.table('partyIdentifierType', (t) => { | ||
return knex.schema.table('participantLimitType', (t) => { | ||
t.dropUnique('name') | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
'use strict' | ||
|
||
exports.up = async (knex, Promise) => { | ||
return await knex.schema.hasTable('transferParticipantRoleType').then(function(exists) { | ||
if (!exists) { | ||
return knex.schema.createTable('transferParticipantRoleType', (t) => { | ||
t.increments('transferParticipantRoleTypeId').primary().notNullable() | ||
t.string('name', 50).notNullable() | ||
t.string('description', 512).defaultTo(null).nullable() | ||
t.boolean('isActive').defaultTo(true).notNullable() | ||
t.dateTime('createdDate').defaultTo(knex.fn.now()).notNullable() | ||
}) | ||
} | ||
}) | ||
} | ||
|
||
exports.down = function (knex, Promise) { | ||
return knex.schema.dropTableIfExists('transferParticipantRoleType') | ||
} |
4 changes: 2 additions & 2 deletions
4
...ations/20180418100501_add-role-indexes.js → ...01_transferParticipantRoleType-indexes.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
'use strict' | ||
|
||
exports.up = function (knex, Promise) { | ||
return knex.schema.table('role', (t) => { | ||
return knex.schema.table('transferParticipantRoleType', (t) => { | ||
t.unique('name') | ||
}) | ||
} | ||
|
||
exports.down = function (knex, Promise) { | ||
return knex.schema.table('role', (t) => { | ||
return knex.schema.table('transferParticipantRoleType', (t) => { | ||
t.dropUnique('name') | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
'use strict' | ||
|
||
exports.up = async (knex, Promise) => { | ||
return await knex.schema.hasTable('transferState').then(function(exists) { | ||
if (!exists) { | ||
return knex.schema.createTable('transferState', (t) => { | ||
t.string('transferStateId', 50).primary().notNullable() | ||
t.string('enumeration', 50).notNullable().comment('transferState associated to the Mojaloop API') | ||
t.string('description', 512).defaultTo(null).nullable() | ||
t.boolean('isActive').defaultTo(true).notNullable() | ||
t.dateTime('createdDate').defaultTo(knex.fn.now()).notNullable() | ||
}) | ||
} | ||
}) | ||
} | ||
|
||
exports.down = function (knex, Promise) { | ||
return knex.schema.dropTableIfExists('transferState') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
'use strict' | ||
|
||
exports.up = async (knex, Promise) => { | ||
return await knex.schema.hasTable('participant').then(function(exists) { | ||
if (!exists) { | ||
return knex.schema.createTable('participant', (t) => { | ||
t.increments('participantId').primary().notNullable() | ||
t.string('name', 256).notNullable() | ||
t.string('description', 512).defaultTo(null).nullable() | ||
t.boolean('isActive').defaultTo(true).notNullable() | ||
t.dateTime('createdDate').defaultTo(knex.fn.now()).notNullable() | ||
t.string('createdBy', 128).notNullable() | ||
}) | ||
} | ||
}) | ||
} | ||
|
||
exports.down = function (knex, Promise) { | ||
return knex.schema.dropTableIfExists('participant') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
'use strict' | ||
|
||
exports.up = async (knex, Promise) => { | ||
return await knex.schema.hasTable('participantContact').then(function(exists) { | ||
if (!exists) { | ||
return knex.schema.createTable('participantContact', (t) => { | ||
t.increments('participantContactId').primary().notNullable() | ||
t.integer('participantId').unsigned().notNullable() | ||
t.foreign('participantId').references('participantId').inTable('participant') | ||
t.integer('contactTypeId').unsigned().notNullable() | ||
t.foreign('contactTypeId').references('contactTypeId').inTable('contactType') | ||
t.string('value', 256).notNullable() | ||
t.integer('priorityPreference').defaultTo(9).notNullable() | ||
t.boolean('isActive').defaultTo(true).notNullable() | ||
t.dateTime('createdDate').defaultTo(knex.fn.now()).notNullable() | ||
t.string('createdBy', 128).notNullable() | ||
}) | ||
} | ||
}) | ||
} | ||
|
||
exports.down = function (knex, Promise) { | ||
return knex.schema.dropTableIfExists('participantContact') | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
'use strict' | ||
|
||
exports.up = async (knex, Promise) => { | ||
return await knex.schema.hasTable('participantEndpoint').then(function(exists) { | ||
if (!exists) { | ||
return knex.schema.createTable('participantEndpoint', (t) => { | ||
t.increments('participantEndpointId').primary().notNullable() | ||
t.integer('participantId').unsigned().notNullable() | ||
t.foreign('participantId').references('participantId').inTable('participant') | ||
t.integer('endpointTypeId').unsigned().notNullable() | ||
t.foreign('endpointTypeId').references('endpointTypeId').inTable('endpointType') | ||
t.string('value', 512).notNullable() | ||
t.boolean('isActive').defaultTo(true).notNullable() | ||
t.dateTime('createdDate').defaultTo(knex.fn.now()).notNullable() | ||
t.string('createdBy', 128).notNullable() | ||
}) | ||
} | ||
}) | ||
} | ||
|
||
exports.down = function (knex, Promise) { | ||
return knex.schema.dropTableIfExists('participantEndpoint') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
'use strict' | ||
|
||
exports.up = function (knex, Promise) { | ||
return knex.schema.table('participantEndpoint', (t) => { | ||
t.index('participantId') | ||
t.index('endpointTypeId') | ||
}) | ||
} | ||
|
||
exports.down = function (knex, Promise) { | ||
return knex.schema.table('participantEndpoint', (t) => { | ||
t.dropIndex('participantId') | ||
t.dropIndex('endpointTypeId') | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
'use strict' | ||
|
||
exports.up = async (knex, Promise) => { | ||
return await knex.schema.hasTable('participantParty').then(function(exists) { | ||
if (!exists) { | ||
return knex.schema.createTable('participantParty', (t) => { | ||
t.bigIncrements('participantPartyId').primary().notNullable() | ||
t.integer('participantId').unsigned().notNullable() | ||
t.foreign('participantId').references('participantId').inTable('participant') | ||
t.bigInteger('partyId').unsigned().notNullable() | ||
}) | ||
} | ||
}) | ||
} | ||
|
||
exports.down = function (knex, Promise) { | ||
return knex.schema.dropTableIfExists('participantParty') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
'use strict' | ||
|
||
exports.up = async (knex, Promise) => { | ||
return await knex.schema.hasTable('participantSettlement').then(function(exists) { | ||
if (!exists) { | ||
return knex.schema.createTable('participantSettlement', (t) => { | ||
t.bigIncrements('participantSettlementId').primary().notNullable() | ||
t.integer('participantId').unsigned().notNullable() | ||
t.foreign('participantId').references('participantId').inTable('participant') | ||
t.string('participantNumber', 16).notNullable() | ||
t.string('routingNumber', 16).notNullable() | ||
}) | ||
} | ||
}) | ||
} | ||
|
||
exports.down = function (knex, Promise) { | ||
return knex.schema.dropTableIfExists('participantSettlement') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.