Bug 30650: DBIC

Signed-off-by: Koha Team University Lyon 3 <koha@univ-lyon3.fr>

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Jonathan Druart 2022-06-27 13:59:51 +02:00 committed by Tomas Cohen Arazi
parent 56e1ce35ab
commit d6d6e6ed0a
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F
6 changed files with 640 additions and 4 deletions

View file

@ -1258,6 +1258,36 @@ __PACKAGE__->has_many(
{ cascade_copy => 0, cascade_delete => 0 },
);
=head2 curbside_pickups_borrowernumbers
Type: has_many
Related object: L<Koha::Schema::Result::CurbsidePickup>
=cut
__PACKAGE__->has_many(
"curbside_pickups_borrowernumbers",
"Koha::Schema::Result::CurbsidePickup",
{ "foreign.borrowernumber" => "self.borrowernumber" },
{ cascade_copy => 0, cascade_delete => 0 },
);
=head2 curbside_pickups_staged_by
Type: has_many
Related object: L<Koha::Schema::Result::CurbsidePickup>
=cut
__PACKAGE__->has_many(
"curbside_pickups_staged_by",
"Koha::Schema::Result::CurbsidePickup",
{ "foreign.staged_by" => "self.borrowernumber" },
{ cascade_copy => 0, cascade_delete => 0 },
);
=head2 discharges
Type: has_many
@ -1989,8 +2019,8 @@ Composing rels: L</user_permissions> -> permission
__PACKAGE__->many_to_many("permissions", "user_permissions", "permission");
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-07-05 12:41:19
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:e5ZH2Ise5JLYRXrq22L9rw
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-07-07 12:48:35
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:iffysIl9TxAnXVzpWiUJuw
__PACKAGE__->has_many(
"extended_attributes",

View file

@ -611,6 +611,36 @@ __PACKAGE__->has_many(
{ cascade_copy => 0, cascade_delete => 0 },
);
=head2 curbside_pickup_policy
Type: might_have
Related object: L<Koha::Schema::Result::CurbsidePickupPolicy>
=cut
__PACKAGE__->might_have(
"curbside_pickup_policy",
"Koha::Schema::Result::CurbsidePickupPolicy",
{ "foreign.branchcode" => "self.branchcode" },
{ cascade_copy => 0, cascade_delete => 0 },
);
=head2 curbside_pickups
Type: has_many
Related object: L<Koha::Schema::Result::CurbsidePickup>
=cut
__PACKAGE__->has_many(
"curbside_pickups",
"Koha::Schema::Result::CurbsidePickup",
{ "foreign.branchcode" => "self.branchcode" },
{ cascade_copy => 0, cascade_delete => 0 },
);
=head2 desks
Type: has_many
@ -882,8 +912,8 @@ __PACKAGE__->has_many(
);
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2022-03-28 22:07:59
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Kpv55lV6FRGoxxu5nufXhg
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-06-27 11:58:43
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1m1v0sml/1gBHxAkQl8BaA
__PACKAGE__->add_columns(
'+pickup_location' => { is_boolean => 1 },

View file

@ -0,0 +1,211 @@
use utf8;
package Koha::Schema::Result::CurbsidePickup;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE
=head1 NAME
Koha::Schema::Result::CurbsidePickup
=cut
use strict;
use warnings;
use base 'DBIx::Class::Core';
=head1 TABLE: C<curbside_pickups>
=cut
__PACKAGE__->table("curbside_pickups");
=head1 ACCESSORS
=head2 id
data_type: 'integer'
is_auto_increment: 1
is_nullable: 0
=head2 borrowernumber
data_type: 'integer'
is_foreign_key: 1
is_nullable: 0
=head2 branchcode
data_type: 'varchar'
is_foreign_key: 1
is_nullable: 0
size: 10
=head2 scheduled_pickup_datetime
data_type: 'datetime'
datetime_undef_if_invalid: 1
is_nullable: 0
=head2 staged_datetime
data_type: 'datetime'
datetime_undef_if_invalid: 1
is_nullable: 1
=head2 staged_by
data_type: 'integer'
is_foreign_key: 1
is_nullable: 1
=head2 arrival_datetime
data_type: 'datetime'
datetime_undef_if_invalid: 1
is_nullable: 1
=head2 delivered_datetime
data_type: 'datetime'
datetime_undef_if_invalid: 1
is_nullable: 1
=head2 delivered_by
data_type: 'integer'
is_nullable: 1
=head2 notes
data_type: 'text'
is_nullable: 1
=cut
__PACKAGE__->add_columns(
"id",
{ data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
"borrowernumber",
{ data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
"branchcode",
{ data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 10 },
"scheduled_pickup_datetime",
{
data_type => "datetime",
datetime_undef_if_invalid => 1,
is_nullable => 0,
},
"staged_datetime",
{
data_type => "datetime",
datetime_undef_if_invalid => 1,
is_nullable => 1,
},
"staged_by",
{ data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
"arrival_datetime",
{
data_type => "datetime",
datetime_undef_if_invalid => 1,
is_nullable => 1,
},
"delivered_datetime",
{
data_type => "datetime",
datetime_undef_if_invalid => 1,
is_nullable => 1,
},
"delivered_by",
{ data_type => "integer", is_nullable => 1 },
"notes",
{ data_type => "text", is_nullable => 1 },
);
=head1 PRIMARY KEY
=over 4
=item * L</id>
=back
=cut
__PACKAGE__->set_primary_key("id");
=head1 RELATIONS
=head2 borrowernumber
Type: belongs_to
Related object: L<Koha::Schema::Result::Borrower>
=cut
__PACKAGE__->belongs_to(
"borrowernumber",
"Koha::Schema::Result::Borrower",
{ borrowernumber => "borrowernumber" },
{ is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
);
=head2 branchcode
Type: belongs_to
Related object: L<Koha::Schema::Result::Branch>
=cut
__PACKAGE__->belongs_to(
"branchcode",
"Koha::Schema::Result::Branch",
{ branchcode => "branchcode" },
{ is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
);
=head2 curbside_pickup_issues
Type: has_many
Related object: L<Koha::Schema::Result::CurbsidePickupIssue>
=cut
__PACKAGE__->has_many(
"curbside_pickup_issues",
"Koha::Schema::Result::CurbsidePickupIssue",
{ "foreign.curbside_pickup_id" => "self.id" },
{ cascade_copy => 0, cascade_delete => 0 },
);
=head2 staged_by
Type: belongs_to
Related object: L<Koha::Schema::Result::Borrower>
=cut
__PACKAGE__->belongs_to(
"staged_by",
"Koha::Schema::Result::Borrower",
{ borrowernumber => "staged_by" },
{
is_deferrable => 1,
join_type => "LEFT",
on_delete => "SET NULL",
on_update => "CASCADE",
},
);
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-06-27 11:58:44
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:8gt7Vqurdid0rwmBMPI5yg
# You can replace this text with custom code or comments, and it will be preserved on regeneration
1;

View file

@ -0,0 +1,96 @@
use utf8;
package Koha::Schema::Result::CurbsidePickupIssue;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE
=head1 NAME
Koha::Schema::Result::CurbsidePickupIssue
=cut
use strict;
use warnings;
use base 'DBIx::Class::Core';
=head1 TABLE: C<curbside_pickup_issues>
=cut
__PACKAGE__->table("curbside_pickup_issues");
=head1 ACCESSORS
=head2 id
data_type: 'integer'
is_auto_increment: 1
is_nullable: 0
=head2 curbside_pickup_id
data_type: 'integer'
is_foreign_key: 1
is_nullable: 0
=head2 issue_id
data_type: 'integer'
is_nullable: 0
=head2 reserve_id
data_type: 'integer'
is_nullable: 0
=cut
__PACKAGE__->add_columns(
"id",
{ data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
"curbside_pickup_id",
{ data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
"issue_id",
{ data_type => "integer", is_nullable => 0 },
"reserve_id",
{ data_type => "integer", is_nullable => 0 },
);
=head1 PRIMARY KEY
=over 4
=item * L</id>
=back
=cut
__PACKAGE__->set_primary_key("id");
=head1 RELATIONS
=head2 curbside_pickup
Type: belongs_to
Related object: L<Koha::Schema::Result::CurbsidePickup>
=cut
__PACKAGE__->belongs_to(
"curbside_pickup",
"Koha::Schema::Result::CurbsidePickup",
{ id => "curbside_pickup_id" },
{ is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
);
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-06-27 11:58:44
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:U8r/RLbAi1yGXexYWUYjtQ
# You can replace this text with custom code or comments, and it will be preserved on regeneration
1;

View file

@ -0,0 +1,117 @@
use utf8;
package Koha::Schema::Result::CurbsidePickupOpeningSlot;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE
=head1 NAME
Koha::Schema::Result::CurbsidePickupOpeningSlot
=cut
use strict;
use warnings;
use base 'DBIx::Class::Core';
=head1 TABLE: C<curbside_pickup_opening_slots>
=cut
__PACKAGE__->table("curbside_pickup_opening_slots");
=head1 ACCESSORS
=head2 id
data_type: 'integer'
is_auto_increment: 1
is_nullable: 0
=head2 curbside_pickup_policy_id
data_type: 'integer'
is_foreign_key: 1
is_nullable: 0
=head2 day
data_type: 'tinyint'
is_nullable: 0
=head2 start_hour
data_type: 'integer'
is_nullable: 0
=head2 start_minute
data_type: 'integer'
is_nullable: 0
=head2 end_hour
data_type: 'integer'
is_nullable: 0
=head2 end_minute
data_type: 'integer'
is_nullable: 0
=cut
__PACKAGE__->add_columns(
"id",
{ data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
"curbside_pickup_policy_id",
{ data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
"day",
{ data_type => "tinyint", is_nullable => 0 },
"start_hour",
{ data_type => "integer", is_nullable => 0 },
"start_minute",
{ data_type => "integer", is_nullable => 0 },
"end_hour",
{ data_type => "integer", is_nullable => 0 },
"end_minute",
{ data_type => "integer", is_nullable => 0 },
);
=head1 PRIMARY KEY
=over 4
=item * L</id>
=back
=cut
__PACKAGE__->set_primary_key("id");
=head1 RELATIONS
=head2 curbside_pickup_policy
Type: belongs_to
Related object: L<Koha::Schema::Result::CurbsidePickupPolicy>
=cut
__PACKAGE__->belongs_to(
"curbside_pickup_policy",
"Koha::Schema::Result::CurbsidePickupPolicy",
{ id => "curbside_pickup_policy_id" },
{ is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
);
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-06-27 11:58:44
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:5kzC0AAB9LL0gR+FFnmYgw
# You can replace this text with custom code or comments, and it will be preserved on regeneration
1;

View file

@ -0,0 +1,152 @@
use utf8;
package Koha::Schema::Result::CurbsidePickupPolicy;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE
=head1 NAME
Koha::Schema::Result::CurbsidePickupPolicy
=cut
use strict;
use warnings;
use base 'DBIx::Class::Core';
=head1 TABLE: C<curbside_pickup_policy>
=cut
__PACKAGE__->table("curbside_pickup_policy");
=head1 ACCESSORS
=head2 id
data_type: 'integer'
is_auto_increment: 1
is_nullable: 0
=head2 branchcode
data_type: 'varchar'
is_foreign_key: 1
is_nullable: 0
size: 10
=head2 enabled
data_type: 'tinyint'
default_value: 0
is_nullable: 0
=head2 enable_waiting_holds_only
data_type: 'tinyint'
default_value: 0
is_nullable: 0
=head2 pickup_interval
data_type: 'integer'
default_value: 0
is_nullable: 0
=head2 patrons_per_interval
data_type: 'integer'
default_value: 0
is_nullable: 0
=head2 patron_scheduled_pickup
data_type: 'tinyint'
default_value: 0
is_nullable: 0
=cut
__PACKAGE__->add_columns(
"id",
{ data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
"branchcode",
{ data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 10 },
"enabled",
{ data_type => "tinyint", default_value => 0, is_nullable => 0 },
"enable_waiting_holds_only",
{ data_type => "tinyint", default_value => 0, is_nullable => 0 },
"pickup_interval",
{ data_type => "integer", default_value => 0, is_nullable => 0 },
"patrons_per_interval",
{ data_type => "integer", default_value => 0, is_nullable => 0 },
"patron_scheduled_pickup",
{ data_type => "tinyint", default_value => 0, is_nullable => 0 },
);
=head1 PRIMARY KEY
=over 4
=item * L</id>
=back
=cut
__PACKAGE__->set_primary_key("id");
=head1 UNIQUE CONSTRAINTS
=head2 C<branchcode>
=over 4
=item * L</branchcode>
=back
=cut
__PACKAGE__->add_unique_constraint("branchcode", ["branchcode"]);
=head1 RELATIONS
=head2 branchcode
Type: belongs_to
Related object: L<Koha::Schema::Result::Branch>
=cut
__PACKAGE__->belongs_to(
"branchcode",
"Koha::Schema::Result::Branch",
{ branchcode => "branchcode" },
{ is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
);
=head2 curbside_pickup_opening_slots
Type: has_many
Related object: L<Koha::Schema::Result::CurbsidePickupOpeningSlot>
=cut
__PACKAGE__->has_many(
"curbside_pickup_opening_slots",
"Koha::Schema::Result::CurbsidePickupOpeningSlot",
{ "foreign.curbside_pickup_policy_id" => "self.id" },
{ cascade_copy => 0, cascade_delete => 0 },
);
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-06-27 11:58:44
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:RyZGROB1+g3kb2bo6mwrUQ
# You can replace this text with custom code or comments, and it will be preserved on regeneration
1;