<?php

namespace Unit\Accounting\Export\Exporter;

use Myvetshop\Module\Clinique\Accounting\Export\Exporter\OrderSlipExporterFactory;
use Myvetshop\Module\Clinique\Accounting\Export\Exporter\PostProcess\VatRoundCorrectorPostProcessor;
use Myvetshop\Module\Clinique\Accounting\Export\Exporter\Provider\BankCharge\BankChargeProvider;
use Myvetshop\Module\Clinique\Accounting\Export\Exporter\Provider\BankCharge\Computer\BankChargeComputerFactory;
use Myvetshop\Module\Clinique\Accounting\Export\Exporter\Provider\Discount\DiscountProvider;
use Myvetshop\Module\Clinique\Accounting\Export\Exporter\Provider\Product\ProductProvider;
use Myvetshop\Module\Clinique\Accounting\Export\Exporter\Provider\Refund\RefundProvider;
use Myvetshop\Module\Clinique\Accounting\Export\Exporter\Provider\Shipping\ShippingProvider;
use Myvetshop\Module\Clinique\Accounting\Export\Exporter\Provider\Vat\VatProvider;

/**
 * @extends AbstractDocumentExporterTest<\OrderSlip>
 */
abstract class AbstractOrderSlipExporterTest extends AbstractDocumentExporterTest
{
    protected function setUp(): void
    {
        parent::setUp();

        $refundProvider = new RefundProvider();
        $discountProvider = new DiscountProvider();
        $vatProvider = new VatProvider(
            $this->orderDetailTaxRepository,
            $this->orderInvoiceTaxRepository,
            $this->orderSlipDetailRepository
        );
        $productProvider = new ProductProvider(
            $this->countryRepository,
            $this->invoiceAddressRepository,
            $this->orderDetailRepository,
            $this->orderDetailTaxRepository,
            $this->orderSlipDetailRepository
        );
        $shippingProvider = new ShippingProvider();
        $bankChargeProvider = new BankChargeProvider(
            new BankChargeComputerFactory(),
            $this->orderPaymentRepository
        );

        $vatPostProcessor = new VatRoundCorrectorPostProcessor();

        $factory = new OrderSlipExporterFactory(
            $refundProvider,
            $discountProvider,
            $vatProvider,
            $productProvider,
            $shippingProvider,
            $bankChargeProvider,
            $vatPostProcessor
        );

        $this->exporter = $factory->create();
    }
}
