<?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="MyMoneyJar\Domain\Jar" table="mmj_jar">
        <id name="id" type="mmj_uuid">
            <generator strategy="NONE"/>
        </id>

        <field name="ownerId" type="mmj_uuid"/>
        <field name="type" length="10"/>
        <field name="name" length="255"/>
        <field name="categories" type="mmj_categories">
            <options>
                <option name="default">[]</option>
            </options>
        </field>
        <field name="startDate" type="datetime_immutable"/>
        <field name="lock" type="mmj_jar_lock" nullable="true"/>
        <field name="collaborators" type="mmj_jar_collaborators" nullable="true"/>
        <field name="paymentBeneficiary" nullable="true"/>
        <field name="transactions" type="mmj_jar_transactions"/>
        <field name="createdAt" type="datetime_immutable"/>
        <field name="brokenAt" type="datetime_immutable" nullable="true"/>
        <field name="deletedAt" type="datetime_immutable" nullable="true"/>

        <embedded name="monthlyGoal" class="Money\Money"/>
        <embedded name="balance" class="Money\Money"/>
        <embedded name="goal" class="Money\Money"/>
        <embedded name="guardianLink" class="MyMoneyJar\Domain\Jar\GuardianLink"/>
        <embedded name="paymentRecurrence" class="MyMoneyJar\Domain\Jar\PaymentRecurrence"/>
    </entity>
</doctrine-mapping>
