This repository was archived by the owner on Jul 24, 2020. It is now read-only.
This repository was archived by the owner on Jul 24, 2020. It is now read-only.
Refactor ReservationsController#checkin and #checkout #666
Closed
Description
Superseding #348, #349 and #350, since the refactorings will have to be done in tandem.
Refactorings to do:
For #checkout:
- TOS acceptance validation
- Fix faulty comparisons (e.g.
if reservation_hash[:equipment_object_id] != ('' or nil)
doesn't do what we'd expect it to do --reservation_hash[:equipment_object_id].present?
is the way to go) - "Going down the checklist" check (see refactor out similar code in ln 138-140 and ln 225-227 of ReservationController #348)
- Overdue reservations validation (pending Fundamental Rewrite of Validation System #644)
-
Move reservation-saving logic into the Cart (pending Fundamental Rewrite of Validation System #644) - Fix the
rescue
block to only rescue ActiveRecord exceptions - Make checkout a transactioned process (Transactionize reservations checkout (?) #225)
- Write full-featured test for the method's full expected behavior (Create full test coverage for ReservationsController #checkin, #checkout and #renew #679)
For #checking:
- "Going down the checklist" check (see refactor out similar code in ln 138-140 and ln 225-227 of ReservationController #348)
-
Move reservation-saving logic into the Cart (pending Fundamental Rewrite of Validation System #644) - Fix the
rescue
block to only rescue ActiveRecord exceptions - Make checkin a transactioned process (Transactionize reservations checkout (?) #225)
- Write full-featured test for the method's full expected behavior (Create full test coverage for ReservationsController #checkin, #checkout and #renew #679)
Activity