<?xml version="1.0" encoding="ISO-8859-1" ?>
<construct>
    <!-- define the module name -->
    <module>account</module>
    <!-- define the module table name -->
    <table>account</table>
    <!-- define the module dependancy(s) -->
    <dependancy/>
    <!-- define the DB cache in seconds -->
    <cache>0</cache>
    <!-- define the default order_by field for SQL queries -->
    <order_by>last_name</order_by>
    <!-- define the methods -->
    <limit>30</limit>
    <!-- define the fields -->
    <field>
        <id>
            <type>I8</type>
            <unique>1</unique>
        </id>
        <site_id>
            <type>I4</type>
        </site_id>
        <date_orig>
            <type>I8</type>
        </date_orig>
        <date_last>
            <type>I8</type>
            <convert>date-now</convert>
        </date_last>
        <date_expire>
            <type>I8</type>
            <convert>date</convert>
        </date_expire>
        <parent_id>
            <type>I4</type>
        </parent_id>
        <language_id>
            <type>C(32)</type>
        </language_id>
        <country_id>
            <type>I4</type>
        </country_id>
        <affiliate_id>
            <type>C(32)</type>
        </affiliate_id>
        <campaign_id>
            <type>I4</type>
        </campaign_id>
        <reseller_id>
            <type>I4</type>
        </reseller_id>
        <currency_id>
            <type>I4</type>
        </currency_id>
        <theme_id>
            <type>C(32)</type>
        </theme_id>
        <username>
            <type>C(128)</type>
            <min_len>4</min_len>
            <max_len>12</max_len>
            <validate>any</validate>
            <unique>1</unique>
            <index>1</index>
        </username>
        <password>
            <type>C(128)</type>
            <min_len>6</min_len>
            <max_len>12</max_len>
            <validate>password</validate>
            <convert>md5</convert>
        </password>
        <inherit_group>
            <type>L</type>
        </inherit_group>
        <misc>
            <type>C2(128)</type>
        </misc>
        <status>
            <type>I4</type>
        </status>
        <first_name>
            <type>C(128)</type>
            <min_len>1</min_len>
            <max_len>128</max_len>
            <validate>any</validate>
            <index>1</index>
        </first_name>
        <middle_name>
            <type>C(128)</type>
        </middle_name>
        <last_name>
            <type>C(128)</type>
            <min_len>1</min_len>
            <max_len>128</max_len>
            <validate>any</validate>
            <index>1</index>
        </last_name>
        <title>
            <type>C(128)</type>
        </title>
        <email>
            <type>C(255)</type>
            <min_len>4</min_len>
            <max_len>128</max_len>
            <validate>email</validate>
            <unique>1</unique>
            <index>1</index>
        </email>
        <company>
            <type>C(255)</type>
        </company>
        <address1>
            <type>C(128)</type>
            <min_len>3</min_len>
            <max_len>128</max_len>
            <validate>any</validate>
        </address1>
        <address2>
            <type>C(128)</type>
            <max_len>128</max_len>
        </address2>
        <city>
            <type>C(32)</type>
            <min_len>2</min_len>
            <max_len>32</max_len>
            <validate>any</validate>
        </city>
        <state>
            <type>C(32)</type>
            <min_len>2</min_len>
            <max_len>32</max_len>
            <validate>any</validate>
        </state>
        <zip>
            <type>C(16)</type>
            <min_len>4</min_len>
            <max_len>16</max_len>
            <validate>any</validate>
        </zip>
        <email_type>
            <type>L</type>
        </email_type>
	    <invoice_delivery>
	      	<type>I4</type>
	  	</invoice_delivery> 
	    <invoice_show_itemized>
	        <type>L</type>
	        <default>1</default>
	    </invoice_show_itemized>        
	    <invoice_grace>
	      	<type>I4</type>
	    </invoice_grace>
	    <invoice_advance_gen>
	      	<type>I4</type>
	    </invoice_advance_gen> 
	    <tax_id>
	    	<type>C(64)</type>
	    </tax_id>
	    <max_child>
	      	<type>I4</type>
	    </max_child>	       
    </field>
    <!-- define indexes -->
    <index>
        <login>username,password</login>
        <search>first_name,middle_name,last_name</search>
        <company>company</company>
        <email>email</email>
        <affiliate>affiliate_id</affiliate>
        <campaign_id>campaign_id</campaign_id>
        <country>country_id</country>
        <region>city,state</region>
        <city>city</city>
        <state>state</state>
        <postal>zip</postal>
        <idmain>id,site_id</idmain>
        <fulltext_user>first_name,last_name,email,company</fulltext_user>
    </index>
    <!-- define all the methods for this class, and the fields they have access to, if applicable. -->
    <method>
        <add>id,date_orig,date_last,language_id,country_id,affiliate_id,reseller_id,currency_id,theme_id,username,password,status,first_name,middle_name,last_name,title,email,company,address1,address2,city,state,zip,tax_id</add>
        <update>id,date_orig,date_last,language_id,country_id,affiliate_id,reseller_id,currency_id,theme_id,username,password,status,first_name,middle_name,last_name,title,email,company,address1,address2,city,state,zip,email_type,tax_id</update>
        <view>id,parent_id,date_last,language_id,country_id,affiliate_id,reseller_id,currency_id,theme_id,username,password,status,first_name,middle_name,last_name,title,email,company,address1,address2,city,state,zip,email_type,tax_id,max_child</view>
    </method>
    <!-- define the method triggers -->
    <trigger>
        <add>
            <success>account_admin:add_account_groups</success>
        </add>
    </trigger>
</construct>
