<?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="ActionEvent" 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)"/>
	
<!-- Call -->
    <integer name="callTypeSelect" title="Call type" selection="crm.event.call.type.select"/>  
	<many-to-many name="guestList" ref="com.axelor.auth.db.User" title="Guest"/>

<!-- 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"/>
	<!-- roq flags -->
  	<integer name="flag" title="Flag" selection="crm.event.flag.select"/>


		<string name="uid" column="calendar_uid" unique="true" hashKey="false" title="UID"/>
	  <string name="url" title="URL"/>
	  <string name="subject" required="true" namecolumn="true" title="Subject"/>
	  <string name="description" title="Description" large="true"/>
	  <string name="status" title="Status"/>
	  <datetime name="startDateTime" required="true" title="Start date"/>
	  <datetime name="endDateTime" required="true" title="End date"/>
	  <boolean name="allDay" title="All day"/>
	  <string name="location" title="Location"/>
	  <string name="geo" title="Geo. coordinates"/>
	  
	  <many-to-one name="organizer" ref="com.axelor.apps.base.db.ICalendarUser" title="Organizer"/>
	  <one-to-many name="attendees" ref="com.axelor.apps.base.db.ICalendarUser" title="Attendees" mappedBy="event" orphanRemoval="false"/>
	
	  <integer name="visibilitySelect" title="Visibility" selection="i.cal.event.visibility.select" default="1"/>
	  <integer name="disponibilitySelect" title="Availability" selection="i.cal.event.disponibility.select" default="1"/>
	  <string name="subjectTeam"/>
	  <integer name="typeSelect" title="Type" selection="icalendar.event.type.select" required="true" />
	  <many-to-one name="user" column="user_id" ref="com.axelor.auth.db.User" title="Assigned to"/>
	  <finder-method name="findByUid" using="uid" />
  </entity>
</domain-models>
