Skip to content
This repository has been archived by the owner on Jul 24, 2020. It is now read-only.

Refactor Reservation Date Logic #1669

Open
esoterik opened this issue Mar 4, 2017 · 2 comments
Open

Refactor Reservation Date Logic #1669

esoterik opened this issue Mar 4, 2017 · 2 comments

Comments

@esoterik
Copy link
Collaborator

esoterik commented Mar 4, 2017

We need to make sure that there's a single source of date logic for reservations that lives in the Reservations model. #end_date and #overlaps_with? are two examples of methods that do this already, but I don't trust that they're used appropriately everywhere.

In the end, the only time the due_date attribute should be referenced outside of the reservation model is during reservation creation and when reservations are flagged as overdue (essentially, only situations that care about the actual due date, not just when the reservation is no longer actively holding an equipment item). Everywhere else should use an appropriate method on the reservation model.

The motivation behind this is to make #986 easier: in that issue, we need to add a processing date attribute to reservations.

@acelwood
Copy link

Should the "due for checkin" date for overdue items be the original due date (in the past) or "today"?

@acelwood
Copy link

The cart and cart validations due date is separate from this issue, right? Because the cart is not (yet) a reservation?

@orenyk orenyk modified the milestones: 6.3.0, 7.0.0, Spring 2017, 6.4.0 Dec 12, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants