Bug 32257: Label for patron attributes misaligned
[koha-ffzg.git] / Koha / Schema / Result / Recall.pm
1 use utf8;
2 package Koha::Schema::Result::Recall;
3
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
6
7 =head1 NAME
8
9 Koha::Schema::Result::Recall - Information related to recalls in Koha
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<recalls>
19
20 =cut
21
22 __PACKAGE__->table("recalls");
23
24 =head1 ACCESSORS
25
26 =head2 recall_id
27
28   data_type: 'integer'
29   is_auto_increment: 1
30   is_nullable: 0
31
32 Unique identifier for this recall
33
34 =head2 patron_id
35
36   data_type: 'integer'
37   default_value: 0
38   is_foreign_key: 1
39   is_nullable: 0
40
41 Identifier for patron who requested recall
42
43 =head2 created_date
44
45   data_type: 'datetime'
46   datetime_undef_if_invalid: 1
47   is_nullable: 1
48
49 Date the recall was requested
50
51 =head2 biblio_id
52
53   data_type: 'integer'
54   default_value: 0
55   is_foreign_key: 1
56   is_nullable: 0
57
58 Identifier for bibliographic record that has been recalled
59
60 =head2 pickup_library_id
61
62   data_type: 'varchar'
63   is_foreign_key: 1
64   is_nullable: 1
65   size: 10
66
67 Identifier for recall pickup library
68
69 =head2 completed_date
70
71   data_type: 'datetime'
72   datetime_undef_if_invalid: 1
73   is_nullable: 1
74
75 Date the recall is completed (fulfilled, cancelled or expired)
76
77 =head2 notes
78
79   data_type: 'mediumtext'
80   is_nullable: 1
81
82 Notes related to the recall
83
84 =head2 priority
85
86   data_type: 'smallint'
87   is_nullable: 1
88
89 Where in the queue the patron sits
90
91 =head2 status
92
93   data_type: 'enum'
94   default_value: 'requested'
95   extra: {list => ["requested","overdue","waiting","in_transit","cancelled","expired","fulfilled"]}
96   is_nullable: 1
97
98 Status of recall
99
100 =head2 timestamp
101
102   data_type: 'timestamp'
103   datetime_undef_if_invalid: 1
104   default_value: current_timestamp
105   is_nullable: 0
106
107 Date and time the recall was last updated
108
109 =head2 item_id
110
111   data_type: 'integer'
112   is_foreign_key: 1
113   is_nullable: 1
114
115 Identifier for item record that was recalled, if an item-level recall
116
117 =head2 waiting_date
118
119   data_type: 'datetime'
120   datetime_undef_if_invalid: 1
121   is_nullable: 1
122
123 Date an item was marked as waiting for the patron at the library
124
125 =head2 expiration_date
126
127   data_type: 'datetime'
128   datetime_undef_if_invalid: 1
129   is_nullable: 1
130
131 Date recall is no longer required, or date recall will expire after waiting on shelf for pickup
132
133 =head2 completed
134
135   data_type: 'tinyint'
136   default_value: 0
137   is_nullable: 0
138
139 Flag if recall is old and no longer active, i.e. expired, cancelled or completed
140
141 =head2 item_level
142
143   data_type: 'tinyint'
144   default_value: 0
145   is_nullable: 0
146
147 Flag if recall is for a specific item
148
149 =cut
150
151 __PACKAGE__->add_columns(
152   "recall_id",
153   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
154   "patron_id",
155   {
156     data_type      => "integer",
157     default_value  => 0,
158     is_foreign_key => 1,
159     is_nullable    => 0,
160   },
161   "created_date",
162   {
163     data_type => "datetime",
164     datetime_undef_if_invalid => 1,
165     is_nullable => 1,
166   },
167   "biblio_id",
168   {
169     data_type      => "integer",
170     default_value  => 0,
171     is_foreign_key => 1,
172     is_nullable    => 0,
173   },
174   "pickup_library_id",
175   { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
176   "completed_date",
177   {
178     data_type => "datetime",
179     datetime_undef_if_invalid => 1,
180     is_nullable => 1,
181   },
182   "notes",
183   { data_type => "mediumtext", is_nullable => 1 },
184   "priority",
185   { data_type => "smallint", is_nullable => 1 },
186   "status",
187   {
188     data_type => "enum",
189     default_value => "requested",
190     extra => {
191       list => [
192         "requested",
193         "overdue",
194         "waiting",
195         "in_transit",
196         "cancelled",
197         "expired",
198         "fulfilled",
199       ],
200     },
201     is_nullable => 1,
202   },
203   "timestamp",
204   {
205     data_type => "timestamp",
206     datetime_undef_if_invalid => 1,
207     default_value => \"current_timestamp",
208     is_nullable => 0,
209   },
210   "item_id",
211   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
212   "waiting_date",
213   {
214     data_type => "datetime",
215     datetime_undef_if_invalid => 1,
216     is_nullable => 1,
217   },
218   "expiration_date",
219   {
220     data_type => "datetime",
221     datetime_undef_if_invalid => 1,
222     is_nullable => 1,
223   },
224   "completed",
225   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
226   "item_level",
227   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
228 );
229
230 =head1 PRIMARY KEY
231
232 =over 4
233
234 =item * L</recall_id>
235
236 =back
237
238 =cut
239
240 __PACKAGE__->set_primary_key("recall_id");
241
242 =head1 RELATIONS
243
244 =head2 biblio
245
246 Type: belongs_to
247
248 Related object: L<Koha::Schema::Result::Biblio>
249
250 =cut
251
252 __PACKAGE__->belongs_to(
253   "biblio",
254   "Koha::Schema::Result::Biblio",
255   { biblionumber => "biblio_id" },
256   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
257 );
258
259 =head2 item
260
261 Type: belongs_to
262
263 Related object: L<Koha::Schema::Result::Item>
264
265 =cut
266
267 __PACKAGE__->belongs_to(
268   "item",
269   "Koha::Schema::Result::Item",
270   { itemnumber => "item_id" },
271   {
272     is_deferrable => 1,
273     join_type     => "LEFT",
274     on_delete     => "CASCADE",
275     on_update     => "CASCADE",
276   },
277 );
278
279 =head2 patron
280
281 Type: belongs_to
282
283 Related object: L<Koha::Schema::Result::Borrower>
284
285 =cut
286
287 __PACKAGE__->belongs_to(
288   "patron",
289   "Koha::Schema::Result::Borrower",
290   { borrowernumber => "patron_id" },
291   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
292 );
293
294 =head2 pickup_library
295
296 Type: belongs_to
297
298 Related object: L<Koha::Schema::Result::Branch>
299
300 =cut
301
302 __PACKAGE__->belongs_to(
303   "pickup_library",
304   "Koha::Schema::Result::Branch",
305   { branchcode => "pickup_library_id" },
306   {
307     is_deferrable => 1,
308     join_type     => "LEFT",
309     on_delete     => "CASCADE",
310     on_update     => "CASCADE",
311   },
312 );
313
314
315 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-04-29 11:14:14
316 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:lUgwwMxaStiOS7pHL0UGJA
317
318 __PACKAGE__->add_columns(
319     '+completed' => { is_boolean => 1 },
320     '+item_level' => { is_boolean => 1 },
321 );
322
323 __PACKAGE__->belongs_to(
324   "library",
325   "Koha::Schema::Result::Branch",
326   { branchcode => "pickup_library_id" },
327   {
328     is_deferrable => 1,
329     join_type     => "LEFT",
330     on_delete     => "CASCADE",
331     on_update     => "CASCADE",
332   },
333 );
334
335 1;