-
Notifications
You must be signed in to change notification settings - Fork 133
[WOOMOB-1385] Booking Pay at location status #14758
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
Adds a new “Pay at location” booking status when an order is completed with Cash on Delivery, and fixes the Today tab date filtering so bookings starting at 12:00 AM are included.
- Map completed + COD orders to a new BookingStatus.PayAtLocation and style it in UI.
- Adjust date range filter lower bound to the previous day’s end-of-day to accommodate exclusive API behavior; update tests accordingly.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
WooCommerce/src/main/kotlin/com/woocommerce/android/ui/bookings/BookingMapper.kt | Maps completed COD orders to PayAtLocation; updates toUiModel signature. |
WooCommerce/src/test/kotlin/com/woocommerce/android/ui/bookings/BookingMapperTest.kt | Adds unit test for PayAtLocation mapping. |
WooCommerce/src/main/kotlin/com/woocommerce/android/ui/bookings/list/BookingListFiltersBuilder.kt | Changes “today at midnight” lower bound to previous day end-of-day. |
WooCommerce/src/test/kotlin/com/woocommerce/android/ui/bookings/list/BookingListFilterBuilderTest.kt | Updates expected Instant for lower bound to reflect exclusive API behavior. |
WooCommerce/src/main/kotlin/com/woocommerce/android/ui/bookings/compose/BookingStatusTag.kt | Adds PayAtLocation status, color mapping, and previews. |
WooCommerce/src/main/res/values/strings.xml | Adds string for “Pay at location”. |
Comments suppressed due to low confidence (1)
WooCommerce/src/main/kotlin/com/woocommerce/android/ui/bookings/list/BookingListFiltersBuilder.kt:1
- Expand the KDoc to document why the lower bound uses the previous day’s end-of-day (the API's start_date_after is exclusive). This makes the non-obvious date arithmetic clear to future readers.
package com.woocommerce.android.ui.bookings.list
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
private fun BookingEntity.Status.toUiModel( | ||
orderStatus: String?, | ||
paymentMethod: String?, | ||
): BookingStatus { | ||
return if (orderStatus == "completed" && paymentMethod == "cod") { | ||
BookingStatus.PayAtLocation | ||
} else { | ||
when (this) { |
Copilot
AI
Oct 15, 2025
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.
Avoid magic strings for order status and payment method. Extract 'completed' and 'cod' into well-named constants (or reference existing enums/constants) to centralize these protocol values and prevent typos.
Copilot uses AI. Check for mistakes.
📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
|
📲 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 #14758 +/- ##
============================================
- Coverage 38.00% 38.00% -0.01%
- Complexity 9960 9964 +4
============================================
Files 2118 2118
Lines 119122 119130 +8
Branches 16225 16230 +5
============================================
+ Hits 45269 45270 +1
- Misses 69287 69294 +7
Partials 4566 4566 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
b5a61e6
to
528e000
Compare
Version |
WooCommerce/src/main/kotlin/com/woocommerce/android/ui/bookings/BookingMapper.kt
Outdated
Show resolved
Hide resolved
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.
Nice work,
WOOMOB-1385
Description
As per the discussion p1760521762369029/1760520041.270299-slack-C09FHQNQERG, this PR adds the
Pay at location
status for the booking based on the order status and the payment method.Note
There's an extra commit b5a61e6 that fixes a bug in the Today tab filtering logic. The
start_date_after
is not inclusive, so Bookings that start at 12:00 AM are not included in the response.Steps to reproduce
Pay at location
Testing information
To test the bug with date filtering, create a booking that starts today at 12:00 AM - I used the room rental template for that. Open the Today tab and verify the booking is there.
The tests that have been performed
The above.
Images/gif
RELEASE-NOTES.txt
if necessary. Use the "[Internal]" label for non-user-facing changes.