<?php

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

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/Ecolet/EcoletOrderDetailsEntity.php');
require_once(DIR_EXTENSION . 'alsendo/src/DTO/Entity/Ecolet/EcoletOrderDetailsSenderEntity.php');
require_once(DIR_EXTENSION . 'alsendo/src/DTO/Entity/Ecolet/EcoletOrderDetailsShippingAddressEntity.php');
require_once(DIR_EXTENSION . 'alsendo/src/DTO/Entity/Ecolet/EcoletOrderDetailsPackageDetailsEntity.php');
require_once(DIR_EXTENSION . 'alsendo/src/DTO/Entity/Ecolet/EcoletOrderDetailsPackageEntity.php');
require_once(DIR_EXTENSION . 'alsendo/src/DTO/Entity/Ecolet/EcoletOrderDetailsShipmentEntity.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 EcoletOrderDetailsEntityFactory implements OrderDetailsEntityFactoryInterface
{
    public function createOrderDetailsFromArray(array $data): OrderDetailsEntity
    {
        return EcoletOrderDetailsEntity::fromArray($data);
    }

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

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

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

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

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