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

Lock Vehicle button shouldn't vanish when booking time period ends #74

Open
grundleborg opened this issue Nov 10, 2024 · 1 comment · May be fixed by #91
Open

Lock Vehicle button shouldn't vanish when booking time period ends #74

grundleborg opened this issue Nov 10, 2024 · 1 comment · May be fixed by #91
Assignees
Labels
bug Something isn't working Difficulty: Medium A mid-range ticket - some size or complexity but not really complex p2 Priority 2 (highly frustrating but workarounds exist)

Comments

@grundleborg
Copy link
Member

grundleborg commented Nov 10, 2024

At the moment the "lock" / "unlock" buttons in the bookings UI for customers only appear if booking_start_time < now() < booking_end_time. This means if you are late returning a vehicle you can't look it from within the web app.

The current logic is correct for the unlock button, however, it needs to be changed for the lock button to be the same as the logic checking whether you can lock a vehicle with a card tap works, which is essentially:

  • If still within booking time, user can lock vehicle.
  • If outside of reservation time, user can lock vehicle only if they have rights to the booking currently active on the box for that vehicle.

The hardware.box object stores the currently active booking as part of it's state. To avoid duplication of code, there is probably already a function somewhere that checks this case and handles it properly for card taps. If possible, we should use the same logic to check whether to show/accept the "ulock" action in the bookings UI so that it always stays consistent.

@grundleborg grundleborg added bug Something isn't working p2 Priority 2 (highly frustrating but workarounds exist) Difficulty: Medium A mid-range ticket - some size or complexity but not really complex labels Nov 10, 2024
@grundleborg
Copy link
Member Author

@Scilly-guy this seems like a good more challenging ticket to take on at some point, and would also be really useful for us operationally by reducing the number of bookings stuck in "late" state.

@Scilly-guy Scilly-guy linked a pull request Jan 3, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Difficulty: Medium A mid-range ticket - some size or complexity but not really complex p2 Priority 2 (highly frustrating but workarounds exist)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants