Closed amrsoll closed 11 months ago
LGTM. However, note that there are more places where we need to update the currency.
⚠️ I presume this would require a migration step, which I am unsure of how to tackle.
I don't think we need to add any migration scripts since these values only are used in runtime. Either way, I think it's very low risk that someone started using one currency and then switching to another, and that this change would affect anyone negatively. I don't think we have a lot of users in total, and even fewer outside of Sweden.
a migration step, which I am unsure of how to tackle.
Migrations are done by creating a new file in api/src/migrations/ (with higher starting number than the last file). Currently the last migration is this one: https://github.com/makerspace/makeradmin/blob/master/api/src/migrations/0023_flexible_change_phone_number.sql
The files are executed in-order on the database. They contain SQL commands that alter the database so that it matches the new database format that the code expects.
E.g. the following adds a column called _pendingactivation to the _membershipmembers table with a boolean value.
ALTER TABLE membership_members ADD COLUMN `pending_activation` boolean;
Executed migrations are stored in the database so they are not applied twice.
This allows me to change the currency I use in Stripe.
I would also recommend to refactor
CURRENCY
->STRIPE_CURRENCY
to follow your code conventions.I kept the changes minimal for this PR so far.
:warning: I presume this would require a migration step, which I am unsure of how to tackle.