feat(shared): add DDD use case contracts

This commit is contained in:
Jérémy Munsch 2026-09-20 17:16:44 +02:00
parent 0ebeafeaf1
commit ec42ef9969
Signed by: forge-joniko
GPG key ID: D7EFE2F5CB6CC0E4
3 changed files with 42 additions and 0 deletions

View file

@ -0,0 +1,10 @@
<?php
declare(strict_types=1);
namespace Shared\DDD\UseCases;
interface Executor
{
public function execute(): object;
}

View file

@ -0,0 +1,19 @@
<?php
declare(strict_types=1);
namespace Shared\DDD\UseCases;
/**
* @template TOutput of Output
*
* @template-covariant T of object
*/
interface Presenter
{
/**
* @param TOutput $output
* @return T
*/
public function present(Output $output): object;
}

View file

@ -0,0 +1,13 @@
<?php
declare(strict_types=1);
namespace Shared\DDD\UseCases;
/**
* Marker interface for use cases that perform database mutations
* requiring an atomic database transaction.
*/
interface Transactional
{
}