Closed falhar closed 1 week ago
The changes in this pull request involve modifications to the Sequelize configuration and the introduction of a new database model and migration script. The .sequelizerc
file is updated to include a new property for the models path and standardizes key formatting. A new migration script creates a TopupHistories
table, while a new model is defined for this table. Additionally, the server's webhook handling logic is refined to improve database interactions and error handling.
File | Change Summary |
---|---|
.sequelizerc | Added "models-path": path.resolve("src", "models") ; reformatted existing keys to unquoted format. |
migrations/scripts/20241116222737-create-topup-history.js | Added migration script for TopupHistories table with specified columns and rollback functionality. |
src/models/index.js | Imported and registered TopupHistories model in the db object; adjusted model registration order. |
src/models/topup-history.js | Introduced new Sequelize model TopupHistories with defined fields and timestamps. |
src/server.js | Updated webhook handling to accept only POST requests; optimized database queries and error handling. |
.example.env | Added STRIPE_FEE_PERCENTAGE and STRIPE_FIXED_FEE_CENTS configuration variables. |
src/components/common.js | Added STRIPE_FEE_PERCENTAGE and STRIPE_FIXED_FEE_CENTS to the config object. |
.sequelizerc
file in the main PR regarding the configuration structure.Server
class that may interact with the database configurations defined in the main PR, particularly in relation to the new models and their paths.🐰 In the meadow, where the bunnies play,
New paths for models have come our way!
With histories of top-ups, we'll hop with glee,
As we handle webhooks, so swiftly and free!
A dance of data, in the server's embrace,
Let's celebrate changes, with a joyful race! 🌼
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit
New Features
Bug Fixes
Chores