Summary: | Add Koha::Acquisition::Basket->close | ||
---|---|---|---|
Product: | Koha | Reporter: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Component: | Acquisitions | Assignee: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | andrew, jonathan.druart, lucas, martin.renvoize, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23971 | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
20.11.00
|
|
Circulation function: | |||
Bug Depends on: | 26515 | ||
Bug Blocks: | 23971, 26584 | ||
Attachments: |
Bug 26582: Unit tests
Bug 26582: Add Koha::Acquisition::Basket->close Bug 26582: Unit tests Bug 26582: Add Koha::Acquisition::Basket->close Bug 26582: Unit tests Bug 26582: Add Koha::Acquisition::Basket->close Bug 26582: (QA follow-up) Rename closed => is_closed |
Description
Tomás Cohen Arazi (tcohen)
2020-09-30 17:39:10 UTC
Created attachment 111003 [details] [review] Bug 26582: Unit tests Created attachment 111004 [details] [review] Bug 26582: Add Koha::Acquisition::Basket->close This patch adds two methods to Koha::Acquisition::Basket: - 'closed': that tells if the basket is closed - 'close': that closes the basket It inherits the behaviour from CloseBasket (as it actually makes sense). It improves CloseBasket by wrapping the action inside a transaction. It uses the $orders->update call with no_trigger as there's no trigger to trigger and the update can be done on a single DB call. A new exceptions file is added for basket-related exceptions. The only specific exception that gets added is Koha::Exceptions::Acquisition::Basket::AlreadyClosed To test: 1. Apply this patches 2. Run: $ kshell k$ prove t/db_dependent/Koha/Acquisition/Basket.t => SUCCESS: Tests pass! 3. Sign off :-D Created attachment 111032 [details] [review] Bug 26582: Unit tests Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 111033 [details] [review] Bug 26582: Add Koha::Acquisition::Basket->close This patch adds two methods to Koha::Acquisition::Basket: - 'closed': that tells if the basket is closed - 'close': that closes the basket It inherits the behaviour from CloseBasket (as it actually makes sense). It improves CloseBasket by wrapping the action inside a transaction. It uses the $orders->update call with no_trigger as there's no trigger to trigger and the update can be done on a single DB call. A new exceptions file is added for basket-related exceptions. The only specific exception that gets added is Koha::Exceptions::Acquisition::Basket::AlreadyClosed To test: 1. Apply this patches 2. Run: $ kshell k$ prove t/db_dependent/Koha/Acquisition/Basket.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Works as expected, tests pass.. QA Script throws a false failure (POD). Signing off Created attachment 111528 [details] [review] Bug 26582: Unit tests Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 111529 [details] [review] Bug 26582: Add Koha::Acquisition::Basket->close This patch adds two methods to Koha::Acquisition::Basket: - 'closed': that tells if the basket is closed - 'close': that closes the basket It inherits the behaviour from CloseBasket (as it actually makes sense). It improves CloseBasket by wrapping the action inside a transaction. It uses the $orders->update call with no_trigger as there's no trigger to trigger and the update can be done on a single DB call. A new exceptions file is added for basket-related exceptions. The only specific exception that gets added is Koha::Exceptions::Acquisition::Basket::AlreadyClosed To test: 1. Apply this patches 2. Run: $ kshell k$ prove t/db_dependent/Koha/Acquisition/Basket.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> "closed" should be "is_closed" (and we need a guideline for this). Created attachment 111748 [details] [review] Bug 26582: (QA follow-up) Rename closed => is_closed Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Pushed to master for 20.11, thanks to everybody involved! enhancement will not be backported to 20.05.x |