<?xml version="1.0" encoding="utf-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
  <entity name="Db\Entity\Estimate" table="estimate">
    <indexes>
      <index name="estimate_status_id" columns="estimate_status_id"/>
      <index name="currency_code" columns="currency_code"/>
      <index name="language" columns="language_code"/>
    </indexes>
    <id name="id" type="integer" >
      <generator strategy="IDENTITY"/>
    </id>
    <field name="poNumber" type="string" column="po_number" length="15" nullable="false"/>
    <field name="date" type="date" column="date" nullable="false"/>
    <field name="notes" type="string" column="notes" length="255" nullable="true"/>
    <field name="terms" type="string" column="terms" length="255" nullable="true"/>
    <field name="firstName" type="string" column="first_name" length="255" nullable="true"/>
    <field name="lastName" type="string" column="last_name" length="255" nullable="true"/>
    <field name="organization" type="string" column="organization" length="255" nullable="true"/>
    <field name="pStreet1" type="string" column="p_street1" length="255" nullable="true"/>
    <field name="pStreet2" type="string" column="p_street2" length="255" nullable="true"/>
    <field name="pCity" type="string" column="p_city" length="255" nullable="true"/>
    <field name="pState" type="string" column="p_state" length="255" nullable="true"/>
    <field name="pCountry" type="string" column="p_country" length="255" nullable="true"/>
    <field name="pCode" type="string" column="p_code" length="255" nullable="true"/>
    <field name="vatName" type="string" column="vat_name" length="255" nullable="true"/>
    <field name="vatNumber" type="string" column="vat_number" length="255" nullable="true"/>
    <many-to-one field="currency" target-entity="Db\Entity\Currency">
      <join-columns>
        <join-column name="currency_code" referenced-column-name="currency_code"/>
      </join-columns>
    </many-to-one>
    <many-to-one field="status" target-entity="Db\Entity\EstimateStatus">
      <join-columns>
        <join-column name="estimate_status_id" referenced-column-name="estimate_status_id"/>
      </join-columns>
    </many-to-one>
    <many-to-one field="language" target-entity="Db\Entity\Language">
      <join-columns>
        <join-column name="language_code" referenced-column-name="language_code"/>
      </join-columns>
    </many-to-one>
    <one-to-many field="estimateLines" target-entity="Db\Entity\EstimateLine" mapped-by="estimate"/>
  </entity>
</doctrine-mapping>
