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

fix(mojaloop/#2719): post quotes fails when transactionId does not equal transactionRequestId #887

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
90 changes: 30 additions & 60 deletions audit-resolve.json
Original file line number Diff line number Diff line change
@@ -1,84 +1,54 @@
{
"decisions": {
"1006904|hapi-swagger>swagger-ui-dist": {
"1064661|@mojaloop/central-services-shared>shins>markdown-it": {
"decision": "ignore",
"madeAt": 1645093979764,
"expiresAt": 1647685971147
"madeAt": 1647265377168,
"expiresAt": 1649857369058
},
"1004946|@mojaloop/event-sdk>@grpc/proto-loader>yargs>string-width>strip-ansi>ansi-regex": {
"1064761|@mojaloop/central-services-shared>widdershins>swagger2openapi>better-ajv-errors>jsonpointer": {
"decision": "ignore",
"madeAt": 1645093981212,
"expiresAt": 1647685971147
"madeAt": 1647265378456,
"expiresAt": 1649857369058
},
"1004946|@mojaloop/event-sdk>@grpc/proto-loader>yargs>cliui>string-width>strip-ansi>ansi-regex": {
"1064761|@mojaloop/central-services-shared>widdershins>swagger2openapi>oas-validator>better-ajv-errors>jsonpointer": {
"decision": "ignore",
"madeAt": 1645093981212,
"expiresAt": 1647685971147
"madeAt": 1647265378456,
"expiresAt": 1649857369058
},
"1004946|@mojaloop/event-sdk>@grpc/proto-loader>yargs>cliui>wrap-ansi>string-width>strip-ansi>ansi-regex": {
"1064768|hapi-swagger>swagger-parser>z-schema>validator": {
"decision": "ignore",
"madeAt": 1645093981212,
"expiresAt": 1647685971147
"madeAt": 1647265379481,
"expiresAt": 1649857369058
},
"1004854|@mojaloop/central-services-shared>widdershins>openapi-sampler>json-pointer": {
"1064843|@mojaloop/central-services-shared>widdershins>yargs>string-width>strip-ansi>ansi-regex": {
"decision": "ignore",
"madeAt": 1645093982981,
"expiresAt": 1647685971147
"madeAt": 1647265380510,
"expiresAt": 1649857369058
},
"1004869|@mojaloop/central-services-shared>widdershins>swagger2openapi>better-ajv-errors>jsonpointer": {
"1064843|@mojaloop/central-services-shared>widdershins>yargs>cliui>string-width>strip-ansi>ansi-regex": {
"decision": "ignore",
"madeAt": 1645093984643,
"expiresAt": 1647685971147
"madeAt": 1647265380510,
"expiresAt": 1649857369058
},
"1004869|@mojaloop/central-services-shared>widdershins>swagger2openapi>oas-validator>better-ajv-errors>jsonpointer": {
"1065159|@mojaloop/central-services-shared>widdershins>swagger2openapi>oas-validator>ajv": {
"decision": "ignore",
"madeAt": 1645093984643,
"expiresAt": 1647685971147
"madeAt": 1647265381612,
"expiresAt": 1649857369058
},
"1004876|hapi-swagger>swagger-parser>z-schema>validator": {
"1065367|@mojaloop/central-services-shared>shins>sanitize-html": {
"decision": "ignore",
"madeAt": 1645093985740,
"expiresAt": 1647685971147
"madeAt": 1647265382779,
"expiresAt": 1649857369058
},
"1004946|@mojaloop/central-services-shared>widdershins>yargs>string-width>strip-ansi>ansi-regex": {
"1065368|@mojaloop/central-services-shared>shins>sanitize-html": {
"decision": "ignore",
"madeAt": 1645093986801,
"expiresAt": 1647685971147
"madeAt": 1647265382779,
"expiresAt": 1649857369058
},
"1004946|@mojaloop/central-services-shared>widdershins>yargs>cliui>string-width>strip-ansi>ansi-regex": {
"1065523|@mojaloop/central-services-shared>widdershins>yargs>yargs-parser": {
"decision": "ignore",
"madeAt": 1645093986801,
"expiresAt": 1647685971147
},
"1005383|@mojaloop/central-services-shared>shins>sanitize-html": {
"decision": "ignore",
"madeAt": 1645093987944,
"expiresAt": 1647685971147
},
"1005384|@mojaloop/central-services-shared>shins>sanitize-html": {
"decision": "ignore",
"madeAt": 1645093987944,
"expiresAt": 1647685971147
},
"1005534|@mojaloop/central-services-shared>widdershins>yargs>yargs-parser": {
"decision": "ignore",
"madeAt": 1645093989033,
"expiresAt": 1647685971147
},
"1006846|@mojaloop/central-services-shared>shins>sanitize-html>postcss": {
"decision": "ignore",
"madeAt": 1645093990094,
"expiresAt": 1647685971147
},
"1006886|@mojaloop/central-services-shared>shins>markdown-it": {
"decision": "ignore",
"madeAt": 1645093991106,
"expiresAt": 1647685971147
},
"1007017|@mojaloop/central-services-shared>widdershins>swagger2openapi>oas-validator>ajv": {
"decision": "ignore",
"madeAt": 1645093992120,
"expiresAt": 1647685971147
"madeAt": 1647265383836,
"expiresAt": 1649857369058
}
},
"rules": {},
Expand Down
58 changes: 58 additions & 0 deletions migrations/500401_quote-hotfix-2719.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*****
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.

Initial contribution
--------------------
The initial functionality and code base was donated by the Mowali project working in conjunction with MTN and Orange as service provides.
* Project: Mowali

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 <name.surname@gatesfoundation.com>

* ModusBox
- Miguel de Barros <miguel.debarros@modusbox.com>
--------------
******/

// Notes: this is a fix for the following issue: https://github.com/mojaloop/project/issues/2719

'use strict'

exports.up = (knex) => {
return knex.schema.hasTable('quote').then((exists) => {
if (exists) {
return knex.schema
.table('quote', (t) => {
// remove unnecessary foreign key constraint that has a conflict with transactionReferenceId foreign key constraint
t.dropForeign('transactionRequestId')
})
}
})
}

exports.down = (knex) => {
return knex.schema.hasTable('quote').then((exists) => {
if (exists) {
return knex.schema
.table('quote', (t) => {
// lets reverse what we did
t.foreign('transactionRequestId').references('transactionReferenceId').inTable('transactionReference')
})
}
})
}
5 changes: 4 additions & 1 deletion migrations/910102_hotfix954.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,8 @@ exports.up = async (knex, Promise) => {
}

exports.down = function (knex) {
return knex.schema.dropTableIfExists('transferError')
return knex.schema.table('transferError', (t) => {
// Undo dropping of foreign key
t.foreign('transferId').references('transferId').inTable('transferErrorDuplicateCheck')
})
}
Loading