Created attachment 82198 [details] [review] Bug 21786: Add library_id to the spec definitions
Created attachment 82199 [details] [review] Bug 21786: Unit tests
Created attachment 82200 [details] [review] 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
Created attachment 82279 [details] [review] Bug 21786: Add library_id to the spec definitions Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 82280 [details] [review] Bug 21786: Unit tests Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 82281 [details] [review] 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>
Created attachment 83529 [details] [review] Bug 21786: (QA follow-up) library_id can be null Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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.
(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)
(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! :-)
Created attachment 83530 [details] [review] 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>
Created attachment 83531 [details] [review] Bug 21786: Unit tests Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Created attachment 83532 [details] [review] 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>
Created attachment 83533 [details] [review] 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>
Awesome work all! Pushed to master for 19.05
Depends on enhancement in bug 19066, will not be backported to 18.11.x series.