This pull request fixes the currency conversion issues(correct number and symbol) in the conference_registrations view and the payment summary view. Now all views dealing with tickets should correctly implement the currency conversion logic.
Include screenshots, videos, etc.
Who authored this PR?
@tiffanylamm
How should this PR be tested?
Most of the changes were changes to the view so they should be viewable at deployment. I also added testing for the changes to show in the conference_registration_controller.
db/migrate/20240422200831_add_amount_paid_cents_to_ticket_purchases.rb
I added a new attribute called amount_paid_cents to the ticket_purchase model. Before the code was delegating :price to the ticket model which returned a money object with the original ticket's price and currency. By adding amount_paid_cents I was able to monetize it so that there's a way to access the purchase's amount paid and currency.
db/migrate/20240417212948_set_currency_for_null_ticket_purchase_currency.rb
This migration makes it so that each ticket_purchase whose currency field is null to be 'USD' instead. I was running into issues because of records that were in the ticket_purchase model before currency was added as a field being NULL when they all should be 'USD'
Checklist:
[x] Has this been deployed to a staging environment or reviewed by a customer?
[x] Tag someone for code review (either a coach / team member)
[x] I have renamed the branch to match PivotTracker's suggested one (necessary for BlueJay)
Pivotal Tracker Link
What this PR does:
This pull request fixes the currency conversion issues(correct number and symbol) in the conference_registrations view and the payment summary view. Now all views dealing with tickets should correctly implement the currency conversion logic.
Include screenshots, videos, etc.
Who authored this PR?
@tiffanylamm
How should this PR be tested?
Most of the changes were changes to the view so they should be viewable at deployment. I also added testing for the changes to show in the conference_registration_controller.
Are there any complications to deploying this?
Merge https://github.com/snap-cloud/snapcon/pull/371 first.
I made two migrations.
db/migrate/20240422200831_add_amount_paid_cents_to_ticket_purchases.rb I added a new attribute called amount_paid_cents to the ticket_purchase model. Before the code was delegating :price to the ticket model which returned a money object with the original ticket's price and currency. By adding amount_paid_cents I was able to monetize it so that there's a way to access the purchase's amount paid and currency. db/migrate/20240417212948_set_currency_for_null_ticket_purchase_currency.rb This migration makes it so that each ticket_purchase whose currency field is null to be 'USD' instead. I was running into issues because of records that were in the ticket_purchase model before currency was added as a field being NULL when they all should be 'USD'
Checklist: