[open-ils-commits] r12107 - in trunk/Open-ILS: examples src/sql/Pg (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Sun Feb 8 09:43:44 EST 2009
Author: erickson
Date: 2009-02-08 09:43:43 -0500 (Sun, 08 Feb 2009)
New Revision: 12107
Modified:
trunk/Open-ILS/examples/fm_IDL.xml
trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql
Log:
more provider data. address, contact, and contact address
Modified: trunk/Open-ILS/examples/fm_IDL.xml
===================================================================
--- trunk/Open-ILS/examples/fm_IDL.xml 2009-02-08 02:37:56 UTC (rev 12106)
+++ trunk/Open-ILS/examples/fm_IDL.xml 2009-02-08 14:43:43 UTC (rev 12107)
@@ -3949,7 +3949,7 @@
</permacrud>
</class>
- <class id="acqpro" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::provider" oils_persist:tablename="acq.provider">
+ <class id="acqpro" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::provider" oils_persist:tablename="acq.provider" reporter:label="Provider">
<fields oils_persist:primary="id" oils_persist:sequence="acq.provider_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" />
@@ -3964,8 +3964,124 @@
<link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
<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="ADMIN_PROVIDER" context_field="owner"/>
+ <retrieve permission="ADMIN_PROVIDER" context_field="owner"/>
+ <update permission="ADMIN_PROVIDER" context_field="owner"/>
+ <delete permission="ADMIN_PROVIDER" context_field="owner"/>
+ </actions>
+ </permacrud>
</class>
+ <class id="acqpa" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::provider_address" oils_persist:tablename="acq.provider_address" reporter:label="Provider Address">
+ <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_address_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="address_type" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="text"/>
+ <field name="city" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="text"/>
+ <field name="country" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="text"/>
+ <field name="county" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="text"/>
+ <field name="id" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="id"/>
+ <field name="provider" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="link"/>
+ <field name="post_code" oils_obj:array_position="9" oils_persist:virtual="false" reporter:datatype="text"/>
+ <field name="state" oils_obj:array_position="10" oils_persist:virtual="false" reporter:datatype="text"/>
+ <field name="street1" oils_obj:array_position="11" oils_persist:virtual="false" reporter:datatype="text"/>
+ <field name="street2" oils_obj:array_position="12" oils_persist:virtual="false" reporter:datatype="text"/>
+ <field name="valid" oils_obj:array_position="13" oils_persist:virtual="false" reporter:datatype="bool"/>
+ </fields>
+ <links>
+ <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
+ </links>
+ <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+ <actions>
+ <create permission="ADMIN_PROVIDER">
+ <context link="provider" field="owner"/>
+ </create>
+ <retrieve permission="ADMIN_PROVIDER">
+ <context link="provider" field="owner"/>
+ </retrieve>
+ <update permission="ADMIN_PROVIDER">
+ <context link="provider" field="owner"/>
+ </update>
+ <delete permission="ADMIN_PROVIDER">
+ <context link="provider" field="owner"/>
+ </delete>
+ </actions>
+ </permacrud>
+ </class>
+
+ <class id="acqpc" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="acq::provider_contact" oils_persist:tablename="acq.provider_contact" reporter:label="Provider Contact">
+ <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_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:datatype="id"/>
+ <field name="provider" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="link"/>
+ <field name="name" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="text"/>
+ <field name="role" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="text"/>
+ <field name="email" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="text"/>
+ <field name="phone" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="text"/>
+ </fields>
+ <links>
+ <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
+ </links>
+ <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+ <actions>
+ <create permission="ADMIN_PROVIDER">
+ <context link="provider" field="owner"/>
+ </create>
+ <retrieve permission="ADMIN_PROVIDER">
+ <context link="provider" field="owner"/>
+ </retrieve>
+ <update permission="ADMIN_PROVIDER">
+ <context link="provider" field="owner"/>
+ </update>
+ <delete permission="ADMIN_PROVIDER">
+ <context link="provider" field="owner"/>
+ </delete>
+ </actions>
+ </permacrud>
+ </class>
+ <class id="acqpca" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::provider_contact_address" oils_persist:tablename="acq.provider_contact_address" reporter:label="Provider Contact Address">
+ <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_address_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 reporter:label="Type" name="address_type" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="text"/>
+ <field reporter:label="City" name="city" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="text"/>
+ <field reporter:label="Country" name="country" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="text"/>
+ <field reporter:label="County" name="county" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="text"/>
+ <field reporter:label="Address ID" name="id" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="id" />
+ <field reporter:label="Postal Code" name="post_code" oils_obj:array_position="8" oils_persist:virtual="false" reporter:datatype="text"/>
+ <field reporter:label="State" name="state" oils_obj:array_position="9" oils_persist:virtual="false" reporter:datatype="text"/>
+ <field reporter:label="Street (1)" name="street1" oils_obj:array_position="10" oils_persist:virtual="false" reporter:datatype="text"/>
+ <field reporter:label="Street (2)" name="street2" oils_obj:array_position="11" oils_persist:virtual="false" reporter:datatype="text"/>
+ <field reporter:label="Contact" name="contact" oils_obj:array_position="12" oils_persist:virtual="false" reporter:datatype="link"/>
+ <field reporter:label="Valid Address?" name="valid" oils_obj:array_position="13" oils_persist:virtual="false" reporter:datatype="bool"/>
+ </fields>
+ <links>
+ <link field="contact" reltype="has_a" key="id" map="" class="acqpc"/>
+ </links>
+ <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+ <actions>
+ <create permission="ADMIN_PROVIDER">
+ <context link="contact" jump='provider' field="owner"/>
+ </create>
+ <retrieve permission="ADMIN_PROVIDER">
+ <context link="contact" jump='provider' field="owner"/>
+ </retrieve>
+ <update permission="ADMIN_PROVIDER">
+ <context link="contact" jump='provider' field="owner"/>
+ </update>
+ <delete permission="ADMIN_PROVIDER">
+ <context link="contact" jump='provider' field="owner"/>
+ </delete>
+ </actions>
+ </permacrud>
+ </class>
+
<class id="acqfs" controller="open-ils.cstore open-ils.reporter-store open-ils.pcrud" oils_obj:fieldmapper="acq::funding_source" oils_persist:tablename="acq.funding_source">
<fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_id_seq">
<field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
Modified: trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql 2009-02-08 02:37:56 UTC (rev 12106)
+++ trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql 2009-02-08 14:43:43 UTC (rev 12107)
@@ -38,6 +38,44 @@
CONSTRAINT provider_name_once_per_owner UNIQUE (name,owner)
);
+CREATE TABLE acq.provider_address (
+ id SERIAL PRIMARY KEY,
+ valid BOOL NOT NULL DEFAULT TRUE,
+ address_type TEXT,
+ provider INT NOT NULL REFERENCES acq.provider (id) DEFERRABLE INITIALLY DEFERRED,
+ street1 TEXT NOT NULL,
+ street2 TEXT,
+ city TEXT NOT NULL,
+ county TEXT,
+ state TEXT NOT NULL,
+ country TEXT NOT NULL,
+ post_code TEXT NOT NULL
+);
+
+CREATE TABLE acq.provider_contact (
+ id SERIAL PRIMARY KEY,
+ provider INT NOT NULL REFERENCES acq.provider (id) DEFERRABLE INITIALLY DEFERRED,
+ name TEXT NULL NULL,
+ role TEXT, -- free-form.. e.g. "our sales guy"
+ email TEXT,
+ phone TEXT
+);
+
+CREATE TABLE acq.provider_contact_address (
+ id SERIAL PRIMARY KEY,
+ valid BOOL NOT NULL DEFAULT TRUE,
+ address_type TEXT,
+ contact INT NOT NULL REFERENCES acq.provider_contact (id) DEFERRABLE INITIALLY DEFERRED,
+ street1 TEXT NOT NULL,
+ street2 TEXT,
+ city TEXT NOT NULL,
+ county TEXT,
+ state TEXT NOT NULL,
+ country TEXT NOT NULL,
+ post_code TEXT NOT NULL
+);
+
+
CREATE TABLE acq.funding_source (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL,
More information about the open-ils-commits
mailing list