<?php
declare(strict_types=1);

namespace PpPhp\Core\Platform\Console\Commands;

use PpPhp\Core\Platform\Console\AbstractCommand;

final class HumanTaskCreateCommand extends AbstractCommand
{
    public function name(): string { return 'workflow:human:create'; }
    public function description(): string { return 'PPphp Human Task Create'; }

    public function handle(array $arguments = []): int
    {
        $this->title('PPphp Human Task Create');
        $task = \PpPhp\Core\Platform\Workflow\HumanTask\HumanTaskRuntime::instance(\PpPhp\Core\Platform\Console\ConsolePath::basePath())->createTask(\PpPhp\Core\Platform\Workflow\HumanTask\HumanTaskRecord::create('console-workflow-instance', 'console_approval', 'Console Approval', '', ['alice'], ['managers'], ['source' => 'console'])); $this->line('Created: ' . $task->taskId());
        return 0;
    }
}
