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

MBL-1571: Bonus support in add ons screen #2089

Conversation

Arkariang
Copy link
Contributor

@Arkariang Arkariang commented Aug 7, 2024

📲 What

Bonus support stepper has been moved to AddOns Screen, for both crowdfund and late pledges.

🛠 How

Several refactors required here:

  • Confirm details screen has been removed for late pledges, this screen only contained user facing the bonus amount stepped, but was in charge to call internally createCheckout mutation, and call the logIn flow in case the user was not logged in.
  • createCheckoutmutation for late pledges is now called inLatePledgeCheckoutViewModel`
  • to avoid multiple VM's with calculations, now all VM's in both late pledges and crowdfund work with PledgeData objects as input an output of the screens, all calculations have been moved to PledgeData extension functions PledgeData.shippingCostIfShipping(), PledgeData.checkoutTotalAmount(), PledgeData.pledgeAmountTotalPlusBonus(), PledgeData.pledgeAmountTotal(), all these methods have been fully unit tested.
  • Extracted to it's own compose re-usable components bonus support and the pledge description, can be found on views -> compose -> checkout -> BonusSupport.kt, PledgeItemizedDetails alongside the shipping selector.
  • PledgeFragment UI has been modified sligthly to not show shipping selector nor bonus amount
  • CheckoutScreen modified accordingly as well.

👀 See

AddOns screen now has the bonus support input, and above the continue button you can see the total pledge amount being updated with addOns amounts + reward amount + bonus amount

Screenshot 2024-08-07 at 11 43 16 AM
  • Late pledges
late_pledge_testing.mp4
  • Crowdfunding
crowdfund_pledge.mp4

| | |

📋 QA

  • Use this project for crowdfund, the project has been created onboarded on the backed creator feature flag to not charge shipping during pledge.
  • Try any other project in staging as well for crowdfund, (ideally one charging shipping).
  • For late pledges use this one the project has been created onboarded on the backed creator feature flag to not charge shipping during pledge.
  • Try as well any other late pledge project you can find around (ideally charging for shipping), I found this one but the more the better

Story 📖

MBL-1571

@Arkariang Arkariang marked this pull request as ready for review August 7, 2024 19:00
@Arkariang Arkariang self-assigned this Aug 7, 2024
@Arkariang Arkariang added the Pledge Redemption PRs related to Pledge Redemption 2024 label Aug 7, 2024
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 25.43478% with 343 lines in your changes missing coverage. Please review.

Project coverage is 68.44%. Comparing base (d32fa71) to head (c421c9f).

Files Patch % Lines
...ui/views/compose/checkout/PledgeItemizedDetails.kt 0.00% 117 Missing ⚠️
...kstarter/ui/views/compose/checkout/BonusSupport.kt 0.00% 92 Missing ⚠️
.../ui/activities/compose/projectpage/AddOnsScreen.kt 0.00% 67 Missing ⚠️
...wmodels/projectpage/LatePledgeCheckoutViewModel.kt 70.88% 13 Missing and 10 partials ⚠️
...kstarter/viewmodels/projectpage/AddOnsViewModel.kt 65.85% 3 Missing and 11 partials ⚠️
...kickstarter/libs/utils/extensions/PledgeDataExt.kt 60.00% 2 Missing and 10 partials ⚠️
...p/src/main/java/com/kickstarter/libs/KSCurrency.kt 0.00% 11 Missing ⚠️
...ain/java/com/kickstarter/libs/utils/RewardUtils.kt 0.00% 1 Missing and 1 partial ⚠️
...rc/main/java/com/kickstarter/ui/data/PledgeData.kt 85.71% 0 Missing and 2 partials ⚠️
...er/viewmodels/projectpage/CheckoutFlowViewModel.kt 60.00% 2 Missing ⚠️
... and 1 more

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@                         Coverage Diff                         @@
##             feature/pledge-redemption-ml1    #2089      +/-   ##
===================================================================
+ Coverage                            67.57%   68.44%   +0.87%     
+ Complexity                            2130     2125       -5     
===================================================================
  Files                                  365      365              
  Lines                                22205    21819     -386     
  Branches                              3132     3086      -46     
===================================================================
- Hits                                 15005    14934      -71     
+ Misses                                5543     5221     -322     
- Partials                              1657     1664       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@mtgriego mtgriego left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done, love the utils methods, makes it much cleaner

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😭 hardly knew them

@Arkariang Arkariang merged commit 3fc65ed into feature/pledge-redemption-ml1 Aug 8, 2024
3 checks passed
@Arkariang Arkariang deleted the imartin/MBL-1571-bonnusSupportInAddOnsScreen branch August 8, 2024 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Pledge Redemption PRs related to Pledge Redemption 2024
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants