-
Notifications
You must be signed in to change notification settings - Fork 1
Description
In many scenarios, a booking workflow does not require an approval process.
In these cases, frontend apps will create (POST) the booking with .approved=true and that will persist.
HOWEVER, when a booking is EDITED (e.g. moved to a different resource or the start time changes), staff-api will always change .approved to false when processing the PUT:
https://github.com/PlaceOS/staff-api/blob/master/src/controllers/bookings.cr#L230
As a result, the app will show the booking as "Declined", which is not desirable in scenarios where there is no approval process (that is most scenarios).
There should be a staff-api configuration flag (perhaps set in PlaceOS Domain.internals or in staff-api.tenant that defines whether the staff-api expects certain bookings (e.g. of type 'desk' or type 'room') to have an approval workflow or not.
The current default is that all Bookings have an approval workflow, but I believe a better default is that there is no approval workflow (because this is a more common scenario), and one can optionally be enabled with a setting like the above. Though if we implement in this way we would have to add to Release Notes that the new setting to enable approval needs to be added to any existing deployments (with approval workflows) that get upgraded.
When there is no approval workflow configured, then staff-api should not change the booking.approval value on edits.