<?php

require __DIR__ . '/../../../../../app/bootstrap.php';

use FiloBlu\Rma\Model\EasyReturn;
use Magento\Framework\App\Area;
use Magento\Framework\App\Bootstrap;
use Magento\Framework\App\State;
use Magento\Rma\Model\ItemFactory;
use Magento\Store\Model\App\Emulation;
use Magento\Store\Model\StoreManagerInterface;
use Magento\Sales\Model\OrderFactory;
use Magento\Rma\Model\RmaFactory;
use FiloBlu\Rma\Plugin\Model\RmaModelRmaProcessor;
use const Filoblu\Storelocator\Model\Rma\ItemFactory;


$bootstrap = Bootstrap::create(BP, $_SERVER);

$objectManager = $bootstrap->getObjectManager();

/** @var State $state */
$state = $objectManager->get(State::class);
$state->setAreaCode(Area::AREA_FRONTEND);


$payload = [
    'city' => 'SANTA MARIA DI SALA',
    'region_id' => 616,
    'postcode' => '30036',
    'country_id' => 'IT',
    'items' =>
        [
            0 =>
                [
                    'order_item_id' => 577,
                    'qty_requested' => 1,
                ],
        ],
];

/** @var \FiloBlu\Rma\Model\EasyReturn $easyReturn */
$easyReturn = $objectManager->get(EasyReturn::class);

$easyReturn->estimateReturnShippingCost($payload);
