Bug 29288

Summary: Add current_checkouts and old_checkouts methods to Koha::Biblio
Product: Koha Reporter: Tomás Cohen Arazi <tomascohen>
Component: Architecture, internals, and plumbingAssignee: Tomás Cohen Arazi <tomascohen>
Status: RESOLVED FIXED QA Contact: Martin Renvoize <martin.renvoize>
Severity: enhancement    
Priority: P5 - low CC: jonathan.druart+koha, kyle, martin.renvoize, nick
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Text to go in the release notes:
Version(s) released in:
21.11.00
Bug Depends on: 11175    
Bug Blocks: 29290    
Attachments: Bug 29288: Unit tests
Bug 29288: Add current_checkouts and old_checkouts methods to Koha::Biblio
Bug 29288: Unit tests
Bug 29288: Add current_checkouts and old_checkouts methods to Koha::Biblio
Bug 29288: Unit tests
Bug 29288: Add current_checkouts and old_checkouts methods to Koha::Biblio
Bug 29288: Unit tests
Bug 29288: Add current_checkouts and old_checkouts methods to Koha::Biblio

Description Tomás Cohen Arazi 2021-10-20 21:01:04 UTC
It would be handy to have such methods. Needed for a follow-up bug.
Comment 1 Tomás Cohen Arazi 2021-10-20 21:03:38 UTC
Created attachment 126614 [details] [review]
Bug 29288: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 2 Tomás Cohen Arazi 2021-10-20 21:03:42 UTC
Created attachment 126615 [details] [review]
Bug 29288: Add current_checkouts and old_checkouts methods to Koha::Biblio

This patch adds helper methods for accessing current and past checkouts
for a given Koha::Biblio object.

To test:
1. Apply the unit tests
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Biblio.t
=> FAIL: Methods are not implemented
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 3 David Nind 2021-10-20 22:36:53 UTC
Created attachment 126629 [details] [review]
Bug 29288: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 David Nind 2021-10-20 22:36:57 UTC
Created attachment 126630 [details] [review]
Bug 29288: Add current_checkouts and old_checkouts methods to Koha::Biblio

This patch adds helper methods for accessing current and past checkouts
for a given Koha::Biblio object.

To test:
1. Apply the unit tests
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Biblio.t
=> FAIL: Methods are not implemented
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: David Nind <david@davidnind.com>
Comment 5 Martin Renvoize 2021-10-21 08:20:13 UTC
Created attachment 126642 [details] [review]
Bug 29288: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 6 Martin Renvoize 2021-10-21 08:20:17 UTC
Created attachment 126643 [details] [review]
Bug 29288: Add current_checkouts and old_checkouts methods to Koha::Biblio

This patch adds helper methods for accessing current and past checkouts
for a given Koha::Biblio object.

To test:
1. Apply the unit tests
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Biblio.t
=> FAIL: Methods are not implemented
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 7 Martin Renvoize 2021-10-21 08:20:51 UTC
I wondered if there was any way to do this directly with relations, but it appears not.

As such, it's looking good and works as expected..

Passing QA
Comment 8 Tomás Cohen Arazi 2021-10-27 11:46:07 UTC
Created attachment 126973 [details] [review]
Bug 29288: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 9 Tomás Cohen Arazi 2021-10-27 11:46:12 UTC
Created attachment 126974 [details] [review]
Bug 29288: Add current_checkouts and old_checkouts methods to Koha::Biblio

This patch adds helper methods for accessing current and past checkouts
for a given Koha::Biblio object.

To test:
1. Apply the unit tests
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Biblio.t
=> FAIL: Methods are not implemented
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 10 Tomás Cohen Arazi 2021-10-27 11:46:59 UTC
Rebased on top of bug 14957.
Comment 11 Jonathan Druart 2021-10-28 15:45:19 UTC
Pushed to master for 21.11, thanks to everybody involved!