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-1916: Display payment plan in Manage Pledge Flow if available #2195

Merged
merged 10 commits into from
Jan 14, 2025

Conversation

jlplks
Copy link
Contributor

@jlplks jlplks commented Jan 13, 2025

📲 What

Changes on the UI of Manage Your Pledge Screen to show the PLOT selection on the pledge changin the banner of the text an adding the Payment Schedule component.

🤔 Why

For the PLOT UI

🛠 How

Added the PaymentIncrement value to the backin object, modify GraphQLTransformer, changing the UI of the Manage your pledge screen to render the PaymentSchedule component, modifying the State enum class on PaymentIncrements to accept raw values in lowercase (cause that how we recibe it from the BE)

👀 See

Screenshot_20250113_085602

📋 QA

If you don't have a PLOT pledged project do it and then check it on the Manage Your Pledge Screen. The banner should say something about plot and the PaymentSchedule component should be rendered correctly

Story 📖

MBL-1916: API | Display payment plan in Manage Pledge Flow if available

jlplks added 3 commits January 9, 2025 18:47
- render payment schedule
- created companion object to map raw value from enum
@jlplks jlplks requested a review from a team January 13, 2025 16:05
@@ -235,6 +241,20 @@ class BackingFragment : Fragment() {

val boldPortionLength = text.toString().split(".").first().length
setBoldSpanOnTextView(boldPortionLength, this, resources.getColor(R.color.kds_support_400, null))

binding?.paymentScheduleComposeView?.setContent {
Copy link
Contributor

@leighdouglas leighdouglas Jan 13, 2025

Choose a reason for hiding this comment

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

My inkling here is that this will appear on all manage pledge screens, regardless of if they are a PLOT pledge. We should probably gate this with the condition that it only shows if the pledge is PLOT.

Copy link
Contributor

Choose a reason for hiding this comment

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

Agre with @leighdouglas

}
}
}

@Composable
fun PaymentRow(paymentIncrement: PaymentIncrement) {
val formattedAmount = String.format(Locale.US, "%.2f", paymentIncrement.amount.amount.parseToDouble())
val formattedAmount =
Copy link
Contributor

Choose a reason for hiding this comment

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

For formatting ammounts I will suggest to taking a look at KSCurrency, we want currency string appropriate to the user's locale

Copy link
Contributor

Choose a reason for hiding this comment

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

The backend is going to provide the formatted amounts for us, we are just waiting for this piece to be finished. We actually don't show these amounts in the users currency, but in the project currency.

@@ -249,6 +254,12 @@ interface BackingFragmentViewModel {
}
.map { it.second.userIsCreator(it.first.getValue()) }

backing
Copy link
Contributor

@Arkariang Arkariang Jan 13, 2025

Choose a reason for hiding this comment

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

For the bussines logic, I will check if the project is enabled or not for plot. And do not forget to cover any new logic with tests

@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 58.82353% with 28 lines in your changes missing coverage. Please review.

Project coverage is 68.38%. Comparing base (d169463) to head (f27190b).

Files with missing lines Patch % Lines
...arter/services/transformers/GraphQLTransformers.kt 0.00% 23 Missing ⚠️
...arter/ui/views/compose/checkout/PaymentSchedule.kt 90.00% 3 Missing ⚠️
...pp/src/main/java/com/kickstarter/models/Backing.kt 87.50% 0 Missing and 1 partial ⚠️
...in/java/com/kickstarter/models/PaymentIncrement.kt 80.00% 1 Missing ⚠️

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

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2195      +/-   ##
============================================
- Coverage     68.42%   68.38%   -0.04%     
- Complexity     2188     2193       +5     
============================================
  Files           351      352       +1     
  Lines         23554    23547       -7     
  Branches       3455     3456       +1     
============================================
- Hits          16117    16103      -14     
- Misses         5611     5616       +5     
- Partials       1826     1828       +2     

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

@jlplks jlplks merged commit dd8db6a into master Jan 14, 2025
3 checks passed
@jlplks jlplks deleted the jpulido/MBL-1916 branch January 14, 2025 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants