<?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="AssessmentCriteriaTemplate"   package="performa.orm">
        
        <IMPORT value="performa.orm.types.*"/>    
        <IMPORT value="oneit.security.*"/>
                        
        <TRANSIENT  name="SuggestedAssessmentType"  type="AssessmentType"       attribHelper="EnumeratedAttributeHelper"/>

        <MULTIPLEREFERENCE  name="AssessmentCriterias"  type="AssessmentCriteria"   backreferenceName="Template" />
        <MULTIPLEREFERENCE  name="WorkFlows"            type="WorkFlow"             backreferenceName="Template" />
        
        <TABLE  name="tl_assessment_template"   tablePrefix="object"    polymorphic="FALSE">
            
            <ATTRIB name="TemplateName"                 type="String"           dbcol="template_name"       length="100"    uniqueGroup="TemplateID"/>
            <ATTRIB name="JobTitle"                     type="String"           dbcol="job_title"           length="60"     mandatory="true"/>
            <ATTRIB name="JobDescription"               type="String"           dbcol="job_description"     mandatory="true"/>
            <ATTRIB name="ReferenceNumber"              type="String"           dbcol="ref_number"          length="10"/>
            <ATTRIB name="GoogleAddressText"            type="String"           dbcol="google_address_text" mandatory="true"    length="300"  />
            <ATTRIB name="ExpectedCandidateRadius"      type="LocationRadius"   dbcol="location_radius"     defaultValue="LocationRadius.KM100" attribHelper="EnumeratedAttributeHelper"    mandatory="true"/>
            <ATTRIB name="Remote"                       type="Boolean"          dbcol="remote"              defaultValue="Boolean.FALSE"/>
            <ATTRIB name="JobType"                      type="JobType"          dbcol="job_type"            attribHelper="EnumeratedAttributeHelper"    mandatory="true"    defaultValue="JobType.FULL_TIME"/>
            <ATTRIB name="Industry"                     type="Industry"         dbcol="industry"            mandatory="true"    attribHelper="EnumeratedAttributeHelper"/>
            <ATTRIB name="RequireCV"                    type="Boolean"          dbcol="require_cv"          defaultValue="Boolean.FALSE"/>
            <ATTRIB name="AssessmentType"               type="AssessmentType"   dbcol="assessment_type"     attribHelper="EnumeratedAttributeHelper"    mandatory="true"    defaultValue="AssessmentType.COMPREHENSIVE"/>
            <ATTRIB name="IncludeAssessmentCriteria"    type="Boolean"          dbcol="include_assessment_criteria" mandatory="true"    defaultValue="Boolean.TRUE"/>

            <SINGLEREFERENCE    name="Level"        type="Level"        dbcol="level_id"            mandatory="false"/>
            <SINGLEREFERENCE    name="Occupation"   type="Occupation"   dbcol="occupation_id"       mandatory="true"/>
            <SINGLEREFERENCE    name="JobOwner"     type="CompanyUser"  dbcol="job_owner_id"        />
            <SINGLEREFERENCE    name="Job"          type="Job"          dbcol="job_id"              />
            <SINGLEREFERENCE    name="Client"       type="Client"       dbcol="client_id"           />
            <SINGLEREFERENCE    name="HiringTeam"   type="HiringTeam"   dbcol="hiring_team_id"      uniqueGroup="TemplateID"/>
            <SINGLEREFERENCE    name="CompanyUser"  type="CompanyUser"  dbcol="company_user_id"     uniqueGroup="TemplateID"/>
            <SINGLEREFERENCE    name="ILOJobTitle"  type="ILOJobTitle"  dbcol="job_title_id"        mandatory="true"/>

        </TABLE>
        
        <SEARCH type="All"  paramFilter="tl_assessment_template.object_id is not null"  orderBy="tl_assessment_template.object_id"   />
        
    </BUSINESSCLASS>
    
</ROOT>