<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->

<entitymodel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/entitymodel.xsd">
  <!-- ========================================================= -->
  <!-- ======================== Defaults ======================= -->
  <!-- ========================================================= -->
    <title>Entity of an Apache OFBiz Component</title>
    <description>None</description>
    <version>1.0</version>

  <!-- ========================================================= -->
  <!-- ======================== Data Model ===================== -->
  <!-- The modules in this file are as follows:                  -->
  <!--  - org.apache.ofbiz.workeffort.timesheet -->
  <!--  - org.apache.ofbiz.workeffort.workeffort -->
  <!-- ========================================================= -->


  <!-- ========================================================= -->
  <!-- org.apache.ofbiz.workeffort.timesheet -->
  <!-- ========================================================= -->

    <entity entity-name="TimeEntry"
            package-name="org.apache.ofbiz.workeffort.timesheet"
            title="Time Entry">
      <field name="timeEntryId" type="id"></field>
      <field name="partyId" type="id"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <field name="rateTypeId" type="id"></field>
      <field name="workEffortId" type="id"></field>
      <field name="timesheetId" type="id"></field>
      <field name="invoiceId" type="id"></field>
      <field name="invoiceItemSeqId" type="id"></field>
      <field name="hours" type="floating-point"></field>
      <field name="comments" type="comment"></field>
      <prim-key field="timeEntryId"/>
      <relation type="one" fk-name="TIME_ENT_PRTY" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
      <relation type="one" fk-name="TIME_ENT_RTTP" rel-entity-name="RateType">
        <key-map field-name="rateTypeId"/>
      </relation>
      <relation type="one" fk-name="TIME_ENT_WEFF" rel-entity-name="WorkEffort">
        <key-map field-name="workEffortId"/>
      </relation>
      <relation type="one" fk-name="TIME_ENT_TSHT" rel-entity-name="Timesheet">
        <key-map field-name="timesheetId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="Invoice">
        <key-map field-name="invoiceId"/>
      </relation>
      <relation type="one" fk-name="TIME_ENT_INVIT" rel-entity-name="InvoiceItem">
        <key-map field-name="invoiceId"/>
        <key-map field-name="invoiceItemSeqId"/>
      </relation>
    </entity>
    <entity entity-name="Timesheet"
            package-name="org.apache.ofbiz.workeffort.timesheet"
            title="Timesheet">
      <field name="timesheetId" type="id"></field>
      <field name="partyId" type="id"></field>
      <field name="clientPartyId" type="id"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <field name="statusId" type="id"></field>
      <field name="approvedByUserLoginId" type="id-vlong"></field>
      <field name="comments" type="comment"></field>
      <prim-key field="timesheetId"/>
      <relation type="one" fk-name="TIMESHEET_PRTY" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
      <relation type="one" fk-name="TIMESHEET_CPTY" title="Client" rel-entity-name="Party">
        <key-map field-name="clientPartyId" rel-field-name="partyId"/>
      </relation>
      <relation type="one" fk-name="TIMESHEET_STS" rel-entity-name="StatusItem">
        <key-map field-name="statusId"/>
      </relation>
        <relation type="one" fk-name="TIMESHEET_AB_UL" title="ApprovedBy" rel-entity-name="UserLogin">
            <key-map field-name="approvedByUserLoginId" rel-field-name="userLoginId"/>
        </relation>
    </entity>
    <entity entity-name="TimesheetRole"
            package-name="org.apache.ofbiz.workeffort.timesheet"
            title="Timesheet Role">
      <field name="timesheetId" type="id"></field>
      <field name="partyId" type="id"></field>
      <field name="roleTypeId" type="id"></field>
      <prim-key field="timesheetId"/>
      <prim-key field="partyId"/>
      <prim-key field="roleTypeId"/>
      <relation type="one" fk-name="TIMESHTRL_TSHT" rel-entity-name="Timesheet">
        <key-map field-name="timesheetId"/>
      </relation>
      <relation type="one" fk-name="TIMESHTRL_PRTY" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="RoleType">
        <key-map field-name="roleTypeId"/>
      </relation>
      <relation type="one" fk-name="TIMESHTRL_PTRL" rel-entity-name="PartyRole">
        <key-map field-name="partyId"/>
        <key-map field-name="roleTypeId"/>
      </relation>
    </entity>

  <!-- ========================================================= -->
  <!-- org.apache.ofbiz.workeffort.workeffort -->
  <!-- ========================================================= -->

    <entity entity-name="ApplicationSandbox"
            package-name="org.apache.ofbiz.workeffort.workeffort"
            title="WorkEffort Application Sandbox">
      <field name="applicationId" type="id"></field>
      <field name="workEffortId" type="id"></field>
      <field name="partyId" type="id"></field>
      <field name="roleTypeId" type="id"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="runtimeDataId" type="id"></field>
      <prim-key field="applicationId"/>
      <relation type="one" fk-name="APP_SNDBX_WEPA" rel-entity-name="WorkEffortPartyAssignment">
        <key-map field-name="workEffortId"/>
        <key-map field-name="partyId"/>
        <key-map field-name="roleTypeId"/>
        <key-map field-name="fromDate"/>
      </relation>
      <relation type="one" fk-name="APP_SNDBX_RNTMDTA" rel-entity-name="RuntimeData">
        <key-map field-name="runtimeDataId"/>
      </relation>
    </entity>
    <entity entity-name="CommunicationEventWorkEff"
            package-name="org.apache.ofbiz.workeffort.workeffort"
            title="Communication Event Work Effort">
      <field name="workEffortId" type="id"></field>
      <field name="communicationEventId" type="id"></field>
      <field name="description" type="description"></field>
      <prim-key field="workEffortId"/>
      <prim-key field="communicationEventId"/>
      <relation type="one" fk-name="COMEV_WEFF_WEFF" rel-entity-name="WorkEffort">
        <key-map field-name="workEffortId"/>
      </relation>
      <relation type="one" fk-name="COMEV_WEFF_CMEV" rel-entity-name="CommunicationEvent">
        <key-map field-name="communicationEventId"/>
      </relation>
    </entity>
    <entity entity-name="Deliverable"
            package-name="org.apache.ofbiz.workeffort.workeffort"
            title="Deliverable">
      <field name="deliverableId" type="id"></field>
      <field name="deliverableTypeId" type="id"></field>
      <field name="deliverableName" type="name"></field>
      <field name="description" type="description"></field>
      <prim-key field="deliverableId"/>
      <relation type="one" fk-name="DELIVERABLE_DLTYP" rel-entity-name="DeliverableType">
        <key-map field-name="deliverableTypeId"/>
      </relation>
    </entity>
    <entity entity-name="DeliverableType"
            package-name="org.apache.ofbiz.workeffort.workeffort"
            title="Deliverable Type">
      <field name="deliverableTypeId" type="id"></field>
      <field name="description" type="description"></field>
      <prim-key field="deliverableTypeId"/>
    </entity>
    <entity entity-name="WorkEffort"
            package-name="org.apache.ofbiz.workeffort.workeffort"
            title="Work Effort">
      <field name="workEffortId" type="id"></field>
      <field name="workEffortTypeId" type="id"></field>
      <field name="currentStatusId" type="id"></field>
      <field name="lastStatusUpdate" type="date-time"></field>
      <field name="workEffortPurposeTypeId" type="id"></field>
      <field name="workEffortParentId" type="id"><description>The primary parent (or the like); it should be one of the parent WorkEfforts already setup in WorkEffortAssoc</description></field>
      <field name="scopeEnumId" type="id"></field>
      <field name="priority" type="numeric"></field>
      <field name="percentComplete" type="numeric"></field>
      <field name="workEffortName" type="name"></field>
      <field name="showAsEnumId" type="id"></field>
      <field name="sendNotificationEmail" type="indicator"></field>
      <field name="description" type="description"></field>
      <field name="locationDesc" type="description"></field>
      <field name="estimatedStartDate" type="date-time"></field>
      <field name="estimatedCompletionDate" type="date-time"></field>
      <field name="actualStartDate" type="date-time"></field>
      <field name="actualCompletionDate" type="date-time"></field>
      <field name="estimatedMilliSeconds" type="floating-point"></field>
      <field name="estimatedSetupMillis" type="floating-point"></field>
      <field name="estimateCalcMethod" type="id"></field>
      <field name="actualMilliSeconds" type="floating-point"></field>
      <field name="actualSetupMillis" type="floating-point"></field>
      <field name="totalMilliSecondsAllowed" type="floating-point"></field>
      <field name="totalMoneyAllowed" type="currency-amount"></field>
      <field name="moneyUomId" type="id"></field>
      <field name="specialTerms" type="long-varchar"></field>
      <field name="timeTransparency" type="numeric"><description>Deprecated - use the availabilityStatusId field in the assignment entities instead</description></field>
      <field name="universalId" type="short-varchar"></field>
      <field name="sourceReferenceId" type="id-long"></field>
      <field name="fixedAssetId" type="id"><description>Deprecated - use the WorkEffortFixedAssetAssign entity instead</description></field>
      <field name="facilityId" type="id"></field>
      <field name="infoUrl" type="long-varchar"></field>
      <field name="recurrenceInfoId" type="id"><description>Deprecated - use the tempExprId field instead</description></field>
      <field name="tempExprId" type="id"></field>
      <field name="runtimeDataId" type="id"></field>
      <field name="noteId" type="id"></field>
      <field name="serviceLoaderName" type="name"></field>
      <field name="quantityToProduce" type="fixed-point"></field>
      <field name="quantityProduced" type="fixed-point"></field>
      <field name="quantityRejected" type="fixed-point"></field>
      <field name="reservPersons" type="fixed-point"><description>the number of persons renting the attached asset</description></field>
      <field name="reserv2ndPPPerc" type="fixed-point"><description>reservationSecondPersonPricePercentage: percentage of the end price for the 2nd person renting this asset connected to the workEffort</description></field>
      <field name="reservNthPPPerc" type="fixed-point"><description>reservationNthPersonPricePercentage: percentage of the end price for the Nth (2+) person renting this asset connected to the workEffort</description></field>
      <field name="accommodationMapId" type="id"/>
      <field name="accommodationSpotId" type="id"/>
      <field name="revisionNumber" type="numeric"></field>
      <field name="createdDate" type="date-time"></field>
      <field name="createdByUserLogin" type="id-vlong"></field>
      <field name="lastModifiedDate" type="date-time"></field>
      <field name="lastModifiedByUserLogin" type="id-vlong"></field>
      <prim-key field="workEffortId"/>
      <relation type="one" fk-name="WK_EFFRT_TYPE" rel-entity-name="WorkEffortType">
        <key-map field-name="workEffortTypeId"/>
      </relation>
      <relation type="one" fk-name="WK_EFFRT_PRPTYP" rel-entity-name="WorkEffortPurposeType">
        <key-map field-name="workEffortPurposeTypeId"/>
      </relation>
      <relation type="one" fk-name="WK_EFFRT_PARENT" title="Parent" rel-entity-name="WorkEffort">
        <key-map field-name="workEffortParentId" rel-field-name="workEffortId"/>
      </relation>
      <relation type="many" rel-entity-name="WorkEffortTypeAttr">
        <key-map field-name="workEffortTypeId"/>
      </relation>
      <relation type="one" fk-name="WK_EFFRT_CURSTTS" title="Current" rel-entity-name="StatusItem">
        <key-map field-name="currentStatusId" rel-field-name="statusId"/>
      </relation>
      <relation type="one" fk-name="WK_EFFRT_SC_ENUM" title="Scope" rel-entity-name="Enumeration">
        <key-map field-name="scopeEnumId" rel-field-name="enumId"/>
      </relation>
      <relation type="one" fk-name="WK_EFFRT_FXDASST" rel-entity-name="FixedAsset">
        <key-map field-name="fixedAssetId"/>
      </relation>
      <relation type="one" fk-name="WK_EFFRT_FACILITY" rel-entity-name="Facility">
        <key-map field-name="facilityId"/>
      </relation>
      <relation type="one" fk-name="WK_EFFRT_MON_UOM" title="Money" rel-entity-name="Uom">
        <key-map field-name="moneyUomId" rel-field-name="uomId"/>
      </relation>
      <relation type="one" fk-name="WK_EFFRT_RECINFO" rel-entity-name="RecurrenceInfo">
        <key-map field-name="recurrenceInfoId"/>
      </relation>
      <relation type="one" fk-name="WK_EFFRT_TEMPEXPR" rel-entity-name="TemporalExpression">
        <key-map field-name="tempExprId"/>
      </relation>
      <relation type="one" fk-name="WK_EFFRT_RNTMDTA" rel-entity-name="RuntimeData">
        <key-map field-name="runtimeDataId"/>
      </relation>
      <relation type="one" fk-name="WK_EFFRT_NOTE" rel-entity-name="NoteData">
        <key-map field-name="noteId"/>
      </relation>
      <relation type="one" fk-name="WK_EFFRT_CUS_MET" rel-entity-name="CustomMethod">
        <key-map field-name="estimateCalcMethod" rel-field-name="customMethodId"/>
      </relation>
      <relation type="one" fk-name="WK_EFFRT_ACC_MAP" rel-entity-name="AccommodationMap">
        <key-map field-name="accommodationMapId"/>
      </relation>
      <relation type="one" fk-name="WK_EFFRT_ACC_SPOT" rel-entity-name="AccommodationSpot">
        <key-map field-name="accommodationSpotId"/>
      </relation>
    </entity>
    <entity entity-name="WorkEffortAssoc"
            package-name="org.apache.ofbiz.workeffort.workeffort"
            title="Work Effort Association">
      <field name="workEffortIdFrom" type="id"></field>
      <field name="workEffortIdTo" type="id"></field>
      <field name="workEffortAssocTypeId" type="id"></field>
      <field name="sequenceNum" type="numeric"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <prim-key field="workEffortIdFrom"/>
      <prim-key field="workEffortIdTo"/>
      <prim-key field="workEffortAssocTypeId"/>
      <prim-key field="fromDate"/>
      <relation type="one" fk-name="WK_EFFRTASSC_TYP" rel-entity-name="WorkEffortAssocType">
        <key-map field-name="workEffortAssocTypeId"/>
      </relation>
      <relation type="many" rel-entity-name="WorkEffortAssocTypeAttr">
        <key-map field-name="workEffortAssocTypeId"/>
      </relation>
      <relation type="one" fk-name="WK_EFFRTASSC_FWE" title="From" rel-entity-name="WorkEffort">
        <key-map field-name="workEffortIdFrom" rel-field-name="workEffortId"/>
      </relation>
      <relation type="one" fk-name="WK_EFFRTASSC_TWE" title="To" rel-entity-name="WorkEffort">
        <key-map field-name="workEffortIdTo" rel-field-name="workEffortId"/>
      </relation>
    </entity>
    <entity entity-name="WorkEffortAssocAttribute"
            package-name="org.apache.ofbiz.workeffort.workeffort"
            title="Work Effort Association Attribute">
      <field name="workEffortIdFrom" type="id"></field>
      <field name="workEffortIdTo" type="id"></field>
      <field name="workEffortAssocTypeId" type="id"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="attrName" type="id-long"></field>
      <field name="attrValue" type="value"></field>
      <field name="attrDescription" type="description"></field>
      <prim-key field="workEffortIdFrom"/>
      <prim-key field="workEffortIdTo"/>
      <prim-key field="workEffortAssocTypeId"/>
      <prim-key field="attrName"/>
      <relation type="one" fk-name="WK_EFFRTASSC_ATTR" rel-entity-name="WorkEffortAssoc">
        <key-map field-name="workEffortIdFrom"/>
        <key-map field-name="workEffortIdTo"/>
        <key-map field-name="workEffortAssocTypeId"/>
        <key-map field-name="fromDate"/>
      </relation>
      <relation type="many" rel-entity-name="WorkEffortAssocTypeAttr">
        <key-map field-name="attrName"/>
      </relation>
    </entity>
    <entity entity-name="WorkEffortAssocType"
            package-name="org.apache.ofbiz.workeffort.workeffort"
            default-resource-name="WorkEffortEntityLabels"
            title="Work Effort Association Type">
      <field name="workEffortAssocTypeId" type="id"></field>
      <field name="parentTypeId" type="id"></field>
      <field name="hasTable" type="indicator"></field>
      <field name="description" type="description"></field>
      <prim-key field="workEffortAssocTypeId"/>
      <relation type="one" fk-name="WK_EFFRTASSC_TPAR" title="Parent" rel-entity-name="WorkEffortAssocType">
        <key-map field-name="parentTypeId" rel-field-name="workEffortAssocTypeId"/>
      </relation>
    </entity>
    <entity entity-name="WorkEffortAssocTypeAttr"
            package-name="org.apache.ofbiz.workeffort.workeffort"
            default-resource-name="WorkEffortEntityLabels"
            title="Work Effort Association Type Attribute">
      <field name="workEffortAssocTypeId" type="id"></field>
      <field name="attrName" type="id-long"></field>
      <field name="description" type="description"></field>
      <prim-key field="workEffortAssocTypeId"/>
      <prim-key field="attrName"/>
      <relation type="one" fk-name="WK_EFFRTASSC_TATR" rel-entity-name="WorkEffortAssocType">
        <key-map field-name="workEffortAssocTypeId"/>
      </relation>
      <relation type="many" rel-entity-name="WorkEffortAssocAttribute">
        <key-map field-name="attrName"/>
      </relation>
      <relation type="many" rel-entity-name="WorkEffortAssoc">
        <key-map field-name="workEffortAssocTypeId"/>
      </relation>
    </entity>
    <entity entity-name="WorkEffortAttribute"
            package-name="org.apache.ofbiz.workeffort.workeffort"
            title="Work Effort Attribute">
      <field name="workEffortId" type="id"></field>
      <field name="attrName" type="id-long"></field>
      <field name="attrValue" type="value"></field>
      <field name="attrDescription" type="description"></field>
      <prim-key field="workEffortId"/>
      <prim-key field="attrName"/>
      <relation type="one" fk-name="WK_EFFRT_ATTR_WE" rel-entity-name="WorkEffort">
        <key-map field-name="workEffortId"/>
      </relation>
      <relation type="many" rel-entity-name="WorkEffortTypeAttr">
        <key-map field-name="attrName"/>
      </relation>
    </entity>
    <entity entity-name="WorkEffortBilling"
            package-name="org.apache.ofbiz.workeffort.workeffort"
            title="Work Effort Billing">
      <field name="workEffortId" type="id"></field>
      <field name="invoiceId" type="id"></field>
      <field name="invoiceItemSeqId" type="id"></field>
      <field name="percentage" type="floating-point"></field>
      <prim-key field="workEffortId"/>
      <prim-key field="invoiceId"/>
      <prim-key field="invoiceItemSeqId"/>
      <relation type="one" fk-name="WK_EFFBLNG_WEFF" rel-entity-name="WorkEffort">
        <key-map field-name="workEffortId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="Invoice">
        <key-map field-name="invoiceId"/>
      </relation>
      <relation type="one" fk-name="WK_EFFBLNG_INVITM" rel-entity-name="InvoiceItem">
        <key-map field-name="invoiceId"/>
        <key-map field-name="invoiceItemSeqId"/>
      </relation>
    </entity>
    <entity entity-name="WorkEffortContactMech" table-name="WORK_EFFORT_CONTACT_MECH_NEW"
            package-name="org.apache.ofbiz.workeffort.workeffort"
            title="WorkEffort Contact Mechanism">
      <field name="workEffortId" type="id"></field>
      <field name="contactMechId" type="id"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <field name="comments" type="comment"></field>
      <prim-key field="workEffortId"/>
      <prim-key field="contactMechId"/>
      <prim-key field="fromDate"/>
      <relation type="one" fk-name="WKEFF_CMECH_WKEFF" rel-entity-name="WorkEffort">
        <key-map field-name="workEffortId"/>
      </relation>
      <relation type="one" fk-name="WKEFF_CMECH_CMECH" rel-entity-name="ContactMech">
        <key-map field-name="contactMechId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="TelecomNumber">
        <key-map field-name="contactMechId"/>
      </relation>
    </entity>
    <entity entity-name="WorkEffortContent" package-name="org.apache.ofbiz.workeffort.workeffort" title="WorkEffort Content">
        <field name="workEffortId" type="id"></field>
        <field name="contentId" type="id"></field>
        <field name="workEffortContentTypeId" type="id"></field>
        <field name="fromDate" type="date-time"></field>
        <field name="thruDate" type="date-time"></field>
        <prim-key field="workEffortId"/>
        <prim-key field="contentId"/>
        <prim-key field="workEffortContentTypeId"/>
        <prim-key field="fromDate"/>
        <relation type="one" fk-name="WKEFF_CNT_WKEFF" rel-entity-name="WorkEffort">
            <key-map field-name="workEffortId"/>
        </relation>
        <relation type="one" fk-name="WKEFF_CNT_CNT" rel-entity-name="Content">
            <key-map field-name="contentId"/>
        </relation>
        <relation type="one" fk-name="WKEFF_CNT_WCTP" rel-entity-name="WorkEffortContentType">
            <key-map field-name="workEffortContentTypeId"/>
        </relation>
    </entity>
    <entity entity-name="WorkEffortContentType" package-name="org.apache.ofbiz.workeffort.workeffort" title="WorkEffort Content Type">
        <field name="workEffortContentTypeId" type="id"></field>
        <field name="parentTypeId" type="id"></field>
        <field name="description" type="description"></field>
        <prim-key field="workEffortContentTypeId"/>
        <relation type="one" fk-name="WEFFCTP_TP_PAR" title="Parent" rel-entity-name="WorkEffortContentType">
            <key-map field-name="parentTypeId" rel-field-name="workEffortContentTypeId"/>
        </relation>
    </entity>
    <entity entity-name="WorkEffortDeliverableProd"
            package-name="org.apache.ofbiz.workeffort.workeffort"
            title="Work Effort Deliverable Produced">
      <field name="workEffortId" type="id"></field>
      <field name="deliverableId" type="id"></field>
      <prim-key field="workEffortId"/>
      <prim-key field="deliverableId"/>
      <relation type="one" fk-name="WKEFF_DELPRD_WEFF" rel-entity-name="WorkEffort">
        <key-map field-name="workEffortId"/>
      </relation>
      <relation type="one" fk-name="WKEFF_DELPRD_DEL" rel-entity-name="Deliverable">
        <key-map field-name="deliverableId"/>
      </relation>
    </entity>
    <entity entity-name="WorkEffortEventReminder"
            package-name="org.apache.ofbiz.workeffort.workeffort"
            title="Work Effort Event Reminder">
      <field name="workEffortId" type="id"></field>
      <field name="sequenceId" type="id"></field>
      <field name="contactMechId" type="id"></field>
      <field name="partyId" type="id">
          <description>The party this reminder is assigned to</description>
      </field>
      <field name="reminderDateTime" type="date-time"></field>
      <field name="repeatCount" type="numeric"></field>
      <field name="repeatInterval" type="numeric">
          <description>The millisecond interval between reminder repeats</description>
      </field>
      <field name="currentCount" type="numeric"></field>
      <field name="reminderOffset" type="numeric">
          <description>The millisecond offset from the event to activate a reminder</description>
      </field>
      <field name="localeId" type="id"></field>
      <field name="timeZoneId" type="id-long"></field>
      <prim-key field="workEffortId"/>
      <prim-key field="sequenceId"/>
      <relation type="one" fk-name="WE_EVENT_REMIND_WE" rel-entity-name="WorkEffort">
        <key-map field-name="workEffortId"/>
      </relation>
      <relation type="one" fk-name="WE_EVENT_REMIND_CM" rel-entity-name="ContactMech">
        <key-map field-name="contactMechId"/>
      </relation>
      <relation type="one" fk-name="WE_EVENT_REMIND_PY" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
    </entity>
    <entity entity-name="WorkEffortFixedAssetAssign"
            package-name="org.apache.ofbiz.workeffort.workeffort"
            title="Work Effort Fixed Asset Assignment">
      <field name="workEffortId" type="id"></field>
      <field name="fixedAssetId" type="id"></field>
      <field name="statusId" type="id"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <field name="availabilityStatusId" type="id"><description>Points to StatusItem value with statusTypeId="WEFA_AVAILABILITY"</description></field>
      <field name="allocatedCost" type="currency-amount"></field>
      <field name="comments" type="comment"></field>
      <prim-key field="workEffortId"/>
      <prim-key field="fixedAssetId"/>
      <prim-key field="fromDate"/>
      <relation type="one" fk-name="WKEFF_FXDAA_WEFF" rel-entity-name="WorkEffort">
        <key-map field-name="workEffortId"/>
      </relation>
      <relation type="one" fk-name="WKEFF_FXDAA_FXAS" rel-entity-name="FixedAsset">
        <key-map field-name="fixedAssetId"/>
      </relation>
      <relation type="one" fk-name="WKEFF_FXDAA_STTS" rel-entity-name="StatusItem">
        <key-map field-name="statusId"/>
      </relation>
      <relation type="one" fk-name="WKEFF_FXDAA_AVAIL" title="Availability" rel-entity-name="StatusItem">
          <key-map field-name="availabilityStatusId" rel-field-name="statusId"/>
      </relation>
    </entity>
    <entity entity-name="WorkEffortFixedAssetStd"
            package-name="org.apache.ofbiz.workeffort.workeffort"
            title="Work Effort Fixed Asset Standard">
      <field name="workEffortId" type="id"></field>
      <field name="fixedAssetTypeId" type="id"></field>
      <field name="estimatedQuantity" type="floating-point"></field>
      <field name="estimatedDuration" type="floating-point"></field>
      <field name="estimatedCost" type="currency-amount"></field>
      <prim-key field="workEffortId"/>
      <prim-key field="fixedAssetTypeId"/>
      <relation type="one" fk-name="WKEFF_FASTD_WEFF" rel-entity-name="WorkEffort">
        <key-map field-name="workEffortId"/>
      </relation>
      <relation type="one" fk-name="WKEFF_FASTD_FAT" rel-entity-name="FixedAssetType">
        <key-map field-name="fixedAssetTypeId"/>
      </relation>
    </entity>
    <entity entity-name="WorkEffortGoodStandard" package-name="org.apache.ofbiz.workeffort.workeffort" title="Work Effort Good Standard">
        <field name="workEffortId" type="id"></field>
        <field name="productId" type="id"></field>
        <field name="workEffortGoodStdTypeId" type="id"></field>
        <field name="fromDate" type="date-time"></field>
        <field name="thruDate" type="date-time"></field>
        <field name="statusId" type="id"></field>
        <field name="estimatedQuantity" type="floating-point"></field>
        <field name="estimatedCost" type="currency-amount"></field>
        <prim-key field="workEffortId"/>
        <prim-key field="productId"/>
        <prim-key field="workEffortGoodStdTypeId"/>
        <prim-key field="fromDate"/>
        <relation type="one" fk-name="WKEFF_GDSTD_WEFF" rel-entity-name="WorkEffort">
            <key-map field-name="workEffortId"/>
        </relation>
        <relation type="one" fk-name="WKEFF_GDSTD_TYPE" rel-entity-name="WorkEffortGoodStandardType">
            <key-map field-name="workEffortGoodStdTypeId"/>
        </relation>
        <relation type="one" fk-name="WKEFF_GDSTD_PROD" rel-entity-name="Product">
            <key-map field-name="productId"/>
        </relation>
        <relation type="one" fk-name="WKEFF_GDSTD_STTS" rel-entity-name="StatusItem">
            <key-map field-name="statusId"/>
        </relation>
    </entity>
    <entity entity-name="WorkEffortGoodStandardType"
            package-name="org.apache.ofbiz.workeffort.workeffort"
            title="Work Effort Good Standard Type">
      <field name="workEffortGoodStdTypeId" type="id"></field>
      <field name="parentTypeId" type="id"></field>
      <field name="hasTable" type="indicator"></field>
      <field name="description" type="description"></field>
      <prim-key field="workEffortGoodStdTypeId"/>
      <relation type="one" fk-name="WKEFF_GDSTD_TPAR" title="Parent" rel-entity-name="WorkEffortGoodStandardType">
        <key-map field-name="parentTypeId" rel-field-name="workEffortGoodStdTypeId"/>
      </relation>
    </entity>
    <entity entity-name="WorkEffortIcalData"
            package-name="org.apache.ofbiz.workeffort.workeffort"
            title="Work Effort iCalendar Data">
        <field name="workEffortId" type="id"></field>
        <field name="icalData" type="very-long">
            <description>iCalender Data</description>
        </field>
        <prim-key field="workEffortId"/>
        <relation type="one" fk-name="WKEFF_ICAL_DATA" rel-entity-name="WorkEffort">
            <key-map field-name="workEffortId"/>
        </relation>
    </entity>
    <entity entity-name="WorkEffortInventoryAssign"
            package-name="org.apache.ofbiz.workeffort.workeffort"
            title="Work Effort Inventory Assignment">
      <field name="workEffortId" type="id"></field>
      <field name="inventoryItemId" type="id"></field>
      <field name="statusId" type="id"></field>
      <field name="quantity" type="floating-point"></field>
      <prim-key field="workEffortId"/>
      <prim-key field="inventoryItemId"/>
      <relation type="one" fk-name="WKEFF_INVAS_WEFF" rel-entity-name="WorkEffort">
        <key-map field-name="workEffortId"/>
      </relation>
      <relation type="one" fk-name="WKEFF_INVAS_INVIT" rel-entity-name="InventoryItem">
        <key-map field-name="inventoryItemId"/>
      </relation>
      <relation type="one" fk-name="WKEFF_INVAS_STTS" rel-entity-name="StatusItem">
        <key-map field-name="statusId"/>
      </relation>
    </entity>
    <entity entity-name="WorkEffortInventoryProduced"
            package-name="org.apache.ofbiz.workeffort.workeffort"
            title="Work Effort Inventory Produced">
      <field name="workEffortId" type="id"></field>
      <field name="inventoryItemId" type="id"></field>
      <prim-key field="workEffortId"/>
      <prim-key field="inventoryItemId"/>
      <relation type="one" fk-name="WKEFF_INVPD_WEFF" rel-entity-name="WorkEffort">
        <key-map field-name="workEffortId"/>
      </relation>
      <relation type="one" fk-name="WKEFF_INVPD_INVIT" rel-entity-name="InventoryItem">
        <key-map field-name="inventoryItemId"/>
      </relation>
    </entity>
    <!-- Work Effort Costing -->
    <entity entity-name="WorkEffortCostCalc"
            package-name="org.apache.ofbiz.workeffort.workeffort"
            title="Work Effort Cost Calculation">
        <field name="workEffortId" type="id"></field>
        <field name="costComponentTypeId" type="id"></field>
        <field name="costComponentCalcId" type="id"></field>
        <field name="fromDate" type="date-time"></field>
        <field name="thruDate" type="date-time"></field>
        <prim-key field="workEffortId"/>
        <prim-key field="costComponentTypeId"/>
        <prim-key field="fromDate"/>
        <relation type="one" fk-name="WK_EFFRT_COS_WEF" rel-entity-name="WorkEffort">
            <key-map field-name="workEffortId"/>
        </relation>
        <relation type="one" fk-name="WK_EFFRT_COS_CCT" rel-entity-name="CostComponentType">
            <key-map field-name="costComponentTypeId"/>
        </relation>
        <relation type="one" fk-name="WK_EFFRT_COS_CCC" rel-entity-name="CostComponentCalc">
            <key-map field-name="costComponentCalcId"/>
        </relation>
    </entity>

    <entity entity-name="WorkEffortKeyword" package-name="org.apache.ofbiz.workeffort.workeffort" title="WorkEffort Keyword" never-cache="true">
        <field name="workEffortId" type="id"></field>
        <field name="keyword" type="short-varchar"></field>
        <field name="relevancyWeight" type="numeric"></field>
        <prim-key field="workEffortId"/>
        <prim-key field="keyword"/>
        <relation type="one" fk-name="WEFF_KWD_WEFF" rel-entity-name="WorkEffort">
            <key-map field-name="workEffortId"/>
        </relation>
        <index name="WEFF_KWD_KWD">
            <index-field name="keyword"/>
        </index>
    </entity>
    <entity entity-name="WorkEffortNote"
            package-name="org.apache.ofbiz.workeffort.workeffort"
            title="Work Effort Note">
      <field name="workEffortId" type="id"></field>
      <field name="noteId" type="id"></field>
      <field name="internalNote" type="indicator"></field>
      <prim-key field="workEffortId"/>
      <prim-key field="noteId"/>
      <relation type="one" fk-name="WKEFF_NTE_WEFF" rel-entity-name="WorkEffort">
        <key-map field-name="workEffortId"/>
      </relation>
      <relation type="one" fk-name="WKEFF_NTE_NOTE" rel-entity-name="NoteData">
        <key-map field-name="noteId"/>
      </relation>
    </entity>
    <entity entity-name="WorkEffortPartyAssignment" package-name="org.apache.ofbiz.workeffort.workeffort" title="Work Effort Party Assignment">
      <field name="workEffortId" type="id"></field>
      <field name="partyId" type="id"></field>
      <field name="roleTypeId" type="id"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <field name="assignedByUserLoginId" type="id-vlong"></field>
      <field name="statusId" type="id"><description>Point to StatusItem value with statusTypeId="PRTYASGN_STATUS"</description></field>
      <field name="statusDateTime" type="date-time"></field>
      <field name="expectationEnumId" type="id"><description>Point to Enumeration value with enumTypeId="WORK_EFF_EXPECT"</description></field>
      <field name="delegateReasonEnumId" type="id"><description>Point to Enumeration value with enumTypeId="WORK_EFF_DEL_REAS"</description></field>
      <field name="facilityId" type="id"></field>
      <field name="comments" type="comment"></field>
      <field name="mustRsvp" type="indicator"></field>
      <field name="availabilityStatusId" type="id"><description>Points to StatusItem value with statusTypeId="WEPA_AVAILABILITY"</description></field>
      <prim-key field="workEffortId"/>
      <prim-key field="partyId"/>
      <prim-key field="roleTypeId"/>
      <prim-key field="fromDate"/>
      <relation type="one" fk-name="WKEFF_PA_WE" rel-entity-name="WorkEffort">
        <key-map field-name="workEffortId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
      <relation type="one" fk-name="WKEFF_PA_PRTY_ROLE" rel-entity-name="PartyRole">
        <key-map field-name="partyId"/>
        <key-map field-name="roleTypeId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="RoleType">
        <key-map field-name="roleTypeId"/>
      </relation>
        <relation type="one" fk-name="WKEFF_PA_ABUSRLOG" title="AssignedBy" rel-entity-name="UserLogin">
            <key-map field-name="assignedByUserLoginId" rel-field-name="userLoginId"/>
        </relation>
        <relation type="one" fk-name="WKEFF_PA_STTS" title="Assignment" rel-entity-name="StatusItem">
            <key-map field-name="statusId"/>
        </relation>
        <relation type="one" fk-name="WKEFF_PA_EXP_ENUM" title="Expectation" rel-entity-name="Enumeration">
            <key-map field-name="expectationEnumId" rel-field-name="enumId"/>
        </relation>
        <relation type="one" fk-name="WKEFF_PA_DELR_ENM" title="DelegateReason" rel-entity-name="Enumeration">
            <key-map field-name="delegateReasonEnumId" rel-field-name="enumId"/>
        </relation>
        <relation type="one" fk-name="WKEFF_PA_FACILITY" rel-entity-name="Facility">
            <key-map field-name="facilityId"/>
        </relation>
        <relation type="one" fk-name="WKEFF_PA_AVSTTS" title="Availability" rel-entity-name="StatusItem">
            <key-map field-name="availabilityStatusId" rel-field-name="statusId"/>
        </relation>
    </entity>
    <entity entity-name="WorkEffortPurposeType" package-name="org.apache.ofbiz.workeffort.workeffort" title="Work Effort Purpose Type"
           default-resource-name="WorkEffortEntityLabels">
      <field name="workEffortPurposeTypeId" type="id"></field>
      <field name="parentTypeId" type="id"></field>
      <field name="description" type="description"></field>
      <prim-key field="workEffortPurposeTypeId"/>
      <relation type="one" fk-name="WK_EFFRT_PTYPE_PAR" title="Parent" rel-entity-name="WorkEffortPurposeType">
        <key-map field-name="parentTypeId" rel-field-name="workEffortPurposeTypeId"/>
      </relation>
    </entity>
    <entity entity-name="WorkEffortReview" package-name="org.apache.ofbiz.workeffort.workeffort" title="WorkEffort Review">
        <field name="workEffortId" type="id"></field>
        <field name="userLoginId" type="id-vlong"></field>
        <field name="reviewDate" type="date-time"></field>
        <field name="statusId" type="id"></field>
        <field name="postedAnonymous" type="indicator"></field>
        <field name="rating" type="floating-point"></field>
        <field name="reviewText" type="very-long"></field>
        <prim-key field="workEffortId"/>
        <prim-key field="userLoginId"/>
        <prim-key field="reviewDate"/>
        <relation type="one" fk-name="WEFF_REVIEW_WEFF" rel-entity-name="WorkEffort">
            <key-map field-name="workEffortId"/>
        </relation>
        <relation type="one" fk-name="WEFF_REVIEW_UL" rel-entity-name="UserLogin">
            <key-map field-name="userLoginId"/>
        </relation>
        <relation type="one" fk-name="WEFF_REVIEW_STTS" rel-entity-name="StatusItem">
            <key-map field-name="statusId"/>
        </relation>
    </entity>
    <entity entity-name="WorkEffortSearchConstraint" package-name="org.apache.ofbiz.workeffort.workeffort" never-cache="true" title="WorkEffort Search Result Constraint">
        <field name="workEffortSearchResultId" type="id"></field>
        <field name="constraintSeqId" type="id"></field>
        <field name="constraintName" type="long-varchar"></field>
        <field name="infoString" type="long-varchar"></field>
        <field name="includeSubWorkEfforts" type="indicator"></field>
        <field name="isAnd" type="indicator"></field>
        <field name="anyPrefix" type="indicator"></field>
        <field name="anySuffix" type="indicator"></field>
        <field name="removeStems" type="indicator"></field>
        <field name="lowValue" type="short-varchar"></field>
        <field name="highValue" type="short-varchar"></field>
        <prim-key field="workEffortSearchResultId"/>
        <prim-key field="constraintSeqId"/>
        <relation type="one" fk-name="WEFF_SCHRSI_RES" rel-entity-name="WorkEffortSearchResult">
            <key-map field-name="workEffortSearchResultId"/>
        </relation>
    </entity>
    <entity entity-name="WorkEffortSearchResult" package-name="org.apache.ofbiz.workeffort.workeffort" never-cache="true" title="WorkEffort Search Result">
        <field name="workEffortSearchResultId" type="id"></field>
        <field name="visitId" type="id"></field>
        <field name="orderByName" type="long-varchar"></field>
        <field name="isAscending" type="indicator"></field>
        <field name="numResults" type="numeric"></field>
        <field name="secondsTotal" type="floating-point"></field>
        <field name="searchDate" type="date-time"></field>
        <prim-key field="workEffortSearchResultId"/>
    </entity>
    <entity entity-name="WorkEffortSkillStandard"
            package-name="org.apache.ofbiz.workeffort.workeffort"
            title="Work Effort Skill Standard">
      <field name="workEffortId" type="id"></field>
      <field name="skillTypeId" type="id"></field>
      <field name="estimatedNumPeople" type="floating-point"></field>
      <field name="estimatedDuration" type="floating-point"></field>
      <field name="estimatedCost" type="currency-amount"></field>
      <prim-key field="workEffortId"/>
      <prim-key field="skillTypeId"/>
      <relation type="one" fk-name="WKEFF_SKLSTD_WEFF" rel-entity-name="WorkEffort">
        <key-map field-name="workEffortId"/>
      </relation>
      <relation type="one" fk-name="WKEFF_SKLSTD_SKTP" rel-entity-name="SkillType">
        <key-map field-name="skillTypeId"/>
      </relation>
    </entity>
    <entity entity-name="WorkEffortStatus"
            package-name="org.apache.ofbiz.workeffort.workeffort"
            title="Work Effort Status">
      <field name="workEffortId" type="id"></field>
      <field name="statusId" type="id"></field>
      <field name="statusDatetime" type="date-time"></field>
      <field name="setByUserLogin" type="id-vlong"></field>
      <field name="reason" type="description"></field>
      <prim-key field="workEffortId"/>
      <prim-key field="statusId"/>
      <prim-key field="statusDatetime"/>
      <relation type="one" fk-name="WKEFF_STTS_WE" rel-entity-name="WorkEffort">
        <key-map field-name="workEffortId"/>
      </relation>
      <relation type="one" fk-name="WKEFF_STTS_STTS" rel-entity-name="StatusItem">
        <key-map field-name="statusId"/>
      </relation>
      <relation type="one" fk-name="WKEFF_STTS_SB_UL" title="SetBy" rel-entity-name="UserLogin">
        <key-map field-name="setByUserLogin" rel-field-name="userLoginId"/>
      </relation>
    </entity>
    <entity entity-name="WorkEffortTransBox"
            package-name="org.apache.ofbiz.workeffort.workeffort"
            title="Work Effort Transition Box">
      <field name="processWorkEffortId" type="id"></field>
      <field name="toActivityId" type="id-long"></field>
      <field name="transitionId" type="id-long"></field>
      <prim-key field="processWorkEffortId"/>
      <prim-key field="toActivityId"/>
      <prim-key field="transitionId"/>
      <relation type="one" fk-name="WKEFF_TXBX_WE" rel-entity-name="WorkEffort">
        <key-map field-name="processWorkEffortId" rel-field-name="workEffortId"/>
      </relation>
    </entity>
    <entity entity-name="WorkEffortType"
            package-name="org.apache.ofbiz.workeffort.workeffort"
            default-resource-name="WorkEffortEntityLabels"
            title="Work Effort Type">
      <field name="workEffortTypeId" type="id"></field>
      <field name="parentTypeId" type="id"></field>
      <field name="hasTable" type="indicator"></field>
      <field name="description" type="description"></field>
      <prim-key field="workEffortTypeId"/>
      <relation type="one" fk-name="WK_EFFRT_TYPE_PAR" title="Parent" rel-entity-name="WorkEffortType">
        <key-map field-name="parentTypeId" rel-field-name="workEffortTypeId"/>
      </relation>
    </entity>
    <entity entity-name="WorkEffortTypeAttr"
            package-name="org.apache.ofbiz.workeffort.workeffort"
            title="Work Effort Type Attribute">
      <field name="workEffortTypeId" type="id"></field>
      <field name="attrName" type="id-long"></field>
      <field name="description" type="description"></field>
      <prim-key field="workEffortTypeId"/>
      <prim-key field="attrName"/>
      <relation type="one" fk-name="WK_EFFRT_TYPE_ATR" rel-entity-name="WorkEffortType">
        <key-map field-name="workEffortTypeId"/>
      </relation>
      <relation type="many" rel-entity-name="WorkEffortAttribute">
        <key-map field-name="attrName"/>
      </relation>
      <relation type="many" rel-entity-name="WorkEffort">
        <key-map field-name="workEffortTypeId"/>
      </relation>
    </entity>
    <entity entity-name="WorkEffortSurveyAppl"
            package-name="org.apache.ofbiz.workeffort.workeffort"
            title="Work Effort Survey Appl">
      <field name="workEffortId" type="id"/>
      <field name="surveyId" type="id"/>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <prim-key field="workEffortId"/>
      <prim-key field="surveyId"/>
      <prim-key field="fromDate"/>
      <relation type="one" fk-name="WKEF_SURVAPL_SVY" rel-entity-name="Survey">
        <key-map field-name="surveyId"/>
      </relation>
      <relation type="one" fk-name="WKEF_SURVAPL_WKE" rel-entity-name="WorkEffort">
        <key-map field-name="workEffortId"/>
      </relation>
      <relation type="one" fk-name="WKEF_SURVAPL_PSSA" rel-entity-name="ProductStoreSurveyAppl">
        <key-map field-name="surveyId" rel-field-name="productStoreSurveyId"/>
      </relation>
    </entity>
</entitymodel>
