-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(csi-318): added externalParticipant table (#1092)
* feat(csi-318): added externalParticipants table * refactor(csi-631): added calculateProxyObligation fn (#1093) * refactor(csi-631): added calculateProxyObligation fn * refactor(csi-631): added forwardPrepare fn * refactor(csi-631): added forwardPrepare fn * refactor(csi-631): improved logging in transfer facade * chore(csi-632): added migrations to create externalParticipant table (#1094) * refactor(csi-631): added calculateProxyObligation fn * refactor(csi-631): added forwardPrepare fn * refactor(csi-631): added forwardPrepare fn * refactor(csi-631): improved logging in transfer facade * chore(csi-632): added migrations to create externalParticipant table * chore(csi-632): added migration to add externalParticipantId FK to fxTransferParticipant * chore(csi-632): added migration to add externalParticipantId FK to fxTransferParticipant * feat(csi-633): added externalParticipant model; updated transfer/facade; added JSDocs; (#1101) * refactor(csi-631): added calculateProxyObligation fn * refactor(csi-631): added forwardPrepare fn * refactor(csi-631): added forwardPrepare fn * refactor(csi-631): improved logging in transfer facade * chore(csi-632): added migrations to create externalParticipant table * chore(csi-632): added migration to add externalParticipantId FK to fxTransferParticipant * chore(csi-632): added migration to add externalParticipantId FK to fxTransferParticipant * feat(csi-633): added externalParticipant model; added JSDocs; updated transfer/facade * feat(csi-633): added externalParticipantId field to fxTransferParticipant table * feat(csi-633): added externalParticipantId field to fxTransferParticipant table * feat(csi-633): updated from feat/fx-impl * feat(csi-650): updated transferTimeout handler to take into account externalParticipant (#1107) * feat(csi-650): updated transferTimeout handler to take into account externalParticipant * feat(csi-650): fixed ep1.externalParticipantId field * feat(csi-650): used leftJoin for externalParticipant table * feat(csi-650): added externalPayeeName as source to timeout handler * feat(csi-650): updated fxTimeout logic to take into account externalParticipant info * feat(csi-650): code cleaning up * feat(csi-650): code cleaning up * feat(csi-651): updated fxAbort handling to use externalParticipant info (#1111) * feat(csi-650): updated transferTimeout handler to take into account externalParticipant * feat(csi-650): fixed ep1.externalParticipantId field * feat(csi-650): used leftJoin for externalParticipant table * feat(csi-650): added externalPayeeName as source to timeout handler * feat(csi-650): updated fxTimeout logic to take into account externalParticipant info * feat(csi-650): code cleaning up * feat(csi-650): code cleaning up * feat(csi-651): updated fxAbort handling to use externalParticipant info * feat(csi-651): updated fxValidation handling * feat(csi-651): fixed one leftJoin clause * feat(csi-651): updated getExternalParticipantIdByNameOrCreate * feat(csi-651): updated getExternalParticipantIdByNameOrCreate * feat(csi-651): added externalParticipantCached model * feat(csi-651): fixed prepare-internals tests * feat(csi-651): added more tests * feat(csi-651): reverted changes back to feat/fx-impl * feat(csi-651): reverted unneeded changes back to feat/fx-impl version * feat(csi-651): excluded some files from test coverage check * chore(snapshot): 17.8.0-snapshot.32 * chore(snapshot): 17.8.0-snapshot.33
- Loading branch information
Showing
33 changed files
with
2,134 additions
and
1,140 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
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
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,47 @@ | ||
/***** | ||
License | ||
-------------- | ||
Copyright © 2017 Bill & Melinda Gates Foundation | ||
The Mojaloop files are made available by the Bill & Melinda Gates Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. | ||
Contributors | ||
-------------- | ||
This is the official list of the Mojaloop project contributors for this file. | ||
Names of the original copyright holders (individuals or organizations) | ||
should be listed with a '*' in the first column. People who have | ||
contributed from an organization can be listed under the organization | ||
that actually holds the copyright for their contributions (see the | ||
Gates Foundation organization for an example). Those individuals should have | ||
their names indented and be marked with a '-'. Email address can be added | ||
optionally within square brackets <email>. | ||
* Gates Foundation | ||
- Name Surname <[email protected]> | ||
* Eugen Klymniuk <[email protected]> | ||
-------------- | ||
**********/ | ||
|
||
exports.up = async (knex) => { | ||
return knex.schema.hasTable('externalParticipant').then(function(exists) { | ||
if (!exists) { | ||
return knex.schema.createTable('externalParticipant', (t) => { | ||
t.bigIncrements('externalParticipantId').primary().notNullable() | ||
t.string('name', 30).notNullable() | ||
t.unique('name') | ||
t.dateTime('createdDate').defaultTo(knex.fn.now()).notNullable() | ||
t.integer('proxyId').unsigned().notNullable() | ||
t.foreign('proxyId').references('participantId').inTable('participant') | ||
}) | ||
} | ||
}) | ||
} | ||
|
||
exports.down = function (knex) { | ||
return knex.schema.hasTable('externalParticipant').then(function(exists) { | ||
if (!exists) { | ||
return knex.schema.dropTableIfExists('externalParticipant') | ||
} | ||
}) | ||
} |
50 changes: 50 additions & 0 deletions
50
migrations/960110_alter_transferParticipant__addFiled_externalParticipantId.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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/***** | ||
License | ||
-------------- | ||
Copyright © 2017 Bill & Melinda Gates Foundation | ||
The Mojaloop files are made available by the Bill & Melinda Gates Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. | ||
Contributors | ||
-------------- | ||
This is the official list of the Mojaloop project contributors for this file. | ||
Names of the original copyright holders (individuals or organizations) | ||
should be listed with a '*' in the first column. People who have | ||
contributed from an organization can be listed under the organization | ||
that actually holds the copyright for their contributions (see the | ||
Gates Foundation organization for an example). Those individuals should have | ||
their names indented and be marked with a '-'. Email address can be added | ||
optionally within square brackets <email>. | ||
* Gates Foundation | ||
- Name Surname <[email protected]> | ||
* Eugen Klymniuk <[email protected]> | ||
-------------- | ||
**********/ | ||
|
||
const EP_ID_FIELD = 'externalParticipantId' | ||
|
||
exports.up = async (knex) => { | ||
return knex.schema.hasTable('transferParticipant').then(function(exists) { | ||
if (exists) { | ||
return knex.schema.alterTable('transferParticipant', (t) => { | ||
t.bigint(EP_ID_FIELD).unsigned().nullable() | ||
t.foreign(EP_ID_FIELD).references(EP_ID_FIELD).inTable('externalParticipant') | ||
t.index(EP_ID_FIELD) | ||
}) | ||
} | ||
}) | ||
} | ||
|
||
exports.down = async (knex) => { | ||
return knex.schema.hasTable('transferParticipant').then(function(exists) { | ||
if (exists) { | ||
return knex.schema.alterTable('transferParticipant', (t) => { | ||
t.dropIndex(EP_ID_FIELD) | ||
t.dropForeign(EP_ID_FIELD) | ||
t.dropColumn(EP_ID_FIELD) | ||
}) | ||
} | ||
}) | ||
} |
50 changes: 50 additions & 0 deletions
50
migrations/960111_alter_fxTransferParticipant__addFiled_externalParticipantId.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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/***** | ||
License | ||
-------------- | ||
Copyright © 2017 Bill & Melinda Gates Foundation | ||
The Mojaloop files are made available by the Bill & Melinda Gates Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. | ||
Contributors | ||
-------------- | ||
This is the official list of the Mojaloop project contributors for this file. | ||
Names of the original copyright holders (individuals or organizations) | ||
should be listed with a '*' in the first column. People who have | ||
contributed from an organization can be listed under the organization | ||
that actually holds the copyright for their contributions (see the | ||
Gates Foundation organization for an example). Those individuals should have | ||
their names indented and be marked with a '-'. Email address can be added | ||
optionally within square brackets <email>. | ||
* Gates Foundation | ||
- Name Surname <[email protected]> | ||
* Eugen Klymniuk <[email protected]> | ||
-------------- | ||
**********/ | ||
|
||
const EP_ID_FIELD = 'externalParticipantId' | ||
|
||
exports.up = async (knex) => { | ||
return knex.schema.hasTable('fxTransferParticipant').then((exists) => { | ||
if (exists) { | ||
return knex.schema.alterTable('fxTransferParticipant', (t) => { | ||
t.bigint(EP_ID_FIELD).unsigned().nullable() | ||
t.foreign(EP_ID_FIELD).references(EP_ID_FIELD).inTable('externalParticipant') | ||
t.index(EP_ID_FIELD) | ||
}) | ||
} | ||
}) | ||
} | ||
|
||
exports.down = async (knex) => { | ||
return knex.schema.hasTable('fxTransferParticipant').then((exists) => { | ||
if (exists) { | ||
return knex.schema.alterTable('fxTransferParticipant', (t) => { | ||
t.dropIndex(EP_ID_FIELD) | ||
t.dropForeign(EP_ID_FIELD) | ||
t.dropColumn(EP_ID_FIELD) | ||
}) | ||
} | ||
}) | ||
} |
Oops, something went wrong.