[open-ils-commits] r11166 - in trunk/Open-ILS: examples src/sql/Pg

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Nov 13 14:19:24 EST 2008


Author: erickson
Date: 2008-11-13 14:19:21 -0500 (Thu, 13 Nov 2008)
New Revision: 11166

Modified:
   trunk/Open-ILS/examples/fm_IDL.xml
   trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
   trunk/Open-ILS/src/sql/Pg/800.fkeys.sql
Log:
added in-db billing types tables and IDL bits.  this will replace the <billing_types> config in opensrf.xml

Modified: trunk/Open-ILS/examples/fm_IDL.xml
===================================================================
--- trunk/Open-ILS/examples/fm_IDL.xml	2008-11-13 18:37:32 UTC (rev 11165)
+++ trunk/Open-ILS/examples/fm_IDL.xml	2008-11-13 19:19:21 UTC (rev 11166)
@@ -3432,7 +3432,28 @@
             </actions>
         </permacrud>
 	</class>
-
+	<class id="cbt" controller="open-ils.cstore" oils_obj:fieldmapper="config::billing_type" oils_persist:tablename="config.billing_type">
+		<fields oils_persist:primary="id">
+			<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:datatype="id" />
+			<field name="name" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="text" oils_persist:i18n="true"/>
+			<field name="owner" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="org_unit" />
+            <field name="default_price" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="money"/>
+		</fields>
+		<links>
+			<link field="owner" reltype="has_a" key="id" map="" class="aou"/>
+		</links>
+        <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+            <actions>
+                <create permission="CREATE_BILLING_TYPE"/>
+                <retrieve permission="CREATE_BILLING_TYPE|UPDATE_BILLING_TYPE|DELETE_BILLING_TYPE"/>
+                <update permission="UPDATE_BILLING_TYPE"/>
+                <delete permission="DELETE_BILLING_TYPE"/>
+            </actions>
+        </permacrud>
+	</class>
 	<class id="acqct" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::currency_type" oils_persist:tablename="acq.currency_type">
 		<fields oils_persist:primary="code">
 			<field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />

Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql	2008-11-13 18:37:32 UTC (rev 11165)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql	2008-11-13 19:19:21 UTC (rev 11166)
@@ -488,5 +488,14 @@
 
 CREATE UNIQUE INDEX i18n_identity ON config.i18n_core (fq_field,identity_value,translation);
 
+CREATE TABLE config.billing_type (
+    id              SERIAL  PRIMARY KEY,
+    name            TEXT    NOT NULL,
+    owner           INT     NOT NULL, -- REFERENCES actor.org_unit (id)
+    default_price   NUMERIC(6,2),
+    CONSTRAINT billing_type_once_per_lib UNIQUE (name, owner)
+);
+
+
 COMMIT;
 

Modified: trunk/Open-ILS/src/sql/Pg/800.fkeys.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/800.fkeys.sql	2008-11-13 18:37:32 UTC (rev 11165)
+++ trunk/Open-ILS/src/sql/Pg/800.fkeys.sql	2008-11-13 19:19:21 UTC (rev 11166)
@@ -95,4 +95,6 @@
 ALTER TABLE action.circulation ADD CONSTRAINT action_circulation_circ_lib_fkey FOREIGN KEY (circ_lib) REFERENCES actor.org_unit (id) ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED;
 ALTER TABLE action.circulation ADD CONSTRAINT action_circulation_target_copy_fkey FOREIGN KEY (target_copy) REFERENCES asset.copy (id) ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED;
 
+ALTER TABLE config.billing_type ADD CONSTRAINT config_billing_type_owner_fkey FOREIGN KEY (owner) REFERENCES actor.org_unit (id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
+
 COMMIT;



More information about the open-ils-commits mailing list