[Feature request]: Create booking via asset page
Contact Details
Is your feature request related to a problem? Please describe?
This was requested by Leonardo from Laerdal Medical.
The ability to book an asset from “within” the asset. (i.e. I open an asset page and I can directly create a booking with that asset from there, without having to open the booking page and create a new booking with that particular asset)
@DonKoko we discussed this briefly via Discord.
Describe the solution you'd like
SCENARIO https://www.figma.com/file/ykvc0MhPeNLsrJ4tJsKosQ/Shelf-%7C-UX-Scenarios?type=design&node-id=4478-29320&mode=design
This feature should work for both Administrators and Self-service users. Of course Self-service user can only select themselves as Custodian.
- Add a Book button on the asset page
- Clicking the Book button opens a Create booking modal
- User fills Name, Booking period and Custodian
- User clicks Create booking
- User gets redirected to the newly created Draft booking with Name, Booking period and Custodian fields filled
- Also the asset is already added to the booking (if warning labels shows it indicates the asset is already booked during booking period or in custody)
From there they can further configure the booking if needed
- The Book button should be hidden on asset page when is marked as 'Unavailable for bookings'
Describe alternatives you've considered
No response
Additional context
No response
An alternative for this could be to enable scanning of tags on the booking create flow?
In terms of technical implementation:
- Clicking on Book button will lead to bookings.new
- We sent some search params with the
assetId. - In the booking.new loader, we parse those search params and use the assetId if present when creating the booking to already link it to assets. Note: This should support an array of assetIds. That way we can also use it in bulk actions.
@DonKoko , I'd like to work on this. Please assign!
Nice release. Functionality works great. Only concern I have that I did not voice earlier is the focus on booking as a primary action on the page. At some point I might request to move the book cat under actions. But, not relevant for now.
@carlosvirreira @jurrejansen btw I added it also for kits. So it works there as well.