Repository navigation
feat(booking): allow renters and lenders to cancel bookings - #363
Conversation
There was a problem hiding this comment.
Reviewed against .github/skills/code-review/SKILL.md. Details are in the inline comments linked below.
| Point | Result | Notes |
|---|---|---|
| Scope | OK | One task. |
| Tests | ISSUE | Don't compile on main; nitpicks here and here. |
| Architecture | OK | No Firebase in the ViewModel. |
| Offline | Question | Pending while offline; KDoc wording. |
| Security | OK | Tight update rule, one question. |
| Clarity | Question | Lender side. |
Nitpick: the Validation section lists testDebugUnitTest but not ./gradlew check or the rules tests.
Requesting changes for the compile failure only; everything else is a question or a nitpick.
|
lucaschristiansson
left a comment
There was a problem hiding this comment.
Thanks for the quick and thorough follow-up: every earlier comment is either fixed or answered.
| Point | Result | Notes |
|---|---|---|
| Scope | OK | One task. |
| Tests | OK | The compile failure is fixed: main is merged in and days is stubbed. All test sources compile and the booking tests pass on my machine. The tests cover late rejection, rejection before returning, retry, duplicate taps and the already-cancelled case. CI and the rules check are green. |
| Architecture | OK | No Firebase in the ViewModel. |
| Offline | OK | Cancelling now updates the list right away and goes back to the old status if the server rejects the write. The KDoc wording is fixed too. |
| Security | OK | The update rule is unchanged and tight. Allowing cancellation of bookings whose days have passed is intended, as you explained. |
| Clarity | OK | The lender list is planned for #361, as you explained. One optional nitpick inline. |
| AI acknowledgement | OK | Copilot is named, and every changed file has the sign-off headers. |
Nitpick: the Validation section still lists only testDebugUnitTest. Could you add ./gradlew check and the rules tests?
Approving. The remaining points are nitpicks and don't block merging.



Summary
Closes #336. Add renter booking retrieval and cancellation for renters and lenders. Only eligible bookings can be cancelled, and ViewModel exposes loading, pending, and error states.
What
REQUESTEDorCONFIRMEDbookings.Why
Renters and lenders need a safe way to cancel bookings. Firestore rules prevent stale or unauthorized writes from changing booking fields beyond status.
Validation
./gradlew ktfmtCheck— Passed../gradlew testDebugUnitTest— Passed.Follow-ups
AI use
Copilot helped writing the code, I reviewed and tested it.