-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: lightning payment controller (#300)
* refactor: add validation to lightning payment function This commit adds an extra validation check for successful and failed lightning payments using the data returned from the lnd node. It also introduces the use of sequelize db transactions to ensure the integrity of the data depending of the outcome of the invoice payment * feat: add invoice column to transactions table This commit adds a new invoice column to the transaction table to store debit payment ln invoices. it also adds a script called create-migration to the Makefile so its easier for developers to create new migrations for the database schema changes.
- Loading branch information
1 parent
6f48e9e
commit 9999e78
Showing
7 changed files
with
149 additions
and
27 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
27 changes: 27 additions & 0 deletions
27
api/app/db/migrations/20240805164050-add-invoice-column-to-transactions.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,27 @@ | ||
"use strict"; | ||
|
||
/** @type {import('sequelize-cli').Migration} */ | ||
module.exports = { | ||
async up(queryInterface, Sequelize) { | ||
/** | ||
* Add altering commands here. | ||
* | ||
* Example: | ||
* await queryInterface.createTable('users', { id: Sequelize.INTEGER }); | ||
*/ | ||
await queryInterface.addColumn("transactions", "invoice", { | ||
type: Sequelize.TEXT, | ||
allowNull: true, | ||
}); | ||
}, | ||
|
||
async down(queryInterface, Sequelize) { | ||
/** | ||
* Add reverting commands here. | ||
* | ||
* Example: | ||
* await queryInterface.dropTable('users'); | ||
*/ | ||
await queryInterface.removeColumn("transactions", "invoice"); | ||
}, | ||
}; |
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