feat: debut du domain Shared avec Contracts et Jobs + rules pour cursor
This commit is contained in:
parent
19a697c712
commit
ca9a74fe69
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Domain\Shared\Domain\Contract;
|
||||
|
||||
interface CommandHandlerInterface
|
||||
{
|
||||
/**
|
||||
* @template T of CommandInterface
|
||||
* @param T $command
|
||||
* @return void
|
||||
*/
|
||||
public function handle(CommandInterface $command): void;
|
||||
}
|
||||
9
src/Domain/Shared/Domain/Contract/CommandInterface.php
Normal file
9
src/Domain/Shared/Domain/Contract/CommandInterface.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Domain\Shared\Domain\Contract;
|
||||
|
||||
interface CommandInterface
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\Shared\Domain\Contract;
|
||||
|
||||
use App\Domain\Shared\Domain\Model\FailedJob;
|
||||
|
||||
interface FailedJobRepositoryInterface
|
||||
{
|
||||
public function save(FailedJob $failedJob): void;
|
||||
public function get(string $id): ?FailedJob;
|
||||
public function delete(string $id): void;
|
||||
public function findAll(): array;
|
||||
public function findByJobType(string $jobType): array;
|
||||
public function findByJobId(string $jobId): array;
|
||||
public function findRetryableJobs(): array;
|
||||
}
|
||||
17
src/Domain/Shared/Domain/Contract/JobRepositoryInterface.php
Normal file
17
src/Domain/Shared/Domain/Contract/JobRepositoryInterface.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\Shared\Domain\Contract;
|
||||
|
||||
use App\Domain\Shared\Domain\Model\Job;
|
||||
use App\Domain\Shared\Domain\Model\JobStatus;
|
||||
|
||||
interface JobRepositoryInterface
|
||||
{
|
||||
public function save(Job $job): void;
|
||||
public function get(string $id): ?Job;
|
||||
public function findByStatus(JobStatus $status): array;
|
||||
public function findByType(string $type): array;
|
||||
public function findPendingJobs(): array;
|
||||
public function findInProgressJobs(): array;
|
||||
public function findFailedJobs(): array;
|
||||
}
|
||||
16
src/Domain/Shared/Domain/Contract/QueryHandlerInterface.php
Normal file
16
src/Domain/Shared/Domain/Contract/QueryHandlerInterface.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Domain\Shared\Domain\Contract;
|
||||
|
||||
interface QueryHandlerInterface
|
||||
{
|
||||
/**
|
||||
* @template T of QueryInterface
|
||||
* @template R of ResponseInterface
|
||||
* @param T $query
|
||||
* @return R
|
||||
*/
|
||||
public function handle(QueryInterface $query): ResponseInterface;
|
||||
}
|
||||
9
src/Domain/Shared/Domain/Contract/QueryInterface.php
Normal file
9
src/Domain/Shared/Domain/Contract/QueryInterface.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Domain\Shared\Domain\Contract;
|
||||
|
||||
interface QueryInterface
|
||||
{
|
||||
}
|
||||
9
src/Domain/Shared/Domain/Contract/ResponseInterface.php
Normal file
9
src/Domain/Shared/Domain/Contract/ResponseInterface.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Domain\Shared\Domain\Contract;
|
||||
|
||||
interface ResponseInterface
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user