Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/1218 Settlement Model Handler Design #607

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
2e21103
feature/1093 Alter DB Schema for Settlements (#501)
ggrg Jan 6, 2020
4e3e01e
Merge branch 'master' of github.com:mojaloop/central-ledger into sett…
ggrg Jan 6, 2020
6de15cf
Merge branch 'master' of github.com:mojaloop/central-ledger into sett…
ggrg Jan 7, 2020
8c4a3e9
Merge branch 'master' of github.com:mojaloop/central-ledger into sett…
ggrg Jan 10, 2020
2fc6e8d
feature/1095 Close Settlement Window Changes (#539)
ggrg Jan 10, 2020
f140f61
feature/1096 Create Settlement Changes #1 (#551)
ggrg Jan 14, 2020
5074b59
Merge branch 'master' of github.com:mojaloop/central-ledger into sett…
ggrg Jan 20, 2020
372db24
feature/1100 Settlement By Currency Wrap Up
ggrg Jan 22, 2020
626c20f
Preparing 8.8.2-snapshot settlement-v2 release
ggrg Jan 23, 2020
94cc321
Merge branch 'master' of github.com:mojaloop/central-ledger into sett…
ggrg Jan 24, 2020
07d9044
Implement createSettlementModel admin API#1179 (#578)
lazolalucas Feb 7, 2020
000d9c1
feature/1211 Settlement v2 Auto Position Reset (#586)
ggrg Feb 11, 2020
eab8e26
Prepared new settlement-v2 snapshot release
ggrg Feb 12, 2020
3de688a
Prepared new settlement-v2 snapshot release
ggrg Feb 12, 2020
83f6e63
Prepare 9.1.1-snapshot settlement-v2 release
ggrg Feb 12, 2020
6324ca6
#1207- Implement settlementModels management - GET and PUT operatio…
lazolalucas Feb 13, 2020
92a4056
feature/1210Validate Settlement Model Definition (#594)
ggrg Feb 14, 2020
1b39d6b
Merge branch 'master' of github.com:mojaloop/central-ledger into sett…
ggrg Feb 19, 2020
6f4fb52
Added transferParticipantStateChange and FKs
ggrg Feb 20, 2020
df79ec3
feature/1209 Restrict Create Settlement
ggrg Feb 20, 2020
ea9c6b8
Merge branch 'settlement-v2' of github.com:mojaloop/central-ledger in…
ggrg Feb 20, 2020
d4f5219
Merge branch 'master' of github.com:mojaloop/central-ledger into feat…
ggrg Feb 28, 2020
b57c12a
Prepare v9.2.3 release
ggrg Feb 28, 2020
17a8582
Deleted duplicated seeds script
ggrg Feb 28, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions migrations/310200_transferParticipant.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ exports.up = async (knex) => {
t.foreign('ledgerEntryTypeId').references('ledgerEntryTypeId').inTable('ledgerEntryType')
t.decimal('amount', 18, 2).notNullable()
t.dateTime('createdDate').defaultTo(knex.fn.now()).notNullable()
t.bigInteger('currentStateChangeId').unsigned().nullable()
})
}
})
Expand Down
46 changes: 46 additions & 0 deletions migrations/310250_transferParticipantStateChange.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*****
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]>

* ModusBox
- Georgi Georgiev <[email protected]>
--------------
******/

'use strict'

exports.up = async (knex) => {
return await knex.schema.hasTable('transferParticipantStateChange').then(function(exists) {
if (!exists) {
return knex.schema.createTable('transferParticipantStateChange', (t) => {
t.bigIncrements('transferParticipantStateChangeId').primary().notNullable()
t.bigInteger('transferParticipantId').unsigned().notNullable()
t.foreign('transferParticipantId').references('transferParticipantId').inTable('transferParticipant')
t.string('settlementWindowStateId', 50).notNullable()
t.foreign('settlementWindowStateId').references('settlementWindowStateId').inTable('settlementWindowState')
t.string('reason', 512).defaultTo(null).nullable()
t.dateTime('createdDate').defaultTo(knex.fn.now()).notNullable()
})
}
})
}

exports.down = function (knex) {
return knex.schema.dropTableIfExists('settlementWindowStateChange')
}
40 changes: 40 additions & 0 deletions migrations/310251_transferParticipantStateChange-indexes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*****
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]>

* ModusBox
- Georgi Georgiev <[email protected]>
--------------
******/

'use strict'

exports.up = function (knex) {
return knex.schema.table('transferParticipantStateChange', (t) => {
t.index('transferParticipantId')
t.index('settlementWindowStateId')
})
}

exports.down = function (knex) {
return knex.schema.table('transferParticipantStateChange', (t) => {
t.dropIndex('transferParticipantId')
t.dropIndex('settlementWindowStateId')
})
}
6 changes: 6 additions & 0 deletions migrations/900100_foreign-keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ exports.up = function (knex) {
.table('settlementWindow', (t) => {
t.foreign('currentStateChangeId').references('settlementWindowStateChange.settlementWindowStateChangeId')
})
.table('transferParticipant', (t) => {
t.foreign('currentStateChangeId').references('transferParticipantStateChange.transferParticipantStateChangeId')
})
}

exports.down = function (knex) {
Expand All @@ -50,4 +53,7 @@ exports.down = function (knex) {
.table('settlementWindow', (t) => {
t.dropForeign('currentStateChangeId')
})
.table('transferParticipant', (t) => {
t.dropForeign('currentStateChangeId')
})
}
84 changes: 42 additions & 42 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mojaloop/central-ledger",
"version": "9.2.2",
"version": "9.2.3",
"description": "Central ledger hosted by a scheme to record and settle transfers",
"license": "Apache-2.0",
"author": "ModusBox",
Expand Down