<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="BlueLogic\Prescription\Api\Data\PrescriptionInterface" type="BlueLogic\Prescription\Model\Prescription"/>
    <preference for="BlueLogic\Prescription\Api\PrescriptionRepositoryInterface" type="BlueLogic\Prescription\Model\PrescriptionRepository"/>
    <preference for="BlueLogic\Prescription\Api\Data\PrescriptionSearchResultsInterface" type="BlueLogic\Prescription\Model\PrescriptionSearchResult"/>
    <virtualType name="BlueLogic\Prescription\Model\Api\SearchCriteria\PrescriptionCollectionProcessor" type="Magento\Framework\Api\SearchCriteria\CollectionProcessor">
        <arguments>
            <argument name="processors" xsi:type="array">
                <item name="filters" xsi:type="object">Magento\Framework\Api\SearchCriteria\CollectionProcessor\FilterProcessor</item>
                <item name="sorting" xsi:type="object">Magento\Framework\Api\SearchCriteria\CollectionProcessor\SortingProcessor</item>
                <item name="pagination" xsi:type="object">Magento\Framework\Api\SearchCriteria\CollectionProcessor\PaginationProcessor</item>
            </argument>
        </arguments>
    </virtualType>
    <type name="BlueLogic\Prescription\Model\PrescriptionRepository">
        <arguments>
            <argument name="collectionProcessor" xsi:type="object">BlueLogic\Prescription\Model\Api\SearchCriteria\PrescriptionCollectionProcessor</argument>
            <argument name="hydrator" xsi:type="object">Magento\Framework\EntityManager\AbstractModelHydrator</argument>
        </arguments>
    </type>
    <type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
        <arguments>
            <argument name="collections" xsi:type="array">
                <item name="prescription_listing_data_source" xsi:type="string">PrescriptionCollection</item>
            </argument>
        </arguments>
    </type>
    <virtualType name="PrescriptionCollection" type="BlueLogic\Prescription\Ui\DataProvider\Prescription\Listing\Collection">
        <arguments>
            <argument name="mainTable" xsi:type="string">prescription_order</argument>
            <argument name="resourceModel" xsi:type="string">BlueLogic\Prescription\Model\ResourceModel\Prescription</argument>
        </arguments>
    </virtualType>
    <type name="BlueLogic\Prescription\Ui\Component\MassAction\Status\Options">
        <arguments>
            <argument name="data" xsi:type="array">
                <item name="urlPath" xsi:type="string">prescription/prescription/massStatus</item>
                <item name="paramName" xsi:type="string">status</item>
                <item name="confirm" xsi:type="array">
                    <item name="title" xsi:type="string" translatable="true">Change Status</item>
                    <item name="message" xsi:type="string" translatable="true">Are you sure to change?</item>
                </item>
            </argument>
        </arguments>
    </type>
</config>
