Bug 31086: DBIC update
[koha-ffzg.git] / Koha / Schema / Result / Reserve.pm
index 491e200..c280e27 100644 (file)
@@ -29,6 +29,8 @@ __PACKAGE__->table("reserves");
   is_auto_increment: 1
   is_nullable: 0
 
+primary key
+
 =head2 borrowernumber
 
   data_type: 'integer'
@@ -36,12 +38,16 @@ __PACKAGE__->table("reserves");
   is_foreign_key: 1
   is_nullable: 0
 
+foreign key from the borrowers table defining which patron this hold is for
+
 =head2 reservedate
 
   data_type: 'date'
   datetime_undef_if_invalid: 1
   is_nullable: 1
 
+the date the hold was placed
+
 =head2 biblionumber
 
   data_type: 'integer'
@@ -49,60 +55,80 @@ __PACKAGE__->table("reserves");
   is_foreign_key: 1
   is_nullable: 0
 
+foreign key from the biblio table defining which bib record this hold is on
+
 =head2 branchcode
 
   data_type: 'varchar'
   is_foreign_key: 1
-  is_nullable: 1
+  is_nullable: 0
   size: 10
 
+foreign key from the branches table defining which branch the patron wishes to pick this hold up at
+
 =head2 desk_id
 
   data_type: 'integer'
   is_foreign_key: 1
   is_nullable: 1
 
+foreign key from the desks table defining which desk the patron should pick this hold up at
+
 =head2 notificationdate
 
   data_type: 'date'
   datetime_undef_if_invalid: 1
   is_nullable: 1
 
+currently unused
+
 =head2 reminderdate
 
   data_type: 'date'
   datetime_undef_if_invalid: 1
   is_nullable: 1
 
+currently unused
+
 =head2 cancellationdate
 
   data_type: 'date'
   datetime_undef_if_invalid: 1
   is_nullable: 1
 
+the date this hold was cancelled
+
 =head2 cancellation_reason
 
   data_type: 'varchar'
   is_nullable: 1
   size: 80
 
+optional authorised value CANCELLATION_REASON
+
 =head2 reservenotes
 
   data_type: 'longtext'
   is_nullable: 1
 
+notes related to this hold
+
 =head2 priority
 
   data_type: 'smallint'
   default_value: 1
   is_nullable: 0
 
+where in the queue the patron sits
+
 =head2 found
 
   data_type: 'varchar'
   is_nullable: 1
   size: 1
 
+a one letter code defining what the status is of the hold is after it has been confirmed
+
 =head2 timestamp
 
   data_type: 'timestamp'
@@ -110,24 +136,40 @@ __PACKAGE__->table("reserves");
   default_value: current_timestamp
   is_nullable: 0
 
+the date and time this hold was last updated
+
 =head2 itemnumber
 
   data_type: 'integer'
   is_foreign_key: 1
   is_nullable: 1
 
+foreign key from the items table defining the specific item the patron has placed on hold or the item this hold was filled with
+
 =head2 waitingdate
 
   data_type: 'date'
   datetime_undef_if_invalid: 1
   is_nullable: 1
 
+the date the item was marked as waiting for the patron at the library
+
 =head2 expirationdate
 
   data_type: 'date'
   datetime_undef_if_invalid: 1
   is_nullable: 1
 
+the date the hold expires (calculated value)
+
+=head2 patron_expiration_date
+
+  data_type: 'date'
+  datetime_undef_if_invalid: 1
+  is_nullable: 1
+
+the date the hold expires - usually the date entered by the patron to say they don't need the hold after a certain date
+
 =head2 lowestPriority
 
   accessor: 'lowest_priority'
@@ -154,18 +196,24 @@ __PACKAGE__->table("reserves");
   is_nullable: 1
   size: 10
 
+If record level hold, the optional itemtype of the item the patron is requesting
+
 =head2 item_level_hold
 
   data_type: 'tinyint'
   default_value: 0
   is_nullable: 0
 
+Is the hpld placed at item level
+
 =head2 non_priority
 
   data_type: 'tinyint'
   default_value: 0
   is_nullable: 0
 
+Is this a non priority hold
+
 =cut
 
 __PACKAGE__->add_columns(
@@ -188,7 +236,7 @@ __PACKAGE__->add_columns(
     is_nullable    => 0,
   },
   "branchcode",
-  { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
+  { data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 10 },
   "desk_id",
   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
   "notificationdate",
@@ -218,6 +266,8 @@ __PACKAGE__->add_columns(
   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
   "expirationdate",
   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
+  "patron_expiration_date",
+  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
   "lowestPriority",
   {
     accessor      => "lowest_priority",
@@ -297,12 +347,7 @@ __PACKAGE__->belongs_to(
   "branchcode",
   "Koha::Schema::Result::Branch",
   { branchcode => "branchcode" },
-  {
-    is_deferrable => 1,
-    join_type     => "LEFT",
-    on_delete     => "CASCADE",
-    on_update     => "CASCADE",
-  },
+  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
 );
 
 =head2 club_holds_to_patron_holds
@@ -381,8 +426,8 @@ __PACKAGE__->belongs_to(
 );
 
 
-# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-11-06 11:00:40
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ue2kNBP+lq8+9NthPiYrrw
+# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-07-22 17:37:42
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:kYRPPeoVo0WMk1gH+qmi/w
 
 __PACKAGE__->belongs_to(
   "item",
@@ -429,4 +474,16 @@ sub koha_objects_class {
     'Koha::Holds';
 }
 
+__PACKAGE__->belongs_to(
+  "itembib",
+  "Koha::Schema::Result::Item",
+  { biblionumber => "biblionumber" },
+  {
+    is_deferrable => 1,
+    join_type     => "LEFT",
+    on_delete     => "CASCADE",
+    on_update     => "CASCADE",
+  },
+);
+
 1;