[Bug 21786] New: Routes for credits should include library_id
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21786 Bug ID: 21786 Summary: Routes for credits should include library_id Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: REST api Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21786 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |19066 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19066 [Bug 19066] Add branchcode to accountlines -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21786 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |20944, 20942 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20942 [Bug 20942] Add route to get patron's account balance https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20944 [Bug 20944] Add routes to add credits to a patron's account -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21786 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21786 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21786 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 82198 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=82198&action=edit Bug 21786: Add library_id to the spec definitions -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21786 --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 82199 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=82199&action=edit Bug 21786: Unit tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21786 --- Comment #3 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 82200 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=82200&action=edit Bug 21786: Make balance and credits endpoints handle library_id This patch: - Adds the branchcode <-> library_id mapping in the controller - Adds 'library_id' to the credit and account_line definitions - Makes add_credit handle the library_id param, passing it to the underlying $account->add_credit method. To test: - Run: $ kshell k$ prove t/db_dependent/api/v1/patrons_accounts.t => FAIL: Tests fail, because library_id is not mapped (balance) and because it is not handled when adding a credit. - Apply this patch - Run: k$ prove t/db_dependent/api/v1/patrons_accounts.t => SUCCESS: Tests pass! - Sign off :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21786 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21786 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #82198|0 |1 is obsolete| | Attachment #82199|0 |1 is obsolete| | Attachment #82200|0 |1 is obsolete| | --- Comment #4 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 82279 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=82279&action=edit Bug 21786: Add library_id to the spec definitions Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21786 --- Comment #5 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 82280 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=82280&action=edit Bug 21786: Unit tests Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21786 --- Comment #6 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 82281 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=82281&action=edit Bug 21786: Make balance and credits endpoints handle library_id This patch: - Adds the branchcode <-> library_id mapping in the controller - Adds 'library_id' to the credit and account_line definitions - Makes add_credit handle the library_id param, passing it to the underlying $account->add_credit method. To test: - Run: $ kshell k$ prove t/db_dependent/api/v1/patrons_accounts.t => FAIL: Tests fail, because library_id is not mapped (balance) and because it is not handled when adding a credit. - Apply this patch - Run: k$ prove t/db_dependent/api/v1/patrons_accounts.t => SUCCESS: Tests pass! - Sign off :-D Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21786 --- Comment #7 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 83529 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=83529&action=edit Bug 21786: (QA follow-up) library_id can be null Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21786 Alex Arnaud <alex.arnaud@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |alex.arnaud@biblibre.com --- Comment #8 from Alex Arnaud <alex.arnaud@biblibre.com> --- got this error: {"errors":[{"message":"Expected string - got null.","path":"\/outstanding_debits\/lines\/0\/library_id"}],"status":500} While retrieving an account with debits made before applying this patch. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21786 Alex Arnaud <alex.arnaud@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact| |alex.arnaud@biblibre.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21786 --- Comment #9 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Alex Arnaud from comment #8)
got this error: {"errors":[{"message":"Expected string - got null.","path":"\/outstanding_debits\/lines\/0\/library_id"}],"status":500}
While retrieving an account with debits made before applying this patch.
Are you sure you restarted Plack? (if you tested with the follow-up) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21786 --- Comment #10 from Alex Arnaud <alex.arnaud@biblibre.com> --- (In reply to Tomás Cohen Arazi from comment #9)
(In reply to Alex Arnaud from comment #8)
got this error: {"errors":[{"message":"Expected string - got null.","path":"\/outstanding_debits\/lines\/0\/library_id"}],"status":500}
While retrieving an account with debits made before applying this patch.
Are you sure you restarted Plack? (if you tested with the follow-up)
The last patch arrived just before my comment. What a quick fix Thomas! :-) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21786 Alex Arnaud <alex.arnaud@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #82279|0 |1 is obsolete| | --- Comment #11 from Alex Arnaud <alex.arnaud@biblibre.com> --- Created attachment 83530 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=83530&action=edit Bug 21786: Add library_id to the spec definitions Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21786 Alex Arnaud <alex.arnaud@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #82280|0 |1 is obsolete| | --- Comment #12 from Alex Arnaud <alex.arnaud@biblibre.com> --- Created attachment 83531 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=83531&action=edit Bug 21786: Unit tests Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21786 Alex Arnaud <alex.arnaud@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #82281|0 |1 is obsolete| | --- Comment #13 from Alex Arnaud <alex.arnaud@biblibre.com> --- Created attachment 83532 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=83532&action=edit Bug 21786: Make balance and credits endpoints handle library_id This patch: - Adds the branchcode <-> library_id mapping in the controller - Adds 'library_id' to the credit and account_line definitions - Makes add_credit handle the library_id param, passing it to the underlying $account->add_credit method. To test: - Run: $ kshell k$ prove t/db_dependent/api/v1/patrons_accounts.t => FAIL: Tests fail, because library_id is not mapped (balance) and because it is not handled when adding a credit. - Apply this patch - Run: k$ prove t/db_dependent/api/v1/patrons_accounts.t => SUCCESS: Tests pass! - Sign off :-D Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21786 Alex Arnaud <alex.arnaud@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #83529|0 |1 is obsolete| | --- Comment #14 from Alex Arnaud <alex.arnaud@biblibre.com> --- Created attachment 83533 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=83533&action=edit Bug 21786: (QA follow-up) library_id can be null Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21786 Alex Arnaud <alex.arnaud@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21786 Bug 21786 depends on bug 20944, which changed state. Bug 20944 Summary: Add routes to add credits to a patron's account https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20944 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21786 Bug 21786 depends on bug 19066, which changed state. Bug 19066 Summary: Add branchcode to accountlines https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19066 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21786 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |nick@bywatersolutions.com --- Comment #15 from Nick Clemens <nick@bywatersolutions.com> --- Awesome work all! Pushed to master for 19.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21786 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Severity|normal |enhancement Resolution|--- |FIXED Status|Pushed to Master |RESOLVED --- Comment #16 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Depends on enhancement in bug 19066, will not be backported to 18.11.x series. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21786 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |normal -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org