Bugzilla – Attachment 138286 Details for
Bug 30650
Add a curbside pickup module
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30650: DBIC
Bug-30650-DBIC.patch (text/plain), 15.30 KB, created by
Jonathan Druart
on 2022-07-29 09:33:42 UTC
(
hide
)
Description:
Bug 30650: DBIC
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-07-29 09:33:42 UTC
Size:
15.30 KB
patch
obsolete
>From 045dd83f4df8673a3f78d13c8bb4f4791337c75c Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 27 Jun 2022 13:59:51 +0200 >Subject: [PATCH] Bug 30650: DBIC > >Signed-off-by: Koha Team University Lyon 3 <koha@univ-lyon3.fr> >--- > Koha/Schema/Result/Borrower.pm | 34 ++- > Koha/Schema/Result/Branch.pm | 34 ++- > Koha/Schema/Result/CurbsidePickup.pm | 211 ++++++++++++++++++ > Koha/Schema/Result/CurbsidePickupIssue.pm | 96 ++++++++ > .../Result/CurbsidePickupOpeningSlot.pm | 117 ++++++++++ > Koha/Schema/Result/CurbsidePickupPolicy.pm | 152 +++++++++++++ > 6 files changed, 640 insertions(+), 4 deletions(-) > create mode 100644 Koha/Schema/Result/CurbsidePickup.pm > create mode 100644 Koha/Schema/Result/CurbsidePickupIssue.pm > create mode 100644 Koha/Schema/Result/CurbsidePickupOpeningSlot.pm > create mode 100644 Koha/Schema/Result/CurbsidePickupPolicy.pm > >diff --git a/Koha/Schema/Result/Borrower.pm b/Koha/Schema/Result/Borrower.pm >index 5b4bcb8fd27..81e45238a92 100644 >--- a/Koha/Schema/Result/Borrower.pm >+++ b/Koha/Schema/Result/Borrower.pm >@@ -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", >diff --git a/Koha/Schema/Result/Branch.pm b/Koha/Schema/Result/Branch.pm >index b2a59b2cbf3..3ff052eea8f 100644 >--- a/Koha/Schema/Result/Branch.pm >+++ b/Koha/Schema/Result/Branch.pm >@@ -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 }, >diff --git a/Koha/Schema/Result/CurbsidePickup.pm b/Koha/Schema/Result/CurbsidePickup.pm >new file mode 100644 >index 00000000000..23ab0360436 >--- /dev/null >+++ b/Koha/Schema/Result/CurbsidePickup.pm >@@ -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; >diff --git a/Koha/Schema/Result/CurbsidePickupIssue.pm b/Koha/Schema/Result/CurbsidePickupIssue.pm >new file mode 100644 >index 00000000000..4c029eb2558 >--- /dev/null >+++ b/Koha/Schema/Result/CurbsidePickupIssue.pm >@@ -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; >diff --git a/Koha/Schema/Result/CurbsidePickupOpeningSlot.pm b/Koha/Schema/Result/CurbsidePickupOpeningSlot.pm >new file mode 100644 >index 00000000000..052379db29a >--- /dev/null >+++ b/Koha/Schema/Result/CurbsidePickupOpeningSlot.pm >@@ -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; >diff --git a/Koha/Schema/Result/CurbsidePickupPolicy.pm b/Koha/Schema/Result/CurbsidePickupPolicy.pm >new file mode 100644 >index 00000000000..1cca912ce8b >--- /dev/null >+++ b/Koha/Schema/Result/CurbsidePickupPolicy.pm >@@ -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; >-- >2.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 30650
:
136584
|
136585
|
136586
|
136587
|
136588
|
136589
|
136590
|
136591
|
136592
|
136593
|
136594
|
136595
|
136596
|
136597
|
136598
|
136599
|
136600
|
136601
|
136602
|
136603
|
136604
|
136605
|
136606
|
136607
|
136608
|
136609
|
136610
|
137095
|
137100
|
137199
|
137211
|
137212
|
137277
|
137278
|
137279
|
137280
|
137281
|
137282
|
137283
|
137284
|
137285
|
137286
|
137287
|
137288
|
137289
|
137290
|
137291
|
137292
|
137293
|
137294
|
137295
|
137296
|
137297
|
137298
|
137299
|
137300
|
137301
|
137302
|
137303
|
137304
|
137305
|
137306
|
137307
|
138261
|
138262
|
138263
|
138264
|
138265
|
138266
|
138267
|
138268
|
138269
|
138270
|
138271
|
138272
|
138273
|
138274
|
138275
|
138276
|
138277
|
138278
|
138279
|
138280
|
138281
|
138282
|
138283
|
138284
|
138285
|
138286
|
138287
|
138288
|
138289
|
138290
|
138291
|
138292
|
138319
|
138320
|
138321
|
138322
|
138323
|
138324
|
138325
|
138330
|
138331
|
138332
|
138333
|
138334
|
138335
|
138336
|
138337
|
138338
|
138339
|
138340
|
138341
|
138342
|
138343
|
138344
|
138345
|
138346
|
138347
|
138348
|
138349
|
138350
|
138351
|
138352
|
138353
|
138354
|
138355
|
138356
|
138357
|
138358
|
138359
|
138360
|
138361
|
138362
|
138363
|
138364
|
138365
|
138366
|
138367
|
138368
|
138369
|
138375
|
138401
|
138610