Skip to content

feat(booking): let lenders see and accept requests on their listing - #380

Draft
lucaschristiansson wants to merge 3 commits into
mainfrom
feature/accept-booking-screen
Draft

lucaschristiansson wants to merge 3 commits into
mainfrom
feature/accept-booking-screen

Conversation

@lucaschristiansson

@lucaschristiansson lucaschristiansson commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Part of #28. The lender side of booking requests, end to end: a "Booking requests" button on your own listing opens a screen with the requests waiting for your answer and those you accepted, and you accept one after a confirmation. Stacked on #379 (view model), itself on #378 (backend): review those first; this PR's base moves to main as they merge.

What

  • ReceivedRequestsScreen:
    • sections "Waiting for your answer" and "Accepted"; each card shows the renter's username (or "A renter"), the days (e.g. "20–21 Nov") and how many;
    • Accept opens a confirmation: "ann_m gets 20–21 Nov. No one else can request these days. 1 other request for these days will be cancelled." It survives a rotation;
    • loading, load error with Retry, empty message; an accept failure is shown above the lists, and every Accept is disabled while one runs.
  • Listing detail: BookingRequestsButton for the owner, styled like "Message lender", shown also while the listing is paused (requests made before the pause can still be accepted).
  • Navigation: route received_requests/{listingId} (signed-in only), opened single-top; back uses dropUnlessResumed, as on the booking request, so a double tap does not also leave the listing.
  • Strings for the screen and the button.

Why

Issue #28: a lender must see the requests on their listing and accept the ones they want. #378 and #379 provide the write and the state; this makes it usable.

Validation

  • ./gradlew ktfmtCheck check compileDebugAndroidTestKotlin: passes. connectedCheck not run (no emulator).
  • ReceivedRequestsScreenTest (8): loading, load error and Retry, empty, cards (names, days, accepted section without Accept), the dialog's text and confirm, cancelling the dialog, disabled buttons with an accept error, and one test with the real view model where accepting moves the request and removes the overlapping one.
  • ListingDetailScreenTest (+2): the owner opens the requests even while paused; a renter does not see the button.
  • AppNavHostTest (+1): the owner opens the requests from the Toolbox listing and comes back.
  • Manual check on a device still to do once feat(booking): let lenders accept booking requests #378's rules are deployed.

AI use

Claude Code (Claude Opus 5.5) wrote the screen, the button, the navigation, the strings and the tests, and reviewed the diff against the team checklist (it caught and fixed the double-tap back). I reviewed and tested the result.

Accepting confirms the request, takes its days off the listing and
cancels the other requests for those days, in one batched write. The
rules only confirm a request whose days the same write removes, so two
requests sharing a day can never both be accepted.

Part of #28.
Loads the bookings of one listing for its owner, waiting and accepted,
with the renters' names, and accepts the request the owner chooses.

Part of #28.
Adds a "Booking requests" button on the owner's listing, opening a
screen with the requests waiting for an answer and those accepted.
Accepting asks for confirmation first, saying which other requests it
cancels.

Part of #28.
@sonarqubecloud

Copy link
Copy Markdown

@lucaschristiansson lucaschristiansson self-assigned this Nov 19, 2026
Base automatically changed from feature/accept-booking-viewmodel to main November 19, 2026 17:33
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.

1 participant