[open-ils-commits] r11270 - in trunk/Open-ILS: examples src/sql/Pg
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Nov 19 15:34:43 EST 2008
Author: miker
Date: 2008-11-19 15:34:40 -0500 (Wed, 19 Nov 2008)
New Revision: 11270
Modified:
trunk/Open-ILS/examples/fm_IDL.xml
trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
trunk/Open-ILS/src/sql/Pg/005.schema.actors.sql
Log:
adding config.standing_penalty, and links to that from actor.usr_standing_penalty
Modified: trunk/Open-ILS/examples/fm_IDL.xml
===================================================================
--- trunk/Open-ILS/examples/fm_IDL.xml 2008-11-19 20:27:04 UTC (rev 11269)
+++ trunk/Open-ILS/examples/fm_IDL.xml 2008-11-19 20:34:40 UTC (rev 11270)
@@ -1695,6 +1695,28 @@
<link field="lit_form" reltype="has_a" key="code" map="" class="clfm"/>
</links>
</class>
+
+ <class id="csp" controller="open-ils.cstore" oils_obj:fieldmapper="config::standing_penalty" oils_persist:tablename="config.standing_penalty">
+ <fields oils_persist:primary="id" oils_persist:sequence="config.standing_penalty_id_seq">
+ <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
+ <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
+ <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
+ <field name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:selector="name" reporter:datatype="id"/>
+ <field name="name" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="text"/>
+ <field name="label" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="text" oils_persist:i18n="true"/>
+ <field name="block_list" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="text"/>
+ </fields>
+ <links/>
+ <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+ <actions>
+ <create permission="CREATE_STANDING_PENALTY" global_required="true"/>
+ <retrieve permission="CREATE_STANDING_PENALTY|UPDATE_STANDING_PENALTY|DELETE_STANDING_PENALTY" global_required="true"/>
+ <update permission="UPDATE_STANDING_PENALTY" global_required="true"/>
+ <delete permission="DELETE_STANDING_PENALTY" global_required="true"/>
+ </actions>
+ </permacrud>
+ </class>
+
<class id="ccs" controller="open-ils.cstore" oils_obj:fieldmapper="config::copy_status" oils_persist:tablename="config.copy_status">
<fields oils_persist:primary="id" oils_persist:sequence="config.copy_status_id_seq">
<field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
@@ -1721,11 +1743,15 @@
<field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
<field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
<field name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="id" />
- <field name="penalty_type" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="text"/>
+ <field name="set_date" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="timestamp"/>
<field name="usr" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="link"/>
+ <field name="staff" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="link"/>
+ <field name="standing_penalty" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="link"/>
</fields>
<links>
<link field="usr" reltype="has_a" key="id" map="" class="au"/>
+ <link field="staff" reltype="has_a" key="id" map="" class="au"/>
+ <link field="standing_penalty" reltype="has_a" key="id" map="" class="csp"/>
</links>
</class>
<class id="aua" controller="open-ils.cstore" oils_obj:fieldmapper="actor::user_address" oils_persist:tablename="actor.usr_address" reporter:label="User Address">
Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2008-11-19 20:27:04 UTC (rev 11269)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2008-11-19 20:34:40 UTC (rev 11270)
@@ -111,6 +111,18 @@
*/
$$;
+CREATE TABLE config.standing_penalty (
+ id SERIAL PRIMARY KEY,
+ name TEXT NOT NULL UNIQUE,
+ label TEXT NOT NULL,
+ block_list TEXT
+);
+INSERT INTO config.standing_penalty (id,name,label,block_list)
+ VALUES (1,'PATRON_EXCEEDS_FINES','Patron exceeds fine threshold','CIRC|HOLD|RENEW');
+INSERT INTO config.standing_penalty (id,name,label,block_list)
+ VALUES (2,'PATRON_EXCEEDS_OVERDUE_COUNT','Patron exceeds max overdue item threshold','CIRC|HOLD|RENEW');
+SELECT SETVAL('config.standing_penalty_id_seq', 100);
+
CREATE TABLE config.xml_transform (
name TEXT PRIMARY KEY,
namespace_uri TEXT NOT NULL,
Modified: trunk/Open-ILS/src/sql/Pg/005.schema.actors.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/005.schema.actors.sql 2008-11-19 20:27:04 UTC (rev 11269)
+++ trunk/Open-ILS/src/sql/Pg/005.schema.actors.sql 2008-11-19 20:34:40 UTC (rev 11270)
@@ -145,9 +145,11 @@
CREATE INDEX actor_usr_note_usr_idx ON actor.usr_note (usr);
CREATE TABLE actor.usr_standing_penalty (
- id SERIAL PRIMARY KEY,
- usr INT NOT NULL REFERENCES actor.usr ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
- penalty_type TEXT NOT NULL
+ id SERIAL PRIMARY KEY,
+ usr INT NOT NULL REFERENCES actor.usr (id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
+ standing_penalty INT NOT NULL REFERENCES config.standing_penalty (id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
+ staff INT REFERENCES actor.usr (id) ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED,
+ set_date TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
COMMENT ON TABLE actor.usr_standing_penalty IS $$
/*
More information about the open-ils-commits
mailing list