Bug 29234: Further clean Z3950 Tests
[koha-ffzg.git] / Koha / Schema / Result / CheckoutRenewal.pm
1 use utf8;
2 package Koha::Schema::Result::CheckoutRenewal;
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::CheckoutRenewal
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<checkout_renewals>
19
20 =cut
21
22 __PACKAGE__->table("checkout_renewals");
23
24 =head1 ACCESSORS
25
26 =head2 renewal_id
27
28   data_type: 'integer'
29   is_auto_increment: 1
30   is_nullable: 0
31
32 =head2 checkout_id
33
34   data_type: 'integer'
35   is_nullable: 1
36
37 the id of the checkout this renewal pertains to
38
39 =head2 renewer_id
40
41   data_type: 'integer'
42   is_foreign_key: 1
43   is_nullable: 1
44
45 the id of the user who processed the renewal
46
47 =head2 seen
48
49   data_type: 'tinyint'
50   default_value: 0
51   is_nullable: 1
52
53 boolean denoting whether the item was present or not
54
55 =head2 interface
56
57   data_type: 'varchar'
58   is_nullable: 0
59   size: 16
60
61 the interface this renewal took place on
62
63 =head2 timestamp
64
65   data_type: 'timestamp'
66   datetime_undef_if_invalid: 1
67   default_value: current_timestamp
68   is_nullable: 0
69
70 the date and time the renewal took place
71
72 =head2 renewal_type
73
74   data_type: 'enum'
75   default_value: 'Manual'
76   extra: {list => ["Automatic","Manual"]}
77   is_nullable: 0
78
79 whether the renewal was an automatic or manual renewal
80
81 =cut
82
83 __PACKAGE__->add_columns(
84   "renewal_id",
85   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
86   "checkout_id",
87   { data_type => "integer", is_nullable => 1 },
88   "renewer_id",
89   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
90   "seen",
91   { data_type => "tinyint", default_value => 0, is_nullable => 1 },
92   "interface",
93   { data_type => "varchar", is_nullable => 0, size => 16 },
94   "timestamp",
95   {
96     data_type => "timestamp",
97     datetime_undef_if_invalid => 1,
98     default_value => \"current_timestamp",
99     is_nullable => 0,
100   },
101   "renewal_type",
102   {
103     data_type => "enum",
104     default_value => "Manual",
105     extra => { list => ["Automatic", "Manual"] },
106     is_nullable => 0,
107   },
108 );
109
110 =head1 PRIMARY KEY
111
112 =over 4
113
114 =item * L</renewal_id>
115
116 =back
117
118 =cut
119
120 __PACKAGE__->set_primary_key("renewal_id");
121
122 =head1 RELATIONS
123
124 =head2 renewer
125
126 Type: belongs_to
127
128 Related object: L<Koha::Schema::Result::Borrower>
129
130 =cut
131
132 __PACKAGE__->belongs_to(
133   "renewer",
134   "Koha::Schema::Result::Borrower",
135   { borrowernumber => "renewer_id" },
136   {
137     is_deferrable => 1,
138     join_type     => "LEFT",
139     on_delete     => "SET NULL",
140     on_update     => "CASCADE",
141   },
142 );
143
144
145 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-12-08 10:49:16
146 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Si1gkXWqpvt98YN0dO7vgw
147
148 =head2 checkout
149
150 Type: belongs_to
151
152 Related object: L<Koha::Schema::Result::Issue>
153
154 =cut
155
156 __PACKAGE__->belongs_to(
157     "checkout",
158     "Koha::Schema::Result::Issue",
159     { "foreign.issue_id" => "self.checkout_id" },
160     {
161         is_deferrable => 1,
162         join_type     => "LEFT",
163     },
164 );
165
166 =head2 old_checkout
167
168 Type: belongs_to
169
170 Related object: L<Koha::Schema::Result::OldIssue>
171
172 =cut
173
174 __PACKAGE__->belongs_to(
175     "old_checkout",
176     "Koha::Schema::Result::OldIssue",
177     { "foreign.issue_id" => "self.checkout_id" },
178     {
179         is_deferrable => 1,
180         join_type     => "LEFT",
181     },
182 );
183
184 __PACKAGE__->add_columns(
185     '+seen' => { is_boolean => 1 }
186 );
187
188 sub koha_objects_class {
189     'Koha::Checkouts::Renewals';
190 }
191 sub koha_object_class {
192     'Koha::Checkouts::Renewal';
193 }
194
195 1;