imports:
    - { resource: "@SyliusCoreBundle/Resources/config/app/config.yml" }

    - { resource: "@SyliusAdminBundle/Resources/config/app/config.yml" }
    - { resource: "@SyliusApiBundle/Resources/config/app/config.yaml" }

    - { resource: "@SyliusShopBundle/Resources/config/app/config.yml" }
    - { resource: "@SyliusPayPalPlugin/Resources/config/config.yaml" }
    - { resource: "@BitBagSyliusCmsPlugin/Resources/config/config.yml" }

parameters:
    sylius_core.public_dir: '%kernel.project_dir%/public'

sylius_addressing:
    resources:
        address:
            classes:
                model: App\Entity\Addressing\Address
        country:
            classes:
                model: App\Entity\Addressing\Country
        province:
            classes:
                model: App\Entity\Addressing\Province
        zone:
            classes:
                model: App\Entity\Addressing\Zone
        zone_member:
            classes:
                model: App\Entity\Addressing\ZoneMember

sylius_attribute:
    resources:
        product:
            attribute:
                classes:
                    model: App\Entity\Product\ProductAttribute
                translation:
                    classes:
                        model: App\Entity\Product\ProductAttributeTranslation
            attribute_value:
                classes:
                    model: App\Entity\Product\ProductAttributeValue

sylius_channel:
    resources:
        channel:
            classes:
                model: App\Entity\Channel\Channel
sylius_core:
    resources:
        product_image:
            classes:
                model: App\Entity\Product\ProductImage
        taxon_image:
            classes:
                model: App\Entity\Taxonomy\TaxonImage
        product_taxon:
            classes:
                model: App\Entity\Product\ProductTaxon
        channel_pricing:
            classes:
                model: App\Entity\Channel\ChannelPricing

sylius_currency:
    resources:
        currency:
            classes:
                model: App\Entity\Currency\Currency
        exchange_rate:
            classes:
                model: App\Entity\Currency\ExchangeRate

sylius_customer:
    resources:
        customer:
            classes:
                model: App\Entity\Customer\Customer
                repository: App\Repository\CustomerRepository
        customer_group:
            classes:
                model: App\Entity\Customer\CustomerGroup

sylius_locale:
    locale: "%locale%"
    resources:
        locale:
            classes:
                model: App\Entity\Locale\Locale
                
sylius_order:
    resources:
        order:
            classes:
                model: App\Entity\Order\Order
                controller: App\Controller\OrderController
                repository: App\Repository\OrderRepository
        order_item:
            classes:
                model: App\Entity\Order\OrderItem
                repository: App\Repository\OrderItemRepository
        order_item_unit:
            classes:
                model: App\Entity\Order\OrderItemUnit
        adjustment:
            classes:
                model: App\Entity\Order\Adjustment
                repository: App\Repository\AdjustmentRepository
        order_sequence:
            classes:
                model: App\Entity\Order\OrderSequence

sylius_payment:
    resources:
        payment_method:
            classes:
                model: App\Entity\Payment\PaymentMethod
            translation:
                classes:
                    model: App\Entity\Payment\PaymentMethodTranslation
        payment:
            classes:
                model: App\Entity\Payment\Payment

sylius_payum:
    resources:
        payment_security_token:
            classes:
                model: App\Entity\Payment\PaymentSecurityToken
        gateway_config:
            classes:
                model: App\Entity\Payment\GatewayConfig

sylius_product:
    resources:
        product:
            classes:
                model: App\Entity\Product\Product
                repository: App\Repository\ProductRepository
            translation:
                classes:
                    model: App\Entity\Product\ProductTranslation
        product_variant:
            classes:
                model: App\Entity\Product\ProductVariant
            translation:
                classes:
                    model: App\Entity\Product\ProductVariantTranslation
        product_option:
            classes:
                model: App\Entity\Product\ProductOption
            translation:
                classes:
                    model: App\Entity\Product\ProductOptionTranslation
        product_option_value:
            classes:
                model: App\Entity\Product\ProductOptionValue
            translation:
                classes:
                    model: App\Entity\Product\ProductOptionValueTranslation
        product_association:
            classes:
                model: App\Entity\Product\ProductAssociation
        product_association_type:
            classes:
                model: App\Entity\Product\ProductAssociationType
            translation:
                classes:
                    model: App\Entity\Product\ProductAssociationTypeTranslation

sylius_promotion:
    resources:
        promotion:
            classes:
                model: App\Entity\Promotion\Promotion
        promotion_rule:
            classes:
                model: App\Entity\Promotion\PromotionRule
        promotion_action:
            classes:
                model: App\Entity\Promotion\PromotionAction
        promotion_coupon:
            classes:
                model: App\Entity\Promotion\PromotionCoupon

sylius_review:
    resources:
        product:
            review:
                classes:
                    model: App\Entity\Product\ProductReview
                    controller: App\Controller\ProductReviewController

sylius_shipping:
    resources:
        shipment:
            classes:
                model: App\Entity\Shipping\Shipment
        shipping_method:
            classes:
                model: App\Entity\Shipping\ShippingMethod
            translation:
                classes:
                    model: App\Entity\Shipping\ShippingMethodTranslation
        shipping_category:
            classes:
                model: App\Entity\Shipping\ShippingCategory
sylius_taxation:
    resources:
        tax_category:
            classes:
                model: App\Entity\Taxation\TaxCategory
        tax_rate:
            classes:
                model: App\Entity\Taxation\TaxRate

sylius_taxonomy:
    resources:
        taxon:
            classes:
                model: App\Entity\Taxonomy\Taxon
            translation:
                classes:
                    model: App\Entity\Taxonomy\TaxonTranslation
sylius_user:
    resources:
        admin:
            user:
                classes:
                    model: App\Entity\User\AdminUser
        shop:
            user:
                classes:
                    model: App\Entity\User\ShopUser
        oauth:
            user:
                classes:
                    model: App\Entity\User\UserOAuth

sylius_shop:
    product_grid:
        include_all_descendants: true

sylius_theme:
    sources:
        filesystem:
            scan_depth: 1
            directories:
                - "%kernel.project_dir%/themes"


sylius_grid:
    grids:
        app_admin_slider:
            driver:
                name: doctrine/orm
                options:
                    class: App\Entity\Slider\Slider
            fields:
                background:
                    type: twig
                    label: image de fond
                    options:
                        template: '@SyliusAdmin/Grid/Field/background.html.twig'
                slider_name:
                    type: string
                    label: Nom du Slide
                title:
                    type: string
                    label: sylius.ui.title
                sub_title:
                    type: string
                    label: Sous Titre
                link_text:
                    type: string
                    label: Texte du bouton
                link_name:
                    type: string
                    label: "redirection du lien vers:"
            actions:
                main:
                    create:
                        type: create
                item: 
                    update:
                        type: update
                    delete:
                        type: delete
#         app_shipping_option:
#             driver:
#                 name: doctrine/orm
#                 options: 
#                     class: App\Entity\Shipping\ShippingOption
#             fields: 
#                 custom_shipping_method: 
#                     type: twig
#                     label: Shipping method
#                     options:
#                         template: "@SyliusUi/Grid/Field/name.html.twig"
#                 min_weight: 
#                     type: string
#                     label: Poids Minimum
#                 max_weight: 
#                     type: string
#                     label: Poids Maximum
#                 price: 
#                     type: string
#                     label: Prix
#             actions:
#                 main:
#                     create: 
#                         type: create
#                 item:
#                     update: 
#                         type: update
#                     delete:
#                         type: delete

#         app_admin_custom_shipping_method:
#             driver:
#                 name: doctrine/orm
#                 options: 
#                     class: App\Entity\Shipping\CustomShippingMethod
#             fields: 
#                 zone: 
#                     type: string
#                     label: Pays du service de livraison
#                 code: 
#                     type: string
#                     label: Code Unique
#                 name: 
#                     type: string
#                     label: Nom du service de livraison
#                 title: 
#                     type: string
#                     label: Titre
#                     sortable: translation.title
#                 description: 
#                     type: string
#                     label: Description
#                     sortable: translation.description
#                 free_from: 
#                     type: string
#                     label: Gratuit a partir de (en centimes)
#                 is_enabled:
#                     type: twig
#                     label: sylius.ui.enabled
#                     options:
#                         template: "@SyliusUi/Grid/Field/enabled.html.twig"
#                 position: 
#                     type: string
#                     label: Position
#             actions:
#                 main:
#                     create: 
#                         type: create
#                 item:
#                     update: 
#                         type: update
#                     delete:
#                         type: delete

sylius_resource:
    resources:
        app.slider:
            driver: doctrine/orm
            classes:
                model: App\Entity\Slider\Slider
                controller: App\Controller\SliderController
                repository: App\Repository\Slider\SliderRepository
#         app.shipping_option:
#             driver: doctrine/orm
#             classes:
#                 model: App\Entity\Shipping\ShippingOption
#                 controller: App\Controller\ShippingOptionController
#                 repository: App\Repository\ShippingOptionRepository
#         app.custom_shipping_method:
#             driver: doctrine/orm
#             classes:
#                 model: App\Entity\Shipping\CustomShippingMethod
#                 controller: App\Controller\CustomShippingMethodController
#                 form: App\Form\CustomShippingMethodType
#             translation:
#                 classes:
#                     model: App\Entity\Shipping\CustomShippingMethodTranslation
#                     form: App\Form\CustomShippingMethodTypeTranslation
#         sylius.shipping_method:
#             driver: doctrine/orm
#             classes:
#                 model: App\Entity\Shipping\ShippingMethod
#                 repository: App\Repository\ShippingMethodRepository

# # services:
# #     sylius.listener.change_redirect_after_adding_to_cart:
# #         class: App\Listener\ChangeRedirectAfterAddingToCartListener
# #         public: true
# #         tags:
# #             - { name: kernel.event_listener,event: sylius.order_item.post_add,method: onSuccessfulAddToCart }
# winzou_state_machine:
#     sylius_order:
#         callbacks:
#             after:
#                 sylius_select_shipping:
#                     # here you are choosing the transition on which the action should take place - we are using the one we have created before
#                     on: ["success"]
#                     # use service and its method here
#                     do: ["@App\\Listner\\OrderListner", "setShippment"]
#                     # this will be the object of an Order here
#                     args: ["object"]
#                     priority: 100