Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Book Availability Logic #15

Open
9gix opened this issue Jan 5, 2016 · 2 comments
Open

Book Availability Logic #15

9gix opened this issue Jan 5, 2016 · 2 comments
Assignees
Labels

Comments

@9gix
Copy link
Owner

9gix commented Jan 5, 2016

The existing logic is based on the Count of Loan and LoanReturn.

  • if Count(Loan) == Count(LoanReturn) then available
  • else: unavailable

The correct logic should be:

  • if Book has no loan or Book last loan has been returned, then available.
  • else unavailable
@9gix 9gix added the cleanup label Jan 5, 2016
@9gix 9gix added the archived label Feb 26, 2017
@9gix 9gix closed this as completed Feb 26, 2017
@9gix 9gix reopened this Feb 26, 2017
@9gix 9gix removed the archived label Feb 26, 2017
@digawp
Copy link
Collaborator

digawp commented Mar 9, 2017

If I don't trace it wrongly, this logic is now implemented here. Seems like it is already using the correct logic. @9gix can you verify?
I would try to verify it myself, but I am not sure how do I create a new account for testing, or if there is a default one

@9gix
Copy link
Owner Author

9gix commented Mar 9, 2017

I believe you're pointing to the correct section for the current master branch.
However, just to share some historical reason, the master used to have the available queryset, which was removed at PR #30. I haven't read in details about the changes yet. But If I'm not wrong, I remove it to decouple catalog and circulation. Since catalog shouldn't know about circulation or availability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants