refactor(audit): remove factory chain and repository interfaces

Remove AuditRepositoryFactory and AuditServicesFactory — two-layer
factory chain replaced by direct DI container wiring. Delete 4
single-consumer repository interfaces. Register all 4 repositories
and SystemAuditRedactionService directly in container. Update all
service constructors to type-hint concrete classes. Fix architecture
test and documentation references to deleted factories.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-26 12:33:59 +01:00
parent 4bf871b640
commit 570e3923b7
22 changed files with 68 additions and 247 deletions

View File

@@ -4,7 +4,7 @@ namespace MintyPHP\Tests\Module\Audit\Service;
use MintyPHP\Http\RequestContext;
use MintyPHP\Http\RequestRuntime;
use MintyPHP\Module\Audit\Repository\ApiAuditLogRepositoryInterface;
use MintyPHP\Module\Audit\Repository\ApiAuditLogRepository;
use MintyPHP\Module\Audit\Service\ApiAuditService;
use PHPUnit\Framework\TestCase;
@@ -30,7 +30,7 @@ class ApiAuditServiceTest extends TestCase
public function testCurrentRequestIdIsNullBeforeStart(): void
{
$service = new ApiAuditService(
$this->createMock(ApiAuditLogRepositoryInterface::class),
$this->createMock(ApiAuditLogRepository::class),
new RequestRuntime()
);
$this->assertNull($service->currentRequestId());
@@ -43,7 +43,7 @@ class ApiAuditServiceTest extends TestCase
$_GET = ['x' => '1'];
$service = new ApiAuditService(
$this->createMock(ApiAuditLogRepositoryInterface::class),
$this->createMock(ApiAuditLogRepository::class),
new RequestRuntime()
);
$service->startRequestContext();
@@ -66,7 +66,7 @@ class ApiAuditServiceTest extends TestCase
$_GET = [];
$service = new ApiAuditService(
$this->createMock(ApiAuditLogRepositoryInterface::class),
$this->createMock(ApiAuditLogRepository::class),
new RequestRuntime()
);
$service->startRequestContext();