<?php


namespace Diamond\Modules\AdminMailing;

use ActiveTable\Contracts\CommandInterface;
use ActiveTable\DataTableEngine;
use Repo\Concrete\Exceptions\ValidationException;

class ValidateMailingTemplateCommand implements CommandInterface
{
    public function __construct(private DataTableEngine $engine)
    {
    }

    public function process(): void
    {

        $data = $this->engine->getRequest()->getParsedBody();

        if(empty($data['bodyFile']) && empty($data['body'])){
            throw new ValidationException([
                'Не указан путь к шаблону или содержимое шаблона'
            ]);
        }
    }

}