<?xml version="1.0" encoding="UTF-8"?>

<!--

 This file is part of the Sylius package.

 (c) Sylius Sp. z o.o.

 For the full copyright and license information, please view the LICENSE
 file that was distributed with this source code.

-->

<doctrine-mongo-mapping xmlns="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping
                                      http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping.xsd"
                  xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping">

    <mapped-superclass name="Sylius\Bundle\TaxonomyBundle\Document\Taxon" collection="sylius_taxon">
        <order-by>
            <order-by-field name="left" direction="ASC" />
        </order-by>
        <field name="code" column="code" type="string" unique="true"/>
        <field name="name" column="name" type="string" />
        <field name="slug" column="slug" type="string" unique="true">
            <gedmo:slug fields="name" unique="true" />
        </field>
        <field name="description" column="description" type="string" />
        <field name="left" column="tree_left" type="int">
            <gedmo:tree-left />
        </field>
        <field name="right" column="tree_right" type="int">
            <gedmo:tree-right />
        </field>
        <field name="level" column="tree_level" type="int">
            <gedmo:tree-level />
        </field>
    </mapped-superclass>
</doctrine-mongo-mapping>
