2 package Koha::Schema::Result::Reserve;
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
9 Koha::Schema::Result::Reserve
16 use base 'DBIx::Class::Core';
18 =head1 TABLE: C<reserves>
22 __PACKAGE__->table("reserves");
41 foreign key from the borrowers table defining which patron this hold is for
46 datetime_undef_if_invalid: 1
49 the date the hold was placed
58 foreign key from the biblio table defining which bib record this hold is on
67 foreign key from the branches table defining which branch the patron wishes to pick this hold up at
75 foreign key from the desks table defining which desk the patron should pick this hold up at
77 =head2 notificationdate
80 datetime_undef_if_invalid: 1
88 datetime_undef_if_invalid: 1
93 =head2 cancellationdate
96 datetime_undef_if_invalid: 1
99 the date this hold was cancelled
101 =head2 cancellation_reason
107 optional authorised value CANCELLATION_REASON
111 data_type: 'longtext'
114 notes related to this hold
118 data_type: 'smallint'
122 where in the queue the patron sits
130 a one letter code defining what the status is of the hold is after it has been confirmed
134 data_type: 'timestamp'
135 datetime_undef_if_invalid: 1
136 default_value: current_timestamp
139 the date and time this hold was last updated
147 foreign key from the items table defining the specific item the patron has placed on hold or the item this hold was filled with
152 datetime_undef_if_invalid: 1
155 the date the item was marked as waiting for the patron at the library
157 =head2 expirationdate
160 datetime_undef_if_invalid: 1
163 the date the hold expires (calculated value)
165 =head2 patron_expiration_date
168 datetime_undef_if_invalid: 1
171 the date the hold expires - usually the date entered by the patron to say they don't need the hold after a certain date
173 =head2 lowestPriority
175 accessor: 'lowest_priority'
188 data_type: 'datetime'
189 datetime_undef_if_invalid: 1
199 If record level hold, the optional itemtype of the item the patron is requesting
201 =head2 item_level_hold
207 Is the hpld placed at item level
215 Is this a non priority hold
219 __PACKAGE__->add_columns(
221 { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
224 data_type => "integer",
230 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
233 data_type => "integer",
239 { data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 10 },
241 { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
243 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
245 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
247 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
248 "cancellation_reason",
249 { data_type => "varchar", is_nullable => 1, size => 80 },
251 { data_type => "longtext", is_nullable => 1 },
253 { data_type => "smallint", default_value => 1, is_nullable => 0 },
255 { data_type => "varchar", is_nullable => 1, size => 1 },
258 data_type => "timestamp",
259 datetime_undef_if_invalid => 1,
260 default_value => \"current_timestamp",
264 { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
266 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
268 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
269 "patron_expiration_date",
270 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
273 accessor => "lowest_priority",
274 data_type => "tinyint",
279 { data_type => "tinyint", default_value => 0, is_nullable => 0 },
282 data_type => "datetime",
283 datetime_undef_if_invalid => 1,
287 { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
289 { data_type => "tinyint", default_value => 0, is_nullable => 0 },
291 { data_type => "tinyint", default_value => 0, is_nullable => 0 },
298 =item * L</reserve_id>
304 __PACKAGE__->set_primary_key("reserve_id");
312 Related object: L<Koha::Schema::Result::Biblio>
316 __PACKAGE__->belongs_to(
318 "Koha::Schema::Result::Biblio",
319 { biblionumber => "biblionumber" },
320 { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
323 =head2 borrowernumber
327 Related object: L<Koha::Schema::Result::Borrower>
331 __PACKAGE__->belongs_to(
333 "Koha::Schema::Result::Borrower",
334 { borrowernumber => "borrowernumber" },
335 { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
342 Related object: L<Koha::Schema::Result::Branch>
346 __PACKAGE__->belongs_to(
348 "Koha::Schema::Result::Branch",
349 { branchcode => "branchcode" },
350 { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
353 =head2 club_holds_to_patron_holds
357 Related object: L<Koha::Schema::Result::ClubHoldsToPatronHold>
361 __PACKAGE__->has_many(
362 "club_holds_to_patron_holds",
363 "Koha::Schema::Result::ClubHoldsToPatronHold",
364 { "foreign.hold_id" => "self.reserve_id" },
365 { cascade_copy => 0, cascade_delete => 0 },
372 Related object: L<Koha::Schema::Result::Desk>
376 __PACKAGE__->belongs_to(
378 "Koha::Schema::Result::Desk",
379 { desk_id => "desk_id" },
383 on_delete => "SET NULL",
384 on_update => "CASCADE",
392 Related object: L<Koha::Schema::Result::Item>
396 __PACKAGE__->belongs_to(
398 "Koha::Schema::Result::Item",
399 { itemnumber => "itemnumber" },
403 on_delete => "CASCADE",
404 on_update => "CASCADE",
412 Related object: L<Koha::Schema::Result::Itemtype>
416 __PACKAGE__->belongs_to(
418 "Koha::Schema::Result::Itemtype",
419 { itemtype => "itemtype" },
423 on_delete => "CASCADE",
424 on_update => "CASCADE",
429 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-07-22 17:37:42
430 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:kYRPPeoVo0WMk1gH+qmi/w
432 __PACKAGE__->belongs_to(
434 "Koha::Schema::Result::Item",
435 { itemnumber => "itemnumber" },
439 on_delete => "CASCADE",
440 on_update => "CASCADE",
444 __PACKAGE__->belongs_to(
446 "Koha::Schema::Result::Biblio",
447 { biblionumber => "biblionumber" },
451 on_delete => "CASCADE",
452 on_update => "CASCADE",
456 __PACKAGE__->belongs_to(
458 "Koha::Schema::Result::Borrower",
459 { "foreign.borrowernumber" => "self.borrowernumber" },
460 { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
463 __PACKAGE__->add_columns(
464 '+item_level_hold' => { is_boolean => 1 },
465 '+lowestPriority' => { is_boolean => 1 },
466 '+suspend' => { is_boolean => 1 },
467 '+non_priority' => { is_boolean => 1 }
470 sub koha_object_class {
473 sub koha_objects_class {
477 __PACKAGE__->belongs_to(
479 "Koha::Schema::Result::Item",
480 { biblionumber => "biblionumber" },
484 on_delete => "CASCADE",
485 on_update => "CASCADE",