Bug 22440: Add standard accessors for later usage
[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_nullable: 1
47
48 Potential bib linked to request
49
50 =head2 due_date
51
52   data_type: 'datetime'
53   datetime_undef_if_invalid: 1
54   is_nullable: 1
55
56 Custom date due specified by backend, leave NULL for default date_due calculation
57
58 =head2 branchcode
59
60   data_type: 'varchar'
61   is_foreign_key: 1
62   is_nullable: 0
63   size: 50
64
65 The branch associated with the request
66
67 =head2 status
68
69   data_type: 'varchar'
70   is_nullable: 1
71   size: 50
72
73 Current Koha status of request
74
75 =head2 status_alias
76
77   data_type: 'varchar'
78   is_foreign_key: 1
79   is_nullable: 1
80   size: 80
81
82 Foreign key to relevant authorised_values.authorised_value
83
84 =head2 placed
85
86   data_type: 'date'
87   datetime_undef_if_invalid: 1
88   is_nullable: 1
89
90 Date the request was placed
91
92 =head2 replied
93
94   data_type: 'date'
95   datetime_undef_if_invalid: 1
96   is_nullable: 1
97
98 Last API response
99
100 =head2 updated
101
102   data_type: 'timestamp'
103   datetime_undef_if_invalid: 1
104   default_value: current_timestamp
105   is_nullable: 0
106
107 =head2 completed
108
109   data_type: 'date'
110   datetime_undef_if_invalid: 1
111   is_nullable: 1
112
113 Date the request was completed
114
115 =head2 medium
116
117   data_type: 'varchar'
118   is_nullable: 1
119   size: 30
120
121 The Koha request type
122
123 =head2 accessurl
124
125   data_type: 'varchar'
126   is_nullable: 1
127   size: 500
128
129 Potential URL for accessing item
130
131 =head2 cost
132
133   data_type: 'varchar'
134   is_nullable: 1
135   size: 20
136
137 Quotes cost of request
138
139 =head2 price_paid
140
141   data_type: 'varchar'
142   is_nullable: 1
143   size: 20
144
145 Final cost of request
146
147 =head2 notesopac
148
149   data_type: 'mediumtext'
150   is_nullable: 1
151
152 Patron notes attached to request
153
154 =head2 notesstaff
155
156   data_type: 'mediumtext'
157   is_nullable: 1
158
159 Staff notes attached to request
160
161 =head2 orderid
162
163   data_type: 'varchar'
164   is_nullable: 1
165   size: 50
166
167 Backend id attached to request
168
169 =head2 backend
170
171   data_type: 'varchar'
172   is_nullable: 1
173   size: 20
174
175 The backend used to create request
176
177 =cut
178
179 __PACKAGE__->add_columns(
180   "illrequest_id",
181   {
182     data_type => "bigint",
183     extra => { unsigned => 1 },
184     is_auto_increment => 1,
185     is_nullable => 0,
186   },
187   "borrowernumber",
188   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
189   "biblio_id",
190   { data_type => "integer", is_nullable => 1 },
191   "due_date",
192   {
193     data_type => "datetime",
194     datetime_undef_if_invalid => 1,
195     is_nullable => 1,
196   },
197   "branchcode",
198   { data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 50 },
199   "status",
200   { data_type => "varchar", is_nullable => 1, size => 50 },
201   "status_alias",
202   { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 80 },
203   "placed",
204   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
205   "replied",
206   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
207   "updated",
208   {
209     data_type => "timestamp",
210     datetime_undef_if_invalid => 1,
211     default_value => \"current_timestamp",
212     is_nullable => 0,
213   },
214   "completed",
215   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
216   "medium",
217   { data_type => "varchar", is_nullable => 1, size => 30 },
218   "accessurl",
219   { data_type => "varchar", is_nullable => 1, size => 500 },
220   "cost",
221   { data_type => "varchar", is_nullable => 1, size => 20 },
222   "price_paid",
223   { data_type => "varchar", is_nullable => 1, size => 20 },
224   "notesopac",
225   { data_type => "mediumtext", is_nullable => 1 },
226   "notesstaff",
227   { data_type => "mediumtext", is_nullable => 1 },
228   "orderid",
229   { data_type => "varchar", is_nullable => 1, size => 50 },
230   "backend",
231   { data_type => "varchar", is_nullable => 1, size => 20 },
232 );
233
234 =head1 PRIMARY KEY
235
236 =over 4
237
238 =item * L</illrequest_id>
239
240 =back
241
242 =cut
243
244 __PACKAGE__->set_primary_key("illrequest_id");
245
246 =head1 RELATIONS
247
248 =head2 borrowernumber
249
250 Type: belongs_to
251
252 Related object: L<Koha::Schema::Result::Borrower>
253
254 =cut
255
256 __PACKAGE__->belongs_to(
257   "borrowernumber",
258   "Koha::Schema::Result::Borrower",
259   { borrowernumber => "borrowernumber" },
260   {
261     is_deferrable => 1,
262     join_type     => "LEFT",
263     on_delete     => "CASCADE",
264     on_update     => "CASCADE",
265   },
266 );
267
268 =head2 branchcode
269
270 Type: belongs_to
271
272 Related object: L<Koha::Schema::Result::Branch>
273
274 =cut
275
276 __PACKAGE__->belongs_to(
277   "branchcode",
278   "Koha::Schema::Result::Branch",
279   { branchcode => "branchcode" },
280   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
281 );
282
283 =head2 illcomments
284
285 Type: has_many
286
287 Related object: L<Koha::Schema::Result::Illcomment>
288
289 =cut
290
291 __PACKAGE__->has_many(
292   "illcomments",
293   "Koha::Schema::Result::Illcomment",
294   { "foreign.illrequest_id" => "self.illrequest_id" },
295   { cascade_copy => 0, cascade_delete => 0 },
296 );
297
298 =head2 illrequestattributes
299
300 Type: has_many
301
302 Related object: L<Koha::Schema::Result::Illrequestattribute>
303
304 =cut
305
306 __PACKAGE__->has_many(
307   "illrequestattributes",
308   "Koha::Schema::Result::Illrequestattribute",
309   { "foreign.illrequest_id" => "self.illrequest_id" },
310   { cascade_copy => 0, cascade_delete => 0 },
311 );
312
313 =head2 status_alias
314
315 Type: belongs_to
316
317 Related object: L<Koha::Schema::Result::AuthorisedValue>
318
319 =cut
320
321 __PACKAGE__->belongs_to(
322   "status_alias",
323   "Koha::Schema::Result::AuthorisedValue",
324   { authorised_value => "status_alias" },
325   {
326     is_deferrable => 1,
327     join_type     => "LEFT",
328     on_delete     => "SET NULL",
329     on_update     => "CASCADE",
330   },
331 );
332
333
334 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-06-23 18:44:13
335 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:on9OCRON/U0uR+m9aPIKPg
336
337 __PACKAGE__->has_many(
338   "comments",
339   "Koha::Schema::Result::Illcomment",
340   { "foreign.illrequest_id" => "self.illrequest_id" },
341   { cascade_copy => 0, cascade_delete => 0 },
342 );
343
344 __PACKAGE__->has_many(
345   "ill_extended_attributes",
346   "Koha::Schema::Result::Illrequestattribute",
347   { "foreign.illrequest_id" => "self.illrequest_id" },
348   { cascade_copy => 0, cascade_delete => 0 },
349 );
350
351 __PACKAGE__->belongs_to(
352   "library",
353   "Koha::Schema::Result::Branch",
354   { branchcode => "branchcode" },
355   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
356 );
357
358 __PACKAGE__->belongs_to(
359   "patron",
360   "Koha::Schema::Result::Borrower",
361   { borrowernumber => "borrowernumber" },
362   {
363     is_deferrable => 1,
364     join_type     => "LEFT",
365     on_delete     => "CASCADE",
366     on_update     => "CASCADE",
367   },
368 );
369
370 1;