<?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\Card" table="mmj_card">
        <id name="id" type="mmj_uuid">
            <generator strategy="NONE"/>
        </id>

        <field name="ownerId" type="mmj_uuid"/>
        <field name="type" length="10"/>
        <field name="cardholderName" length="255"/>
        <field name="expirationDate" length="4"/>
        <field name="status" length="50"/>
        <field name="issuedAt" type="datetime_immutable"/>
        <field name="activatedAt" type="datetime_immutable" nullable="true"/>
        <field name="lockedAt" type="datetime_immutable" nullable="true"/>
        <field name="putOnHoldAt" type="datetime_immutable" nullable="true"/>
        <field name="transactions" type="mmj_card_transactions"/>
        <field name="replacements" type="mmj_card_replacements">
            <options>
                <option name="default">[]</option>
            </options>
        </field>

        <embedded name="cardIdentifier" class="MyMoneyJar\Domain\Card\CardIdentifier" use-column-prefix="false"/>
        <embedded name="balance" class="Money\Money"/>
    </entity>
</doctrine-mapping>
