<?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="crm" package="com.axelor.apps.crm.db"/>

  <entity name="Event" lang="java" extends="com.axelor.apps.base.db.ICalendarEvent">

<!-- Commun   -->
	<datetime name="limitDateT" title="Limit Date"/>
  	
  	<long name="duration" title="Duration"/>
  	
  	<many-to-one name="eventCategory" ref="com.axelor.apps.crm.db.EventCategory" title="Category"/>
  	
  	<string name="relatedToSelect" title="Related to" selection="crm.event.related.to.select"/>
    <long name="relatedToSelectId"/>
  	<integer name="statusSelect" title="Status" selection="crm.event.status.select"/>
    
  	<many-to-one name="team" ref="com.axelor.team.db.Team" title="Team"/>
	
	<string name="calendarEventUid" title="UID (Calendar)"/>
	
	<one-to-many name="eventReminderList" ref="com.axelor.apps.crm.db.EventReminder" mappedBy="event" title="Reminders"/>
	
	<many-to-one name="partner" ref="com.axelor.apps.base.db.Partner" title="Partner"/>
  	<many-to-one name="contactPartner" ref="com.axelor.apps.base.db.Partner" title="Contact"/>
	<many-to-one name="lead" ref="com.axelor.apps.crm.db.Lead" title="Lead"/>
	
<!-- Call -->
    <integer name="callTypeSelect" title="Call type" selection="crm.event.call.type.select"/>  

<!-- Task -->
  	<boolean name="isRecurrent" title="Recurrent"/>
  	<many-to-one name="parentEvent" ref="com.axelor.apps.crm.db.Event"/>
  	
    <integer name="prioritySelect" title="Priority"
        selection="crm.event.priority.select" default="2"/>

  	<many-to-one name="recurrenceConfiguration" ref="com.axelor.apps.crm.db.RecurrenceConfiguration"/>
	
  	<extra-code>
      	<![CDATA[
      		// TYPE SELECT
      		public static final int TYPE_EVENT = 0;
	  		public static final int TYPE_CALL = 1;
	  		public static final int TYPE_MEETING = 2;
	  		public static final int TYPE_TASK = 3;
	  		
	  		// STATUS SELECT
	  		public static final int STATUS_PLANNED = 1;
	  		public static final int STATUS_REALIZED = 2;
	  		public static final int STATUS_CANCELED = 3;
	  		public static final int STATUS_NOT_STARTED = 11;
	  		public static final int STATUS_ON_GOING = 12;
	  		public static final int STATUS_PENDING = 13;
	  		public static final int STATUS_FINISHED = 14;
	  		public static final int STATUS_REPORTED = 15;
	  ]]>
    </extra-code>

  </entity>
</domain-models>
