Still have some code for this in the pipeline. Coming up.
Created attachment 151800 [details] [review] Bug 33245: TestBuilder: Default value for anonymized When we create a patron with TestBuilder, we normally do not expect an anonymized status. This will certainly hold for the patrons we are creating for testing is_active in a following patch. Test plan: Run t/db_dependent/Koha/Patron.t Run t/db_dependent/Koha/Patrons.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 151801 [details] [review] Bug 33245: Introduce patron->is_active Does only add the new patron method. NOTE: We may define additional criteria at some point, but I think that this is a good starting point. Test plan: Run perl -MKoha::Patron -e'print Koha::Patrons->find(X)->is_active;' Note: replace X by a valid borrowernumber. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 151802 [details] [review] Bug 33245: Add unit test Test plan: Run t/db_dependent/Koha/Patron.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 153435 [details] [review] Bug 33245: TestBuilder: Default value for anonymized When we create a patron with TestBuilder, we normally do not expect an anonymized status. This will certainly hold for the patrons we are creating for testing is_active in a following patch. Test plan: Run t/db_dependent/Koha/Patron.t Run t/db_dependent/Koha/Patrons.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Created attachment 153436 [details] [review] Bug 33245: Introduce patron->is_active Does only add the new patron method. NOTE: We may define additional criteria at some point, but I think that this is a good starting point. Test plan: Run perl -MKoha::Patron -e'print Koha::Patrons->find(X)->is_active;' Note: replace X by a valid borrowernumber. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Created attachment 153437 [details] [review] Bug 33245: Add unit test Test plan: Run t/db_dependent/Koha/Patron.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Please amend and tidy the patches. + $dt = dt_from_string()->subtract( days => 180 ); # default fallback Where is 180 coming from?
(In reply to Jonathan Druart from comment #8) > Please amend and tidy the patches. Will submit. > + $dt = dt_from_string()->subtract( days => 180 ); # default fallback > Where is 180 coming from? The 180 is a fallback as noted in the comment. Normally you should pass the desired number of days, months to the routine. The follow-up patch does this in a cron script: Bug 33522 + my $patron_active = $recent->is_active({ months => $active // $inactive }); # checked already that only one is defined
Created attachment 155050 [details] [review] Bug 33245: TestBuilder: Default value for anonymized When we create a patron with TestBuilder, we normally do not expect an anonymized status. This will certainly hold for the patrons we are creating for testing is_active in a following patch. Test plan: Run t/db_dependent/Koha/Patron.t Run t/db_dependent/Koha/Patrons.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Created attachment 155051 [details] [review] Bug 33245: Introduce patron->is_active Does only add the new patron method. NOTE: We may define additional criteria at some point, but I think that this is a good starting point. Test plan: Run perl -MKoha::Patron -e'print Koha::Patrons->find(X)->is_active;' Note: replace X by a valid borrowernumber. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Created attachment 155052 [details] [review] Bug 33245: Add unit test Test plan: Run t/db_dependent/Koha/Patron.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
(In reply to Marcel de Rooy from comment #9) > (In reply to Jonathan Druart from comment #8) > > + $dt = dt_from_string()->subtract( days => 180 ); # default fallback > > Where is 180 coming from? > > The 180 is a fallback as noted in the comment. Normally you should pass the > desired number of days, months to the routine. So maybe make it mandatory?
Created attachment 155161 [details] [review] Bug 33245: TestBuilder: Default value for anonymized When we create a patron with TestBuilder, we normally do not expect an anonymized status. This will certainly hold for the patrons we are creating for testing is_active in a following patch. Test plan: Run t/db_dependent/Koha/Patron.t Run t/db_dependent/Koha/Patrons.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Created attachment 155162 [details] [review] Bug 33245: Introduce patron->is_active Does only add the new patron method. NOTE: We may define additional criteria at some point, but I think that this is a good starting point. Test plan: Run perl -MKoha::Patron -e'print Koha::Patrons->find(X)->is_active(Y);' Note: replace X by a valid borrowernumber and Y by date criterium. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Created attachment 155163 [details] [review] Bug 33245: Add unit test Test plan: Run t/db_dependent/Koha/Patron.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
(In reply to Jonathan Druart from comment #13) > (In reply to Marcel de Rooy from comment #9) > > (In reply to Jonathan Druart from comment #8) > > > + $dt = dt_from_string()->subtract( days => 180 ); # default fallback > > > Where is 180 coming from? > > > > The 180 is a fallback as noted in the comment. Normally you should pass the > > desired number of days, months to the routine. > > So maybe make it mandatory? Fixed. Throws exception now.
Created attachment 156528 [details] [review] Bug 33245: TestBuilder: Default value for anonymized When we create a patron with TestBuilder, we normally do not expect an anonymized status. This will certainly hold for the patrons we are creating for testing is_active in a following patch. Test plan: Run t/db_dependent/Koha/Patron.t Run t/db_dependent/Koha/Patrons.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 156529 [details] [review] Bug 33245: Introduce patron->is_active Does only add the new patron method. NOTE: We may define additional criteria at some point, but I think that this is a good starting point. Test plan: Run perl -MKoha::Patron -e'print Koha::Patrons->find(X)->is_active(Y);' Note: replace X by a valid borrowernumber and Y by date criterium. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 156530 [details] [review] Bug 33245: Add unit test Test plan: Run t/db_dependent/Koha/Patron.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> JD amended patch: Adjust number of tests Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Please rebase the tests.
Created attachment 156541 [details] [review] Bug 33245: TestBuilder: Default value for anonymized When we create a patron with TestBuilder, we normally do not expect an anonymized status. This will certainly hold for the patrons we are creating for testing is_active in a following patch. Test plan: Run t/db_dependent/Koha/Patron.t Run t/db_dependent/Koha/Patrons.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 156542 [details] [review] Bug 33245: Introduce patron->is_active Does only add the new patron method. NOTE: We may define additional criteria at some point, but I think that this is a good starting point. Test plan: Run perl -MKoha::Patron -e'print Koha::Patrons->find(X)->is_active(Y);' Note: replace X by a valid borrowernumber and Y by date criterium. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 156543 [details] [review] Bug 33245: Add unit test Test plan: Run t/db_dependent/Koha/Patron.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> JD amended patch: Adjust number of tests Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Pushed to master for 23.11. Nice work everyone, thanks!
Enhancement not pushed to 23.05.x