<?php

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

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/Apaczka/ApaczkaOrderDetailsEntity.php');
require_once(DIR_EXTENSION . 'alsendo/src/DTO/Entity/Apaczka/ApaczkaOrderDetailsSenderEntity.php');
require_once(DIR_EXTENSION . 'alsendo/src/DTO/Entity/Apaczka/ApaczkaOrderDetailsShippingAddressEntity.php');
require_once(DIR_EXTENSION . 'alsendo/src/DTO/Entity/Apaczka/ApaczkaOrderDetailsPackageDetailsEntity.php');
require_once(DIR_EXTENSION . 'alsendo/src/DTO/Entity/Apaczka/ApaczkaOrderDetailsPackageEntity.php');
require_once(DIR_EXTENSION . 'alsendo/src/DTO/Entity/Apaczka/ApaczkaOrderDetailsShipmentEntity.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 ApaczkaOrderDetailsEntityFactory implements OrderDetailsEntityFactoryInterface
{
    public function createOrderDetailsFromArray(array $data): OrderDetailsEntity
    {
        return ApaczkaOrderDetailsEntity::fromArray($data);
    }

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

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

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

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

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