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-1814] PLOT plan selector component #2195

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

jovaniks
Copy link
Contributor

@jovaniks jovaniks commented Nov 13, 2024

📲 What

Create a new Payment Plan Selector component to allow users to select a payment plan option. The component will feature the options:

Pledge in full (default selection)
Pledge over time (just contains the initial state, it will be extended in MBL-1815)

🤔 Why

This feature is part of the Pledge Over Time (PLOT) initiative. It provides backers with more flexibility in how they contribute to projects. By implementing this, backers can choose whether to pay upfront or in multiple payments.

🛠 How

  • UI: A new Payment Plan Selector component will be implemented in the new Checkout UI.
  • State Machine: The component will have three primary states:
    • Default: Pledge in full (selected by default).
    • PLOT Selected: Pledge over time, when eligible (displays incremental charges).
    • PLOT Ineligible: Disabled when PLOT conditions are not met (e.g., pledge amount over $150 or ineligible).
  • Feature Flags:
    • API: The project.isPledgeOverTimeAllowed flag from the API will determine whether the Pledge over time option is available for the project.
    • App: The feature flag pledge_over_time will control the availability of this option at both the project level and for individual backers.

👀 See

Plot Allowed Plot Not Allowed
plot-component plot-componen-not-allowed

✅ Acceptance criteria

  • The component is displayed when bot feature flags are ON.

@jovaniks jovaniks self-assigned this Nov 13, 2024
@jovaniks jovaniks requested review from scottkicks and removed request for stevestreza-ksr November 14, 2024 18:04
Copy link
Contributor

@scottkicks scottkicks left a comment

Choose a reason for hiding this comment

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

Looking pretty good!

I added some Prelude and naming cleanup opportunities and also a question about whether we need to use a UITableView for this. I think we might be able to avoid some overhead from creating a new data source and table view cells by using a more basic UIStackView + UIView approach. You might have looked into this as an alternative already so lmk if you prefer the table view approach here.

I also think we might able to reduce some code by making a shared UIView for each payment plan option. They both have a selectable button and label that can be shared. Then we could dynamically show the PLOT details as needed. What do you think?

We should also probably add unit test coverage to PledgePaymentPlansViewModel if possible.

@nativeksr
Copy link
Collaborator

nativeksr commented Nov 15, 2024

1 Warning
⚠️ Big PR

Generated by 🚫 Danger

@jovaniks jovaniks requested review from scottkicks and stevestreza-ksr and removed request for ifosli November 18, 2024 17:21
Copy link
Contributor

@scottkicks scottkicks left a comment

Choose a reason for hiding this comment

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

Thanks for making those changes!

Just want to make sure that the "eligible but pledge amount is < $150" state is accounted for as well before merging. I don't see it in the gifs you added in the PR description

@jovaniks
Copy link
Contributor Author

Thanks for making those changes!

Just want to make sure that the "eligible but pledge amount is < $150" state is accounted for as well before merging. I don't see it in the gifs you added in the PR description

The plan is to tackle this validation in the ticket https://kickstarter.atlassian.net/browse/MBL-1816

@jovaniks jovaniks requested review from ifosli and removed request for stevestreza-ksr November 20, 2024 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants