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

  <!-- Déclaration Préalable À l'Embauche -->
  <entity name="DPAE">
    <many-to-one name="employee" title="Employee" ref="com.axelor.apps.hr.db.Employee"/> <!-- mapping -->

    <!-- 1) Employer institution -->
    <string name="registrationCode" title="Registration code"/>
    <string name="mainActivityCode" title="Main activity code" min="5" max="5"/>
    <many-to-one name="company" title="Company" ref="com.axelor.apps.base.db.Company"/>
    <many-to-one name="companyAddress" title="Company address" ref="com.axelor.apps.base.db.Address"/>
    <string name="companyFixedPhone" title="Company fixed phone"/>
    <string name="healthService" title="Health service"/>
    <many-to-one name="healthServiceAddress" title="Health service address" ref="com.axelor.apps.base.db.Address"/>

    <!-- 2) Employee -->
    <string name="lastName" title="Last name"/>
    <string name="firstName" title="First name"/>
    <string name="socialSecurityNumber" title="Social security number" min="12" max="15"/>
    <string name="sexSelect" title="Sex" selection="employee.hr.sex.select"/>
    <date name="dateOfBirth" title="Date of birth"/>
    <many-to-one name="departmentOfBirth" title="Department of birth" ref="com.axelor.apps.base.db.Department"/>
    <many-to-one name="cityOfBirth" title="City of birth" ref="com.axelor.apps.base.db.City"/>
    <many-to-one name="countryOfBirth" title="Country of birth" ref="com.axelor.apps.base.db.Country"/>

    <!-- 3) Contract -->
    <date name="dateOfHire" title="Date of hire"/>
    <time name="timeOfHire" title="Time of hire"/>
    <string name="trialPeriodDuration" title="Trial period duration"/>
    <many-to-one name="contractType" title="Contract type" ref="com.axelor.apps.hr.db.EmploymentContractType"/>
    <date name="endDateOfContract" title="End date of hire"/>
  </entity>

</domain-models>
