Skip to content

cats-846 grace period change

background

Ask is to change 5 minute default “taken shift” grace period to 15 minutes, and allow iv admin to configure as needed. The change will allow people up to 15 minutes to ‘untake’ a shift, theoretically reducing some reported anxiety in ‘shift taking’.

changes

Option::SHIFT_TAKE_GRACE_PERIOD_MINUTES added with default of 15 minutes.
The option will be loaded during a seeder process during setup, and also during prod migration.

ShiftService and Shift model calls to get configurable ‘minutes’ were changed to grab ‘option’ value first, with fallback to default config value.

Couple of small inline phpdoc additions added, and return values changed from ‘int’ to ‘float’ in a couple places, to allow someone to enter, say, 15.5 minutes (which, for some manual testing/override, people may want to put in 0.1 for 6 seconds, for example).

Automated testing and ‘non-prod’ environments will still use the ‘30 second’ hard coded constant Shift::TEST_PENDING_LIMIT_SECONDS(renamed from TEST_PENDING_LIMIT) and SHIFT::PENDING_LIMIT was removed as a constant altogether.

vet portal

‘grace period take minutes’ are now shown in the confirmation modal when taking a shift.

You will have {{ gracePeriodShiftTakeMinutes }} minutes to remove this shift after taking it.

This information is passed to the initial vetPortalShell component via the AccountController and initial blade file rendering.

It is also available and pulled from ‘/api/vet-portal-init’ route, which sends down vet portal info options. Currently this is the only piece of data being pulled, but more of the earlier ‘initialization’ data from the AccountController should be migrated to this endpoint.

Whenever the ‘visibility’ of the vet portal changes (someone going to another tab, then coming back, or reopening the browser), an event triggers to load the current shifts. A second call to ‘vet-portal-init’ route now happens, and the ‘gracePeriodShiftTakeMinutes’ data is pushed to the vuex store.