refactor: migrate to scoped execution contexts

Signed-off-by: Sebastian <krupinski01@gmail.com>
This commit is contained in:
2026-07-27 00:50:43 -04:00
parent 75d034f478
commit 436197fbfe
+6 -6
View File
@@ -7,8 +7,8 @@ namespace KTXM\Mail\Controllers;
use InvalidArgumentException; use InvalidArgumentException;
use KTXC\Http\Response\JsonResponse; use KTXC\Http\Response\JsonResponse;
use KTXC\Http\Response\Response; use KTXC\Http\Response\Response;
use KTXC\SessionIdentity; use KTXC\Context\IdentityContextInterface;
use KTXC\SessionTenant; use KTXC\Context\TenantContextInterface;
use KTXF\Controller\ControllerAbstract; use KTXF\Controller\ControllerAbstract;
use KTXF\Routing\Attributes\AuthenticatedRoute; use KTXF\Routing\Attributes\AuthenticatedRoute;
use KTXM\Mail\CompositionManager; use KTXM\Mail\CompositionManager;
@@ -18,8 +18,8 @@ use Throwable;
final class CompositionController extends ControllerAbstract { final class CompositionController extends ControllerAbstract {
public function __construct( public function __construct(
private readonly SessionTenant $tenantIdentity, private readonly TenantContextInterface $tenantContext,
private readonly SessionIdentity $userIdentity, private readonly IdentityContextInterface $identityContext,
private readonly CompositionManager $compositionManager, private readonly CompositionManager $compositionManager,
private readonly LoggerInterface $logger, private readonly LoggerInterface $logger,
) {} ) {}
@@ -31,8 +31,8 @@ final class CompositionController extends ControllerAbstract {
string|null $operation = null, string|null $operation = null,
array|null $data = null, array|null $data = null,
): Response { ): Response {
$tenantId = $this->tenantIdentity->identifier(); $tenantId = $this->tenantContext->identifier();
$userId = $this->userIdentity->identifier(); $userId = $this->identityContext->identifier();
try { try {
if ($operation === null) { if ($operation === null) {