<?xml version="1.0" encoding="UTF-8"?>
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd">
    <route method="POST" url="/V1/customer/cart/merge">
        <service class="FiloBlu\Refilo\Api\MergeCartsInterface" method="mergeGuestCartIntoActiveCustomerCart"/>
        <resources>
            <resource ref="self"/>
        </resources>
    </route>
    <route url="/V1/newsletter/subscribe" method="POST">
        <service class="FiloBlu\Refilo\Api\NewsletterManagementInterface" method="subscribe"/>
        <resources>
            <resource ref="anonymous"/>
        </resources>
        <data>
            <parameter name="email">null</parameter>
            <parameter name="source">website</parameter>
            <parameter name="firstname"></parameter>
            <parameter name="lastname"></parameter>
            <parameter name="dob"></parameter>
            <parameter name="gender"></parameter>
            <parameter name="country"></parameter>
            <parameter name="collections"></parameter>
            <parameter name="phone"></parameter>
            <parameter name="language"></parameter>
            <parameter name="website_name"></parameter>
        </data>
    </route>
    <route url="/V1/customers/switchcustomergroup" method="PUT">
        <service class="FiloBlu\Refilo\Api\CustomerGroupManagmentInterface" method="updateCustomerGroup" />
        <resources>
            <resource ref="Magento_Customer::manage"/>
        </resources>
    </route>
    <route url="/V1/customers/registerwithcustomergroup" method="POST">
        <service class="FiloBlu\Refilo\Api\CustomerGroupManagmentInterface" method="createAccount"/>
        <resources>
            <resource ref="Magento_Customer::manage"/>
        </resources>
    </route>
    <route url="/V1/customers/:customerId/additionalinfo" method="GET">
        <service class="FiloBlu\Refilo\Api\CustomerAdditionalManagementInterface" method="getAdditionalInfo"/>
        <resources>
            <resource ref="Magento_Customer::manage"/>
        </resources>
    </route>
    <route url="/V1/wishlist" method="POST">
        <service class="FiloBlu\Refilo\Api\WishlistManagementInterface" method="saveProductToWishlist"/>
        <resources>
            <resource ref="anonymous"/>
        </resources>
        <data>
            <parameter name="product_id"/>
            <parameter name="customer_id"/>
            <parameter name="attribute_id">null</parameter>
            <parameter name="option_value">null</parameter>
        </data>
    </route>
    <route url="/V1/wishlist" method="PUT">
        <service class="FiloBlu\Refilo\Api\WishlistManagementInterface" method="updateProductQtyToWishlist"/>
        <resources>
            <resource ref="anonymous"/>
        </resources>
        <data>
            <parameter name="product_id"/>
            <parameter name="customer_id"/>
            <parameter name="qty"/>
        </data>
    </route>
    <route url="/V1/wishlist/:customer_id/product/:product_id" method="DELETE">
        <service class="FiloBlu\Refilo\Api\WishlistManagementInterface" method="deleteProductFromWishlist"/>
        <resources>
            <resource ref="anonymous"/>
        </resources>
    </route>
    <route url="/V1/wishlist/clean/:customer_id" method="DELETE">
        <service class="FiloBlu\Refilo\Api\WishlistManagementInterface" method="deleteAllProductFromWishlist"/>
        <resources>
            <resource ref="anonymous"/>
        </resources>
    </route>

    <route method="POST" url="/V1/filoblu/search/term">
        <service class="FiloBlu\Refilo\Api\SearchManagementInterface" method="updateSearchTerm"/>
        <resources>
            <resource ref="self"/>
        </resources>
    </route>

    <route url="/V1/cart/clean/:cartId" method="DELETE">
        <service class="FiloBlu\Refilo\Api\CartManagementInterface" method="emptyCart"/>
        <resources>
            <resource ref="anonymous"/>
        </resources>
    </route>

    <route url="/V1/guest-cart/clean/:cartId" method="DELETE">
        <service class="FiloBlu\Refilo\Api\CartManagementInterface" method="emptyGuestCart"/>
        <resources>
            <resource ref="anonymous"/>
        </resources>
    </route>

    <route url="/V1/guest-order" method="POST">
        <service class="FiloBlu\Refilo\Api\OrderMappingManagementInterface" method="getGuestOrder"/>
        <resources>
            <resource ref="self"/>
        </resources>
    </route>

    <route url="/V1/customer-order" method="POST">
        <service class="FiloBlu\Refilo\Api\OrderMappingManagementInterface" method="getCustomerOrder"/>
        <resources>
            <resource ref="self"/>
        </resources>
    </route>
</routes>
