forked from fa/breadcrumb-the-shire
Implement handover protocols as a new entity in the helpdesk module, allowing users to create fillable protocol records from admin-defined software product schemas. Key additions: - DB migration (helpdesk_handovers table) with tenant scope - HandoverService with status workflow (draft/in_progress/completed/archived) - Three-tier permissions (view/create/manage) - Two-step creation wizard (Stripe-style assistant) - Grid.js list page with search and status filter - Edit/detail page with aside metadata and status controls - Reusable core autocomplete lookup component (app-lookup-field) - Debitor lookup data endpoint for autocomplete - Dynamic form rendering from schema snapshots - 11 PHPUnit tests for HandoverService - DE+EN i18n translations (48 keys each) Also includes: PHPStan fixes (dead code removal, stale baseline cleanup), software product edit title improvement, fieldset simplification, and Stripe-style hover for schema preview. Workflow: HD-HANDOVERS-001 (.agents/runs/HD-HANDOVERS-001/) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
118 lines
6.0 KiB
PHP
118 lines
6.0 KiB
PHP
<?php
|
|
|
|
namespace MintyPHP\Module\Helpdesk;
|
|
|
|
use MintyPHP\App\AppContainer;
|
|
use MintyPHP\App\Container\ContainerRegistrar;
|
|
use MintyPHP\Http\SessionStoreInterface;
|
|
use MintyPHP\Module\Helpdesk\Service\BcODataGateway;
|
|
use MintyPHP\Module\Helpdesk\Service\BcSoapGateway;
|
|
use MintyPHP\Module\Helpdesk\Service\DebitorDetailService;
|
|
use MintyPHP\Module\Helpdesk\Service\DebitorSearchService;
|
|
use MintyPHP\Module\Helpdesk\Service\EffectiveHelpdeskSettingsService;
|
|
use MintyPHP\Module\Helpdesk\Service\HelpdeskOAuthTokenService;
|
|
use MintyPHP\Module\Helpdesk\Service\HelpdeskSettingsGateway;
|
|
use MintyPHP\Module\Helpdesk\Service\HelpdeskTenantSettingsGateway;
|
|
use MintyPHP\Module\Helpdesk\Repository\HelpdeskTenantSettingsRepository;
|
|
use MintyPHP\Module\Helpdesk\Repository\HelpdeskTokenRepository;
|
|
use MintyPHP\Module\Helpdesk\Service\SoftwareProductService;
|
|
use MintyPHP\Module\Helpdesk\Service\SoftwareProductSyncService;
|
|
use MintyPHP\Module\Helpdesk\Service\SystemRecommendationEngine;
|
|
use MintyPHP\Module\Helpdesk\Service\TicketCommunicationService;
|
|
use MintyPHP\Module\Helpdesk\Handler\SoftwareProductSyncJobHandler;
|
|
use MintyPHP\Module\Helpdesk\Repository\HandoverRepository;
|
|
use MintyPHP\Module\Helpdesk\Repository\SoftwareProductRepository;
|
|
use MintyPHP\Module\Helpdesk\Service\HandoverService;
|
|
use MintyPHP\Service\Access\PermissionService;
|
|
use MintyPHP\Service\Settings\SettingServicesFactory;
|
|
use MintyPHP\Service\Settings\SettingsMetadataGateway;
|
|
|
|
final class HelpdeskContainerRegistrar implements ContainerRegistrar
|
|
{
|
|
public function register(AppContainer $container): void
|
|
{
|
|
$container->set(HelpdeskAuthorizationPolicy::class, static fn (AppContainer $c): HelpdeskAuthorizationPolicy => new HelpdeskAuthorizationPolicy(
|
|
$c->get(PermissionService::class)
|
|
));
|
|
|
|
$container->set(HelpdeskSettingsGateway::class, static fn (AppContainer $c): HelpdeskSettingsGateway => new HelpdeskSettingsGateway(
|
|
$c->get(SettingsMetadataGateway::class),
|
|
$c->get(SettingServicesFactory::class)->createSettingsCryptoGateway()
|
|
));
|
|
|
|
$container->set(HelpdeskTenantSettingsRepository::class, static fn (): HelpdeskTenantSettingsRepository => new HelpdeskTenantSettingsRepository());
|
|
|
|
$container->set(HelpdeskTenantSettingsGateway::class, static fn (AppContainer $c): HelpdeskTenantSettingsGateway => new HelpdeskTenantSettingsGateway(
|
|
$c->get(HelpdeskTenantSettingsRepository::class),
|
|
$c->get(SettingServicesFactory::class)->createSettingsCryptoGateway()
|
|
));
|
|
|
|
$container->set(EffectiveHelpdeskSettingsService::class, static fn (AppContainer $c): EffectiveHelpdeskSettingsService => new EffectiveHelpdeskSettingsService(
|
|
$c->get(HelpdeskSettingsGateway::class),
|
|
$c->get(HelpdeskTenantSettingsGateway::class),
|
|
$c->get(SessionStoreInterface::class)
|
|
));
|
|
|
|
$container->set(BcODataGateway::class, static fn (AppContainer $c): BcODataGateway => new BcODataGateway(
|
|
$c->get(EffectiveHelpdeskSettingsService::class),
|
|
$c->get(HelpdeskOAuthTokenService::class),
|
|
$c->get(SessionStoreInterface::class)
|
|
));
|
|
|
|
$container->set(BcSoapGateway::class, static fn (AppContainer $c): BcSoapGateway => new BcSoapGateway(
|
|
$c->get(EffectiveHelpdeskSettingsService::class),
|
|
$c->get(HelpdeskOAuthTokenService::class),
|
|
$c->get(SessionStoreInterface::class)
|
|
));
|
|
|
|
$container->set(HelpdeskTokenRepository::class, static fn (AppContainer $c): HelpdeskTokenRepository => new HelpdeskTokenRepository(
|
|
$c->get(SettingServicesFactory::class)->createSettingsCryptoGateway()
|
|
));
|
|
|
|
$container->set(HelpdeskOAuthTokenService::class, static fn (AppContainer $c): HelpdeskOAuthTokenService => new HelpdeskOAuthTokenService(
|
|
$c->get(EffectiveHelpdeskSettingsService::class),
|
|
$c->get(HelpdeskTokenRepository::class)
|
|
));
|
|
|
|
$container->set(DebitorSearchService::class, static fn (AppContainer $c): DebitorSearchService => new DebitorSearchService(
|
|
$c->get(BcODataGateway::class),
|
|
$c->get(EffectiveHelpdeskSettingsService::class)
|
|
));
|
|
|
|
$container->set(DebitorDetailService::class, static fn (AppContainer $c): DebitorDetailService => new DebitorDetailService(
|
|
$c->get(BcODataGateway::class),
|
|
$c->get(EffectiveHelpdeskSettingsService::class)
|
|
));
|
|
|
|
$container->set(TicketCommunicationService::class, static fn (AppContainer $c): TicketCommunicationService => new TicketCommunicationService(
|
|
$c->get(BcSoapGateway::class),
|
|
$c->get(BcODataGateway::class)
|
|
));
|
|
|
|
$container->set(SystemRecommendationEngine::class, static fn (): SystemRecommendationEngine => new SystemRecommendationEngine());
|
|
|
|
$container->set(SoftwareProductRepository::class, static fn (): SoftwareProductRepository => new SoftwareProductRepository());
|
|
|
|
$container->set(SoftwareProductSyncService::class, static fn (AppContainer $c): SoftwareProductSyncService => new SoftwareProductSyncService(
|
|
$c->get(BcODataGateway::class),
|
|
$c->get(SoftwareProductRepository::class),
|
|
$c->get(HelpdeskSettingsGateway::class)
|
|
));
|
|
|
|
$container->set(SoftwareProductService::class, static fn (AppContainer $c): SoftwareProductService => new SoftwareProductService(
|
|
$c->get(SoftwareProductRepository::class)
|
|
));
|
|
|
|
$container->set(SoftwareProductSyncJobHandler::class, static fn (AppContainer $c): SoftwareProductSyncJobHandler => new SoftwareProductSyncJobHandler(
|
|
$c->get(SoftwareProductSyncService::class)
|
|
));
|
|
|
|
$container->set(HandoverRepository::class, static fn (): HandoverRepository => new HandoverRepository());
|
|
|
|
$container->set(HandoverService::class, static fn (AppContainer $c): HandoverService => new HandoverService(
|
|
$c->get(HandoverRepository::class),
|
|
$c->get(SoftwareProductService::class)
|
|
));
|
|
}
|
|
}
|