Bug 30719: Rename `batch` for `ill_batch` in Koha::Illrequest
[koha.git] / Koha / Schema / Result / Illrequest.pm
1 use utf8;
2 package Koha::Schema::Result::Illrequest;
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::Illrequest
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<illrequests>
19
20 =cut
21
22 __PACKAGE__->table("illrequests");
23
24 =head1 ACCESSORS
25
26 =head2 illrequest_id
27
28   data_type: 'bigint'
29   extra: {unsigned => 1}
30   is_auto_increment: 1
31   is_nullable: 0
32
33 ILL request number
34
35 =head2 borrowernumber
36
37   data_type: 'integer'
38   is_foreign_key: 1
39   is_nullable: 1
40
41 Patron associated with request
42
43 =head2 biblio_id
44
45   data_type: 'integer'
46   is_foreign_key: 1
47   is_nullable: 1
48
49 Potential bib linked to request
50
51 =head2 deleted_biblio_id
52
53   data_type: 'integer'
54   is_nullable: 1
55
56 Deleted bib linked to request
57
58 =head2 due_date
59
60   data_type: 'datetime'
61   datetime_undef_if_invalid: 1
62   is_nullable: 1
63
64 Custom date due specified by backend, leave NULL for default date_due calculation
65
66 =head2 branchcode
67
68   data_type: 'varchar'
69   is_foreign_key: 1
70   is_nullable: 0
71   size: 50
72
73 The branch associated with the request
74
75 =head2 status
76
77   data_type: 'varchar'
78   is_nullable: 1
79   size: 50
80
81 Current Koha status of request
82
83 =head2 status_alias
84
85   data_type: 'varchar'
86   is_foreign_key: 1
87   is_nullable: 1
88   size: 80
89
90 Foreign key to relevant authorised_values.authorised_value
91
92 =head2 placed
93
94   data_type: 'date'
95   datetime_undef_if_invalid: 1
96   is_nullable: 1
97
98 Date the request was placed
99
100 =head2 replied
101
102   data_type: 'date'
103   datetime_undef_if_invalid: 1
104   is_nullable: 1
105
106 Last API response
107
108 =head2 updated
109
110   data_type: 'timestamp'
111   datetime_undef_if_invalid: 1
112   default_value: current_timestamp
113   is_nullable: 0
114
115 =head2 completed
116
117   data_type: 'date'
118   datetime_undef_if_invalid: 1
119   is_nullable: 1
120
121 Date the request was completed
122
123 =head2 medium
124
125   data_type: 'varchar'
126   is_nullable: 1
127   size: 30
128
129 The Koha request type
130
131 =head2 accessurl
132
133   data_type: 'varchar'
134   is_nullable: 1
135   size: 500
136
137 Potential URL for accessing item
138
139 =head2 cost
140
141   data_type: 'varchar'
142   is_nullable: 1
143   size: 20
144
145 Quotes cost of request
146
147 =head2 price_paid
148
149   data_type: 'varchar'
150   is_nullable: 1
151   size: 20
152
153 Final cost of request
154
155 =head2 notesopac
156
157   data_type: 'mediumtext'
158   is_nullable: 1
159
160 Patron notes attached to request
161
162 =head2 notesstaff
163
164   data_type: 'mediumtext'
165   is_nullable: 1
166
167 Staff notes attached to request
168
169 =head2 orderid
170
171   data_type: 'varchar'
172   is_nullable: 1
173   size: 50
174
175 Backend id attached to request
176
177 =head2 backend
178
179   data_type: 'varchar'
180   is_nullable: 1
181   size: 20
182
183 The backend used to create request
184
185 =head2 batch_id
186
187   data_type: 'integer'
188   is_foreign_key: 1
189   is_nullable: 1
190
191 Optional ID of batch that this request belongs to
192
193 =cut
194
195 __PACKAGE__->add_columns(
196   "illrequest_id",
197   {
198     data_type => "bigint",
199     extra => { unsigned => 1 },
200     is_auto_increment => 1,
201     is_nullable => 0,
202   },
203   "borrowernumber",
204   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
205   "biblio_id",
206   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
207   "deleted_biblio_id",
208   { data_type => "integer", is_nullable => 1 },
209   "due_date",
210   {
211     data_type => "datetime",
212     datetime_undef_if_invalid => 1,
213     is_nullable => 1,
214   },
215   "branchcode",
216   { data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 50 },
217   "status",
218   { data_type => "varchar", is_nullable => 1, size => 50 },
219   "status_alias",
220   { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 80 },
221   "placed",
222   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
223   "replied",
224   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
225   "updated",
226   {
227     data_type => "timestamp",
228     datetime_undef_if_invalid => 1,
229     default_value => \"current_timestamp",
230     is_nullable => 0,
231   },
232   "completed",
233   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
234   "medium",
235   { data_type => "varchar", is_nullable => 1, size => 30 },
236   "accessurl",
237   { data_type => "varchar", is_nullable => 1, size => 500 },
238   "cost",
239   { data_type => "varchar", is_nullable => 1, size => 20 },
240   "price_paid",
241   { data_type => "varchar", is_nullable => 1, size => 20 },
242   "notesopac",
243   { data_type => "mediumtext", is_nullable => 1 },
244   "notesstaff",
245   { data_type => "mediumtext", is_nullable => 1 },
246   "orderid",
247   { data_type => "varchar", is_nullable => 1, size => 50 },
248   "backend",
249   { data_type => "varchar", is_nullable => 1, size => 20 },
250   "batch_id",
251   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
252 );
253
254 =head1 PRIMARY KEY
255
256 =over 4
257
258 =item * L</illrequest_id>
259
260 =back
261
262 =cut
263
264 __PACKAGE__->set_primary_key("illrequest_id");
265
266 =head1 RELATIONS
267
268 =head2 batch
269
270 Type: belongs_to
271
272 Related object: L<Koha::Schema::Result::Illbatch>
273
274 =cut
275
276 __PACKAGE__->belongs_to(
277   "batch",
278   "Koha::Schema::Result::Illbatch",
279   { ill_batch_id => "batch_id" },
280   {
281     is_deferrable => 1,
282     join_type     => "LEFT",
283     on_delete     => "SET NULL",
284     on_update     => "CASCADE",
285   },
286 );
287
288 =head2 biblio
289
290 Type: belongs_to
291
292 Related object: L<Koha::Schema::Result::Biblio>
293
294 =cut
295
296 __PACKAGE__->belongs_to(
297   "biblio",
298   "Koha::Schema::Result::Biblio",
299   { biblionumber => "biblio_id" },
300   {
301     is_deferrable => 1,
302     join_type     => "LEFT",
303     on_delete     => "SET NULL",
304     on_update     => "CASCADE",
305   },
306 );
307
308 =head2 borrowernumber
309
310 Type: belongs_to
311
312 Related object: L<Koha::Schema::Result::Borrower>
313
314 =cut
315
316 __PACKAGE__->belongs_to(
317   "borrowernumber",
318   "Koha::Schema::Result::Borrower",
319   { borrowernumber => "borrowernumber" },
320   {
321     is_deferrable => 1,
322     join_type     => "LEFT",
323     on_delete     => "CASCADE",
324     on_update     => "CASCADE",
325   },
326 );
327
328 =head2 branchcode
329
330 Type: belongs_to
331
332 Related object: L<Koha::Schema::Result::Branch>
333
334 =cut
335
336 __PACKAGE__->belongs_to(
337   "branchcode",
338   "Koha::Schema::Result::Branch",
339   { branchcode => "branchcode" },
340   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
341 );
342
343 =head2 illcomments
344
345 Type: has_many
346
347 Related object: L<Koha::Schema::Result::Illcomment>
348
349 =cut
350
351 __PACKAGE__->has_many(
352   "illcomments",
353   "Koha::Schema::Result::Illcomment",
354   { "foreign.illrequest_id" => "self.illrequest_id" },
355   { cascade_copy => 0, cascade_delete => 0 },
356 );
357
358 =head2 illrequestattributes
359
360 Type: has_many
361
362 Related object: L<Koha::Schema::Result::Illrequestattribute>
363
364 =cut
365
366 __PACKAGE__->has_many(
367   "illrequestattributes",
368   "Koha::Schema::Result::Illrequestattribute",
369   { "foreign.illrequest_id" => "self.illrequest_id" },
370   { cascade_copy => 0, cascade_delete => 0 },
371 );
372
373 =head2 status_alias
374
375 Type: belongs_to
376
377 Related object: L<Koha::Schema::Result::AuthorisedValue>
378
379 =cut
380
381 __PACKAGE__->belongs_to(
382   "status_alias",
383   "Koha::Schema::Result::AuthorisedValue",
384   { authorised_value => "status_alias" },
385   {
386     is_deferrable => 1,
387     join_type     => "LEFT",
388     on_delete     => "SET NULL",
389     on_update     => "CASCADE",
390   },
391 );
392
393
394 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-10-10 14:49:40
395 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:DQl+7uwLCz5GeqU2hBFmMA
396
397 __PACKAGE__->has_many(
398   "comments",
399   "Koha::Schema::Result::Illcomment",
400   { "foreign.illrequest_id" => "self.illrequest_id" },
401   { cascade_copy => 0, cascade_delete => 0 },
402 );
403
404 __PACKAGE__->has_many(
405   "extended_attributes",
406   "Koha::Schema::Result::Illrequestattribute",
407   { "foreign.illrequest_id" => "self.illrequest_id" },
408   { cascade_copy => 0, cascade_delete => 0 },
409 );
410
411 __PACKAGE__->belongs_to(
412   "ill_batch",
413   "Koha::Schema::Result::Illbatch",
414   { ill_batch_id => "batch_id" },
415   {
416     is_deferrable => 1,
417     join_type     => "LEFT",
418     on_delete     => "SET NULL",
419     on_update     => "CASCADE",
420   },
421 );
422
423 __PACKAGE__->belongs_to(
424   "library",
425   "Koha::Schema::Result::Branch",
426   { branchcode => "branchcode" },
427   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
428 );
429
430 __PACKAGE__->belongs_to(
431   "patron",
432   "Koha::Schema::Result::Borrower",
433   { borrowernumber => "borrowernumber" },
434   {
435     is_deferrable => 1,
436     join_type     => "LEFT",
437     on_delete     => "CASCADE",
438     on_update     => "CASCADE",
439   },
440 );
441
442 1;