major update

This commit is contained in:
2026-03-04 15:56:58 +01:00
parent 16759a2732
commit 8f4dd5840d
478 changed files with 24313 additions and 8201 deletions

View File

@@ -3,23 +3,35 @@
namespace MintyPHP\Service\Audit;
use MintyPHP\Repository\Audit\ApiAuditLogRepository;
use MintyPHP\Repository\Audit\SystemAuditLogRepository;
use MintyPHP\Repository\Audit\UserLifecycleAuditRepository;
use MintyPHP\Service\Settings\SettingGateway;
class AuditServicesFactory
{
private ?ApiAuditLogRepository $apiAuditLogRepository = null;
private ?UserLifecycleAuditRepository $userLifecycleAuditRepository = null;
private ?ApiAuditService $apiAuditService = null;
private ?UserLifecycleAuditService $userLifecycleAuditService = null;
private ?SystemAuditRedactionService $systemAuditRedactionService = null;
private ?SystemAuditService $systemAuditService = null;
public function __construct(
private readonly AuditRepositoryFactory $auditRepositoryFactory,
private readonly SettingGateway $settingGateway
) {}
public function createApiAuditLogRepository(): ApiAuditLogRepository
{
return $this->apiAuditLogRepository ??= new ApiAuditLogRepository();
return $this->auditRepositoryFactory->createApiAuditLogRepository();
}
public function createUserLifecycleAuditRepository(): UserLifecycleAuditRepository
{
return $this->userLifecycleAuditRepository ??= new UserLifecycleAuditRepository();
return $this->auditRepositoryFactory->createUserLifecycleAuditRepository();
}
public function createSystemAuditLogRepository(): SystemAuditLogRepository
{
return $this->auditRepositoryFactory->createSystemAuditLogRepository();
}
public function createApiAuditService(): ApiAuditService
@@ -33,4 +45,18 @@ class AuditServicesFactory
$this->createUserLifecycleAuditRepository()
);
}
public function createSystemAuditRedactionService(): SystemAuditRedactionService
{
return $this->systemAuditRedactionService ??= new SystemAuditRedactionService();
}
public function createSystemAuditService(): SystemAuditService
{
return $this->systemAuditService ??= new SystemAuditService(
$this->createSystemAuditLogRepository(),
$this->createSystemAuditRedactionService(),
$this->settingGateway
);
}
}