Bug 31378: DBIC schema
[koha.git] / Koha / Schema / Result / Category.pm
1 use utf8;
2 package Koha::Schema::Result::Category;
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::Category
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<categories>
19
20 =cut
21
22 __PACKAGE__->table("categories");
23
24 =head1 ACCESSORS
25
26 =head2 categorycode
27
28   data_type: 'varchar'
29   default_value: (empty string)
30   is_nullable: 0
31   size: 10
32
33 unique primary key used to idenfity the patron category
34
35 =head2 description
36
37   data_type: 'longtext'
38   is_nullable: 1
39
40 description of the patron category
41
42 =head2 enrolmentperiod
43
44   data_type: 'smallint'
45   is_nullable: 1
46
47 number of months the patron is enrolled for (will be NULL if enrolmentperioddate is set)
48
49 =head2 enrolmentperioddate
50
51   data_type: 'date'
52   datetime_undef_if_invalid: 1
53   is_nullable: 1
54
55 date the patron is enrolled until (will be NULL if enrolmentperiod is set)
56
57 =head2 password_expiry_days
58
59   data_type: 'smallint'
60   is_nullable: 1
61
62 number of days after which the patron must reset their password
63
64 =head2 upperagelimit
65
66   data_type: 'smallint'
67   is_nullable: 1
68
69 age limit for the patron
70
71 =head2 dateofbirthrequired
72
73   data_type: 'tinyint'
74   is_nullable: 1
75
76 the minimum age required for the patron category
77
78 =head2 finetype
79
80   data_type: 'varchar'
81   is_nullable: 1
82   size: 30
83
84 unused in Koha
85
86 =head2 bulk
87
88   data_type: 'tinyint'
89   is_nullable: 1
90
91 =head2 enrolmentfee
92
93   data_type: 'decimal'
94   is_nullable: 1
95   size: [28,6]
96
97 enrollment fee for the patron
98
99 =head2 overduenoticerequired
100
101   data_type: 'tinyint'
102   is_nullable: 1
103
104 are overdue notices sent to this patron category (1 for yes, 0 for no)
105
106 =head2 issuelimit
107
108   data_type: 'smallint'
109   is_nullable: 1
110
111 unused in Koha
112
113 =head2 reservefee
114
115   data_type: 'decimal'
116   is_nullable: 1
117   size: [28,6]
118
119 cost to place holds
120
121 =head2 hidelostitems
122
123   data_type: 'tinyint'
124   default_value: 0
125   is_nullable: 0
126
127 are lost items shown to this category (1 for yes, 0 for no)
128
129 =head2 category_type
130
131   data_type: 'varchar'
132   default_value: 'A'
133   is_nullable: 0
134   size: 1
135
136 type of Koha patron (Adult, Child, Professional, Organizational, Statistical, Staff)
137
138 =head2 BlockExpiredPatronOpacActions
139
140   accessor: 'block_expired_patron_opac_actions'
141   data_type: 'tinyint'
142   default_value: -1
143   is_nullable: 0
144
145 wheither or not a patron of this category can renew books or place holds once their card has expired. 0 means they can, 1 means they cannot, -1 means use syspref BlockExpiredPatronOpacActions
146
147 =head2 default_privacy
148
149   data_type: 'enum'
150   default_value: 'default'
151   extra: {list => ["default","never","forever"]}
152   is_nullable: 0
153
154 Default privacy setting for this patron category
155
156 =head2 checkprevcheckout
157
158   data_type: 'varchar'
159   default_value: 'inherit'
160   is_nullable: 0
161   size: 7
162
163 produce a warning for this patron category if this item has previously been checked out to this patron if 'yes', not if 'no', defer to syspref setting if 'inherit'.
164
165 =head2 can_be_guarantee
166
167   data_type: 'tinyint'
168   default_value: 0
169   is_nullable: 0
170
171 if patrons of this category can be guarantees
172
173 =head2 reset_password
174
175   data_type: 'tinyint'
176   is_nullable: 1
177
178 if patrons of this category can do the password reset flow,
179
180 =head2 change_password
181
182   data_type: 'tinyint'
183   is_nullable: 1
184
185 if patrons of this category can change their passwords in the OAPC
186
187 =head2 min_password_length
188
189   data_type: 'smallint'
190   is_nullable: 1
191
192 set minimum password length for patrons in this category
193
194 =head2 require_strong_password
195
196   data_type: 'tinyint'
197   is_nullable: 1
198
199 set required password strength for patrons in this category
200
201 =head2 exclude_from_local_holds_priority
202
203   data_type: 'tinyint'
204   is_nullable: 1
205
206 Exclude patrons of this category from local holds priority
207
208 =cut
209
210 __PACKAGE__->add_columns(
211   "categorycode",
212   { data_type => "varchar", default_value => "", is_nullable => 0, size => 10 },
213   "description",
214   { data_type => "longtext", is_nullable => 1 },
215   "enrolmentperiod",
216   { data_type => "smallint", is_nullable => 1 },
217   "enrolmentperioddate",
218   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
219   "password_expiry_days",
220   { data_type => "smallint", is_nullable => 1 },
221   "upperagelimit",
222   { data_type => "smallint", is_nullable => 1 },
223   "dateofbirthrequired",
224   { data_type => "tinyint", is_nullable => 1 },
225   "finetype",
226   { data_type => "varchar", is_nullable => 1, size => 30 },
227   "bulk",
228   { data_type => "tinyint", is_nullable => 1 },
229   "enrolmentfee",
230   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
231   "overduenoticerequired",
232   { data_type => "tinyint", is_nullable => 1 },
233   "issuelimit",
234   { data_type => "smallint", is_nullable => 1 },
235   "reservefee",
236   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
237   "hidelostitems",
238   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
239   "category_type",
240   { data_type => "varchar", default_value => "A", is_nullable => 0, size => 1 },
241   "BlockExpiredPatronOpacActions",
242   {
243     accessor      => "block_expired_patron_opac_actions",
244     data_type     => "tinyint",
245     default_value => -1,
246     is_nullable   => 0,
247   },
248   "default_privacy",
249   {
250     data_type => "enum",
251     default_value => "default",
252     extra => { list => ["default", "never", "forever"] },
253     is_nullable => 0,
254   },
255   "checkprevcheckout",
256   {
257     data_type => "varchar",
258     default_value => "inherit",
259     is_nullable => 0,
260     size => 7,
261   },
262   "can_be_guarantee",
263   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
264   "reset_password",
265   { data_type => "tinyint", is_nullable => 1 },
266   "change_password",
267   { data_type => "tinyint", is_nullable => 1 },
268   "min_password_length",
269   { data_type => "smallint", is_nullable => 1 },
270   "require_strong_password",
271   { data_type => "tinyint", is_nullable => 1 },
272   "exclude_from_local_holds_priority",
273   { data_type => "tinyint", is_nullable => 1 },
274 );
275
276 =head1 PRIMARY KEY
277
278 =over 4
279
280 =item * L</categorycode>
281
282 =back
283
284 =cut
285
286 __PACKAGE__->set_primary_key("categorycode");
287
288 =head1 RELATIONS
289
290 =head2 borrower_attribute_types
291
292 Type: has_many
293
294 Related object: L<Koha::Schema::Result::BorrowerAttributeType>
295
296 =cut
297
298 __PACKAGE__->has_many(
299   "borrower_attribute_types",
300   "Koha::Schema::Result::BorrowerAttributeType",
301   { "foreign.category_code" => "self.categorycode" },
302   { cascade_copy => 0, cascade_delete => 0 },
303 );
304
305 =head2 borrower_message_preferences
306
307 Type: has_many
308
309 Related object: L<Koha::Schema::Result::BorrowerMessagePreference>
310
311 =cut
312
313 __PACKAGE__->has_many(
314   "borrower_message_preferences",
315   "Koha::Schema::Result::BorrowerMessagePreference",
316   { "foreign.categorycode" => "self.categorycode" },
317   { cascade_copy => 0, cascade_delete => 0 },
318 );
319
320 =head2 borrowers
321
322 Type: has_many
323
324 Related object: L<Koha::Schema::Result::Borrower>
325
326 =cut
327
328 __PACKAGE__->has_many(
329   "borrowers",
330   "Koha::Schema::Result::Borrower",
331   { "foreign.categorycode" => "self.categorycode" },
332   { cascade_copy => 0, cascade_delete => 0 },
333 );
334
335 =head2 categories_branches
336
337 Type: has_many
338
339 Related object: L<Koha::Schema::Result::CategoriesBranch>
340
341 =cut
342
343 __PACKAGE__->has_many(
344   "categories_branches",
345   "Koha::Schema::Result::CategoriesBranch",
346   { "foreign.categorycode" => "self.categorycode" },
347   { cascade_copy => 0, cascade_delete => 0 },
348 );
349
350 =head2 circulation_rules
351
352 Type: has_many
353
354 Related object: L<Koha::Schema::Result::CirculationRule>
355
356 =cut
357
358 __PACKAGE__->has_many(
359   "circulation_rules",
360   "Koha::Schema::Result::CirculationRule",
361   { "foreign.categorycode" => "self.categorycode" },
362   { cascade_copy => 0, cascade_delete => 0 },
363 );
364
365 =head2 identity_provider_domains
366
367 Type: has_many
368
369 Related object: L<Koha::Schema::Result::IdentityProviderDomain>
370
371 =cut
372
373 __PACKAGE__->has_many(
374   "identity_provider_domains",
375   "Koha::Schema::Result::IdentityProviderDomain",
376   { "foreign.default_category_id" => "self.categorycode" },
377   { cascade_copy => 0, cascade_delete => 0 },
378 );
379
380
381 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-11-08 17:35:26
382 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:B89OgAY/KnJbQaHpu5Xdfg
383
384 sub koha_object_class {
385     'Koha::Patron::Category';
386 }
387 sub koha_objects_class {
388     'Koha::Patron::Categories';
389 }
390
391 __PACKAGE__->add_columns(
392     '+can_be_guarantee'                  => { is_boolean => 1 },
393     '+exclude_from_local_holds_priority' => { is_boolean => 1 },
394     '+require_strong_password'           => { is_boolean => 1 },
395 );
396
397 1;