<?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="HiringTeam"   package="performa.orm">
        
        <IMPORT value="performa.orm.types.*"/>
        <IMPORT value="performa.orm.types.TimeZone"/>
        <IMPORT value="oneit.business.shopping.orm.*"/>

        <MULTIPLEREFERENCE  name="Users"    type="CompanyUserHiringTeamLink"    backreferenceName="HiringTeam"  />
<!--        <MULTIPLEREFERENCE  name="Clients"  type="Client"       backreferenceName="HiringTeam"  />-->

        <TABLE  name="tl_hiring_team"   tablePrefix="object">
            
            <ATTRIB name="HiringTeamName"       type="String"           dbcol="hiring_team_name"    mandatory="true"    length="100"    />
            <ATTRIB name="HiringTeamLogo"       type="BinaryContent"    dbcol="hiring_team_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="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"/>
            <ATTRIB name="ManageOwnBilling"     type="Boolean"          dbcol="manage_own_billing"  mandatory="false"   defaultValue="Boolean.TRUE"/>
            <ATTRIB name="StripeReference"      type="String"           dbcol="stripe_reference"    length="100"        />
            <ATTRIB name="StripeSubscription"   type="String"           dbcol="stripe_subscription" length="100"        />
            <ATTRIB name="NameOnCard"           type="String"           dbcol="name_on_card"        length="100"        />
            <ATTRIB name="CardPostCode"         type="String"           dbcol="card_post_code"      length="10"         />
            <ATTRIB name="CardID"               type="String"           dbcol="card_id"             length="100"        />
            <ATTRIB name="PlanRenewedOn"        type="Date"             dbcol="plan_renewed_on"     mandatory="false"   />
            <ATTRIB name="UsedCredits"          type="Integer"          dbcol="used_credits"        />

            <SINGLEREFERENCE    name="Company"      type="Company"      dbcol="company_id"          mandatory="true"    backreferenceName="HiringTeams" />
            <SINGLEREFERENCE    name="BillingTeam"  type="HiringTeam"   dbcol="billing_team_id"     mandatory="false"   />
            <SINGLEREFERENCE    name="AddedByUser"  type="CompanyUser"  dbcol="added_by_user_id"    mandatory="true"    />
            <SINGLEREFERENCE    name="PaymentPlan"  type="PaymentPlan"  dbcol="payment_plan_id"     mandatory="false"   />
            
        </TABLE>
        
        <SEARCH type="All"  paramFilter="tl_hiring_team.object_id is not null"    >
        </SEARCH>
        
    </BUSINESSCLASS>
    
</ROOT>