<?php

namespace Opencart\Extension\Alsendo\DTO\Entity\Zaslat;

require_once(DIR_EXTENSION . 'alsendo/src/DTO/Entity/OrderDetailsEntityFactoryInterface.php');
require_once(DIR_EXTENSION . 'alsendo/src/DTO/Entity/OrderDetailsEntity.php');
require_once(DIR_EXTENSION . 'alsendo/src/DTO/Entity/AbstractOrderDetailsSenderEntity.php');
require_once(DIR_EXTENSION . 'alsendo/src/DTO/Entity/AbstractOrderDetailsShippingAddressEntity.php');
require_once(DIR_EXTENSION . 'alsendo/src/DTO/Entity/AbstractOrderDetailsPackageDetailsEntity.php');
require_once(DIR_EXTENSION . 'alsendo/src/DTO/Entity/AbstractOrderDetailsPackageEntity.php');
require_once(DIR_EXTENSION . 'alsendo/src/DTO/Entity/AbstractOrderDetailsShipmentEntity.php');
require_once(DIR_EXTENSION . 'alsendo/src/DTO/Entity/Zaslat/ZaslatOrderDetailsEntity.php');
require_once(DIR_EXTENSION . 'alsendo/src/DTO/Entity/Zaslat/ZaslatOrderDetailsSenderEntity.php');
require_once(DIR_EXTENSION . 'alsendo/src/DTO/Entity/Zaslat/ZaslatOrderDetailsShippingAddressEntity.php');
require_once(DIR_EXTENSION . 'alsendo/src/DTO/Entity/Zaslat/ZaslatOrderDetailsPackageDetailsEntity.php');
require_once(DIR_EXTENSION . 'alsendo/src/DTO/Entity/Zaslat/ZaslatOrderDetailsPackageEntity.php');
require_once(DIR_EXTENSION . 'alsendo/src/DTO/Entity/Zaslat/ZaslatOrderDetailsShipmentEntity.php');

use Opencart\Extension\Alsendo\DTO\Entity\AbstractOrderDetailsPackageEntity;
use Opencart\Extension\Alsendo\DTO\Entity\AbstractOrderDetailsPackageDetailsEntity;
use Opencart\Extension\Alsendo\DTO\Entity\AbstractOrderDetailsSenderEntity;
use Opencart\Extension\Alsendo\DTO\Entity\AbstractOrderDetailsShipmentEntity;
use Opencart\Extension\Alsendo\DTO\Entity\AbstractOrderDetailsShippingAddressEntity;
use Opencart\Extension\Alsendo\DTO\Entity\OrderDetailsEntity;
use Opencart\Extension\Alsendo\DTO\Entity\OrderDetailsEntityFactoryInterface;

class ZaslatOrderDetailsEntityFactory implements OrderDetailsEntityFactoryInterface
{
    public function createOrderDetailsFromArray(array $data): OrderDetailsEntity
    {
        return ZaslatOrderDetailsEntity::fromArray($data);
    }

    public function createSenderFromArray(array $data): AbstractOrderDetailsSenderEntity
    {
        return ZaslatOrderDetailsSenderEntity::fromArray($data);
    }

    public function createShippingAddressFromArray(array $data): AbstractOrderDetailsShippingAddressEntity
    {
        return ZaslatOrderDetailsShippingAddressEntity::fromArray($data);
    }

    public function createPackageDetailsFromArray(array $data, string $currencyCode = 'PLN'): AbstractOrderDetailsPackageDetailsEntity
    {
        return ZaslatOrderDetailsPackageDetailsEntity::fromArray($data, $currencyCode);
    }

    public function createPackageFromArray(array $data): AbstractOrderDetailsPackageEntity
    {
        return ZaslatOrderDetailsPackageEntity::fromArray($data);
    }

    public function createShipmentFromArray(array $data): AbstractOrderDetailsShipmentEntity
    {
        return ZaslatOrderDetailsShipmentEntity::fromArray($data);
    }
}
