<?xml version="1.0" encoding="UTF-8"?>

<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='http://www.oneit.com.au/schemas/5.2/BusinessObject.xsd'>

    <BUSINESSCLASS  name="Company"    package="performa.orm">
        
        <IMPORT value="performa.orm.types.*"/>
        <IMPORT value="performa.orm.types.TimeZone"/>
        <IMPORT value="oneit.business.shopping.orm.*"/>

        <MULTIPLEREFERENCE  name="Users"    type="CompanyUser"  backreferenceName="Company"/>
        <MULTIPLEREFERENCE  name="Clients"  type="Client"       backreferenceName="Company"/>
        
        <TRANSIENT  name="UserEmail"        type="String"/>
        <TRANSIENT  name="FirstName"        type="String"/>
        <TRANSIENT  name="LastName"         type="String"/>
        <TRANSIENT  name="RoleType"         type="RoleType"     defaultValue="RoleType.STANDARD"    attribHelper="EnumeratedAttributeHelper"/>
        <TRANSIENT  name="IsLogoDeleted"    type="Boolean"      defaultValue="Boolean.FALSE"/>
        <TRANSIENT  name="CompletedProfile" type="Boolean"      defaultValue="Boolean.FALSE"/>

        <TABLE  name="tl_company" tablePrefix="object">
            
            <ATTRIB name="CompanyName"      type="String"           dbcol="company_name"        mandatory="true"    length="100"    />
            <ATTRIB name="CompanyLogo"      type="BinaryContent"    dbcol="company_logo"        mandatory="false"   binaryHandler="loggedin"    attribHelper="BLOBAttributeHelper"  attribHelperInstance="BLOBAttributeHelper.INSTANCE" />
            <ATTRIB name="HiringTeamType"   type="HiringTeamType"   dbcol="hiring_team_type"    mandatory="false"   attribHelper="EnumeratedAttributeHelper"/>
            <ATTRIB name="Industry"         type="Industry"         dbcol="industry"            mandatory="false"   attribHelper="EnumeratedAttributeHelper"/>
            <ATTRIB name="TimeZone"         type="TimeZone"         dbcol="time_zone"           mandatory="false"   attribHelper="EnumeratedAttributeHelper"/>
            <ATTRIB name="IsVerified"       type="Boolean"          dbcol="is_verified"         defaultValue="Boolean.FALSE"/>
            <ATTRIB name="State"            type="State"            dbcol="state"               mandatory="false"   defaultValue="State.WA"     attribHelper="EnumeratedAttributeHelper"/>
            <ATTRIB name="Country"          type="Countries"        dbcol="country"             mandatory="false"   defaultValue="Countries.AU" attribHelper="EnumeratedAttributeHelper"/>
            <ATTRIB name="PostCode"         type="String"           dbcol="post_code"           mandatory="false"   length="10"/>
            <ATTRIB name="City"             type="String"           dbcol="city"                mandatory="false"   length="100"/>
            <ATTRIB name="HasClientSupport" type="Boolean"          dbcol="has_client_support"  mandatory="false"   defaultValue="Boolean.FALSE"/>
           
            <SINGLEREFERENCE    name="AddedByUser"  type="CompanyUser"  dbcol="added_by_user_id"    mandatory="true"/>
            
        </TABLE>
        
        <SEARCH type="All"  paramFilter="tl_company.object_id is not null"    >
        </SEARCH>
        
    </BUSINESSCLASS>
    
</ROOT>