<?php
declare(strict_types=1);

namespace PpPhp\Core\Platform\Console\Commands;

use PpPhp\Core\Platform\Console\AbstractCommand;

final class ProjectionRegisterCommand extends AbstractCommand
{
    public function name(): string { return 'projection:register'; }
    public function description(): string { return 'PPphp Projection Register'; }

    public function handle(array $arguments = []): int
    {
        $this->title('PPphp Projection Register');
        $definition = \PpPhp\Core\Platform\Event\Sourcing\Projection\ProjectionRuntime::instance(\PpPhp\Core\Platform\Console\ConsolePath::basePath())->register(\PpPhp\Core\Platform\Event\Sourcing\Projection\ProjectionDefinition::create('console_projection', 'Console Projection', [], [])); $this->line('Registered: ' . $definition->projectionId());
        return 0;
    }
}
