2026-02-23 12:58:19 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace MintyPHP\Service\Scheduler;
|
|
|
|
|
|
feat: extend module platform with UI slots, runtime components, CLI tooling and {{userId}} search support
Completes the generic module platform that enables modules to contribute
UI elements, runtime JS components, and search resources without any
core hardcoding.
New generic UI slot types:
- topbar.right_item: module-contributed topbar buttons
- layout.body_end_template: module-contributed dialog/overlay templates
- layout.head_style: module-contributed global CSS
- runtime.component: declarative JS component registration with phase ordering
New infrastructure:
- ModuleAutoloader: PSR-4 autoloading for module-local PHP classes
- ModuleRuntimePageBuilder: symlinks module pages into runtime directory
- ModuleRuntimeAssetPublisher: publishes module CSS/JS to web/modules/
- ModulePermissionSynchronizer: syncs module permissions to DB
- CLI scripts: module-runtime-sync, module-build, module-migrate,
module-permissions-sync, module-assets-sync
- {{userId}} placeholder in SearchDataService for user-scoped search queries
- Component runtime with phased initialization (early/default/late)
- AppContainer.protectExistingBindings() to prevent module→core overwrites
- Architecture tests: ModuleStructureContractTest, CoreTemplateIsolationTest,
FrontendComponentRuntimeContractTest, AppContainerIsolationContractTest
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 22:19:56 +01:00
|
|
|
use MintyPHP\App\AppContainer;
|
2026-03-05 08:26:51 +01:00
|
|
|
use MintyPHP\Repository\Scheduler\ScheduledJobRepositoryInterface;
|
|
|
|
|
use MintyPHP\Repository\Scheduler\ScheduledJobRunRepositoryInterface;
|
|
|
|
|
use MintyPHP\Repository\Scheduler\SchedulerRuntimeRepositoryInterface;
|
2026-03-04 15:56:58 +01:00
|
|
|
use MintyPHP\Repository\Support\DatabaseSessionRepository;
|
refactor(audit): extract audit domain into self-contained module
Move the entire audit subsystem (system audit, API audit, import audit,
user lifecycle audit, frontend telemetry) from core into modules/audit/.
Core decoupling via interface-based injection:
- AuditRecorderInterface replaces SystemAuditService in 10+ core services
- UserLifecycleAuditInterface / ImportAuditInterface for specialized flows
- NullAuditRecorder fallback when audit module is disabled
- ApiBootstrap/ApiResponse use null-safe callable resolvers
Module structure (modules/audit/):
- Manifest with routes, permissions, scheduler jobs, authorization policy
- 9 services, 8 repositories, 6 domain enums, 4 job handlers
- 33 page files, 4 JS files, 8 test files, migration scripts, i18n
Core cleanup:
- OperationsAuthorizationPolicy, UiCapabilityMap, PermissionService
surgically cleaned of audit-specific constants
- Sidebar template cleared of hardcoded audit navigation
- AuditModuleIsolationContractTest ensures no future core→module coupling
All quality gates pass: 1346 tests (19,276 assertions), PHPStan level 5
clean, architecture contracts verified.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 21:12:49 +01:00
|
|
|
use MintyPHP\Service\Audit\AuditRecorderInterface;
|
2026-02-23 12:58:19 +01:00
|
|
|
use MintyPHP\Service\User\UserLifecycleService;
|
|
|
|
|
use MintyPHP\Service\User\UserServicesFactory;
|
|
|
|
|
|
|
|
|
|
class SchedulerServicesFactory
|
|
|
|
|
{
|
|
|
|
|
private ?ScheduleCalculator $scheduleCalculator = null;
|
|
|
|
|
private ?ScheduledJobRegistry $scheduledJobRegistry = null;
|
|
|
|
|
private ?ScheduledJobService $scheduledJobService = null;
|
|
|
|
|
private ?SchedulerRunService $schedulerRunService = null;
|
|
|
|
|
|
2026-03-04 15:56:58 +01:00
|
|
|
public function __construct(
|
|
|
|
|
private readonly UserServicesFactory $userServicesFactory,
|
refactor(audit): extract audit domain into self-contained module
Move the entire audit subsystem (system audit, API audit, import audit,
user lifecycle audit, frontend telemetry) from core into modules/audit/.
Core decoupling via interface-based injection:
- AuditRecorderInterface replaces SystemAuditService in 10+ core services
- UserLifecycleAuditInterface / ImportAuditInterface for specialized flows
- NullAuditRecorder fallback when audit module is disabled
- ApiBootstrap/ApiResponse use null-safe callable resolvers
Module structure (modules/audit/):
- Manifest with routes, permissions, scheduler jobs, authorization policy
- 9 services, 8 repositories, 6 domain enums, 4 job handlers
- 33 page files, 4 JS files, 8 test files, migration scripts, i18n
Core cleanup:
- OperationsAuthorizationPolicy, UiCapabilityMap, PermissionService
surgically cleaned of audit-specific constants
- Sidebar template cleared of hardcoded audit navigation
- AuditModuleIsolationContractTest ensures no future core→module coupling
All quality gates pass: 1346 tests (19,276 assertions), PHPStan level 5
clean, architecture contracts verified.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 21:12:49 +01:00
|
|
|
private readonly AuditRecorderInterface $auditRecorder,
|
2026-03-04 15:56:58 +01:00
|
|
|
private readonly DatabaseSessionRepository $databaseSessionRepository,
|
feat: extend module platform with UI slots, runtime components, CLI tooling and {{userId}} search support
Completes the generic module platform that enables modules to contribute
UI elements, runtime JS components, and search resources without any
core hardcoding.
New generic UI slot types:
- topbar.right_item: module-contributed topbar buttons
- layout.body_end_template: module-contributed dialog/overlay templates
- layout.head_style: module-contributed global CSS
- runtime.component: declarative JS component registration with phase ordering
New infrastructure:
- ModuleAutoloader: PSR-4 autoloading for module-local PHP classes
- ModuleRuntimePageBuilder: symlinks module pages into runtime directory
- ModuleRuntimeAssetPublisher: publishes module CSS/JS to web/modules/
- ModulePermissionSynchronizer: syncs module permissions to DB
- CLI scripts: module-runtime-sync, module-build, module-migrate,
module-permissions-sync, module-assets-sync
- {{userId}} placeholder in SearchDataService for user-scoped search queries
- Component runtime with phased initialization (early/default/late)
- AppContainer.protectExistingBindings() to prevent module→core overwrites
- Architecture tests: ModuleStructureContractTest, CoreTemplateIsolationTest,
FrontendComponentRuntimeContractTest, AppContainerIsolationContractTest
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 22:19:56 +01:00
|
|
|
private readonly SchedulerRepositoryFactory $schedulerRepositoryFactory,
|
|
|
|
|
private readonly AppContainer $appContainer
|
2026-03-05 11:17:42 +01:00
|
|
|
) {
|
|
|
|
|
}
|
2026-03-04 15:56:58 +01:00
|
|
|
|
2026-02-23 12:58:19 +01:00
|
|
|
public function createScheduledJobService(): ScheduledJobService
|
|
|
|
|
{
|
|
|
|
|
return $this->scheduledJobService ??= new ScheduledJobService(
|
|
|
|
|
$this->getScheduledJobRepository(),
|
|
|
|
|
$this->getScheduledJobRunRepository(),
|
|
|
|
|
$this->getScheduledJobRegistry(),
|
|
|
|
|
$this->getScheduleCalculator()
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function createSchedulerRunService(): SchedulerRunService
|
|
|
|
|
{
|
|
|
|
|
return $this->schedulerRunService ??= new SchedulerRunService(
|
|
|
|
|
$this->createScheduledJobService(),
|
|
|
|
|
$this->getScheduledJobRepository(),
|
|
|
|
|
$this->getScheduledJobRunRepository(),
|
|
|
|
|
$this->getSchedulerRuntimeRepository(),
|
|
|
|
|
$this->getScheduledJobRegistry(),
|
2026-03-04 15:56:58 +01:00
|
|
|
$this->getScheduleCalculator(),
|
|
|
|
|
$this->getDatabaseSessionRepository(),
|
refactor(audit): extract audit domain into self-contained module
Move the entire audit subsystem (system audit, API audit, import audit,
user lifecycle audit, frontend telemetry) from core into modules/audit/.
Core decoupling via interface-based injection:
- AuditRecorderInterface replaces SystemAuditService in 10+ core services
- UserLifecycleAuditInterface / ImportAuditInterface for specialized flows
- NullAuditRecorder fallback when audit module is disabled
- ApiBootstrap/ApiResponse use null-safe callable resolvers
Module structure (modules/audit/):
- Manifest with routes, permissions, scheduler jobs, authorization policy
- 9 services, 8 repositories, 6 domain enums, 4 job handlers
- 33 page files, 4 JS files, 8 test files, migration scripts, i18n
Core cleanup:
- OperationsAuthorizationPolicy, UiCapabilityMap, PermissionService
surgically cleaned of audit-specific constants
- Sidebar template cleared of hardcoded audit navigation
- AuditModuleIsolationContractTest ensures no future core→module coupling
All quality gates pass: 1346 tests (19,276 assertions), PHPStan level 5
clean, architecture contracts verified.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 21:12:49 +01:00
|
|
|
$this->getAuditRecorder()
|
2026-02-23 12:58:19 +01:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function createUserLifecycleService(): UserLifecycleService
|
|
|
|
|
{
|
|
|
|
|
return $this->getUserLifecycleService();
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-05 08:26:51 +01:00
|
|
|
private function getScheduledJobRepository(): ScheduledJobRepositoryInterface
|
2026-02-23 12:58:19 +01:00
|
|
|
{
|
2026-03-04 15:56:58 +01:00
|
|
|
return $this->schedulerRepositoryFactory->createScheduledJobRepository();
|
2026-02-23 12:58:19 +01:00
|
|
|
}
|
|
|
|
|
|
2026-03-05 08:26:51 +01:00
|
|
|
private function getScheduledJobRunRepository(): ScheduledJobRunRepositoryInterface
|
2026-02-23 12:58:19 +01:00
|
|
|
{
|
2026-03-04 15:56:58 +01:00
|
|
|
return $this->schedulerRepositoryFactory->createScheduledJobRunRepository();
|
2026-02-23 12:58:19 +01:00
|
|
|
}
|
|
|
|
|
|
2026-03-05 08:26:51 +01:00
|
|
|
private function getSchedulerRuntimeRepository(): SchedulerRuntimeRepositoryInterface
|
2026-02-23 12:58:19 +01:00
|
|
|
{
|
2026-03-04 15:56:58 +01:00
|
|
|
return $this->schedulerRepositoryFactory->createSchedulerRuntimeRepository();
|
2026-02-23 12:58:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private function getScheduleCalculator(): ScheduleCalculator
|
|
|
|
|
{
|
|
|
|
|
return $this->scheduleCalculator ??= new ScheduleCalculator();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private function getUserLifecycleService(): UserLifecycleService
|
|
|
|
|
{
|
2026-03-04 15:56:58 +01:00
|
|
|
return $this->userServicesFactory->createUserLifecycleService();
|
2026-02-23 12:58:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private function getScheduledJobRegistry(): ScheduledJobRegistry
|
|
|
|
|
{
|
2026-03-04 15:56:58 +01:00
|
|
|
return $this->scheduledJobRegistry ??= new ScheduledJobRegistry(
|
|
|
|
|
$this->getUserLifecycleService(),
|
feat: extend module platform with UI slots, runtime components, CLI tooling and {{userId}} search support
Completes the generic module platform that enables modules to contribute
UI elements, runtime JS components, and search resources without any
core hardcoding.
New generic UI slot types:
- topbar.right_item: module-contributed topbar buttons
- layout.body_end_template: module-contributed dialog/overlay templates
- layout.head_style: module-contributed global CSS
- runtime.component: declarative JS component registration with phase ordering
New infrastructure:
- ModuleAutoloader: PSR-4 autoloading for module-local PHP classes
- ModuleRuntimePageBuilder: symlinks module pages into runtime directory
- ModuleRuntimeAssetPublisher: publishes module CSS/JS to web/modules/
- ModulePermissionSynchronizer: syncs module permissions to DB
- CLI scripts: module-runtime-sync, module-build, module-migrate,
module-permissions-sync, module-assets-sync
- {{userId}} placeholder in SearchDataService for user-scoped search queries
- Component runtime with phased initialization (early/default/late)
- AppContainer.protectExistingBindings() to prevent module→core overwrites
- Architecture tests: ModuleStructureContractTest, CoreTemplateIsolationTest,
FrontendComponentRuntimeContractTest, AppContainerIsolationContractTest
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 22:19:56 +01:00
|
|
|
$this->appContainer
|
2026-03-04 15:56:58 +01:00
|
|
|
);
|
2026-02-23 12:58:19 +01:00
|
|
|
}
|
|
|
|
|
|
2026-03-04 15:56:58 +01:00
|
|
|
private function getDatabaseSessionRepository(): DatabaseSessionRepository
|
2026-02-23 12:58:19 +01:00
|
|
|
{
|
2026-03-04 15:56:58 +01:00
|
|
|
return $this->databaseSessionRepository;
|
2026-02-23 12:58:19 +01:00
|
|
|
}
|
2026-03-04 15:56:58 +01:00
|
|
|
|
refactor(audit): extract audit domain into self-contained module
Move the entire audit subsystem (system audit, API audit, import audit,
user lifecycle audit, frontend telemetry) from core into modules/audit/.
Core decoupling via interface-based injection:
- AuditRecorderInterface replaces SystemAuditService in 10+ core services
- UserLifecycleAuditInterface / ImportAuditInterface for specialized flows
- NullAuditRecorder fallback when audit module is disabled
- ApiBootstrap/ApiResponse use null-safe callable resolvers
Module structure (modules/audit/):
- Manifest with routes, permissions, scheduler jobs, authorization policy
- 9 services, 8 repositories, 6 domain enums, 4 job handlers
- 33 page files, 4 JS files, 8 test files, migration scripts, i18n
Core cleanup:
- OperationsAuthorizationPolicy, UiCapabilityMap, PermissionService
surgically cleaned of audit-specific constants
- Sidebar template cleared of hardcoded audit navigation
- AuditModuleIsolationContractTest ensures no future core→module coupling
All quality gates pass: 1346 tests (19,276 assertions), PHPStan level 5
clean, architecture contracts verified.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 21:12:49 +01:00
|
|
|
private function getAuditRecorder(): AuditRecorderInterface
|
2026-03-04 15:56:58 +01:00
|
|
|
{
|
refactor(audit): extract audit domain into self-contained module
Move the entire audit subsystem (system audit, API audit, import audit,
user lifecycle audit, frontend telemetry) from core into modules/audit/.
Core decoupling via interface-based injection:
- AuditRecorderInterface replaces SystemAuditService in 10+ core services
- UserLifecycleAuditInterface / ImportAuditInterface for specialized flows
- NullAuditRecorder fallback when audit module is disabled
- ApiBootstrap/ApiResponse use null-safe callable resolvers
Module structure (modules/audit/):
- Manifest with routes, permissions, scheduler jobs, authorization policy
- 9 services, 8 repositories, 6 domain enums, 4 job handlers
- 33 page files, 4 JS files, 8 test files, migration scripts, i18n
Core cleanup:
- OperationsAuthorizationPolicy, UiCapabilityMap, PermissionService
surgically cleaned of audit-specific constants
- Sidebar template cleared of hardcoded audit navigation
- AuditModuleIsolationContractTest ensures no future core→module coupling
All quality gates pass: 1346 tests (19,276 assertions), PHPStan level 5
clean, architecture contracts verified.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 21:12:49 +01:00
|
|
|
return $this->auditRecorder;
|
2026-03-04 15:56:58 +01:00
|
|
|
}
|
|
|
|
|
|
2026-02-23 12:58:19 +01:00
|
|
|
}
|