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

patron: add circulation statistic API #1312

Merged

Conversation

zannkukai
Copy link
Contributor

Adds an API to get patron circulation loan statistics. This API return
the number of loans relate to this patron by state.

Closes #1278

Co-Authored-by: Renaud Michotte renaud.michotte@gmail.com

Code review check list

  • Commit message template compliance.
  • Commit message without typos.
  • File names.
  • Functions names.
  • Functions docstrings.
  • Unnecessary commited files?

@zannkukai zannkukai added the f: circulation Concerns the circulation interface or backend label Oct 16, 2020
@zannkukai zannkukai added this to the v0.14.0 milestone Oct 16, 2020
@zannkukai zannkukai requested a review from BadrAly October 16, 2020 15:16
@zannkukai zannkukai self-assigned this Oct 16, 2020
@zannkukai zannkukai force-pushed the zan-patron-circulation-stat branch 2 times, most recently from 3382e7f to cb632de Compare October 19, 2020 08:13
@zannkukai zannkukai marked this pull request as ready for review October 19, 2020 09:04
rero_ils/modules/loans/api.py Outdated Show resolved Hide resolved
@zannkukai zannkukai force-pushed the zan-patron-circulation-stat branch 2 times, most recently from d493943 to afbc9dc Compare October 20, 2020 07:20
@zannkukai zannkukai requested a review from lauren-d October 20, 2020 07:23

login_user_via_session(client, librarian_martigny_no_email.user)
res = client.get(url)
assert res.status_code == 200
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test to validate the output of the function get_loans_stats_by_patron_pid? so we are sure it is returning the expected results

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's difficult because stats are different if you execute the test as standalone or with the full tests.

@BadrAly BadrAly self-requested a review October 26, 2020 17:22
@zannkukai zannkukai force-pushed the zan-patron-circulation-stat branch from afbc9dc to 9c134a2 Compare October 27, 2020 14:53
@zannkukai zannkukai changed the base branch from dev to US1643-borrow-limits October 27, 2020 14:53
@zannkukai zannkukai requested review from BadrAly and lauren-d October 27, 2020 14:53
@zannkukai zannkukai force-pushed the US1643-borrow-limits branch from da250ee to 97dfe0e Compare October 28, 2020 09:08
@zannkukai zannkukai force-pushed the zan-patron-circulation-stat branch 3 times, most recently from b97aa84 to 00cacf1 Compare October 28, 2020 12:29
@zannkukai zannkukai force-pushed the zan-patron-circulation-stat branch 3 times, most recently from cb2b3d5 to adf2b28 Compare October 28, 2020 18:00
Adds an API to get patron circulation informations. This API return
the number of loans relate to this patron by state and messages useful
for the circulation about this patron (patron blocked, checkout limit,
...)

Closes rero#1278

Co-Authored-by: Renaud Michotte <renaud.michotte@gmail.com>
@zannkukai zannkukai force-pushed the zan-patron-circulation-stat branch from adf2b28 to befae76 Compare October 28, 2020 18:25
@zannkukai zannkukai merged commit 808f75a into rero:US1643-borrow-limits Oct 28, 2020
@zannkukai zannkukai deleted the zan-patron-circulation-stat branch November 2, 2020 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
f: circulation Concerns the circulation interface or backend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The patron account tab should contain the count of the items.
5 participants