<?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"      />
        <MULTIPLEREFERENCE  name="BillingTeams" type="HiringTeam"                   backreferenceName="BilledByTeam"    />

        <TRANSIENT  name="IsLogoDeleted"    type="Boolean"      defaultValue="Boolean.FALSE"/>
        <TRANSIENT  name="CouponCode"       type="String"       length="20"/>
        <TRANSIENT  name="StripeBrand"      type="String"   />
        <TRANSIENT  name="StripeLast4"      type="String"   />

        <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="StripeFixedSubItem"   type="String"           dbcol="stripe_fixed_sub_item"   length="100"        />
            <ATTRIB name="StripeMeteredSubItem" type="String"           dbcol="stripe_metered_sub_item" 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"            />
            <ATTRIB name="AvailableCredits"     type="Integer"          dbcol="available_credits"       />
            <ATTRIB name="IsPPJ"                type="Boolean"          dbcol="is_ppj"                  defaultValue="Boolean.TRUE"/>
            <ATTRIB name="HasCap"               type="Boolean"          dbcol="has_cap"                 defaultValue="Boolean.FALSE"/>
            <ATTRIB name="MaxCap"               type="Integer"          dbcol="max_cap"                 />
            <ATTRIB name="CouponExpiryDate"     type="Date"             dbcol="coupon_expiry_date"      />
            <ATTRIB name="LastPlanAmount"       type="Double"           dbcol="last_plan_amount"        />

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