<?php

namespace Opencart\Extension\Alsendo\DTO\ConfigurationRequests;

require_once(DIR_EXTENSION . 'alsendo/src/DTO/ConfigurationRequests/CoreConfigurationRequestDTO.php');

class GetTemplateDataRequestDTO
{
    public ?int $id = null;
    public ?int $autoCompleteContentForOrderId = null;

    public static function fromCoreConfigurationRequestDTO(CoreConfigurationRequestDTO $coreDto): self
    {
        $dto = new self();

        $dto->id = $coreDto->id;
        if ($coreDto->autoCompleteContentForOrderId) {
            $dto->autoCompleteContentForOrderId = $coreDto->autoCompleteContentForOrderId;
        }

        return $dto;
    }
}
