-
Notifications
You must be signed in to change notification settings - Fork 133
[WOOMOB-1346] Booking details - payment section #14666
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a payment section to the booking details screen with payment information display and action buttons for marking payments as paid/refunded and viewing the associated order.
Key changes:
- Added payment section UI component with payment breakdown (service, tax, discount, total)
- Implemented "View order" navigation functionality
- Added "Mark as paid" and "Mark as refunded" buttons with state management
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
BookingPaymentSection.kt | New composable component for displaying payment details and action buttons |
BookingDetailsViewState.kt | Added payment model and callback functions for payment actions |
BookingDetailsViewModel.kt | Implemented payment status update logic and callback handling |
BookingDetailsScreen.kt | Integrated payment section into booking details UI |
BookingDetailsFragment.kt | Added navigation to order details screen |
nav_graph_bookings.xml | Added navigation action to order details |
strings.xml | Added payment section related string resources |
BookingDetailsViewModelTest.kt | Updated test to use new state structure |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
...merce/src/main/kotlin/com/woocommerce/android/ui/bookings/details/BookingDetailsViewState.kt
Show resolved
Hide resolved
...ommerce/src/main/kotlin/com/woocommerce/android/ui/bookings/compose/BookingPaymentSection.kt
Outdated
Show resolved
Hide resolved
📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
|
...ommerce/src/main/kotlin/com/woocommerce/android/ui/bookings/compose/BookingPaymentSection.kt
Outdated
Show resolved
Hide resolved
thickness = 0.5.dp, | ||
modifier = Modifier.padding(start = 16.dp) | ||
) | ||
if (paymentStatus == BookingPaymentStatus.PAID) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not 100% this is the correct logic. Should we also show the Mark as refunded
if the booking status is completed
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I asked about it in Slack (p1759326540162229-slack-C09FHQNQERG). If we don’t get a reply, we can add a TODO comment to update this logic later and merge the PR now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have renamed the button to Issue refund
, and for now, both Mark as paid
and Issue refund
will open the order screen. We can update to a refund screen when we have the order object to properly enable that.
📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## trunk #14666 +/- ##
============================================
- Coverage 38.41% 38.39% -0.03%
Complexity 9823 9823
============================================
Files 2090 2091 +1
Lines 116568 116688 +120
Branches 15592 15611 +19
============================================
+ Hits 44785 44801 +16
- Misses 67625 67729 +104
Partials 4158 4158 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
a4e6bd3
to
bdcebd8
Compare
bdcebd8
to
874459f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I don't have any blocking feedback, so I'm approving, but please review my comments before merging. 🚀
...ommerce/src/main/kotlin/com/woocommerce/android/ui/bookings/compose/BookingPaymentSection.kt
Show resolved
Hide resolved
...ommerce/src/main/kotlin/com/woocommerce/android/ui/bookings/compose/BookingPaymentSection.kt
Show resolved
Hide resolved
...ommerce/src/main/kotlin/com/woocommerce/android/ui/bookings/compose/BookingPaymentSection.kt
Outdated
Show resolved
Hide resolved
thickness = 0.5.dp, | ||
modifier = Modifier.padding(start = 16.dp) | ||
) | ||
if (paymentStatus == BookingPaymentStatus.PAID) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I asked about it in Slack (p1759326540162229-slack-C09FHQNQERG). If we don’t get a reply, we can add a TODO comment to update this logic later and merge the PR now.
@irfano Do you want to re-review the latest commits? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for handling the changes. ✅
Closes WOOMOB-1346
Description
This PR adds the payment section to the
BookingDetailsScreen
with a workingView order
button and not fully implementedmark as paid/mark as refunded
buttons.There are two extra commits that move the view model callback to the view state to limit the growing number of parameters - fc1ae2f and a4e6bd3.
Steps to reproduce
View order
Testing information
You can verify with different font/view scaling and light/dark theme.
Tapping on the
Mark as paid
/Mark as refunded
should also update the temp in-memory state.The tests that have been performed
The above.
Images/gif
Screen_recording_20250930_115742.mp4
RELEASE-NOTES.txt
if necessary. Use the "[Internal]" label for non-user-facing changes.