Bug 41728: (QA follow-up) Move Item::Checkin::Availability to Item::Availability::Checkin
Introduce a dedicated Koha::Item::Availability::* namespace for checkers
that return a Koha::Result::Availability. Keeping these under the Item
subject prefix keeps them co-located with the Item they describe, while
the Availability sub-namespace gives future parallel checkers
(Checkout, Hold, Book, ...) an obvious home rather than scattering them
as single-file directories alongside Koha/Item/Transfer/ etc.
The $item->checkin_availability convenience method on Koha::Item is
preserved; only its internal delegation target changes.
Renames:
Koha::Item::Checkin::Availability -> Koha::Item::Availability::Checkin
Koha/Item/Checkin/Availability.pm -> Koha/Item/Availability/Checkin.pm
t/db_dependent/Koha/Item/Checkin/Availability.t
-> t/db_dependent/Koha/Item/Availability/Checkin.t
Test plan:
prove t/db_dependent/Koha/Item/Availability/Checkin.t
prove t/db_dependent/Circulation/Returns.t
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
parent
be74523028
commit
fbe7c7a60f
|
|
@ -867,7 +867,7 @@ sub can_be_returned_at {
|
||||||
|
|
||||||
Returns check-in availability information for this item.
|
Returns check-in availability information for this item.
|
||||||
|
|
||||||
This is a convenience method that calls Koha::Item::Checkin::Availability->check().
|
This is a convenience method that calls Koha::Item::Availability::Checkin->check().
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
library => branchcode where the return takes place (required)
|
library => branchcode where the return takes place (required)
|
||||||
|
|
@ -887,8 +887,8 @@ Returns a Koha::Result::Availability object with methods:
|
||||||
sub checkin_availability {
|
sub checkin_availability {
|
||||||
my ( $self, $params ) = @_;
|
my ( $self, $params ) = @_;
|
||||||
|
|
||||||
require Koha::Item::Checkin::Availability;
|
require Koha::Item::Availability::Checkin;
|
||||||
return Koha::Item::Checkin::Availability->check( $self, $params );
|
return Koha::Item::Availability::Checkin->check( $self, $params );
|
||||||
}
|
}
|
||||||
|
|
||||||
=head3 request_transfer
|
=head3 request_transfer
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package Koha::Item::Checkin::Availability;
|
package Koha::Item::Availability::Checkin;
|
||||||
|
|
||||||
# Copyright 2026 Koha Development Team
|
# Copyright 2026 Koha Development Team
|
||||||
#
|
#
|
||||||
|
|
@ -24,11 +24,11 @@ use Koha::Result::Availability;
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
Koha::Item::Checkin::Availability - Check-in availability validation for items
|
Koha::Item::Availability::Checkin - Check-in availability validation for items
|
||||||
|
|
||||||
=head1 SYNOPSIS
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
my $availability = Koha::Item::Checkin::Availability->check( $item,
|
my $availability = Koha::Item::Availability::Checkin->check( $item,
|
||||||
{
|
{
|
||||||
library => $branchcode,
|
library => $branchcode,
|
||||||
to_library => $destination_branchcode,
|
to_library => $destination_branchcode,
|
||||||
|
|
@ -68,7 +68,7 @@ The result categorizes conditions as:
|
||||||
|
|
||||||
=head3 check
|
=head3 check
|
||||||
|
|
||||||
my $availability = Koha::Item::Checkin::Availability->check( $item,
|
my $availability = Koha::Item::Availability::Checkin->check( $item,
|
||||||
{
|
{
|
||||||
library => $branchcode,
|
library => $branchcode,
|
||||||
to_library => $destination_branchcode,
|
to_library => $destination_branchcode,
|
||||||
|
|
@ -26,7 +26,7 @@ use t::lib::TestBuilder;
|
||||||
use t::lib::Mocks;
|
use t::lib::Mocks;
|
||||||
|
|
||||||
use Koha::Database;
|
use Koha::Database;
|
||||||
use Koha::Item::Checkin::Availability;
|
use Koha::Item::Availability::Checkin;
|
||||||
|
|
||||||
my $builder = t::lib::TestBuilder->new;
|
my $builder = t::lib::TestBuilder->new;
|
||||||
my $schema = Koha::Database->new->schema;
|
my $schema = Koha::Database->new->schema;
|
||||||
Loading…
Reference in New Issue