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 => 1, 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" },
353 on_delete => "CASCADE",
354 on_update => "CASCADE",
358 =head2 club_holds_to_patron_holds
362 Related object: L<Koha::Schema::Result::ClubHoldsToPatronHold>
366 __PACKAGE__->has_many(
367 "club_holds_to_patron_holds",
368 "Koha::Schema::Result::ClubHoldsToPatronHold",
369 { "foreign.hold_id" => "self.reserve_id" },
370 { cascade_copy => 0, cascade_delete => 0 },
377 Related object: L<Koha::Schema::Result::Desk>
381 __PACKAGE__->belongs_to(
383 "Koha::Schema::Result::Desk",
384 { desk_id => "desk_id" },
388 on_delete => "SET NULL",
389 on_update => "CASCADE",
397 Related object: L<Koha::Schema::Result::Item>
401 __PACKAGE__->belongs_to(
403 "Koha::Schema::Result::Item",
404 { itemnumber => "itemnumber" },
408 on_delete => "CASCADE",
409 on_update => "CASCADE",
417 Related object: L<Koha::Schema::Result::Itemtype>
421 __PACKAGE__->belongs_to(
423 "Koha::Schema::Result::Itemtype",
424 { itemtype => "itemtype" },
428 on_delete => "CASCADE",
429 on_update => "CASCADE",
434 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-01-28 20:08:09
435 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7Q8/GFCOkXdn+jg69HZ0GQ
437 __PACKAGE__->belongs_to(
439 "Koha::Schema::Result::Item",
440 { itemnumber => "itemnumber" },
444 on_delete => "CASCADE",
445 on_update => "CASCADE",
449 __PACKAGE__->belongs_to(
451 "Koha::Schema::Result::Biblio",
452 { biblionumber => "biblionumber" },
456 on_delete => "CASCADE",
457 on_update => "CASCADE",
461 __PACKAGE__->belongs_to(
463 "Koha::Schema::Result::Borrower",
464 { "foreign.borrowernumber" => "self.borrowernumber" },
465 { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
468 __PACKAGE__->add_columns(
469 '+item_level_hold' => { is_boolean => 1 },
470 '+lowestPriority' => { is_boolean => 1 },
471 '+suspend' => { is_boolean => 1 },
472 '+non_priority' => { is_boolean => 1 }
475 sub koha_object_class {
478 sub koha_objects_class {
482 __PACKAGE__->belongs_to(
484 "Koha::Schema::Result::Item",
485 { biblionumber => "biblionumber" },
489 on_delete => "CASCADE",
490 on_update => "CASCADE",