<?xml version="1.0" encoding="UTF-8"?>
<domain-models xmlns="http://axelor.com/xml/ns/domain-models" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://axelor.com/xml/ns/domain-models http://axelor.com/xml/ns/domain-models/domain-models_5.2.xsd">

	<module name="talent" package="com.axelor.apps.talent.db"/>

	<entity name="Appraisal" lang="java" cacheable="true">
		<many-to-one name="employee" ref="com.axelor.apps.hr.db.Employee" title="Employee"  />
		<many-to-one name="company" ref="com.axelor.apps.base.db.Company" title="Company" />
		<many-to-one name="appraisalType" ref="AppraisalType" title="Type of appraisal" required="true"/>
		<date name="toDate" title="Deadline" />
		<many-to-one name="reviewerEmployee" ref="com.axelor.apps.hr.db.Employee" title="Reviewer" />
		<string name="description" title="Description" large="true" />
		<integer name="statusSelect" title="Status" selection="appraisal.status.selected" readonly="true"/>
		<boolean name="isTemplate" title="Is template" />
		
		<extra-code><![CDATA[
	
	   	// TYPE SELECT
		public static final int STATUS_DRAFT = 0;
		public static final int STATUS_SENT = 1;
		public static final int STATUS_COMPLETED = 2;
		public static final int STATUS_CANCELED = 3;
	
		]]></extra-code>
		
		<track>
			<field name="employee"/>
			<field name="company"/>
			<field name="appraisalType"/>
			<field name="toDate"/>
			<field name="reviewerEmployee"/>
			<field name="attrs"/>
			<field name="description"/>
			<field name="statusSelect" on="UPDATE"/>
			<field name="isTemplate"/>
			<message if="statusSelect == 1" on="UPDATE">Appraisal sent</message>
			<message if="statusSelect == 2" on="UPDATE">Appraisal realized</message>
			<message if="statusSelect == 3" on="UPDATE">Appraisal cancelled</message>
			<message if="statusSelect == 0" on="UPDATE">Appraisal draft</message>
		</track>
		
		
	</entity>
	
</domain-models>
