The declaration of an operation: the smallest building block of a mutation the owning domain offers other domains —
one verb, one method on its interface, composable with others in the caller's unit of work. #[Call] is mandatory.
List it in your module's ARTIFACTS and name its final handler in HANDLER; another domain takes it from the
registry. An operation is an Operation of the audited execution: it opens no transaction and seals nothing, it runs
in its caller's unit of work.
// {Domain}/Services/PostDocument.php
#[Call('postDocument', AccountingRole::Clerk, note: 'Post a document from another module.')]
final class PostDocument extends AbstractOperation
{
public const string NAMESPACE = 'com.example.accounting.services.post_document';
public const string TITLE = 'Post a document';
public const string DESCRIPTION = 'Takes a posting over from a module and records its origin.';
public const string INTERFACE = PostDocumentInterface::class;
public const string HANDLER = PostDocumentHandler::class;
}
// {Domain}/Contracts/PostDocumentInterface.php — plain PHP, one verb
interface PostDocumentInterface
{
public function handle(PostingRequest $request): PostingReference;
}