Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions lib/Controller/DeadlineController.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,18 @@ class DeadlineController extends Controller
/**
* Constructor.
*
* @param string $appName App id.
* @param IRequest $request Request.
* @param DeadlineService $termijn Termijn service.
* @param DeadlinePauseService $pause Pause service.
* @param DeadlineExtensionService $extension Extension service.
* @param IUserSession $userSession User session.
* @param LoggerInterface $logger Logger.
* @param string $appName App id.
* @param IRequest $request Request.
* @param DeadlineService $deadlineService Deadline service.
* @param DeadlinePauseService $pause Pause service.
* @param DeadlineExtensionService $extension Extension service.
* @param IUserSession $userSession User session.
* @param LoggerInterface $logger Logger.
*/
public function __construct(
string $appName,
IRequest $request,
private readonly DeadlineService $termijn,
private readonly DeadlineService $deadlineService,
private readonly DeadlinePauseService $pause,
private readonly DeadlineExtensionService $extension,
private readonly IUserSession $userSession,
Expand Down Expand Up @@ -127,7 +127,7 @@ public function create(): JSONResponse
}

try {
$row = $this->termijn->createTermijnInstance($zaakId, $zaaktype);
$row = $this->deadlineService->createTermijnInstance($zaakId, $zaaktype);
return new JSONResponse($row, Http::STATUS_CREATED);
} catch (Throwable $e) {
return $this->error(e: $e, log: 'Termijn create failed');
Expand All @@ -152,7 +152,7 @@ public function show(string $id): JSONResponse
return $denied;
}

$row = $this->termijn->getTermijnInstance($id);
$row = $this->deadlineService->getTermijnInstance($id);
if ($row === null) {
return $this->notFound(msg: 'TermijnInstance not found: '.$id);
}
Expand Down Expand Up @@ -293,7 +293,7 @@ public function complete(string $id): JSONResponse
}

try {
$row = $this->termijn->markTermijnCompleted(
$row = $this->deadlineService->markTermijnCompleted(
$id,
$completedAt,
$documentLink
Expand Down
10 changes: 5 additions & 5 deletions lib/Listener/DeadlineCaseCreatedListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ class DeadlineCaseCreatedListener implements IEventListener
/**
* Constructor.
*
* @param DeadlineService $termijnService DeadlineService.
* @param ObjectSchemaSlugResolver $slugResolver Schema id-to-slug resolver.
* @param LoggerInterface $logger Logger.
* @param DeadlineService $deadlineService DeadlineService.
* @param ObjectSchemaSlugResolver $slugResolver Schema id-to-slug resolver.
* @param LoggerInterface $logger Logger.
*/
public function __construct(
private readonly DeadlineService $termijnService,
private readonly DeadlineService $deadlineService,
private readonly ObjectSchemaSlugResolver $slugResolver,
private readonly LoggerInterface $logger,
) {
Expand Down Expand Up @@ -89,7 +89,7 @@ public function handle(Event $event): void
}

try {
$this->termijnService->createTermijnInstance($caseId, $zaaktype);
$this->deadlineService->createTermijnInstance($caseId, $zaaktype);
} catch (\Throwable $e) {
// A case without a coupled definition is permissible — debug log only.
$this->logger->debug(
Expand Down
12 changes: 6 additions & 6 deletions lib/Service/DeadlineDailyScanService.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ class DeadlineDailyScanService
* Constructor.
*
* @param SettingsService $settingsService Settings service.
* @param DeadlineService $termijnService DeadlineService.
* @param DeadlineService $deadlineService DeadlineService.
* @param DeadlineEscalationService $escalationService Escalation service.
* @param LoggerInterface $logger Logger.
* @param DwangsomCalculationService|null $dwangsomService Dwangsom calculation service.
*/
public function __construct(
private readonly SettingsService $settingsService,
private readonly DeadlineService $termijnService,
private readonly DeadlineService $deadlineService,
private readonly DeadlineEscalationService $escalationService,
private readonly LoggerInterface $logger,
private readonly ?DwangsomCalculationService $dwangsomService=null,
Expand Down Expand Up @@ -228,7 +228,7 @@ private function handlePauseExpiry(array $row, string $rowId, DateTimeImmutable
$pauseEnd = (string) ($row['pauzeDeadline'] ?? '');
if ($pauseEnd !== '' && $pauseEnd < $now->format('Y-m-d')) {
$counts['pauseExpired']++;
$this->termijnService->recordEvent(
$this->deadlineService->recordEvent(
termijnInstanceId: $rowId,
type: 'pauze-verlopen',
grondslag: 'AWB 4:5',
Expand Down Expand Up @@ -271,8 +271,8 @@ private function calculateDaysLeft(string $deadline, DateTimeImmutable $now): in
private function recordOverschrijding(string $rowId, DateTimeImmutable $now, array &$counts): void
{
$counts['overschreden']++;
$this->termijnService->updateTermijnInstance($rowId, ['status' => 'overschreden']);
$this->termijnService->recordEvent(
$this->deadlineService->updateTermijnInstance($rowId, ['status' => 'overschreden']);
$this->deadlineService->recordEvent(
termijnInstanceId: $rowId,
type: 'overschreden',
grondslag: 'AWB 4:13',
Expand All @@ -299,7 +299,7 @@ private function escalateThreshold(string $rowId, int $daysLeft, array &$counts)
}

// Re-read instance to pick up the just-updated status/notificatiesVerstuurd.
$latest = $this->termijnService->getTermijnInstance($rowId);
$latest = $this->deadlineService->getTermijnInstance($rowId);
if ($latest === null) {
return;
}
Expand Down
8 changes: 4 additions & 4 deletions lib/Service/DeadlineEscalationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ class DeadlineEscalationService
/**
* Constructor.
*
* @param DeadlineService $termijnService DeadlineService for instance lookup/update.
* @param LoggerInterface $logger Logger.
* @param DeadlineService $deadlineService DeadlineService for instance lookup/update.
* @param LoggerInterface $logger Logger.
*/
public function __construct(
private readonly DeadlineService $termijnService,
private readonly DeadlineService $deadlineService,
private readonly LoggerInterface $logger,
) {
}//end __construct()
Expand Down Expand Up @@ -148,7 +148,7 @@ public function notifyThreshold(array $instance, int $threshold): bool

// Mark threshold as sent (duplicate suppression).
$alreadySent[] = $threshold;
$this->termijnService->updateTermijnInstance(
$this->deadlineService->updateTermijnInstance(
$instanceId,
['notificatiesVerstuurd' => array_values(array_unique(array_map('intval', $alreadySent)))]
);
Expand Down
14 changes: 7 additions & 7 deletions lib/Service/DeadlineExtensionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ class DeadlineExtensionService
/**
* Constructor.
*
* @param DeadlineService $termijnService DeadlineService.
* @param DeadlineService $deadlineService DeadlineService.
*/
public function __construct(
private readonly DeadlineService $termijnService,
private readonly DeadlineService $deadlineService,
) {
}//end __construct()

Expand Down Expand Up @@ -152,7 +152,7 @@ private function applyExtension(
): array {
$this->assertExtensionInput(motivering: $motivering, newEinddatum: $newEinddatum);

$instance = $this->termijnService->getTermijnInstance($termijnInstanceId);
$instance = $this->deadlineService->getTermijnInstance($termijnInstanceId);
if ($instance === null) {
throw new RuntimeException('TermijnInstance not found: '.$termijnInstanceId);
}
Expand All @@ -163,7 +163,7 @@ private function applyExtension(
$consumed = (int) ($instance['aantalVerlengingen'] ?? 0);
$dagenImpact = $this->calculateDagenImpact(current: $current, newEinddatum: $newEinddatum);

$updated = $this->termijnService->updateTermijnInstance(
$updated = $this->deadlineService->updateTermijnInstance(
$termijnInstanceId,
[
'einddatumActueel' => $newEinddatum,
Expand All @@ -174,7 +174,7 @@ private function applyExtension(

$context = $this->resolveExtensionContext(mode: $mode);

$this->termijnService->recordEvent(
$this->deadlineService->recordEvent(
termijnInstanceId: $termijnInstanceId,
type: 'verleng',
grondslag: $context['grondslag'],
Expand Down Expand Up @@ -301,10 +301,10 @@ private function resolveMaxExtensions(array $instance): int
// is the data we actually need.
$svcDef = null;
try {
$reflection = new ReflectionClass($this->termijnService);
$reflection = new ReflectionClass($this->deadlineService);
if ($reflection->hasProperty('definitieCache') === true) {
$prop = $reflection->getProperty('definitieCache');
$cache = $prop->getValue($this->termijnService);
$cache = $prop->getValue($this->deadlineService);
if (is_array($cache) === true) {
foreach ($cache as $row) {
if (is_array($row) === true && (string) ($row['id'] ?? '') === $defId) {
Expand Down
12 changes: 6 additions & 6 deletions lib/Service/DeadlineNotificationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ class DeadlineNotificationService
/**
* Constructor.
*
* @param DeadlineService $termijnService Termijn service.
* @param BerichtenboxRoutingService $router Router (procest notification-router).
* @param LoggerInterface $logger Logger.
* @param IJobList|null $jobList Optional job list for async dispatch.
* @param DeadlineService $deadlineService Termijn service.
* @param BerichtenboxRoutingService $router Router (procest notification-router).
* @param LoggerInterface $logger Logger.
* @param IJobList|null $jobList Optional job list for async dispatch.
*/
public function __construct(
private readonly DeadlineService $termijnService,
private readonly DeadlineService $deadlineService,
private readonly BerichtenboxRoutingService $router,
private readonly LoggerInterface $logger,
private readonly ?IJobList $jobList=null,
Expand Down Expand Up @@ -132,7 +132,7 @@ public function sendTermijnNotification(
throw new InvalidArgumentException('Unknown template: '.$type);
}

$instance = $this->termijnService->getTermijnInstance($termijnInstanceId);
$instance = $this->deadlineService->getTermijnInstance($termijnInstanceId);
$payload = $this->renderTemplate(type: $type, instance: $instance ?? [], context: $context);

$payload['recipient'] = $recipientUserId;
Expand Down
16 changes: 8 additions & 8 deletions lib/Service/DeadlinePauseService.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ class DeadlinePauseService
/**
* Constructor.
*
* @param DeadlineService $termijnService DeadlineService.
* @param DeadlineService $deadlineService DeadlineService.
*/
public function __construct(
private readonly DeadlineService $termijnService,
private readonly DeadlineService $deadlineService,
) {
}//end __construct()

Expand Down Expand Up @@ -76,7 +76,7 @@ public function registerPauze(
throw new RuntimeException('Pause duration must be positive (AWB 4:5)');
}

$instance = $this->termijnService->getTermijnInstance($termijnInstanceId);
$instance = $this->deadlineService->getTermijnInstance($termijnInstanceId);
if ($instance === null) {
throw new RuntimeException('TermijnInstance not found: '.$termijnInstanceId);
}
Expand All @@ -90,7 +90,7 @@ public function registerPauze(
$newEnd = $current->modify('+'.$duurDagen.' days')->format('Y-m-d');
$pauseEnd = $now->modify('+'.$duurDagen.' days')->format('Y-m-d');

$updated = $this->termijnService->updateTermijnInstance(
$updated = $this->deadlineService->updateTermijnInstance(
$termijnInstanceId,
[
'einddatumActueel' => $newEnd,
Expand All @@ -101,7 +101,7 @@ public function registerPauze(
]
);

$this->termijnService->recordEvent(
$this->deadlineService->recordEvent(
termijnInstanceId: $termijnInstanceId,
type: 'pauze',
grondslag: 'AWB 4:5',
Expand Down Expand Up @@ -134,7 +134,7 @@ public function resumeAfterPauze(string $termijnInstanceId, ?DateTimeImmutable $
{
$aanvullingDatum = ($aanvullingDatum ?? new DateTimeImmutable());

$instance = $this->termijnService->getTermijnInstance($termijnInstanceId);
$instance = $this->deadlineService->getTermijnInstance($termijnInstanceId);
if ($instance === null) {
throw new RuntimeException('TermijnInstance not found: '.$termijnInstanceId);
}
Expand All @@ -155,7 +155,7 @@ public function resumeAfterPauze(string $termijnInstanceId, ?DateTimeImmutable $
$current = new DateTimeImmutable((string) ($instance['einddatumActueel'] ?? $aanvullingDatum->format('Y-m-d')));
$newEnd = $current->modify('-'.$unused.' days')->format('Y-m-d');

$updated = $this->termijnService->updateTermijnInstance(
$updated = $this->deadlineService->updateTermijnInstance(
$termijnInstanceId,
[
'einddatumActueel' => $newEnd,
Expand All @@ -164,7 +164,7 @@ public function resumeAfterPauze(string $termijnInstanceId, ?DateTimeImmutable $
]
);

$this->termijnService->recordEvent(
$this->deadlineService->recordEvent(
termijnInstanceId: $termijnInstanceId,
type: 'hervat',
grondslag: 'AWB 4:15',
Expand Down
8 changes: 4 additions & 4 deletions lib/Service/DwangsomBezwaarService.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ class DwangsomBezwaarService
* Constructor.
*
* @param SettingsService $settingsService Settings.
* @param DeadlineService $termijnService Termijn service for events.
* @param DeadlineService $deadlineService Termijn service for events.
* @param LoggerInterface $logger Logger.
*/
public function __construct(
private readonly SettingsService $settingsService,
private readonly DeadlineService $termijnService,
private readonly DeadlineService $deadlineService,
private readonly LoggerInterface $logger,
) {
}//end __construct()
Expand Down Expand Up @@ -123,7 +123,7 @@ public function registerBezwaar(string $berekeningId, string $grondslag, string
// Record event on termijn.
$instanceId = (string) ($berekening['termijnInstance'] ?? '');
if ($instanceId !== '') {
$this->termijnService->recordEvent(
$this->deadlineService->recordEvent(
termijnInstanceId: $instanceId,
type: 'bezwaar-ingediend',
grondslag: $grondslag,
Expand Down Expand Up @@ -207,7 +207,7 @@ public function resolveBezwaar(string $berekeningId, int $newBedragCents, string

$instanceId = (string) ($berekening['termijnInstance'] ?? '');
if ($instanceId !== '') {
$this->termijnService->recordEvent(
$this->deadlineService->recordEvent(
termijnInstanceId: $instanceId,
type: 'bezwaar-opgelost',
grondslag: $grondslag,
Expand Down
12 changes: 6 additions & 6 deletions lib/Service/IngebrekestellingService.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ class IngebrekestellingService
* Constructor.
*
* @param SettingsService $settingsService Settings service.
* @param DeadlineService $termijnService DeadlineService.
* @param DeadlineService $deadlineService DeadlineService.
* @param LoggerInterface $logger Logger.
*/
public function __construct(
private readonly SettingsService $settingsService,
private readonly DeadlineService $termijnService,
private readonly DeadlineService $deadlineService,
private readonly LoggerInterface $logger,
) {
}//end __construct()
Expand All @@ -79,7 +79,7 @@ public function registerIngebrekestelling(
string $kanaal,
string $documentLink=''
): array {
$instance = $this->termijnService->getTermijnInstance($termijnInstanceId);
$instance = $this->deadlineService->getTermijnInstance($termijnInstanceId);
if ($instance === null) {
throw new RuntimeException('TermijnInstance not found: '.$termijnInstanceId);
}
Expand Down Expand Up @@ -158,7 +158,7 @@ private function startDwangsomBerekening(
string $kanaal,
string $documentLink
): array {
$this->termijnService->updateTermijnInstance(
$this->deadlineService->updateTermijnInstance(
$termijnInstanceId,
['relevantIngbrekes' => $ingebrekestellingId]
);
Expand Down Expand Up @@ -187,7 +187,7 @@ private function startDwangsomBerekening(
]
);

$this->termijnService->recordEvent(
$this->deadlineService->recordEvent(
termijnInstanceId: $termijnInstanceId,
type: 'ingebrekestelling-ontvangen',
grondslag: 'AWB 4:17',
Expand All @@ -197,7 +197,7 @@ private function startDwangsomBerekening(
documentLink: $documentLink,
);

$this->termijnService->recordEvent(
$this->deadlineService->recordEvent(
termijnInstanceId: $termijnInstanceId,
type: 'dwangsom-gestart',
grondslag: 'AWB 4:17',
Expand Down
Loading