inveniosoftware / invenio-circulation

Library circulation module for Invenio.
https://invenio-circulation.readthedocs.io
MIT License
0 stars 18 forks source link

Policies: Request circulation policies #98

Closed BadrAly closed 5 years ago

BadrAly commented 5 years ago

Co-authored-by: Aly Badr aly.badr@rero.ch Co-authored-by: bertrand Zuchuat bertrand.zuchuat@rero.ch

ntarocco commented 5 years ago

@BadrAly I want to give you our point of view on this, because we had similar thoughts.

The CREATED status is a "fake" one: we need a starting point to perform the first transition to REQUESTED or to another state, but ideally we should never have loans in state CREATED.

Are you planning to build a UI to find all CREATED and clean them up at certain point?

In our case, we decided that we never want this state, so we actually check in ILS, before, if the Item can be requested and then we perform in one single atomic operation:

# check first if loan can be created and requested for the given item
loan = Loan.create()  # status will be CREATED
circulation.trigger(
    loan, **dict(params, trigger="request")
)
# status will be REQUESTED

Basically for us is or REQUESTED, or it does not exist in our db.

BadrAly commented 5 years ago

@ntarocco : Could you please merge this PR? We already manage the CREATED status as you explained on our UI. @jma will add more to this later.