Commit 4e71769b authored by Vladislav Timofeev's avatar Vladislav Timofeev
Browse files

dump

parents
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
<?php

declare(strict_types=1);

namespace App\Context\Content\Application\Command\Export\ExportContentToGitStore;

use App\Context\Shared\Domain\Bus\Command\Command;

class ExportContentToGitStoreCommand implements Command
{
}
+31 −0
Original line number Diff line number Diff line
<?php

declare(strict_types=1);

namespace App\Context\Content\Application\Command\Export\ExportContentToGitStore;

use App\Context\Content\Application\Process\Export\Content\ExportContentService;
use App\Context\Content\Application\Service\Git\GitStore;
use App\Context\Shared\Domain\Bus\Command\CommandHandler;

class ExportContentToGitStoreHandler implements CommandHandler
{
    public function __construct(
        protected readonly GitStore $gitStore,
        protected readonly ExportContentService $exportContentService,
    ) {
    }

    public function __invoke(ExportContentToGitStoreCommand $command): ExportContentToGitStoreResponse
    {
        try {
            $this->gitStore->pull();
            $this->exportContentService->run();
            $this->gitStore->push();
        } finally {
            $this->gitStore->clean();
        }

        return new ExportContentToGitStoreResponse();
    }
}
+11 −0
Original line number Diff line number Diff line
<?php

declare(strict_types=1);

namespace App\Context\Content\Application\Command\Export\ExportContentToGitStore;

use App\Context\Shared\Domain\Bus\Command\CommandResponse;

class ExportContentToGitStoreResponse implements CommandResponse
{
}
+17 −0
Original line number Diff line number Diff line
<?php

declare(strict_types=1);

namespace App\Context\Content\Application\Command\Level\AssignLevelModerator;

use App\Context\Shared\Domain\Bus\Command\Command;

class AssignLevelModeratorCommand implements Command
{
    public function __construct(
        public readonly string $skillId,
        public readonly string $levelId,
        public readonly string $memberId,
    ) {
    }
}
+21 −0
Original line number Diff line number Diff line
<?php

declare(strict_types=1);

namespace App\Context\Content\Application\Command\Level\AssignLevelModerator;

use App\Context\Shared\Domain\Aggregate\AggregateId;
use App\Context\Shared\Domain\Bus\Command\AggregateCommandResponse;

class AssignLevelModeratorCommandResponse implements AggregateCommandResponse
{
    public function __construct(
        private readonly AggregateId $id
    ) {
    }

    public function getAggregateId(): AggregateId
    {
        return $this->id;
    }
}