Bug 12446: (QA follow-up) Minor kohastructure.sql fix
[koha.git] / Koha / Schema / Result / ReturnClaim.pm
1 use utf8;
2 package Koha::Schema::Result::ReturnClaim;
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::ReturnClaim
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<return_claims>
19
20 =cut
21
22 __PACKAGE__->table("return_claims");
23
24 =head1 ACCESSORS
25
26 =head2 id
27
28   data_type: 'integer'
29   is_auto_increment: 1
30   is_nullable: 0
31
32 Unique ID of the return claim
33
34 =head2 itemnumber
35
36   data_type: 'integer'
37   is_foreign_key: 1
38   is_nullable: 0
39
40 ID of the item
41
42 =head2 issue_id
43
44   data_type: 'integer'
45   is_nullable: 1
46
47 ID of the checkout that triggered the claim
48
49 =head2 borrowernumber
50
51   data_type: 'integer'
52   is_foreign_key: 1
53   is_nullable: 0
54
55 ID of the patron
56
57 =head2 notes
58
59   data_type: 'mediumtext'
60   is_nullable: 1
61
62 Notes about the claim
63
64 =head2 created_on
65
66   data_type: 'timestamp'
67   datetime_undef_if_invalid: 1
68   is_nullable: 1
69
70 Time and date the claim was created
71
72 =head2 created_by
73
74   data_type: 'integer'
75   is_foreign_key: 1
76   is_nullable: 1
77
78 ID of the staff member that registered the claim
79
80 =head2 updated_on
81
82   data_type: 'timestamp'
83   datetime_undef_if_invalid: 1
84   is_nullable: 1
85
86 Time and date of the latest change on the claim (notes)
87
88 =head2 updated_by
89
90   data_type: 'integer'
91   is_foreign_key: 1
92   is_nullable: 1
93
94 ID of the staff member that updated the claim
95
96 =head2 resolution
97
98   data_type: 'varchar'
99   is_nullable: 1
100   size: 80
101
102 Resolution code (RETURN_CLAIM_RESOLUTION AVs)
103
104 =head2 resolved_on
105
106   data_type: 'timestamp'
107   datetime_undef_if_invalid: 1
108   is_nullable: 1
109
110 Time and date the claim was resolved
111
112 =head2 resolved_by
113
114   data_type: 'integer'
115   is_foreign_key: 1
116   is_nullable: 1
117
118 ID of the staff member that resolved the claim
119
120 =cut
121
122 __PACKAGE__->add_columns(
123   "id",
124   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
125   "itemnumber",
126   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
127   "issue_id",
128   { data_type => "integer", is_nullable => 1 },
129   "borrowernumber",
130   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
131   "notes",
132   { data_type => "mediumtext", is_nullable => 1 },
133   "created_on",
134   {
135     data_type => "timestamp",
136     datetime_undef_if_invalid => 1,
137     is_nullable => 1,
138   },
139   "created_by",
140   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
141   "updated_on",
142   {
143     data_type => "timestamp",
144     datetime_undef_if_invalid => 1,
145     is_nullable => 1,
146   },
147   "updated_by",
148   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
149   "resolution",
150   { data_type => "varchar", is_nullable => 1, size => 80 },
151   "resolved_on",
152   {
153     data_type => "timestamp",
154     datetime_undef_if_invalid => 1,
155     is_nullable => 1,
156   },
157   "resolved_by",
158   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
159 );
160
161 =head1 PRIMARY KEY
162
163 =over 4
164
165 =item * L</id>
166
167 =back
168
169 =cut
170
171 __PACKAGE__->set_primary_key("id");
172
173 =head1 UNIQUE CONSTRAINTS
174
175 =head2 C<issue_id>
176
177 =over 4
178
179 =item * L</issue_id>
180
181 =back
182
183 =cut
184
185 __PACKAGE__->add_unique_constraint("issue_id", ["issue_id"]);
186
187 =head1 RELATIONS
188
189 =head2 borrowernumber
190
191 Type: belongs_to
192
193 Related object: L<Koha::Schema::Result::Borrower>
194
195 =cut
196
197 __PACKAGE__->belongs_to(
198   "borrowernumber",
199   "Koha::Schema::Result::Borrower",
200   { borrowernumber => "borrowernumber" },
201   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
202 );
203
204 =head2 created_by
205
206 Type: belongs_to
207
208 Related object: L<Koha::Schema::Result::Borrower>
209
210 =cut
211
212 __PACKAGE__->belongs_to(
213   "created_by",
214   "Koha::Schema::Result::Borrower",
215   { borrowernumber => "created_by" },
216   {
217     is_deferrable => 1,
218     join_type     => "LEFT",
219     on_delete     => "SET NULL",
220     on_update     => "CASCADE",
221   },
222 );
223
224 =head2 itemnumber
225
226 Type: belongs_to
227
228 Related object: L<Koha::Schema::Result::Item>
229
230 =cut
231
232 __PACKAGE__->belongs_to(
233   "itemnumber",
234   "Koha::Schema::Result::Item",
235   { itemnumber => "itemnumber" },
236   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
237 );
238
239 =head2 resolved_by
240
241 Type: belongs_to
242
243 Related object: L<Koha::Schema::Result::Borrower>
244
245 =cut
246
247 __PACKAGE__->belongs_to(
248   "resolved_by",
249   "Koha::Schema::Result::Borrower",
250   { borrowernumber => "resolved_by" },
251   {
252     is_deferrable => 1,
253     join_type     => "LEFT",
254     on_delete     => "SET NULL",
255     on_update     => "CASCADE",
256   },
257 );
258
259 =head2 updated_by
260
261 Type: belongs_to
262
263 Related object: L<Koha::Schema::Result::Borrower>
264
265 =cut
266
267 __PACKAGE__->belongs_to(
268   "updated_by",
269   "Koha::Schema::Result::Borrower",
270   { borrowernumber => "updated_by" },
271   {
272     is_deferrable => 1,
273     join_type     => "LEFT",
274     on_delete     => "SET NULL",
275     on_update     => "CASCADE",
276   },
277 );
278
279
280 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-11-17 10:01:24
281 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Ik93SD3kLNecIyRgsBVKDQ
282
283 =head2 checkout
284
285 Type: belongs_to
286
287 Related object: L<Koha::Schema::Result::Issue>
288
289 =cut
290
291 __PACKAGE__->belongs_to(
292     "checkout",
293     "Koha::Schema::Result::Issue",
294     { issue_id => "issue_id" },
295     {
296         is_deferrable => 1,
297         join_type     => "LEFT",
298     },
299 );
300
301 =head2 old_checkout
302
303 Type: belongs_to
304
305 Related object: L<Koha::Schema::Result::OldIssue>
306
307 =cut
308
309 __PACKAGE__->belongs_to(
310     "old_checkout",
311     "Koha::Schema::Result::OldIssue",
312     { issue_id => "issue_id" },
313     {
314         is_deferrable => 1,
315         join_type     => "LEFT",
316     },
317 );
318
319 =head2 item
320
321 Type: belongs_to
322
323 Related object: L<Koha::Schema::Result::Item>
324
325 =cut
326
327 __PACKAGE__->belongs_to(
328   "item",
329   "Koha::Schema::Result::Item",
330   { itemnumber => "itemnumber" },
331   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
332 );
333
334 sub koha_objects_class {
335     'Koha::Checkouts::ReturnClaims';
336 }
337 sub koha_object_class {
338     'Koha::Checkouts::ReturnClaim';
339 }
340
341 1;