updating money handling; adding readonly fieldmapper classes (views); allow fields...
[Evergreen.git] / Open-ILS / src / perlmods / OpenILS / Application / Storage / Driver / Pg / dbi.pm
1 {
2         #---------------------------------------------------------------------
3         package money::billable_transaction;
4         
5         money::billable_transaction->table( 'money.billable_transaction' );
6         money::billable_transaction->sequence( 'money.billable_transaction_id_seq' );
7
8         #---------------------------------------------------------------------
9         package money::billing;
10         
11         money::billing->table( 'money.billing' );
12         money::billing->sequence( 'money.billing_id_seq' );
13
14         #---------------------------------------------------------------------
15         package money::payment;
16         
17         money::payment->table( 'money.payment' );
18         money::payment->sequence( 'money.payment_id_seq' );
19
20         #---------------------------------------------------------------------
21         package money::cash_payment;
22         
23         money::cash_payment->table( 'money.cash_payment' );
24         money::cash_payment->sequence( 'money.payment_id_seq' );
25
26         #---------------------------------------------------------------------
27         package money::check_payment;
28         
29         money::check_payment->table( 'money.check_payment' );
30         money::check_payment->sequence( 'money.payment_id_seq' );
31
32         #---------------------------------------------------------------------
33         package money::credit_payment;
34         
35         money::credit_payment->table( 'money.credit_payment' );
36         money::credit_payment->sequence( 'money.payment_id_seq' );
37
38         #---------------------------------------------------------------------
39         package money::credit_card_payment;
40         
41         money::credit_card_payment->table( 'money.credit_card_payment' );
42         money::credit_card_payment->sequence( 'money.payment_id_seq' );
43
44         #---------------------------------------------------------------------
45         package money::work_payment;
46         
47         money::work_payment->table( 'money.work_payment' );
48         money::work_payment->sequence( 'money.payment_id_seq' );
49
50         #---------------------------------------------------------------------
51         package money::forgive_payment;
52         
53         money::forgive_payment->table( 'money.forgive_payment' );
54         money::forgive_payment->sequence( 'money.payment_id_seq' );
55
56         #---------------------------------------------------------------------
57         package money::billable_transaction_summary;
58         
59         money::billable_transaction_summary->table( 'money.billable_xact_summary' );
60
61         #---------------------------------------------------------------------
62         package money::user_summary;
63         
64         money::billable_transaction_summary->table( 'money.usr_summary' );
65
66         #---------------------------------------------------------------------
67         package action::circulation;
68         
69         action::circulation->table( 'action.circulation' );
70         action::circulation->sequence( 'money.billable_xact_id_seq' );
71
72         #---------------------------------------------------------------------
73         package action::survey;
74         
75         action::survey->table( 'action.survey' );
76         action::survey->sequence( 'action.survey_id_seq' );
77         
78         #---------------------------------------------------------------------
79         package action::survey_question;
80         
81         action::survey_question->table( 'action.survey_question' );
82         action::survey_question->sequence( 'action.survey_question_id_seq' );
83         
84         #---------------------------------------------------------------------
85         package action::survey_answer;
86         
87         action::survey_answer->table( 'action.survey_answer' );
88         action::survey_answer->sequence( 'action.survey_answer_id_seq' );
89         
90         #---------------------------------------------------------------------
91         package action::survey_response;
92         
93         action::survey_response->table( 'action.survey_response' );
94         action::survey_response->sequence( 'action.survey_response_id_seq' );
95         
96         #---------------------------------------------------------------------
97         package config::copy_status;
98         
99         config::copy_status->table( 'config.copy_status' );
100         config::copy_status->sequence( 'config.copy_status_id_seq' );
101
102         #---------------------------------------------------------------------
103         package config::rules::circ_duration;
104         
105         config::rules::circ_duration->table( 'config.rule_circ_duration' );
106         config::rules::circ_duration->sequence( 'config.rule_circ_duration_id_seq' );
107         
108         #---------------------------------------------------------------------
109         package config::rules::age_hold_protect;
110         
111         config::rules::age_hold_protect->table( 'config.rule_age_hold_protect' );
112         config::rules::age_hold_protect->sequence( 'config.rule_age_hold_protect_id_seq' );
113         
114         #---------------------------------------------------------------------
115         package config::rules::max_fine;
116         
117         config::rules::max_fine->table( 'config.rule_max_fine' );
118         config::rules::max_fine->sequence( 'config.rule_max_fine_id_seq' );
119         
120         #---------------------------------------------------------------------
121         package config::rules::recuring_fine;
122         
123         config::rules::recuring_fine->table( 'config.rule_recuring_fine' );
124         config::rules::recuring_fine->sequence( 'config.rule_recuring_fine_id_seq' );
125         
126         #---------------------------------------------------------------------
127         package config::net_access_level;
128         
129         config::net_access_level->table( 'config.net_access_level' );
130         config::net_access_level->sequence( 'config.net_access_level_id_seq' );
131         
132         #---------------------------------------------------------------------
133         package config::standing;
134         
135         config::standing->table( 'config.standing' );
136         config::standing->sequence( 'config.standing_id_seq' );
137         
138         #---------------------------------------------------------------------
139         package config::metabib_field;
140         
141         config::metabib_field->table( 'config.metabib_field' );
142         config::metabib_field->sequence( 'config.metabib_field_id_seq' );
143         
144         #---------------------------------------------------------------------
145         package config::bib_source;
146         
147         config::bib_source->table( 'config.bib_source' );
148         config::bib_source->sequence( 'config.bib_source_id_seq' );
149         
150         #---------------------------------------------------------------------
151         package config::identification_type;
152         
153         config::identification_type->table( 'config.identification_type' );
154         config::identification_type->sequence( 'config.identification_type_id_seq' );
155         
156         #---------------------------------------------------------------------
157         package asset::call_number_note;
158         
159         asset::call_number_note->table( 'asset.call_number_note' );
160         asset::call_number_note->sequence( 'asset.call_number_note_id_seq' );
161         
162         #---------------------------------------------------------------------
163         package asset::copy_note;
164         
165         asset::copy_note->table( 'asset.copy_note' );
166         asset::copy_note->sequence( 'asset.copy_note_id_seq' );
167
168         #---------------------------------------------------------------------
169         package asset::call_number;
170         
171         asset::call_number->table( 'asset.call_number' );
172         asset::call_number->sequence( 'asset.call_number_id_seq' );
173         
174         #---------------------------------------------------------------------
175         package asset::copy_location;
176         
177         asset::copy_location->table( 'asset.copy_location' );
178         asset::copy_location->sequence( 'asset.copy_location_id_seq' );
179
180         #---------------------------------------------------------------------
181         package asset::copy;
182         
183         asset::copy->table( 'asset.copy' );
184         asset::copy->sequence( 'asset.copy_id_seq' );
185
186         #---------------------------------------------------------------------
187         package asset::stat_cat;
188         
189         asset::stat_cat->table( 'asset.stat_cat' );
190         asset::stat_cat->sequence( 'asset.stat_cat_id_seq' );
191         
192         #---------------------------------------------------------------------
193         package asset::stat_cat_entry;
194         
195         asset::stat_cat_entry->table( 'asset.stat_cat_entry' );
196         asset::stat_cat_entry->sequence( 'asset.stat_cat_entry_id_seq' );
197         
198         #---------------------------------------------------------------------
199         package asset::stat_cat_entry_copy_map;
200         
201         asset::stat_cat_entry_copy_map->table( 'asset.stat_cat_entry_copy_map' );
202         asset::stat_cat_entry_copy_map->sequence( 'asset.stat_cat_entry_copy_map_id_seq' );
203         
204         #---------------------------------------------------------------------
205         package biblio::record_entry;
206         
207         biblio::record_entry->table( 'biblio.record_entry' );
208         biblio::record_entry->sequence( 'biblio.record_entry_id_seq' );
209
210         #---------------------------------------------------------------------
211         #package biblio::record_marc;
212         #
213         #biblio::record_marc->table( 'biblio.record_marc' );
214         #biblio::record_marc->sequence( 'biblio.record_marc_id_seq' );
215         #
216         #---------------------------------------------------------------------
217         package biblio::record_note;
218         
219         biblio::record_note->table( 'biblio.record_note' );
220         biblio::record_note->sequence( 'biblio.record_note_id_seq' );
221         
222         #---------------------------------------------------------------------
223         package actor::user;
224         
225         actor::user->table( 'actor.usr' );
226         actor::user->sequence( 'actor.usr_id_seq' );
227
228         #---------------------------------------------------------------------
229         package actor::user_address;
230         
231         actor::user_address->table( 'actor.usr_address' );
232         actor::user_address->sequence( 'actor.usr_address_id_seq' );
233
234         #---------------------------------------------------------------------
235         package actor::org_address;
236         
237         actor::org_address->table( 'actor.org_address' );
238         actor::org_address->sequence( 'actor.org_address_id_seq' );
239         
240         #---------------------------------------------------------------------
241         package actor::profile;
242         
243         actor::profile->table( 'actor.profile' );
244         actor::profile->sequence( 'actor.profile_id_seq' );
245         
246         #---------------------------------------------------------------------
247         package actor::org_unit_type;
248         
249         actor::org_unit_type->table( 'actor.org_unit_type' );
250         actor::org_unit_type->sequence( 'actor.org_unit_type_id_seq' );
251
252         #---------------------------------------------------------------------
253         package actor::org_unit;
254         
255         actor::org_unit->table( 'actor.org_unit' );
256         actor::org_unit->sequence( 'actor.org_unit_id_seq' );
257
258         #---------------------------------------------------------------------
259         package actor::stat_cat;
260         
261         actor::stat_cat->table( 'actor.stat_cat' );
262         actor::stat_cat->sequence( 'actor.stat_cat_id_seq' );
263         
264         #---------------------------------------------------------------------
265         package actor::stat_cat_entry;
266         
267         actor::stat_cat_entry->table( 'actor.stat_cat_entry' );
268         actor::stat_cat_entry->sequence( 'actor.stat_cat_entry_id_seq' );
269         
270         #---------------------------------------------------------------------
271         package actor::stat_cat_entry_user_map;
272         
273         actor::stat_cat_entry_user_map->table( 'actor.stat_cat_entry_usr_map' );
274         actor::stat_cat_entry_user_map->sequence( 'actor.stat_cat_entry_usr_map_id_seq' );
275         
276         #---------------------------------------------------------------------
277         package actor::card;
278         
279         actor::card->table( 'actor.card' );
280         actor::card->sequence( 'actor.card_id_seq' );
281
282         #---------------------------------------------------------------------
283
284         #-------------------------------------------------------------------------------
285         package metabib::metarecord;
286
287         metabib::metarecord->table( 'metabib.metarecord' );
288         metabib::metarecord->sequence( 'metabib.metarecord_id_seq' );
289
290         OpenILS::Application::Storage->register_method(
291                 api_name        => 'open-ils.storage.direct.metabib.metarecord.batch.create',
292                 method          => 'copy_create',
293                 api_level       => 1,
294                 'package'       => 'OpenILS::Application::Storage',
295                 cdbi            => 'metabib::metarecord',
296         );
297
298
299         #-------------------------------------------------------------------------------
300
301         #-------------------------------------------------------------------------------
302         package metabib::title_field_entry;
303
304         metabib::title_field_entry->table( 'metabib.title_field_entry' );
305         metabib::title_field_entry->sequence( 'metabib.title_field_entry_id_seq' );
306         metabib::title_field_entry->columns( 'FTS' => 'index_vector' );
307
308 #       metabib::title_field_entry->add_trigger(
309 #               before_create => \&OpenILS::Application::Storage::Driver::Pg::tsearch2_trigger
310 #       );
311 #       metabib::title_field_entry->add_trigger(
312 #               before_update => \&OpenILS::Application::Storage::Driver::Pg::tsearch2_trigger
313 #       );
314
315         OpenILS::Application::Storage->register_method(
316                 api_name        => 'open-ils.storage.direct.metabib.title_field_entry.batch.create',
317                 method          => 'copy_create',
318                 api_level       => 1,
319                 'package'       => 'OpenILS::Application::Storage',
320                 cdbi            => 'metabib::title_field_entry',
321         );
322
323         #-------------------------------------------------------------------------------
324
325         #-------------------------------------------------------------------------------
326         package metabib::author_field_entry;
327
328         metabib::author_field_entry->table( 'metabib.author_field_entry' );
329         metabib::author_field_entry->sequence( 'metabib.author_field_entry_id_seq' );
330         metabib::author_field_entry->columns( 'FTS' => 'index_vector' );
331
332         OpenILS::Application::Storage->register_method(
333                 api_name        => 'open-ils.storage.direct.metabib.author_field_entry.batch.create',
334                 method          => 'copy_create',
335                 api_level       => 1,
336                 'package'       => 'OpenILS::Application::Storage',
337                 cdbi            => 'metabib::author_field_entry',
338         );
339
340         #-------------------------------------------------------------------------------
341
342         #-------------------------------------------------------------------------------
343         package metabib::subject_field_entry;
344
345         metabib::subject_field_entry->table( 'metabib.subject_field_entry' );
346         metabib::subject_field_entry->sequence( 'metabib.subject_field_entry_id_seq' );
347         metabib::subject_field_entry->columns( 'FTS' => 'index_vector' );
348
349         OpenILS::Application::Storage->register_method(
350                 api_name        => 'open-ils.storage.direct.metabib.subject_field_entry.batch.create',
351                 method          => 'copy_create',
352                 api_level       => 1,
353                 'package'       => 'OpenILS::Application::Storage',
354                 cdbi            => 'metabib::subject_field_entry',
355         );
356
357         #-------------------------------------------------------------------------------
358
359         #-------------------------------------------------------------------------------
360         package metabib::keyword_field_entry;
361
362         metabib::keyword_field_entry->table( 'metabib.keyword_field_entry' );
363         metabib::keyword_field_entry->sequence( 'metabib.keyword_field_entry_id_seq' );
364         metabib::keyword_field_entry->columns( 'FTS' => 'index_vector' );
365
366         OpenILS::Application::Storage->register_method(
367                 api_name        => 'open-ils.storage.direct.metabib.keyword_field_entry.batch.create',
368                 method          => 'copy_create',
369                 api_level       => 1,
370                 'package'       => 'OpenILS::Application::Storage',
371                 cdbi            => 'metabib::keyword_field_entry',
372         );
373
374         #-------------------------------------------------------------------------------
375         package metabib::series_field_entry;
376
377         metabib::series_field_entry->table( 'metabib.series_field_entry' );
378         metabib::series_field_entry->sequence( 'metabib.series_field_entry_id_seq' );
379         metabib::series_field_entry->columns( 'FTS' => 'index_vector' );
380
381         OpenILS::Application::Storage->register_method(
382                 api_name        => 'open-ils.storage.direct.metabib.series_field_entry.batch.create',
383                 method          => 'copy_create',
384                 api_level       => 1,
385                 'package'       => 'OpenILS::Application::Storage',
386                 cdbi            => 'metabib::series_field_entry',
387         );
388
389         #-------------------------------------------------------------------------------
390
391         #-------------------------------------------------------------------------------
392         #package metabib::title_field_entry_source_map;
393
394         #metabib::title_field_entry_source_map->table( 'metabib.title_field_entry_source_map' );
395
396         #-------------------------------------------------------------------------------
397
398         #-------------------------------------------------------------------------------
399         #package metabib::author_field_entry_source_map;
400
401         #metabib::author_field_entry_source_map->table( 'metabib.author_field_entry_source_map' );
402
403         #-------------------------------------------------------------------------------
404
405         #-------------------------------------------------------------------------------
406         #package metabib::subject_field_entry_source_map;
407
408         #metabib::subject_field_entry_source_map->table( 'metabib.subject_field_entry_source_map' );
409
410         #-------------------------------------------------------------------------------
411
412         #-------------------------------------------------------------------------------
413         #package metabib::keyword_field_entry_source_map;
414
415         #metabib::keyword_field_entry_source_map->table( 'metabib.keyword_field_entry_source_map' );
416
417         #-------------------------------------------------------------------------------
418
419         #-------------------------------------------------------------------------------
420         package metabib::metarecord_source_map;
421
422         metabib::metarecord_source_map->table( 'metabib.metarecord_source_map' );
423         OpenILS::Application::Storage->register_method(
424                 api_name        => 'open-ils.storage.direct.metabib.metarecord_source_map.batch.create',
425                 method          => 'copy_create',
426                 api_level       => 1,
427                 'package'       => 'OpenILS::Application::Storage',
428                 cdbi            => 'metabib::metarecord_source_map',
429         );
430
431
432         #-------------------------------------------------------------------------------
433         package metabib::record_descriptor;
434
435         metabib::record_descriptor->table( 'metabib.rec_descriptor' );
436         metabib::record_descriptor->sequence( 'metabib.rec_descriptor_id_seq' );
437
438         OpenILS::Application::Storage->register_method(
439                 api_name        => 'open-ils.storage.direct.metabib.record_descriptor.batch.create',
440                 method          => 'copy_create',
441                 api_level       => 1,
442                 'package'       => 'OpenILS::Application::Storage',
443                 cdbi            => 'metabib::record_descriptor',
444         );
445
446         #-------------------------------------------------------------------------------
447
448
449         #-------------------------------------------------------------------------------
450         package metabib::full_rec;
451
452         metabib::full_rec->table( 'metabib.full_rec' );
453         metabib::full_rec->sequence( 'metabib.full_rec_id_seq' );
454         metabib::full_rec->columns( 'FTS' => 'index_vector' );
455
456         OpenILS::Application::Storage->register_method(
457                 api_name        => 'open-ils.storage.direct.metabib.full_rec.batch.create',
458                 method          => 'copy_create',
459                 api_level       => 1,
460                 'package'       => 'OpenILS::Application::Storage',
461                 cdbi            => 'metabib::full_rec',
462         );
463
464
465         #-------------------------------------------------------------------------------
466
467         package permission::perm_list;
468
469         permission::perm_list->sequence( 'permission.perm_list_id_seq' );
470         permission::perm_list->table('permission.perm_list');
471
472         #-------------------------------------------------------------------------------
473
474         package permission::grp_tree;
475
476         permission::grp_tree->sequence( 'permission.grp_tree_id_seq' );
477         permission::grp_tree->table('permission.grp_tree');
478
479         #-------------------------------------------------------------------------------
480
481         package permission::usr_grp_map;
482
483         permission::usr_grp_map->sequence( 'permission.usr_grp_map_id_seq' );
484         permission::usr_grp_map->table('permission.usr_grp_map');
485
486         #-------------------------------------------------------------------------------
487
488         package permission::usr_perm_map;
489
490         permission::usr_perm_map->sequence( 'permission.usr_perm_map_id_seq' );
491         permission::usr_perm_map->table('permission.usr_perm_map');
492
493         #-------------------------------------------------------------------------------
494
495         package permission::grp_perm_map;
496
497         permission::grp_perm_map->sequence( 'permission.grp_perm_map_id_seq' );
498         permission::grp_perm_map->table('permission.grp_perm_map');
499
500         #-------------------------------------------------------------------------------
501
502         package action::hold_request;
503
504         action::hold_request->sequence( 'action.hold_request_id_seq' );
505         action::hold_request->table('action.hold_request');
506
507         #-------------------------------------------------------------------------------
508
509         package action::hold_notification;
510
511         action::hold_notification->sequence( 'action.hold_notification_id_seq' );
512         action::hold_notification->table('action.hold_notification');
513
514         #-------------------------------------------------------------------------------
515
516         package action::hold_copy_map;
517
518         action::hold_copy_map->sequence( 'action.hold_copy_map_id_seq' );
519         action::hold_copy_map->table('action.hold_copy_map');
520
521         #-------------------------------------------------------------------------------
522
523         package action::hold_transit_copy;
524
525         action::hold_transit_copy->sequence( 'action.hold_transit_copy_id_seq' );
526         action::hold_transit_copy->table('action.hold_transit_copy');
527
528         #-------------------------------------------------------------------------------
529
530
531 }
532
533 1;