<?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
                          https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
    <entity
            name="Basango\IdentityAndAccess\Domain\Model\Entity\User"
            repository-class="Basango\IdentityAndAccess\Infrastructure\Persistence\Doctrine\ORM\UserOrmRepository"
            table="user"
    >
        <id name="id" type="user_id">
            <generator strategy="NONE" />
        </id>

        <field name="name"/>
        <field name="email" type="email" />
        <field name="password" length="512" />
        <embedded name="roles" class="Basango\IdentityAndAccess\Domain\Model\ValueObject\Roles" use-column-prefix="false" />

        <field name="isLocked" type="boolean">
            <options>
                <option name="default">false</option>
            </options>
        </field>
        <field name="isConfirmed" type="boolean">
            <options>
                <option name="default">false</option>
            </options>
        </field>

        <field name="createdAt" type="datetime_immutable" />
        <field name="updatedAt" type="datetime_immutable" nullable="true" />
     </entity>
</doctrine-mapping>
