<?xml version="1.0" encoding="UTF-8"?>
<entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.1.0">
  <name>Contract_entity</name>
  <title>Contract</title>
  <majorModelMode>DISTRIBUTED</majorModelMode>
  <documentation>%aditoprj%/entity/Contract_entity/documentation.adoc</documentation>
  <iconId>VAADIN:FORM</iconId>
  <recordContainer>db</recordContainer>
  <entityFields>
    <entityField>
      <name>CONTRACTCODE</name>
      <documentation>%aditoprj%/entity/Contract_entity/entityfields/contractcode/documentation.adoc</documentation>
      <title>Contract number</title>
      <mandatory v="true" />
      <onValidation>%aditoprj%/entity/Contract_entity/entityfields/contractcode/onValidation.js</onValidation>
    </entityField>
    <entityField>
      <name>CONTRACTDUE</name>
      <documentation>%aditoprj%/entity/Contract_entity/entityfields/contractdue/documentation.adoc</documentation>
      <title>Next due date</title>
      <contentType>DATE</contentType>
      <resolution>DAY</resolution>
      <onValidation>%aditoprj%/entity/Contract_entity/entityfields/contractdue/onValidation.js</onValidation>
    </entityField>
    <entityField>
      <name>CONTRACTEND</name>
      <documentation>%aditoprj%/entity/Contract_entity/entityfields/contractend/documentation.adoc</documentation>
      <title>Contract expiry date</title>
      <contentType>DATE</contentType>
      <resolution>DAY</resolution>
      <onValidation>%aditoprj%/entity/Contract_entity/entityfields/contractend/onValidation.js</onValidation>
      <onValueChange>%aditoprj%/entity/Contract_entity/entityfields/contractend/onValueChange.js</onValueChange>
    </entityField>
    <entityField>
      <name>CONTRACTID</name>
      <searchable v="false" />
      <valueProcess>%aditoprj%/entity/Contract_entity/entityfields/contractid/valueProcess.js</valueProcess>
    </entityField>
    <entityField>
      <name>CONTRACTSTART</name>
      <documentation>%aditoprj%/entity/Contract_entity/entityfields/contractstart/documentation.adoc</documentation>
      <title>Contract start date</title>
      <contentType>DATE</contentType>
      <resolution>DAY</resolution>
      <onValidation>%aditoprj%/entity/Contract_entity/entityfields/contractstart/onValidation.js</onValidation>
      <onValueChange>%aditoprj%/entity/Contract_entity/entityfields/contractstart/onValueChange.js</onValueChange>
    </entityField>
    <entityField>
      <name>CONTRACTSTATUS</name>
      <title>${CONTRACT_STATUS}</title>
      <possibleItemsProcess>%aditoprj%/entity/Contract_entity/entityfields/contractstatus/possibleItemsProcess.js</possibleItemsProcess>
    </entityField>
    <entityField>
      <name>CONTRACTTYPE</name>
      <title>Type of contract</title>
      <possibleItemsProcess>%aditoprj%/entity/Contract_entity/entityfields/contracttype/possibleItemsProcess.js</possibleItemsProcess>
    </entityField>
    <entityField>
      <name>DATE_EDIT</name>
      <contentType>DATE</contentType>
      <outputFormat>yyyy-MM-dd&amp;apos;T&amp;apos;HH:mm:ssZ</outputFormat>
      <searchable v="false" />
      <valueProcess>%aditoprj%/entity/Contract_entity/entityfields/date_edit/valueProcess.js</valueProcess>
    </entityField>
    <entityField>
      <name>DATE_NEW</name>
      <contentType>DATE</contentType>
      <outputFormat>yyyy-MM-dd&amp;apos;T&amp;apos;HH:mm:ssZ</outputFormat>
      <searchable v="false" />
      <valueProcess>%aditoprj%/entity/Contract_entity/entityfields/date_new/valueProcess.js</valueProcess>
    </entityField>
    <entityField>
      <name>PAYMENT</name>
      <title>Payment method</title>
      <mandatory v="true" />
      <possibleItemsProcess>%aditoprj%/entity/Contract_entity/entityfields/payment/possibleItemsProcess.js</possibleItemsProcess>
    </entityField>
    <entityField>
      <name>RELATION_ID</name>
      <documentation>%aditoprj%/entity/Contract_entity/entityfields/relation_id/documentation.adoc</documentation>
      <title>Connection</title>
      <linkedContextProcess>%aditoprj%/entity/Contract_entity/entityfields/relation_id/linkedContextProcess.js</linkedContextProcess>
      <mandatory v="true" />
      <outgoingField>ContractRelation_dfo</outgoingField>
      <valueProcess>%aditoprj%/entity/Contract_entity/entityfields/relation_id/valueProcess.js</valueProcess>
    </entityField>
    <entityField>
      <name>REMARK</name>
      <title>Description</title>
      <contentType>LONG_TEXT</contentType>
    </entityField>
    <entityField>
      <name>USER_EDIT</name>
      <searchable v="false" />
      <valueProcess>%aditoprj%/entity/Contract_entity/entityfields/user_edit/valueProcess.js</valueProcess>
    </entityField>
    <entityField>
      <name>USER_NEW</name>
      <searchable v="false" />
      <valueProcess>%aditoprj%/entity/Contract_entity/entityfields/user_new/valueProcess.js</valueProcess>
    </entityField>
    <entityIncomingField>
      <name>PersContract_dfi</name>
      <fieldType>DEPENDENCY_IN</fieldType>
      <recordContainer>db</recordContainer>
      <dependencies>
        <entityDependency>
          <name>2146b082-6377-4b34-be6b-3dad18885614</name>
          <entityName>Pers_entity</entityName>
          <fieldName>PersContract_dfo</fieldName>
          <isOutgoing v="false" />
        </entityDependency>
      </dependencies>
    </entityIncomingField>
    <entityIncomingField>
      <name>OrgContract_dfi</name>
      <fieldType>DEPENDENCY_IN</fieldType>
      <recordContainer>db</recordContainer>
      <dependencies>
        <entityDependency>
          <name>6d7c7166-84b4-4da2-9a48-cc1e390ac987</name>
          <entityName>Org_entity</entityName>
          <fieldName>OrgContract_dfo</fieldName>
          <isOutgoing v="false" />
        </entityDependency>
      </dependencies>
    </entityIncomingField>
    <entityParameter>
      <name>RelId_param</name>
      <expose v="true" />
      <description>PARAMETER</description>
    </entityParameter>
    <entityField>
      <name>IMAGE</name>
      <contentType>IMAGE</contentType>
      <valueProcess>%aditoprj%/entity/Contract_entity/entityfields/image/valueProcess.js</valueProcess>
    </entityField>
    <entityFieldGroup>
      <name>CONTRACTCODE_DISPLAY_fieldGroup</name>
      <valueProcess>%aditoprj%/entity/Contract_entity/entityfields/contractcode_display_fieldgroup/valueProcess.js</valueProcess>
      <documentation>%aditoprj%/entity/Contract_entity/entityfields/contractcode_display_fieldgroup/documentation.adoc</documentation>
      <description>FIELDGROUP</description>
      <fields>
        <element>CONTRACTTYPE</element>
        <element>CONTRACTCODE</element>
      </fields>
    </entityFieldGroup>
    <entityOutgoingField>
      <name>ContractHistory_dfo</name>
      <title>Histories</title>
      <fieldType>DEPENDENCY_OUT</fieldType>
      <dependency>
        <name>dependency</name>
        <entityName>History_entity</entityName>
        <fieldName>ContractHistory_dfi</fieldName>
      </dependency>
      <children>
        <entityParameter>
          <name>RowId_param</name>
          <code>%aditoprj%/entity/Contract_entity/entityfields/contracthistory_dfo/children/rowid_param/code.js</code>
        </entityParameter>
      </children>
    </entityOutgoingField>
    <entityOutgoingField>
      <name>ContractRelation_dfo</name>
      <fieldType>DEPENDENCY_OUT</fieldType>
      <dependency>
        <name>dependency</name>
        <entityName>Relation_entity</entityName>
        <fieldName>ContractRelation_dfi</fieldName>
      </dependency>
    </entityOutgoingField>
    <entityIncomingField>
      <name>#INCOMING</name>
    </entityIncomingField>
    <entityField>
      <name>RELATION_ORG_ID</name>
    </entityField>
    <entityField>
      <name>RELATION_PERS_ID</name>
    </entityField>
  </entityFields>
  <recordContainers>
    <dbRecordContainer>
      <name>db</name>
      <alias>Data_alias</alias>
      <maximumDbRows v="0" />
      <fromClauseProcess>%aditoprj%/entity/Contract_entity/recordcontainers/db/fromClauseProcess.js</fromClauseProcess>
      <conditionProcess>%aditoprj%/entity/Contract_entity/recordcontainers/db/conditionProcess.js</conditionProcess>
      <linkInformation>
        <linkInformation>
          <name>99139e0f-3074-4c07-8998-bd83676e5a58</name>
          <tableName>CONTRACT</tableName>
          <primaryKey>CONTRACTID</primaryKey>
          <isUIDTable v="true" />
          <readonly v="false" />
        </linkInformation>
        <linkInformation>
          <name>2c5a2300-594b-46ee-8234-eaafb49a9a1e</name>
          <tableName>RELATION</tableName>
          <primaryKey>RELATIONID</primaryKey>
          <isUIDTable v="false" />
          <readonly v="true" />
        </linkInformation>
      </linkInformation>
      <recordFieldMappings>
        <dbRecordFieldMapping>
          <name>CONTRACTCODE.value</name>
          <recordfield>CONTRACT.CONTRACTCODE</recordfield>
        </dbRecordFieldMapping>
        <dbRecordFieldMapping>
          <name>CONTRACTDUE.value</name>
          <recordfield>CONTRACT.CONTRACTDUE</recordfield>
        </dbRecordFieldMapping>
        <dbRecordFieldMapping>
          <name>CONTRACTEND.value</name>
          <recordfield>CONTRACT.CONTRACTEND</recordfield>
        </dbRecordFieldMapping>
        <dbRecordFieldMapping>
          <name>CONTRACTID.value</name>
          <recordfield>CONTRACT.CONTRACTID</recordfield>
        </dbRecordFieldMapping>
        <dbRecordFieldMapping>
          <name>CONTRACTSTART.value</name>
          <recordfield>CONTRACT.CONTRACTSTART</recordfield>
        </dbRecordFieldMapping>
        <dbRecordFieldMapping>
          <name>CONTRACTSTATUS.value</name>
          <recordfield>CONTRACT.CONTRACTSTATUS</recordfield>
        </dbRecordFieldMapping>
        <dbRecordFieldMapping>
          <name>CONTRACTTYPE.value</name>
          <recordfield>CONTRACT.CONTRACTTYPE</recordfield>
        </dbRecordFieldMapping>
        <dbRecordFieldMapping>
          <name>DATE_EDIT.value</name>
          <recordfield>CONTRACT.DATE_EDIT</recordfield>
        </dbRecordFieldMapping>
        <dbRecordFieldMapping>
          <name>DATE_NEW.value</name>
          <recordfield>CONTRACT.DATE_NEW</recordfield>
        </dbRecordFieldMapping>
        <dbRecordFieldMapping>
          <name>PAYMENT.value</name>
          <recordfield>CONTRACT.PAYMENT</recordfield>
        </dbRecordFieldMapping>
        <dbRecordFieldMapping>
          <name>REMARK.value</name>
          <recordfield>CONTRACT.REMARK</recordfield>
        </dbRecordFieldMapping>
        <dbRecordFieldMapping>
          <name>USER_EDIT.value</name>
          <recordfield>CONTRACT.USER_EDIT</recordfield>
        </dbRecordFieldMapping>
        <dbRecordFieldMapping>
          <name>USER_NEW.value</name>
          <recordfield>CONTRACT.USER_NEW</recordfield>
        </dbRecordFieldMapping>
        <dbRecordFieldMapping>
          <name>RELATION_ID.displayValue</name>
          <recordfield>RELATION.RELATIONID</recordfield>
        </dbRecordFieldMapping>
        <dbRecordFieldMapping>
          <name>RELATION_ID.value</name>
          <recordfield>CONTRACT.RELATION_ID</recordfield>
        </dbRecordFieldMapping>
        <dbRecordFieldMapping>
          <name>RELATION_ORG_ID.value</name>
          <recordfield>RELATION.ORG_ID</recordfield>
        </dbRecordFieldMapping>
        <dbRecordFieldMapping>
          <name>RELATION_PERS_ID.value</name>
          <recordfield>RELATION.PERS_ID</recordfield>
        </dbRecordFieldMapping>
      </recordFieldMappings>
    </dbRecordContainer>
  </recordContainers>
</entity>