When we configure our CIRCULATION_POLICIES for the transition extension we provide an input max_count which is the number of maximum number of automatic extensions allowed for a loan. This number should affects only patrons, admins and librarians should not be restricted by extensions cap.
Instead of providing a number for max extensions we can move this logic outside of our circulation module and provide instead of max_count a boolean or a method can_be_extended which will do the validation for it.
We will also have to adjust _ensure_valid_extension accordingly.
When we configure our
CIRCULATION_POLICIES
for the transitionextension
we provide an inputmax_count
which is the number of maximum number of automatic extensions allowed for a loan. This number should affects only patrons, admins and librarians should not be restricted by extensions cap.Instead of providing a number for max extensions we can move this logic outside of our circulation module and provide instead of
max_count
a boolean or a methodcan_be_extended
which will do the validation for it.We will also have to adjust
_ensure_valid_extension
accordingly.