-
Notifications
You must be signed in to change notification settings - Fork 58
Reservation Status Overhaul #462
Comments
I believe that the spirit of this feature will be handled through the "archive reservation" functionality (#728), as long as we can write notes when archiving. I'm not sure we need a scope specifically for lost equipment. Thoughts? |
I think it would be nice to be able to differentiate easily between archived and normal reservations, especially if the reservation archive action simply sets a checked-in time. Otherwise the admin won't be able to tell easily which ones have been archived and which ones were 'normal' reservations. It might be worth thinking about adding a status column to the reservations db. We already have an 'approval status' column that we could just rename to 'status'. Right now status is calculated based on various date criteria, and those calculations are duplicated between The only downside would be that the calculation of the 'missed' status would be dependent on a rake task :P. |
But aren't we relying on the approval status to override validations? I think we'd have to implement a separate column, but moving reservation status in the db is probably worthwhile. In that case it would be easy to differentiate between archived and checked-in reservations. I think you're probably right in that simply relying on notes during the archiving process isn't really sufficient. |
I don't think there's ever a situation where we need both the value of the approval status and the regular status to do something; every scope uses 'approvalstatus = auto or approved' as a filter. Auto and approved requests could just be converted to checkedout requests when they get checked out. Hmm, I just realized that the status of overdue would also need to be done via rake task. Maybe it's not such a great idea after all? What do we think about dependence on rake tasks? Actually, just had another idea. Returned overdue means returned + overdue, regular overdue means checked out + overdue. But missed also means reserved + overdue, in a sense (that is, the current date is after the reservation due date and the equipment hasn't been checked in). We could have one rake task (and one boolean column the db) that checks for this overdue criteria for all non-returned reservations. That way |
Since we're removing the |
The main issue with this is that overdue status change will have to be dependent on a rake task to scan through all the reservations each day and see if they're overdue or not. But if we think that's fine then I think it could really simplify everything else... |
Yea, I think that should be OK. I'm wondering if we could alternatively have a separate scope just for overdue so we don't miss them (i.e. use both status and due dates to check for overdue, but just status for everything else). We'll have to iron this out but either way we should go for it. |
While this sounds awesome, given resource constraints I'm bumping this to the Wish List (but with higher priority). |
Looking over this again, I think that using a Rake task to update statuses every night / eliminating most of our scopes would be awesome and we should try to get this done if we push out a v5.2.0. |
Would having major functionality dependent on a rake task upset deployment/config? IE are there nontrivially popular server configurations that do not allow running of cron jobs/rake tasks? |
I don't think so... if you're running your own VM / server then you will likely have cron by default, and I'd imagine all other cloud deployment services provide some form of cron (e.g. Heroku's scheduler, etc). @dgoerger any thoughts? |
afaik cron service should be available on virtually all hosting services.. it would be an odd omission from a unix server to be sure. We do however need to be careful not to have too many intensive tasks running simultaneously in shared environments. we already have cron tasks for emails, don't we? i.e., I thought we already had a hard dependency on crond? |
That's a great point, we're already relying on cron for most of our e-mails so at this point I'd say it's fair to consider it a dependency. |
Going to use approval_status to indicate whether or not a missed reservation email was sent. See #1031 |
Ok, confirmed: we should be considering a reservation We should also make sure that our upcoming reservation e-mail makes this behavior clear (although, admittedly, that's more complex once you factor in #1202, so maybe it's better to leave them separate). |
all of the status changes (status column, overdue boolean, flags bitmask) are implemented, including related rake tasks, in the process of updating everything else |
(also, the status enum works like this) |
everything is now functional; need to update scopes and remove |
wait, to clarify, missed reservations should still be marked missed after the due date passes for this issue, right? |
Nope, we're going to switch back to considering them missed after the start passes. This will preserve the current behavior of v3.4.x and we can try to make it configurable if we implement #1202. |
Something that came up today while I was glancing through our e-mails to respond to client feedback: we currently have a |
opened a new issue for some of the new flags, #1216 |
we also need to write status validations to ensure that the status is consistent with the other reservation attributes |
closes #462 - updated test for reservation model - add status enum to reservation model - add flags column to reservation - replaced all other instances of not_returned scope with not_available - removed denied_requests scope, replaced with denied - status validations - removed approval status - prevent status from changing when in a final state - human readable status moved to model - replace not_available scope with active
2015-02-23
We'll be overhauling the Reservation
status
method and converting it into a database column. This will make model scopes much simpler (and resolve an issue introduced by #939), as well as multiple rake tasks.Original
"Lost Reservation"/"Missing Equipment" should be another way to categorize reservations, in addition to Checked Out, Overdue, Future, etc.
The text was updated successfully, but these errors were encountered: