diff --git a/appinfo/info.xml b/appinfo/info.xml index ee8273820..b97f14290 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -120,6 +120,17 @@ Vrij en open source onder de EUPL-1.2-licentie. + + OCA\Procest\Repair\RenameDutchSchemaSlugs OCA\Procest\Repair\InitializeSettings OCA\Procest\Repair\LoadDefaultZgwMappings OCA\Procest\Repair\SeedBezwaarBeroepData diff --git a/lib/Controller/ContactMomentController.php b/lib/Controller/ContactMomentController.php index 54e1221e7..044f11b8b 100644 --- a/lib/Controller/ContactMomentController.php +++ b/lib/Controller/ContactMomentController.php @@ -98,7 +98,7 @@ public function create(): JSONResponse { } $data = [ - 'kanaal' => (string)$this->request->getParam('kanaal', ''), + 'notificationChannel' => (string)$this->request->getParam('notificationChannel', ''), 'direction' => (string)$this->request->getParam('direction', 'inbound'), 'callerIdentification' => (string)$this->request->getParam('callerIdentification', ''), 'nature' => (string)$this->request->getParam('nature', 'informatieverzoek'), diff --git a/lib/Controller/DwangsomController.php b/lib/Controller/DwangsomController.php index 9e18a8c2c..8c7dc3c49 100644 --- a/lib/Controller/DwangsomController.php +++ b/lib/Controller/DwangsomController.php @@ -109,7 +109,7 @@ private function denyUnlessMayAccess(string $calculationId, bool $mutation): ?JS $caseId = $this->owningCase->resolveVia( objectId: $calculationId, schemaKey: 'dwangsom_berekening_schema', - linkField: 'termijnInstance', + linkField: 'deadlineInstance', viaSchemaKey: 'termijn_instance_schema', caseField: 'case' ); diff --git a/lib/Controller/NoticeOfDefaultController.php b/lib/Controller/NoticeOfDefaultController.php index f628bf9ed..a8b8ae0a9 100644 --- a/lib/Controller/NoticeOfDefaultController.php +++ b/lib/Controller/NoticeOfDefaultController.php @@ -101,7 +101,7 @@ public function register(): JSONResponse { } $instanceId = (string)($body['termijnInstanceId'] ?? ''); - $channel = (string)($body['kanaal'] ?? ''); + $channel = (string)($body['notificationChannel'] ?? ''); $whenStr = (string)($body['receiptDate'] ?? ''); $documentLink = (string)($body['documentLink'] ?? ''); if ($instanceId === '' || $channel === '' || $whenStr === '') { diff --git a/lib/Controller/ParafeerActieController.php b/lib/Controller/ParafeerActieController.php index fb356f6c5..d2fca87b4 100644 --- a/lib/Controller/ParafeerActieController.php +++ b/lib/Controller/ParafeerActieController.php @@ -88,7 +88,7 @@ public function create(): JSONResponse { try { $data = $this->getRequestBody(); - $proposalId = (string)($data['voorstel'] ?? ''); + $proposalId = (string)($data['proposal'] ?? ''); if ($proposalId === '') { return new JSONResponse( ['message' => 'voorstel is required'], @@ -140,7 +140,7 @@ public function index(): JSONResponse { } try { - $proposalId = (string)($this->request->getParam('voorstel') ?? ''); + $proposalId = (string)($this->request->getParam('proposal') ?? ''); if ($proposalId === '') { return new JSONResponse( ['message' => 'voorstel is required'], diff --git a/lib/Controller/ParaferingAuditExportController.php b/lib/Controller/ParaferingAuditExportController.php index 901c5ad3c..20cdabb3f 100644 --- a/lib/Controller/ParaferingAuditExportController.php +++ b/lib/Controller/ParaferingAuditExportController.php @@ -130,7 +130,7 @@ public function export(string $id, string $format = 'json'): JSONResponse { } catch (Throwable $e) { $this->logger->error( 'Procest: parafering audit export failed', - ['voorstel' => $id, 'exception' => $e->getMessage()], + ['proposal' => $id, 'exception' => $e->getMessage()], ); return new JSONResponse( @@ -224,7 +224,7 @@ private function resolveProposalOnderwerp(string $proposalId): ?string { } catch (Throwable $e) { $this->logger->warning( 'Procest: failed to resolve voorstel onderwerp for export', - ['voorstel' => $proposalId, 'exception' => $e->getMessage()], + ['proposal' => $proposalId, 'exception' => $e->getMessage()], ); return null; diff --git a/lib/Cron/OriDataQualityCheck.php b/lib/Cron/OriDataQualityCheck.php index 5101827bb..12c3bd875 100644 --- a/lib/Cron/OriDataQualityCheck.php +++ b/lib/Cron/OriDataQualityCheck.php @@ -246,14 +246,14 @@ private function checkRaadsledenReferenceIntegrity(object $objectService): array } try { - $politicalGroup = $this->findObjectAsArray( + $fractie = $this->findObjectAsArray( objectService: $objectService, register: 'ori', schema: 'fractie', id: $politicalGroupRef ); - if ($politicalGroup === null) { + if ($fractie === null) { $issues[] = [ 'schema' => 'raadslid', 'slug' => $rlSlug, diff --git a/lib/Listener/ApprovalStepNotificationListener.php b/lib/Listener/ApprovalStepNotificationListener.php index bd0be0115..58e52bdfd 100644 --- a/lib/Listener/ApprovalStepNotificationListener.php +++ b/lib/Listener/ApprovalStepNotificationListener.php @@ -223,7 +223,7 @@ private function loadProposal(string $objectUuid): array { } catch (Throwable $e) { $this->logger->warning( 'Procest: could not load voorstel for approval notification', - ['voorstel' => $objectUuid, 'exception' => $e->getMessage()] + ['proposal' => $objectUuid, 'exception' => $e->getMessage()] ); } diff --git a/lib/Listener/ParaferingAuditListener.php b/lib/Listener/ParaferingAuditListener.php index 9f1a1a70c..423d15852 100644 --- a/lib/Listener/ParaferingAuditListener.php +++ b/lib/Listener/ParaferingAuditListener.php @@ -84,7 +84,7 @@ public function handle(Event $event): void { if ($object === null) { $this->logger->warning( 'Procest: ParaferingAuditListener could not resolve voorstel ObjectEntity; audit entry skipped', - ['voorstel' => $event->getVoorstelId()], + ['proposal' => $event->getVoorstelId()], ); return; } @@ -104,7 +104,7 @@ public function handle(Event $event): void { $this->logger->error( 'Procest: ParaferingAuditListener failed', [ - 'voorstel' => $event->getVoorstelId(), + 'proposal' => $event->getVoorstelId(), 'action' => $event->getAction(), 'exception' => $e->getMessage(), ], diff --git a/lib/Repair/RenameDutchColumns.php b/lib/Repair/RenameDutchColumns.php index 374c0ef2b..4ed72a639 100644 --- a/lib/Repair/RenameDutchColumns.php +++ b/lib/Repair/RenameDutchColumns.php @@ -539,6 +539,14 @@ class RenameDutchColumns implements IRepairStep { 'wachtwoord_kluis_ref' => 'password_vault_ref', 'zaak_identificatie' => 'case_identification', 'zaak_identificatie_strategie' => 'case_identification_strategy', + 'avg_classificatie' => 'gdpr_classification', + 'catalogus' => 'catalog', + 'dwangsom_berekening' => 'penalty_payment_calculation', + 'ingebrekestelling' => 'notice_of_default', + 'kanaal' => 'notification_channel', + 'termijn_definitie' => 'deadline_definition', + 'termijn_instance' => 'deadline_instance', + 'voorstel' => 'proposal', ]; /** diff --git a/lib/Repair/RenameDutchSchemaSlugDecisions.php b/lib/Repair/RenameDutchSchemaSlugDecisions.php new file mode 100644 index 000000000..bfe011a98 --- /dev/null +++ b/lib/Repair/RenameDutchSchemaSlugDecisions.php @@ -0,0 +1,157 @@ + + * @copyright 2026 Conduction B.V. + * @license EUPL-1.2 https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12 + * @link https://www.conduction.nl + * + * SPDX-FileCopyrightText: 2026 Conduction B.V. + * SPDX-License-Identifier: EUPL-1.2 + */ + +declare(strict_types=1); + +namespace OCA\Procest\Repair; + +/** + * Pure predicates for the Dutch-to-English schema slug migration. + * + * @spec exclude No canonical spec covers the Dutch-to-English vocabulary + * migration. Pointing this at an existing spec would report conformance to a + * requirement that says nothing about it. + */ +class RenameDutchSchemaSlugDecisions { + + /** + * Decide which slugs may be renamed, given what the install actually holds. + * + * Returns the renames in the order they must be applied, plus the ones + * refused and why. Two schemas cannot share a slug, so a target that is + * already present means BOTH are left alone: merging them is a decision + * about data, not a rename. + * + * The `$existing` set is updated as it goes, so a rename earlier in the map + * is visible to the collision check of a later one — otherwise two entries + * targeting the same name would both look safe. + * + * @param array $map Old slug => new slug. + * @param array $existing Slugs currently present. + * + * @return array{renames: array, refused: array} + * + * @spec exclude No canonical spec covers the Dutch-to-English vocabulary + * migration. Pointing this at an existing spec would report conformance to a + * requirement that says nothing about it. + */ + public function plan(array $map, array $existing): array { + $renames = []; + $refused = []; + + foreach ($map as $old => $new) { + if (in_array($old, $existing, true) === false) { + // Not on this install — not a refusal, just nothing to do. + continue; + } + + if (in_array($new, $existing, true) === true) { + $refused[$old] = sprintf("target slug '%s' already exists", $new); + continue; + } + + $renames[$old] = $new; + $existing[] = $new; + } + + return [ + 'renames' => $renames, + 'refused' => $refused, + ]; + }//end plan() + + /** + * Pull the schema ids out of the registers' `schemas` JSON column. + * + * The column is JSON, and a register row can carry null, a malformed value + * or a list with non-numeric entries. Every one of those must yield "no ids" + * rather than a fatal, because this runs inside a repair step where an + * exception aborts the upgrade. + * + * @param array> $rows Register rows. + * + * @return array Distinct schema ids. + * + * @spec exclude No canonical spec covers the Dutch-to-English vocabulary + * migration. Pointing this at an existing spec would report conformance to a + * requirement that says nothing about it. + */ + public function schemaIdsFrom(array $rows): array { + $ids = []; + + foreach ($rows as $row) { + $decoded = json_decode((string)($row['schemas'] ?? '[]'), true); + if (is_array($decoded) === false) { + continue; + } + + foreach ($decoded as $id) { + if (is_numeric($id) === true) { + $ids[] = (int)$id; + } + } + } + + return array_values(array_unique($ids)); + }//end schemaIdsFrom() + + /** + * Build the `?,?,?` placeholder list for an IN clause. + * + * Trivial, and here rather than inline because the step builds one three + * times and a mismatch between the placeholder count and the bound + * parameters is the kind of error that only shows up at runtime, inside a + * repair step, on somebody else's install. + * + * @param int $count Number of bound parameters. + * + * @return string The placeholder list. + * + * @spec exclude No canonical spec covers the Dutch-to-English vocabulary + * migration. Pointing this at an existing spec would report conformance to a + * requirement that says nothing about it. + */ + public function placeholders(int $count): string { + return implode(',', array_fill(0, max(0, $count), '?')); + }//end placeholders() + /** + * Pull the slugs out of schema rows. + * + * Sibling of schemaIdsFrom(), and defensive for the same reason: a row with + * a null slug must yield an empty string rather than a TypeError inside a + * repair step, where an exception aborts the upgrade. + * + * @param array> $rows Schema rows. + * + * @return array The slugs. + * + * @spec exclude No canonical spec covers the Dutch-to-English vocabulary + * migration. Pointing this at an existing spec would report conformance to a + * requirement that says nothing about it. + */ + public function slugsFrom(array $rows): array { + return array_map(static fn (array $row): string => (string)($row['slug'] ?? ''), $rows); + }//end slugsFrom() +}//end class diff --git a/lib/Repair/RenameDutchSchemaSlugs.php b/lib/Repair/RenameDutchSchemaSlugs.php new file mode 100644 index 000000000..8d3b02b54 --- /dev/null +++ b/lib/Repair/RenameDutchSchemaSlugs.php @@ -0,0 +1,245 @@ + bezwaar (lifecycle + * record) -> bezwaar.case -> objection (filed on that case)`, and SettingsService + * carries separate `bezwaar_schema` and `objection_schema` keys. Naming the + * lifecycle record in English is a design decision, not a translation. + * + * @category Repair + * @package OCA\Procest\Repair + * @author Conduction Development Team + * @copyright 2026 Conduction B.V. + * @license EUPL-1.2 https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12 + * @link https://procest.nl + * + * SPDX-License-Identifier: EUPL-1.2 + * SPDX-FileCopyrightText: 2026 Conduction B.V. + */ + +declare(strict_types=1); + +namespace OCA\Procest\Repair; + +use OCP\DB\Exception; +use OCP\IDBConnection; +use OCP\Migration\IOutput; +use OCP\Migration\IRepairStep; +use Psr\Log\LoggerInterface; + +/** + * Renames Dutch schema slugs on the rows the import will match against. + * + * @spec exclude No canonical spec covers the Dutch-to-English vocabulary + * migration. Pointing this at an existing spec would report conformance to a + * requirement that says nothing about it. + */ +class RenameDutchSchemaSlugs implements IRepairStep { + + /** + * Old slug => new slug, for schemas this app owns. + * + * Targets are read off each schema's own English title where it had one: + * `catalogus` was already titled "Catalog", `voorstel` "Proposal", `kanaal` + * "Notification Channel". + * + * The `ori` register's schemas are deliberately ABSENT. decidesk already + * owns the canonical Popolo-shaped schemas — Person, Membership, Post, + * Meeting, Vote, VotingRound, AgendaItem, GovernanceBody — extended with + * schema.org, plus an OriController/OriSerializer that maps them onto ORI. + * procest's `ori` register duplicates that and should be REMOVED rather than + * renamed: renaming would cement a structure that is going away, and mint + * names that collide conceptually with decidesk's canonical ones. + * + * @var array + */ + public const SLUG_MAP = [ + 'avgClassificatie' => 'gdprClassification', + 'catalogus' => 'catalog', + 'dwangsomBerekening' => 'penaltyPaymentCalculation', + 'ingebrekestelling' => 'noticeOfDefault', + 'kanaal' => 'notificationChannel', + 'termijnDefinitie' => 'deadlineDefinition', + 'termijnInstance' => 'deadlineInstance', + 'voorstel' => 'proposal', + ]; + + /** + * Registers whose schemas are in scope. + * + * @var array + */ + private const REGISTER_SLUGS = ['procest']; + + /** + * Constructor. + * + * @param IDBConnection $db Database connection. + * @param LoggerInterface $logger Logger. + * @param RenameDutchSchemaSlugDecisions $decisions The pure predicates. + * + * @spec exclude No canonical spec covers the Dutch-to-English vocabulary + * migration. Pointing this at an existing spec would report conformance to a + * requirement that says nothing about it. + */ + public function __construct( + private readonly IDBConnection $db, + private readonly LoggerInterface $logger, + private readonly RenameDutchSchemaSlugDecisions $decisions = new RenameDutchSchemaSlugDecisions(), + ) { + }//end __construct() + + /** + * Step name shown by `occ maintenance:repair`. + * + * @return string + * + * @spec exclude No canonical spec covers the Dutch-to-English vocabulary + * migration. Pointing this at an existing spec would report conformance to a + * requirement that says nothing about it. + */ + public function getName(): string { + return 'Rename Dutch Procest schema slugs'; + }//end getName() + + /** + * Rename the slugs on this app's existing schema rows. + * + * @param IOutput $output Repair output. + * + * @return void + * + * @spec exclude No canonical spec covers the Dutch-to-English vocabulary + * migration. Pointing this at an existing spec would report conformance to a + * requirement that says nothing about it. + */ + public function run(IOutput $output): void { + $schemaIds = $this->inScopeSchemaIds(); + if ($schemaIds === []) { + $output->info('RenameDutchSchemaSlugs: no Procest registers on this install; nothing to do.'); + return; + } + + $existing = $this->slugsOf(schemaIds: $schemaIds); + $plan = $this->decisions->plan(map: self::SLUG_MAP, existing: $existing); + + foreach ($plan['refused'] as $old => $why) { + $this->logger->warning( + 'RenameDutchSchemaSlugs: ' . $why . '; renaming neither.', + ['old' => $old] + ); + } + + $renamed = 0; + foreach ($plan['renames'] as $old => $new) { + if ($this->renameSlug(old: $old, new: $new, schemaIds: $schemaIds) === true) { + $renamed++; + } + } + + $output->info( + sprintf( + 'RenameDutchSchemaSlugs: %d slug(s) renamed, %d refused.', + $renamed, + count($plan['refused']) + ) + ); + }//end run() + + /** + * Resolve the schema ids belonging to this app's registers. + * + * @return array + */ + private function inScopeSchemaIds(): array { + $placeholders = $this->decisions->placeholders(count: count(self::REGISTER_SLUGS)); + + try { + $rows = $this->db->executeQuery( + 'SELECT schemas FROM `*PREFIX*openregister_registers` WHERE slug IN (' . $placeholders . ')', + self::REGISTER_SLUGS + )->fetchAll(); + } catch (Exception $e) { + $this->logger->warning( + 'RenameDutchSchemaSlugs: could not resolve the registers; skipping.', + ['exception' => $e->getMessage()] + ); + return []; + } + + return $this->decisions->schemaIdsFrom(rows: $rows); + }//end inScopeSchemaIds() + + /** + * Read the slugs currently held by the given schemas. + * + * @param array $schemaIds Schema ids to read. + * + * @return array + */ + private function slugsOf(array $schemaIds): array { + $placeholders = $this->decisions->placeholders(count: count($schemaIds)); + + try { + $rows = $this->db->executeQuery( + 'SELECT slug FROM `*PREFIX*openregister_schemas` WHERE id IN (' . $placeholders . ')', + array_map(static fn (int $id): string => (string)$id, $schemaIds) + )->fetchAll(); + } catch (Exception $e) { + $this->logger->warning( + 'RenameDutchSchemaSlugs: could not read schema slugs; skipping.', + ['exception' => $e->getMessage()] + ); + return []; + } + + return $this->decisions->slugsFrom(rows: $rows); + }//end slugsOf() + + /** + * Rename one slug, scoped to this app's schemas. + * + * @param string $old Current slug. + * @param string $new Replacement slug. + * @param array $schemaIds Schema ids in scope. + * + * @return bool True when the row was updated. + */ + private function renameSlug(string $old, string $new, array $schemaIds): bool { + $placeholders = $this->decisions->placeholders(count: count($schemaIds)); + + try { + $this->db->executeStatement( + 'UPDATE `*PREFIX*openregister_schemas` SET slug = ? WHERE slug = ? AND id IN (' . $placeholders . ')', + array_merge([$new, $old], array_map(static fn (int $id): string => (string)$id, $schemaIds)) + ); + } catch (Exception $e) { + $this->logger->warning( + 'RenameDutchSchemaSlugs: slug rename failed.', + ['old' => $old, 'new' => $new, 'exception' => $e->getMessage()] + ); + return false; + } + + return true; + }//end renameSlug() +}//end class diff --git a/lib/Service/AdviceDelegationService.php b/lib/Service/AdviceDelegationService.php index 652d001cf..bcb77b9f5 100644 --- a/lib/Service/AdviceDelegationService.php +++ b/lib/Service/AdviceDelegationService.php @@ -116,7 +116,7 @@ public function raiseVoorstelBesluit(string $proposalId, array $payload = []): s externalReference: (string)($payload['externalReference'] ?? $proposalId), subject: [ 'subjectRegister' => (string)($payload['subjectRegister'] ?? ''), - 'subjectSchema' => 'voorstel', + 'subjectSchema' => 'proposal', 'subjectId' => $proposalId, 'subjectLabel' => (string)($payload['subjectLabel'] ?? ($payload['title'] ?? '')), ], diff --git a/lib/Service/BerichtenboxRoutingService.php b/lib/Service/BerichtenboxRoutingService.php index 2d2874d70..0d2d46790 100644 --- a/lib/Service/BerichtenboxRoutingService.php +++ b/lib/Service/BerichtenboxRoutingService.php @@ -56,7 +56,7 @@ public function __construct( * * @param array $decision The beschikking object. * - * @return array{kanaal: string, sentOn: string, sentBy: string, messageId: string} The verzending record. + * @return array{notificationChannel: string, sentOn: string, sentBy: string, messageId: string} The verzending record. * * @spec openspec/changes/beschikking-generatie/tasks.md#T15 */ @@ -74,12 +74,12 @@ public function routeToBerichtenbox(array $decision): array { 'BerichtenboxRoutingService: beschikking gerouteerd', [ 'reference' => $reference, - 'kanaal' => $channel, + 'notificationChannel' => $channel, ], ); return [ - 'kanaal' => $channel, + 'notificationChannel' => $channel, 'sentOn' => (new DateTimeImmutable())->format('c'), 'sentBy' => 'systeem', 'messageId' => $messageId, diff --git a/lib/Service/BesluitvormingParafeerService.php b/lib/Service/BesluitvormingParafeerService.php index 4fd35cd27..8e673d9bb 100644 --- a/lib/Service/BesluitvormingParafeerService.php +++ b/lib/Service/BesluitvormingParafeerService.php @@ -120,7 +120,7 @@ public function activate(string $proposalId): array { $updated = $objectService->saveObject(object: array_merge($proposal, $updateData), register: $register, schema: $proposalSchema); $this->logger->info( - 'Besluitvorming parafering activated for voorstel: ' . $proposalId, + 'Besluitvorming parafering activated for proposal: ' . $proposalId, ['app' => Application::APP_ID] ); @@ -205,7 +205,7 @@ public function handleParaafAction(string $proposalId, string $parafeeractieId): ); $this->logger->info( - 'All parafen collected for voorstel: ' . $proposalId . ', transitioning case.', + 'All parafen collected for proposal: ' . $proposalId . ', transitioning case.', ['app' => Application::APP_ID] ); @@ -321,7 +321,7 @@ public function allParafenCollected(string $proposalId): bool { objectService: $objectService, register: $register, schema: $actionSchema, - filters: ['voorstel' => $proposalId] + filters: ['proposal' => $proposalId] ); if (empty($acties) === true) { diff --git a/lib/Service/ContactMomentService.php b/lib/Service/ContactMomentService.php index 0c7ec1eeb..add07d9bf 100644 --- a/lib/Service/ContactMomentService.php +++ b/lib/Service/ContactMomentService.php @@ -84,7 +84,7 @@ public function createContactMoment(array $data): array { $now = date('c'); $record = [ - 'kanaal' => (string)$data['kanaal'], + 'notificationChannel' => (string)$data['notificationChannel'], 'direction' => (string)($data['direction'] ?? 'inbound'), 'startTime' => (string)($data['startTime'] ?? $now), 'endTime' => ($data['endTime'] ?? null), @@ -131,7 +131,7 @@ public function createContactMoment(array $data): array { * @throws RuntimeException When a required field is missing or invalid. */ private function validateInput(array $data): void { - $channel = (string)($data['kanaal'] ?? ''); + $channel = (string)($data['notificationChannel'] ?? ''); if (in_array($channel, self::VALID_KANALEN, true) === false) { throw new RuntimeException('Invalid kanaal'); } diff --git a/lib/Service/DeadlineExtensionService.php b/lib/Service/DeadlineExtensionService.php index 93b7e82e1..3a97996b2 100644 --- a/lib/Service/DeadlineExtensionService.php +++ b/lib/Service/DeadlineExtensionService.php @@ -283,7 +283,7 @@ private function resolveExtensionContext(string $mode): array { */ private function resolveMaxExtensions(array $instance): int { // Prefer to look up the definition by the linked id. - $defId = (string)($instance['termijnDefinitie'] ?? ''); + $defId = (string)($instance['deadlineDefinition'] ?? ''); if ($defId === '') { return 1; } diff --git a/lib/Service/DwangsomBezwaarService.php b/lib/Service/DwangsomBezwaarService.php index 81764ed11..e07b73181 100644 --- a/lib/Service/DwangsomBezwaarService.php +++ b/lib/Service/DwangsomBezwaarService.php @@ -119,7 +119,7 @@ public function registerBezwaar(string $calculationId, string $basis, string $ra } // Record event on termijn. - $instanceId = (string)($calculation['termijnInstance'] ?? ''); + $instanceId = (string)($calculation['deadlineInstance'] ?? ''); if ($instanceId !== '') { $this->termService->recordEvent( termInstanceId: $instanceId, @@ -202,7 +202,7 @@ public function resolveBezwaar(string $calculationId, int $newAmountCents, strin } } - $instanceId = (string)($calculation['termijnInstance'] ?? ''); + $instanceId = (string)($calculation['deadlineInstance'] ?? ''); if ($instanceId !== '') { $this->termService->recordEvent( termInstanceId: $instanceId, @@ -268,7 +268,7 @@ private function findUitbetalingen( objectService: $objectService, register: $register, schema: $uSchema, - filters: ['dwangsomBerekening' => $calculationId] + filters: ['penaltyPaymentCalculation' => $calculationId] ); } catch (\Throwable $e) { // Lookup failures must not block the bezwaar transition. diff --git a/lib/Service/DwangsomCalculationService.php b/lib/Service/DwangsomCalculationService.php index 06dcecb08..38027855b 100644 --- a/lib/Service/DwangsomCalculationService.php +++ b/lib/Service/DwangsomCalculationService.php @@ -295,7 +295,7 @@ public function stopForBeschikking(string $calculationId): ?array { * @return int Cents. */ private function resolveCustomDailyTariff(array $calculation): int { - $instanceId = (string)($calculation['termijnInstance'] ?? ''); + $instanceId = (string)($calculation['deadlineInstance'] ?? ''); if ($instanceId === '') { return self::AWB_TIER_1_CENTS; } @@ -352,7 +352,7 @@ private function resolveTermijnDefinitieId( return ''; } - return (string)($instance['termijnDefinitie'] ?? ''); + return (string)($instance['deadlineDefinition'] ?? ''); }//end resolveTermijnDefinitieId() /** diff --git a/lib/Service/DwangsomUitbetalingService.php b/lib/Service/DwangsomUitbetalingService.php index b50f6f7c6..cb201a069 100644 --- a/lib/Service/DwangsomUitbetalingService.php +++ b/lib/Service/DwangsomUitbetalingService.php @@ -99,7 +99,7 @@ public function prepareBetaling( $uiterlijk = $receiptDate->modify('+' . self::BETALING_UITERLIJK_OFFSET_DAYS . ' days')->format('Y-m-d'); $row = [ - 'dwangsomBerekening' => $calculationId, + 'penaltyPaymentCalculation' => $calculationId, 'amount' => $final, 'accountHolderName' => $accountHolderName, 'iban' => strtoupper(str_replace(' ', '', $iban)), diff --git a/lib/Service/NoticeOfDefaultService.php b/lib/Service/NoticeOfDefaultService.php index cc9b1ef86..98487c07f 100644 --- a/lib/Service/NoticeOfDefaultService.php +++ b/lib/Service/NoticeOfDefaultService.php @@ -90,9 +90,9 @@ public function registerNoticeOfDefault( $isValid = ($status === 'overschreden' && $deadline !== '' && $deadline < $receipt); $row = [ - 'termijnInstance' => $termInstanceId, + 'deadlineInstance' => $termInstanceId, 'receiptDate' => $receipt, - 'kanaal' => $channel, + 'notificationChannel' => $channel, 'gevalideerd' => $isValid, 'documentLink' => $documentLink, ]; @@ -108,7 +108,7 @@ public function registerNoticeOfDefault( if ($isValid === false) { $this->logger->info( 'Premature ingebrekestelling rejected', - ['termijnInstance' => $termInstanceId, 'receiptDate' => $receipt] + ['deadlineInstance' => $termInstanceId, 'receiptDate' => $receipt] ); return $row; } @@ -119,13 +119,13 @@ public function registerNoticeOfDefault( if ($existing !== '') { $this->logger->info( 'Additional ingebrekestelling recorded; first remains the dwangsom basis', - ['termijnInstance' => $termInstanceId, 'firstNotice' => $existing] + ['deadlineInstance' => $termInstanceId, 'firstNotice' => $existing] ); return $row; } // First valid notice: link it and start a DwangsomBerekening. - $row['dwangsomBerekening'] = $this->startPenaltyPaymentCalculation( + $row['penaltyPaymentCalculation'] = $this->startPenaltyPaymentCalculation( termInstanceId: $termInstanceId, instance: $instance, ingebrekestellingId: (string)$row['id'], @@ -173,8 +173,8 @@ private function startPenaltyPaymentCalculation( $calculation = $this->saveSchema( schemaConfigKey: 'dwangsom_berekening_schema', object: [ - 'ingebrekestelling' => $ingebrekestellingId, - 'termijnInstance' => $termInstanceId, + 'noticeOfDefault' => $ingebrekestellingId, + 'deadlineInstance' => $termInstanceId, 'startDate' => $startAt, 'currentDag' => 0, 'dailyRate' => 0, @@ -216,7 +216,7 @@ private function startPenaltyPaymentCalculation( * @return array{plafond:int,grace:int,custom:bool,dailyTariff?:int} */ private function resolveRegime(array $instance): array { - $defId = (string)($instance['termijnDefinitie'] ?? ''); + $defId = (string)($instance['deadlineDefinition'] ?? ''); if ($defId === '') { return ['plafond' => self::TARIFF_AWB_PLAFOND, 'grace' => self::TARIFF_AWB_GRACE, 'custom' => false]; } diff --git a/lib/Service/NotificatieService.php b/lib/Service/NotificatieService.php index 62b21d387..526847e6b 100644 --- a/lib/Service/NotificatieService.php +++ b/lib/Service/NotificatieService.php @@ -121,7 +121,7 @@ public function publish( array $characteristics = [], ): void { $notification = [ - 'kanaal' => $channel, + 'notificationChannel' => $channel, 'hoofdObject' => $hoofdObject, 'resource' => $resource, 'resourceUrl' => $resourceUrl, @@ -136,7 +136,7 @@ public function publish( $this->logger->warning( 'Failed to deliver notification', [ - 'kanaal' => $channel, + 'notificationChannel' => $channel, 'action' => $action, 'exception' => $e->getMessage(), ] @@ -206,7 +206,7 @@ private function deliverToSubscription( // Check if this subscription listens to the notification channel. $matches = false; foreach ($kanalen as $channelConfig) { - if (($channelConfig['name'] ?? '') === $notification['kanaal']) { + if (($channelConfig['name'] ?? '') === $notification['notificationChannel']) { $matches = true; break; } @@ -249,7 +249,7 @@ private function deliverToSubscription( $this->logger->info( 'Notification delivered', [ - 'kanaal' => $notification['kanaal'], + 'notificationChannel' => $notification['notificationChannel'], 'callbackUrl' => $callbackUrl, ] ); diff --git a/lib/Service/Parafeer/ParaferingActionMapper.php b/lib/Service/Parafeer/ParaferingActionMapper.php index b00b61216..6aed92e70 100644 --- a/lib/Service/Parafeer/ParaferingActionMapper.php +++ b/lib/Service/Parafeer/ParaferingActionMapper.php @@ -86,7 +86,7 @@ public function parseActionInput(array $data): array { */ public function buildActieData(string $proposalId, int $stepOrder, string $actor, array $input): array { $actionData = [ - 'voorstel' => $proposalId, + 'proposal' => $proposalId, 'step' => $stepOrder, 'actor' => $actor, 'actorType' => 'user', diff --git a/lib/Service/ParafeerActieService.php b/lib/Service/ParafeerActieService.php index 9d7caf134..ea174905e 100644 --- a/lib/Service/ParafeerActieService.php +++ b/lib/Service/ParafeerActieService.php @@ -221,7 +221,7 @@ private function dispatchTransition( $this->logger->warning( 'Procest: ParafeerTransitionEvent dispatch failed', [ - 'voorstel' => $proposalId, + 'proposal' => $proposalId, 'action' => $action, 'exception' => $e->getMessage(), ], @@ -260,7 +260,7 @@ public function recordAction(string $proposalId, array $data, IUser $currentUser } catch (\Throwable $e) { $this->logger->error( 'ParafeerActieService::recordAction failed', - ['voorstel' => $proposalId, 'exception' => $e->getMessage()] + ['proposal' => $proposalId, 'exception' => $e->getMessage()] ); throw new RuntimeException('Operation failed'); }//end try @@ -342,7 +342,7 @@ private function performRecordAction(string $proposalId, array $data, IUser $cur return [ 'parafeeractie' => $this->normalizer->toArray(value: $savedAction), - 'voorstel' => ['id' => $proposalId, 'status' => self::STATUS_TERUGGESTUURD], + 'proposal' => ['id' => $proposalId, 'status' => self::STATUS_TERUGGESTUURD], ]; } @@ -366,7 +366,7 @@ private function performRecordAction(string $proposalId, array $data, IUser $cur return [ 'parafeeractie' => $this->normalizer->toArray(value: $savedAction), - 'voorstel' => $this->normalizer->toArray(value: $updatedProposal), + 'proposal' => $this->normalizer->toArray(value: $updatedProposal), ]; }//end performRecordAction() @@ -477,7 +477,7 @@ private function applyAccorderingEffects( } catch (\Throwable $e) { $this->logger->warning( 'Failed to send accordering notification to steller', - ['voorstel' => $proposalId, 'exception' => $e->getMessage()] + ['proposal' => $proposalId, 'exception' => $e->getMessage()] ); } } @@ -567,7 +567,7 @@ private function delegateToApprovalWorkflow( } catch (\Throwable $e) { $this->logger->warning( 'Procest: approval-workflow delegation failed; legacy path governs', - ['voorstel' => $proposalId, 'action' => $action, 'exception' => $e->getMessage()] + ['proposal' => $proposalId, 'action' => $action, 'exception' => $e->getMessage()] ); }//end try }//end delegateToApprovalWorkflow() @@ -593,7 +593,7 @@ public function listActions(string $proposalId): array { objectService: $objectService, register: $register, schema: $actionSchema, - filters: ['voorstel' => $proposalId, '_limit' => 500], + filters: ['proposal' => $proposalId, '_limit' => 500], ); $rows = []; @@ -617,7 +617,7 @@ static function (array $a, array $b): int { } catch (\Throwable $e) { $this->logger->error( 'ParafeerActieService::listActions failed', - ['voorstel' => $proposalId, 'exception' => $e->getMessage()] + ['proposal' => $proposalId, 'exception' => $e->getMessage()] ); return []; }//end try @@ -652,7 +652,7 @@ public function applyPdfSignature( if (count($nodes) === 0) { $this->logger->warning( 'ParafeerActieService: voorstel document not found for PDF signing', - ['voorstel' => $proposalId, 'file' => $fileId] + ['proposal' => $proposalId, 'file' => $fileId] ); return; } @@ -661,7 +661,7 @@ public function applyPdfSignature( if (($file instanceof File) === false) { $this->logger->warning( 'ParafeerActieService: voorstel node is not a writable file', - ['voorstel' => $proposalId, 'file' => $fileId] + ['proposal' => $proposalId, 'file' => $fileId] ); return; } @@ -684,7 +684,7 @@ public function applyPdfSignature( $this->logger->info( 'ParafeerActieService: PDF signature annotation applied', [ - 'voorstel' => $proposalId, + 'proposal' => $proposalId, 'file' => $fileId, 'actor' => $actor->getUID(), ] @@ -692,12 +692,12 @@ public function applyPdfSignature( } catch (NotFoundException $e) { $this->logger->warning( 'ParafeerActieService: PDF signing skipped — file not found', - ['voorstel' => $proposalId, 'file' => $fileId] + ['proposal' => $proposalId, 'file' => $fileId] ); } catch (\Throwable $e) { $this->logger->warning( 'ParafeerActieService: PDF signature could not be applied', - ['voorstel' => $proposalId, 'file' => $fileId, 'exception' => $e->getMessage()] + ['proposal' => $proposalId, 'file' => $fileId, 'exception' => $e->getMessage()] ); }//end try }//end applyPdfSignature() @@ -746,7 +746,7 @@ private function handleReturn( } catch (\Throwable $e) { $this->logger->warning( 'Failed to send teruggestuurd notification', - ['voorstel' => $proposalId, 'exception' => $e->getMessage()] + ['proposal' => $proposalId, 'exception' => $e->getMessage()] ); } } diff --git a/lib/Service/ParafeerRouteService.php b/lib/Service/ParafeerRouteService.php index 16be502f0..9e5d76f63 100644 --- a/lib/Service/ParafeerRouteService.php +++ b/lib/Service/ParafeerRouteService.php @@ -142,7 +142,7 @@ private function dispatchTransition( $this->logger->warning( 'Procest: ParafeerTransitionEvent dispatch failed', [ - 'voorstel' => $proposalId, + 'proposal' => $proposalId, 'action' => $action, 'exception' => $e->getMessage(), ], @@ -243,7 +243,7 @@ private function createApprovalChain(string $voorstelUuid, array $route, array $ } catch (Throwable $e) { $this->logger->warning( 'Procest: ApprovalChain creation failed, falling back to in-array routing', - ['voorstel' => $voorstelUuid, 'exception' => $e->getMessage()] + ['proposal' => $voorstelUuid, 'exception' => $e->getMessage()] ); return null; } @@ -281,7 +281,7 @@ public function completeStep(string $proposalId, array $actionData): array { } $actieData = [ - 'voorstel' => $proposal['id'] ?? $proposal['uuid'] ?? $proposalId, + 'proposal' => $proposal['id'] ?? $proposal['uuid'] ?? $proposalId, 'step' => $currentStep, 'actor' => $this->requireUserId(), 'actorType' => (string)($actionData['actorType'] ?? 'user'), @@ -372,7 +372,7 @@ public function skipStep(string $proposalId, int $step, string $reason): array { $objectService->saveObject( object: [ - 'voorstel' => $proposal['id'] ?? $proposal['uuid'] ?? $proposalId, + 'proposal' => $proposal['id'] ?? $proposal['uuid'] ?? $proposalId, 'step' => $step, 'actor' => $userId, 'actorType' => 'user', @@ -532,7 +532,7 @@ public function addAdhocStep(string $proposalId, int $afterStep, array $stepData }//end addAdhocStep() /** - * Advance the voorstel: either activate the next step or mark geaccordeerd. + * Advance the proposal: either activate the next step or mark geaccordeerd. * * @param object $objectService The OpenRegister ObjectService * @param string $register The register slug/UUID diff --git a/lib/Service/Parafering/AuditTrailService.php b/lib/Service/Parafering/AuditTrailService.php index 64d0f9ed3..b0029d4e8 100644 --- a/lib/Service/Parafering/AuditTrailService.php +++ b/lib/Service/Parafering/AuditTrailService.php @@ -93,7 +93,7 @@ public function export(string $proposalId, string $proposalOnderwerp, string $ex objectService: $objectService, register: $register, schema: $schema, - filters: ['voorstel' => $proposalId, '_limit' => 5000], + filters: ['proposal' => $proposalId, '_limit' => 5000], ); $entries = []; @@ -131,7 +131,7 @@ static function (array $a, array $b): int { 'exportedAt' => (new DateTimeImmutable('now')) ->setTimezone(new DateTimeZone('UTC')) ->format('Y-m-d\TH:i:s\Z'), - 'voorstel' => $proposalId, + 'proposal' => $proposalId, 'voorstelOnderwerp' => $proposalOnderwerp, 'retentionUntil' => $retentionUntil, 'selectielijstCategory' => $selectielijst, diff --git a/lib/Service/ParaferingApprovalBridge.php b/lib/Service/ParaferingApprovalBridge.php index df05135dc..c07edca59 100644 --- a/lib/Service/ParaferingApprovalBridge.php +++ b/lib/Service/ParaferingApprovalBridge.php @@ -141,14 +141,14 @@ public function initializeChainForVoorstel(string $voorstelUuid, string $name, a $chainUuid = (string)($chain->getUuid() ?? ''); $this->logger->info( 'Procest: parafering ApprovalChain created in OpenRegister', - ['voorstel' => $voorstelUuid, 'chain' => $chainUuid, 'steps' => count($chainSteps)] + ['proposal' => $voorstelUuid, 'chain' => $chainUuid, 'steps' => count($chainSteps)] ); return $chainUuid; } catch (Throwable $e) { $this->logger->error( 'Procest: failed to create parafering ApprovalChain', - ['voorstel' => $voorstelUuid, 'exception' => $e->getMessage()] + ['proposal' => $voorstelUuid, 'exception' => $e->getMessage()] ); throw new RuntimeException('Approval chain creation failed'); }//end try @@ -190,7 +190,7 @@ public function approveCurrentStep(string $voorstelUuid, string $userId, string } catch (Throwable $e) { $this->logger->error( 'Procest: ApprovalService::approveStep failed', - ['voorstel' => $voorstelUuid, 'step' => $stepId, 'exception' => $e->getMessage()] + ['proposal' => $voorstelUuid, 'step' => $stepId, 'exception' => $e->getMessage()] ); throw new RuntimeException('Approval step transition failed'); } @@ -226,7 +226,7 @@ public function rejectCurrentStep(string $voorstelUuid, string $userId, string $ } catch (Throwable $e) { $this->logger->error( 'Procest: ApprovalService::rejectStep failed', - ['voorstel' => $voorstelUuid, 'step' => $stepId, 'exception' => $e->getMessage()] + ['proposal' => $voorstelUuid, 'step' => $stepId, 'exception' => $e->getMessage()] ); throw new RuntimeException('Rejection step transition failed'); } @@ -288,7 +288,7 @@ private function findPendingStepId(string $voorstelUuid): ?int { } catch (Throwable $e) { $this->logger->warning( 'Procest: could not resolve pending approval step', - ['voorstel' => $voorstelUuid, 'exception' => $e->getMessage()] + ['proposal' => $voorstelUuid, 'exception' => $e->getMessage()] ); } diff --git a/lib/Service/ParaferingNotificationService.php b/lib/Service/ParaferingNotificationService.php index d10831f5b..25fe885c4 100644 --- a/lib/Service/ParaferingNotificationService.php +++ b/lib/Service/ParaferingNotificationService.php @@ -69,7 +69,7 @@ public function notifyStepActivated( $notification->setApp(Application::APP_ID) ->setUser($actorUserId) ->setDateTime(new DateTime()) - ->setObject('voorstel', $proposalId) + ->setObject('proposal', $proposalId) ->setSubject( 'parafering_step_activated', [ @@ -84,7 +84,7 @@ public function notifyStepActivated( 'Failed to send parafering step notification', [ 'actor' => $actorUserId, - 'voorstel' => $proposalId, + 'proposal' => $proposalId, 'exception' => $e->getMessage(), ] ); @@ -116,7 +116,7 @@ public function notifyVoorstelReturned( $notification->setApp(Application::APP_ID) ->setUser($stellerUserId) ->setDateTime(new DateTime()) - ->setObject('voorstel', $proposalId) + ->setObject('proposal', $proposalId) ->setSubject( 'voorstel_returned', [ @@ -132,7 +132,7 @@ public function notifyVoorstelReturned( 'Failed to send voorstel return notification', [ 'author' => $stellerUserId, - 'voorstel' => $proposalId, + 'proposal' => $proposalId, 'exception' => $e->getMessage(), ] ); @@ -162,7 +162,7 @@ public function notifyParaferingReminder( $notification->setApp(Application::APP_ID) ->setUser($actorUserId) ->setDateTime(new DateTime()) - ->setObject('voorstel', $proposalId) + ->setObject('proposal', $proposalId) ->setSubject( 'parafering_reminder', [ @@ -177,7 +177,7 @@ public function notifyParaferingReminder( 'Failed to send parafering reminder notification', [ 'actor' => $actorUserId, - 'voorstel' => $proposalId, + 'proposal' => $proposalId, 'exception' => $e->getMessage(), ] ); diff --git a/lib/Service/Settings/SchemaSlugMap.php b/lib/Service/Settings/SchemaSlugMap.php index a7215370c..af411fa2d 100644 --- a/lib/Service/Settings/SchemaSlugMap.php +++ b/lib/Service/Settings/SchemaSlugMap.php @@ -46,7 +46,7 @@ class SchemaSlugMap { * @var array */ public const SLUG_TO_CONFIG_KEY = [ - 'catalogus' => 'catalogus_schema', + 'catalog' => 'catalogus_schema', 'case' => 'case_schema', 'task' => 'task_schema', 'status' => 'status_schema', @@ -71,7 +71,7 @@ class SchemaSlugMap { 'document' => 'document_schema', 'documentLink' => 'document_link_schema', 'usageRights' => 'usage_rights_schema', - 'kanaal' => 'kanaal_schema', + 'notificationChannel' => 'kanaal_schema', 'abonnement' => 'abonnement_schema', 'inspectieChecklist' => 'inspectie_checklist_schema', 'inspectieRapport' => 'inspectie_rapport_schema', @@ -87,7 +87,7 @@ class SchemaSlugMap { 'hearingSession' => 'hearing_session_schema', 'advisoryReport' => 'advisory_report_schema', 'appealDecision' => 'appeal_decision_schema', - 'voorstel' => 'voorstel_schema', + 'proposal' => 'voorstel_schema', 'parafeerroute' => 'parafeerroute_schema', 'parafeeractie' => 'parafeeractie_schema', 'paraferingAuditEntry' => 'parafering_audit_entry_schema', @@ -141,11 +141,11 @@ class SchemaSlugMap { 'portaalVerzoek' => 'portaal_verzoek_schema', 'portaalNotificatieVoorkeur' => 'portaal_notificatie_voorkeur_schema', // Termijnbewaking + dwangsom (AWB 4:13/4:14/4:17). - 'termijnDefinitie' => 'termijn_definitie_schema', - 'termijnInstance' => 'termijn_instance_schema', + 'deadlineDefinition' => 'termijn_definitie_schema', + 'deadlineInstance' => 'termijn_instance_schema', 'termijnGebeurtenis' => 'termijn_gebeurtenis_schema', - 'ingebrekestelling' => 'ingebrekestelling_schema', - 'dwangsomBerekening' => 'dwangsom_berekening_schema', + 'noticeOfDefault' => 'ingebrekestelling_schema', + 'penaltyPaymentCalculation' => 'dwangsom_berekening_schema', 'dwangsomUitbetaling' => 'dwangsom_uitbetaling_schema', // Mandaat-matrix authorization engine. // KEY renamed with the schema slug; VALUE deliberately left as-is. The diff --git a/lib/Service/TermijnNotificationService.php b/lib/Service/TermijnNotificationService.php index 948270d92..a4d01f425 100644 --- a/lib/Service/TermijnNotificationService.php +++ b/lib/Service/TermijnNotificationService.php @@ -135,7 +135,7 @@ public function sendTermijnNotification( $payload = $this->renderTemplate(type: $type, instance: $instance ?? [], context: $context); $payload['recipient'] = $recipientUserId; - $payload['termijnInstance'] = $termInstanceId; + $payload['deadlineInstance'] = $termInstanceId; $payload['template'] = $type; // Route the rendered notification through the procest notification @@ -155,7 +155,7 @@ public function sendTermijnNotification( 'type' => $type, 'recipient' => $recipientUserId, 'instance' => $termInstanceId, - 'kanaal' => $payload['dispatch']['kanaal'], + 'notificationChannel' => $payload['dispatch']['notificationChannel'], ] ); diff --git a/lib/Service/TermijnService.php b/lib/Service/TermijnService.php index e9d2b77e5..edf942b02 100644 --- a/lib/Service/TermijnService.php +++ b/lib/Service/TermijnService.php @@ -98,7 +98,7 @@ public function createTermijnInstance(string $caseId, string $caseType, ?DateTim $instance = [ 'case' => $caseId, - 'termijnDefinitie' => (string)($definitie['id'] ?? ''), + 'deadlineDefinition' => (string)($definitie['id'] ?? ''), 'startDate' => $startDate->format('Y-m-d\TH:i:sP'), 'endDateCalculated' => $endDate, 'endDateCurrent' => $endDate, @@ -371,7 +371,7 @@ public function recordEvent( ): ?array { $moment = ($moment ?? new DateTimeImmutable()); $event = [ - 'termijnInstance' => $termInstanceId, + 'deadlineInstance' => $termInstanceId, 'type' => $type, 'moment' => $moment->format('Y-m-d\TH:i:sP'), 'actor' => $actor, diff --git a/lib/Service/Transitions/BesluitvormingActivateHandler.php b/lib/Service/Transitions/BesluitvormingActivateHandler.php index 1e9a7d07e..a33a9ddad 100644 --- a/lib/Service/Transitions/BesluitvormingActivateHandler.php +++ b/lib/Service/Transitions/BesluitvormingActivateHandler.php @@ -80,7 +80,7 @@ public function handle(array $actionConfig, array $case, array $transitionContex $this->parafeerService->activate($proposalId); - return new ActionResult(succeeded: true, data: ['voorstel' => $proposalId]); + return new ActionResult(succeeded: true, data: ['proposal' => $proposalId]); } catch (\Throwable $e) { $this->logger->error( 'BesluitvormingActivateHandler failed', @@ -99,7 +99,7 @@ public function handle(array $actionConfig, array $case, array $transitionContex */ private function resolveProposalId(array $case): string { // A voorstel may be linked directly on the case. - $direct = (string)($case['voorstel'] ?? ''); + $direct = (string)($case['proposal'] ?? ''); if ($direct !== '') { return $direct; } diff --git a/lib/Settings/ori_register.json b/lib/Settings/ori_register.json index 9eb9067d8..9dc4a26a8 100644 --- a/lib/Settings/ori_register.json +++ b/lib/Settings/ori_register.json @@ -1759,7 +1759,7 @@ "slug": "stemming-herinrichting-marktplein" }, "subject": "Voorstel: Herinrichting marktplein Voorbeeldstad", - "type": "voorstel", + "type": "proposal", "result": "aangenomen", "agendapunt": "raad-20250902-04-herinrichting-marktplein", "votesFor": 19, @@ -1815,7 +1815,7 @@ "slug": "stemming-subsidieregeling-duurzame-energie" }, "subject": "Voorstel: Subsidieregeling duurzame energie 2025-2026", - "type": "voorstel", + "type": "proposal", "result": "aangenomen", "agendapunt": "raad-20250902-05-subsidie-duurzame-energie", "votesFor": 25, @@ -2039,7 +2039,7 @@ "slug": "stemming-bestemmingsplan-buitengebied" }, "subject": "Voorstel: Bestemmingsplan buitengebied Voorbeeldstad", - "type": "voorstel", + "type": "proposal", "result": "aangenomen", "agendapunt": "raad-20250902-06-bestemmingsplan", "votesFor": 27, diff --git a/lib/Settings/procest_register.json b/lib/Settings/procest_register.json index 06b392558..3e00009eb 100644 --- a/lib/Settings/procest_register.json +++ b/lib/Settings/procest_register.json @@ -45,11 +45,11 @@ "description": "Auto-generated identifier", "title": "Identifier" }, - "catalogus": { + "catalog": { "type": "string", "format": "uuid", - "$ref": "catalogus", - "description": "Reference to the parent catalogus", + "$ref": "catalog", + "description": "Reference to the parent catalog", "title": "Catalog" }, "purpose": { @@ -493,11 +493,11 @@ "x-translatable": true, "title": "Description" }, - "catalogus": { + "catalog": { "type": "string", "format": "uuid", - "$ref": "catalogus", - "description": "Reference to the parent catalogus", + "$ref": "catalog", + "description": "Reference to the parent catalog", "title": "Catalog" }, "caseType": { @@ -584,11 +584,11 @@ "x-translatable": true, "title": "Description" }, - "catalogus": { + "catalog": { "type": "string", "format": "uuid", - "$ref": "catalogus", - "description": "Reference to the parent catalogus", + "$ref": "catalog", + "description": "Reference to the parent catalog", "title": "Catalog" }, "caseType": { @@ -2195,8 +2195,8 @@ } } }, - "kanaal": { - "slug": "kanaal", + "notificationChannel": { + "slug": "notificationChannel", "icon": "BellRingOutline", "version": "1.0.0", "x-schema-org": "schema:BroadcastChannel", @@ -2260,8 +2260,8 @@ } } }, - "catalogus": { - "slug": "catalogus", + "catalog": { + "slug": "catalog", "icon": "BookOpenPageVariant", "version": "1.0.0", "x-schema-org": "schema:DataCatalog", @@ -2668,8 +2668,8 @@ } } }, - "voorstel": { - "slug": "voorstel", + "proposal": { + "slug": "proposal", "icon": "FileDocumentEditOutline", "version": "1.1.0", "x-schema-org": "schema:CreativeWork", @@ -2990,18 +2990,18 @@ "description": "An immutable record of a parafering action on a voorstel step", "type": "object", "required": [ - "voorstel", + "proposal", "step", "actor", "action" ], "properties": { - "voorstel": { + "proposal": { "type": "string", "format": "uuid", - "$ref": "voorstel", + "$ref": "proposal", "onDelete": "CASCADE", - "description": "Reference to the voorstel", + "description": "Reference to the proposal", "title": "Proposal" }, "step": { @@ -3156,7 +3156,7 @@ "description": "DEPRECATED (migrate-parafering-to-or-audit): historical append-only audit entries for parafeerroute transitions. New transitions are recorded via OR's native audit trail instead of this schema. Existing rows remain readable for one major release. Originally: regulator-grade entry per transition (started, paraferd, advised, terugsturen, route-changed, completed) with actor, role, timestamp, reason, content snapshot, redacted IP, and SHA-256 tamper-detection hash.", "type": "object", "required": [ - "voorstel", + "proposal", "action", "actor", "actorRole", @@ -3165,12 +3165,12 @@ "auditEntryHash" ], "properties": { - "voorstel": { + "proposal": { "type": "string", "format": "uuid", - "$ref": "voorstel", + "$ref": "proposal", "onDelete": "CASCADE", - "description": "Reference to the voorstel that this transition occurred on", + "description": "Reference to the proposal that this transition occurred on", "title": "Proposal" }, "step": { @@ -3409,7 +3409,7 @@ "description": "Required motivation when hearingWaived = true", "title": "Waiver Reason" }, - "ingebrekestelling": { + "noticeOfDefault": { "type": "string", "format": "date", "description": "Date the bezwaarmaker submitted an ingebrekestelling per AWB 4:17 — starts the 14-day grace clock", @@ -3494,7 +3494,7 @@ "from": { "dateAdd": { "date": { - "prop": "ingebrekestelling" + "prop": "noticeOfDefault" }, "amount": 14, "unit": "days" @@ -3533,7 +3533,7 @@ "from": { "dateAdd": { "date": { - "prop": "ingebrekestelling" + "prop": "noticeOfDefault" }, "amount": 14, "unit": "days" @@ -3575,7 +3575,7 @@ "from": { "dateAdd": { "date": { - "prop": "ingebrekestelling" + "prop": "noticeOfDefault" }, "amount": 14, "unit": "days" @@ -9241,7 +9241,7 @@ "decision", "document", "documentLink", - "catalogus", + "catalog", "zaaktypeInformatieobjecttype", "caseProperty", "caseDocument", @@ -9251,13 +9251,13 @@ "dispatch", "usageRights", "workflowTemplate", - "kanaal", + "notificationChannel", "abonnement", "objection", "hearingSession", "advisoryReport", "appealDecision", - "voorstel", + "proposal", "parafeerroute", "parafeeractie", "paraferingAuditEntry", @@ -9319,7 +9319,7 @@ "type": "string" }, { - "field": "voorstel", + "field": "proposal", "type": "string" }, { @@ -9345,7 +9345,7 @@ "label": "Actor role" }, { - "field": "voorstel", + "field": "proposal", "label": "Voorstel" }, { diff --git a/lib/Settings/register.d/30-beschikking.json b/lib/Settings/register.d/30-beschikking.json index 04130dd6f..45fab69e4 100644 --- a/lib/Settings/register.d/30-beschikking.json +++ b/lib/Settings/register.d/30-beschikking.json @@ -182,7 +182,7 @@ "title": "Dispatch", "description": "Berichtenbox delivery record", "properties": { - "kanaal": { "type": "string", "title": "Dispatch Channel", "description": "Channel used for dispatch, e.g. berichtenbox-mijnoverheid" }, + "notificationChannel": { "type": "string", "title": "Dispatch Channel", "description": "Channel used for dispatch, e.g. berichtenbox-mijnoverheid" }, "sentOn": { "type": "string", "title": "Sent On", "description": "Timestamp at which the beschikking was sent", "format": "date-time" }, "sentBy": { "type": "string", "title": "Sent By", "description": "Actor who sent the beschikking (user id or 'systeem')" }, "messageId": { "type": "string", "title": "Message ID", "description": "Berichtenbox message identifier" }, @@ -389,7 +389,7 @@ "validationRapportId": "val-2026-99231" }, "dispatch": { - "kanaal": "berichtenbox-mijnoverheid", + "notificationChannel": "berichtenbox-mijnoverheid", "sentOn": "2026-04-02T09:00:00+02:00", "sentBy": "systeem", "messageId": "MO-2026-04-02-771234" diff --git a/lib/Settings/register.d/40-kcc-werkplek.json b/lib/Settings/register.d/40-kcc-werkplek.json index 55c4adf59..971d3c1ae 100644 --- a/lib/Settings/register.d/40-kcc-werkplek.json +++ b/lib/Settings/register.d/40-kcc-werkplek.json @@ -31,9 +31,9 @@ "title": "Contactmoment", "description": "A single inbound or outbound contact (telefoon, email, chat, webformulier, social media, balie) handled in the KCC-werkplek, logged against the case and the identified burger.", "type": "object", - "required": ["kanaal", "direction", "identificationMethod", "kccEmployeeId", "nature", "summary"], + "required": ["notificationChannel", "direction", "identificationMethod", "kccEmployeeId", "nature", "summary"], "properties": { - "kanaal": {"type": "string", "title": "Channel", "enum": ["phone", "email", "webformulier", "chat", "social_media", "balie"], "description": "Communication channel"}, + "notificationChannel": {"type": "string", "title": "Channel", "enum": ["phone", "email", "webformulier", "chat", "social_media", "balie"], "description": "Communication channel"}, "direction": {"type": "string", "title": "Direction", "enum": ["inbound", "outbound"], "description": "Direction of the contact"}, "startTime": {"type": "string", "title": "Start Time", "format": "date-time", "description": "Start time of the contact"}, "endTime": {"type": "string", "title": "End Time", "format": "date-time", "description": "End time of the contact"}, diff --git a/lib/Settings/register.d/50-sociaal-domein.json b/lib/Settings/register.d/50-sociaal-domein.json index b9e12b70e..6c0c8802e 100644 --- a/lib/Settings/register.d/50-sociaal-domein.json +++ b/lib/Settings/register.d/50-sociaal-domein.json @@ -8,7 +8,7 @@ "title": "WMO Zaak", "description": "Sociaal-domein zaaktype wmo-melding (Wmo 2015, art. 2.3.2-2.3.6). Maatschappelijke ondersteuning voor volwassenen. Volledig OpenRegister-backed; status-lifecycle als configuratie, geen custom state machine.", "type": "object", - "required": ["caseType", "bsn", "districtTeam", "avgClassificatie"], + "required": ["caseType", "bsn", "districtTeam", "gdprClassification"], "properties": { "caseType": { "title": "Case Type", @@ -117,8 +117,8 @@ "type": "string", "description": "Referentie naar de bijbehorende Indicatiestelling" }, - "avgClassificatie": { - "$ref": "#/components/schemas/avgClassificatie" + "gdprClassification": { + "$ref": "#/components/schemas/gdprClassification" } } }, @@ -210,7 +210,7 @@ "title": "Jeugdwet Zaak", "description": "Sociaal-domein zaaktype jeugdwet-melding (Jeugdwet 2015, art. 2.3, 6.1.2, 7.3). Gezinsgerichte, multi-agency jeugdhulp. OpenRegister-backed.", "type": "object", - "required": ["caseType", "jeugdigeBsn", "districtTeam", "avgClassificatie"], + "required": ["caseType", "jeugdigeBsn", "districtTeam", "gdprClassification"], "properties": { "caseType": { "title": "Case Type", @@ -304,8 +304,8 @@ "items": {"type": "string"}, "description": "Historie van eerdere gezinsplannen (verlengingen)" }, - "avgClassificatie": { - "$ref": "#/components/schemas/avgClassificatie" + "gdprClassification": { + "$ref": "#/components/schemas/gdprClassification" } } }, @@ -482,7 +482,7 @@ "title": "Participatiewet Zaak", "description": "Sociaal-domein zaaktype bijstandsaanvraag (Participatiewet 2015, art. 18, 31-34, 9). Inkomens- en werkgerichte ondersteuning met vermogens-/inkomenstoets. OpenRegister-backed.", "type": "object", - "required": ["caseType", "bsn", "avgClassificatie"], + "required": ["caseType", "bsn", "gdprClassification"], "properties": { "caseType": { "title": "Case Type", @@ -612,8 +612,8 @@ "type": "boolean", "description": "True bij vermogen boven vrijstelling (auto-afwijzing)" }, - "avgClassificatie": { - "$ref": "#/components/schemas/avgClassificatie" + "gdprClassification": { + "$ref": "#/components/schemas/gdprClassification" } } }, @@ -814,8 +814,8 @@ } } }, - "avgClassificatie": { - "slug": "avgClassificatie", + "gdprClassification": { + "slug": "gdprClassification", "icon": "ShieldLockOutline", "version": "1.0.0", "title": "AVG Classificatie", @@ -998,7 +998,7 @@ "participatiewetZaak", "reIntegratieTraject", "toestemming", - "avgClassificatie", + "gdprClassification", "sociaalDomeinAuditLog", "avgIncident" ] @@ -1023,7 +1023,7 @@ "handlerId": "consulent-wmo-211", "status": "beschikking-verleend", "leadTimeStatutory": {"investigationWeeks": 6, "decisionWeeks": 2, "totalWeeks": 8}, - "avgClassificatie": { + "gdprClassification": { "categories": ["medisch"], "specialPersonalData": true, "justification": "artikel-9-2-h-avg", @@ -1053,7 +1053,7 @@ "handlerId": "consulent-wmo-211", "status": "uitvoering", "leadTimeStatutory": {"investigationWeeks": 6, "decisionWeeks": 2, "totalWeeks": 8}, - "avgClassificatie": { + "gdprClassification": { "categories": ["medisch", "gezinssituatie"], "specialPersonalData": true, "justification": "artikel-9-2-h-avg", @@ -1083,7 +1083,7 @@ "handlerId": "consulent-wmo-188", "status": "beschikking-voorbereiding", "leadTimeStatutory": {"investigationWeeks": 6, "decisionWeeks": 2, "totalWeeks": 8}, - "avgClassificatie": { + "gdprClassification": { "categories": ["medisch", "gezinssituatie"], "specialPersonalData": true, "justification": "artikel-9-2-h-avg", @@ -1112,7 +1112,7 @@ "districtTeam": "jeugdteam-noord", "handlerId": "jeugdconsulent-340", "status": "ondersteuning-loopt", - "avgClassificatie": { + "gdprClassification": { "categories": ["gezinssituatie", "medisch"], "specialPersonalData": true, "justification": "artikel-9-2-h-avg", @@ -1141,7 +1141,7 @@ "districtTeam": "jeugdteam-zuid", "handlerId": "jeugdconsulent-355", "status": "gezinsplan-gereed", - "avgClassificatie": { + "gdprClassification": { "categories": ["medisch", "gezinssituatie"], "specialPersonalData": true, "justification": "artikel-9-2-h-avg", @@ -1170,7 +1170,7 @@ "districtTeam": "jeugdteam-west", "handlerId": "jeugdconsulent-362", "status": "ondersteuning-gestart", - "avgClassificatie": { + "gdprClassification": { "categories": ["medisch", "gezinssituatie"], "specialPersonalData": true, "justification": "artikel-9-2-h-avg", @@ -1200,7 +1200,7 @@ "handlerId": "klantmanager-477", "districtTeam": "werk-en-inkomenteam-oost", "status": "re-integratie-loopt", - "avgClassificatie": { + "gdprClassification": { "categories": ["financieel", "gezinssituatie"], "specialPersonalData": true, "justification": "artikel-9-2-b-avg", @@ -1230,7 +1230,7 @@ "handlerId": "klantmanager-501", "districtTeam": "werk-en-inkomenteam-west", "status": "re-integratie-loopt", - "avgClassificatie": { + "gdprClassification": { "categories": ["financieel", "medisch"], "specialPersonalData": true, "justification": "artikel-9-2-b-avg", @@ -1260,7 +1260,7 @@ "handlerId": "klantmanager-512", "districtTeam": "werk-en-inkomenteam-centrum", "status": "beschikking-voorbereiding", - "avgClassificatie": { + "gdprClassification": { "categories": ["financieel", "gezinssituatie"], "specialPersonalData": true, "justification": "artikel-9-2-b-avg", diff --git a/lib/Settings/register.d/60-termijnbewaking.json b/lib/Settings/register.d/60-termijnbewaking.json index f3718bd21..89a7eb540 100644 --- a/lib/Settings/register.d/60-termijnbewaking.json +++ b/lib/Settings/register.d/60-termijnbewaking.json @@ -3,18 +3,18 @@ "registers": { "procest": { "schemas": [ - "termijnDefinitie", - "termijnInstance", + "deadlineDefinition", + "deadlineInstance", "termijnGebeurtenis", - "ingebrekestelling", - "dwangsomBerekening", + "noticeOfDefault", + "penaltyPaymentCalculation", "dwangsomUitbetaling" ] } }, "schemas": { - "termijnDefinitie": { - "slug": "termijnDefinitie", + "deadlineDefinition": { + "slug": "deadlineDefinition", "icon": "TimerOutline", "version": "1.0.0", "x-schema-org": "schema:DefinedTerm", @@ -108,8 +108,8 @@ } } }, - "termijnInstance": { - "slug": "termijnInstance", + "deadlineInstance": { + "slug": "deadlineInstance", "icon": "TimerSandFull", "version": "1.0.0", "x-schema-org": "schema:Action", @@ -118,7 +118,7 @@ "type": "object", "required": [ "case", - "termijnDefinitie", + "deadlineDefinition", "startDate", "endDateCalculated", "endDateCurrent", @@ -131,7 +131,7 @@ "description": "Reference to the procest case (case id)", "facetable": true }, - "termijnDefinitie": { + "deadlineDefinition": { "type": "string", "title": "Deadline Definition Reference", "description": "Reference to the TermijnDefinitie this instance materialised from" @@ -203,12 +203,12 @@ "description": "Immutable append-only audit log entry for any termijn lifecycle event. Once written, never updated.", "type": "object", "required": [ - "termijnInstance", + "deadlineInstance", "type", "moment" ], "properties": { - "termijnInstance": { + "deadlineInstance": { "type": "string", "title": "Deadline Instance Reference", "description": "TermijnInstance reference", @@ -266,8 +266,8 @@ } } }, - "ingebrekestelling": { - "slug": "ingebrekestelling", + "noticeOfDefault": { + "slug": "noticeOfDefault", "icon": "EmailAlert", "version": "1.0.0", "x-schema-org": "schema:Message", @@ -275,12 +275,12 @@ "description": "Burger notice that the deadline has lapsed (AWB 4:17). Validated against the TermijnInstance to start a DwangsomBerekening.", "type": "object", "required": [ - "termijnInstance", + "deadlineInstance", "receiptDate", - "kanaal" + "notificationChannel" ], "properties": { - "termijnInstance": { + "deadlineInstance": { "type": "string", "title": "Deadline Instance Reference", "description": "TermijnInstance the notice relates to", @@ -292,7 +292,7 @@ "title": "Receipt Date", "description": "Date the notice arrived" }, - "kanaal": { + "notificationChannel": { "type": "string", "enum": ["post", "email", "portaal", "balie", "phone"], "title": "Channel", @@ -324,8 +324,8 @@ } } }, - "dwangsomBerekening": { - "slug": "dwangsomBerekening", + "penaltyPaymentCalculation": { + "slug": "penaltyPaymentCalculation", "icon": "Calculator", "version": "1.0.0", "x-schema-org": "schema:MonetaryAmount", @@ -333,17 +333,17 @@ "description": "Daily-accruing dwangsom calculation per AWB 4:17. Tracks current day, tariff tier, cumulative amount in EUR cents, plafond enforcement.", "type": "object", "required": [ - "ingebrekestelling", + "noticeOfDefault", "startDate" ], "properties": { - "ingebrekestelling": { + "noticeOfDefault": { "type": "string", "title": "Default Notice Reference", "description": "Ingebrekestelling that started the calculation", "facetable": true }, - "termijnInstance": { + "deadlineInstance": { "type": "string", "title": "Deadline Instance Reference", "description": "Convenience back-reference to the termijn" @@ -419,12 +419,12 @@ "description": "Payment signal towards the burger after the dwangsom is locked.", "type": "object", "required": [ - "dwangsomBerekening", + "penaltyPaymentCalculation", "amount", "reference" ], "properties": { - "dwangsomBerekening": { + "penaltyPaymentCalculation": { "type": "string", "title": "Penalty Calculation Reference", "description": "Berekening reference", diff --git a/src/dialogs/BesluitRegistration.vue b/src/dialogs/BesluitRegistration.vue index 1bb9e57f8..d7da26a76 100644 --- a/src/dialogs/BesluitRegistration.vue +++ b/src/dialogs/BesluitRegistration.vue @@ -105,7 +105,7 @@ export default { }, props: { - voorstel: { + proposal: { type: Object, required: true, }, @@ -117,7 +117,7 @@ export default { decisionTypes: [], selectedDecisionType: null, form: { - title: this.voorstel.subject || '', + title: this.proposal.subject || '', effectiveDate: new Date().toISOString().split('T')[0], explanation: '', governingBody: 'College van B&W', @@ -175,7 +175,7 @@ export default { // procest keeps the parafeerroute untouched; only the besluit // decision is delegated, and the besluit is materialised from // the decidesk outcome. - await registerBesluit(this.voorstel.id || this.voorstel._self?.id, { + await registerBesluit(this.proposal.id || this.proposal._self?.id, { title: this.form.title.trim(), effectiveDate: this.form.effectiveDate || undefined, explanation: this.form.explanation || undefined, @@ -187,8 +187,8 @@ export default { // Reflect the awaiting-decidesk state on the voorstel (projection; // the decided besluit lands when decidesk posts the outcome). - await this.objectStore.saveObject('voorstel', { - ...this.voorstel, + await this.objectStore.saveObject('proposal', { + ...this.proposal, status: 'awaiting-decidesk', }) diff --git a/src/dialogs/ParafeerActieDialog.vue b/src/dialogs/ParafeerActieDialog.vue index 7fe0070ba..1e30c5899 100644 --- a/src/dialogs/ParafeerActieDialog.vue +++ b/src/dialogs/ParafeerActieDialog.vue @@ -244,7 +244,7 @@ export default { */ buildPayload(action) { const payload = { - voorstel: this.voorstelId, + proposal: this.voorstelId, action, } if (this.comment.trim() !== '') payload.comment = this.comment.trim() @@ -280,7 +280,7 @@ export default { } this.validationError = '' const payload = { - voorstel: this.voorstelId, + proposal: this.voorstelId, action: 'returned', comment: this.returnReason.trim(), } diff --git a/src/dialogs/VoorstelCreateDialog.vue b/src/dialogs/VoorstelCreateDialog.vue index 8fbea8ec5..9f793af8e 100644 --- a/src/dialogs/VoorstelCreateDialog.vue +++ b/src/dialogs/VoorstelCreateDialog.vue @@ -219,10 +219,10 @@ export default { voorstelData.parafeerroute = routeId } - await this.objectStore.saveObject('voorstel', voorstelData) + await this.objectStore.saveObject('proposal', voorstelData) this.$emit('created') } catch (error) { - console.error('Failed to create voorstel:', error) + console.error('Failed to create proposal:', error) this.errors.subject = error.message || t('procest', 'Failed to create') } finally { @@ -234,7 +234,7 @@ export default { diff --git a/src/views/voorstellen/components/ParafeerActionBar.vue b/src/views/voorstellen/components/ParafeerActionBar.vue index bce0a0b5e..87a7dc137 100644 --- a/src/views/voorstellen/components/ParafeerActionBar.vue +++ b/src/views/voorstellen/components/ParafeerActionBar.vue @@ -110,7 +110,7 @@ export default { }, props: { - voorstel: { + proposal: { type: Object, required: true, }, @@ -173,8 +173,8 @@ export default { // Create parafeeractie const actieData = { - voorstel: this.voorstel.id, - step: this.voorstel.currentStep, + proposal: this.proposal.id, + step: this.proposal.currentStep, actor: userId, actorType: this.isDelegating ? 'delegate' : 'user', action: 'parafered', @@ -186,11 +186,11 @@ export default { await this.objectStore.saveObject('parafeeractie', actieData) // Advance voorstel - const nextStep = getNextStep(this.voorstel) - const newStatus = getStatusAfterAdvance(this.voorstel) - await this.objectStore.saveObject('voorstel', { - ...this.voorstel, - currentStep: nextStep || this.voorstel.currentStep, + const nextStep = getNextStep(this.proposal) + const newStatus = getStatusAfterAdvance(this.proposal) + await this.objectStore.saveObject('proposal', { + ...this.proposal, + currentStep: nextStep || this.proposal.currentStep, status: newStatus, }) @@ -209,19 +209,19 @@ export default { const userId = getCurrentUser()?.uid || '' await this.objectStore.saveObject('parafeeractie', { - voorstel: this.voorstel.id, - step: this.voorstel.currentStep, + proposal: this.proposal.id, + step: this.proposal.currentStep, actor: userId, actorType: 'user', action: 'advised', advice: this.adviceText, }) - const nextStep = getNextStep(this.voorstel) - const newStatus = getStatusAfterAdvance(this.voorstel) - await this.objectStore.saveObject('voorstel', { - ...this.voorstel, - currentStep: nextStep || this.voorstel.currentStep, + const nextStep = getNextStep(this.proposal) + const newStatus = getStatusAfterAdvance(this.proposal) + await this.objectStore.saveObject('proposal', { + ...this.proposal, + currentStep: nextStep || this.proposal.currentStep, status: newStatus, }) @@ -245,18 +245,18 @@ export default { const userId = getCurrentUser()?.uid || '' await this.objectStore.saveObject('parafeeractie', { - voorstel: this.voorstel.id, - step: this.voorstel.currentStep, + proposal: this.proposal.id, + step: this.proposal.currentStep, actor: userId, actorType: 'user', action: 'returned', comment: this.returnComment.trim(), }) - await this.objectStore.saveObject('voorstel', { - ...this.voorstel, + await this.objectStore.saveObject('proposal', { + ...this.proposal, status: 'teruggestuurd', - returnedFromStep: this.voorstel.currentStep, + returnedFromStep: this.proposal.currentStep, }) this.$emit('action-completed') diff --git a/src/views/voorstellen/components/ParafeerInbox.vue b/src/views/voorstellen/components/ParafeerInbox.vue index 0ba024b5f..40b7966a0 100644 --- a/src/views/voorstellen/components/ParafeerInbox.vue +++ b/src/views/voorstellen/components/ParafeerInbox.vue @@ -102,7 +102,7 @@ export default { async loadVoorstellen() { this.loading = true try { - const results = await this.objectStore.fetchCollection('voorstel', { + const results = await this.objectStore.fetchCollection('proposal', { _limit: 200, }) this.voorstellen = Array.isArray(results) diff --git a/tests/Unit/Lifecycle/VoorstelLifecycleTest.php b/tests/Unit/Lifecycle/VoorstelLifecycleTest.php index 5834c8893..8bbfb0176 100644 --- a/tests/Unit/Lifecycle/VoorstelLifecycleTest.php +++ b/tests/Unit/Lifecycle/VoorstelLifecycleTest.php @@ -48,7 +48,7 @@ final class VoorstelLifecycleTest extends TestCase { protected function setUp(): void { $registerPath = __DIR__ . '/../../../lib/Settings/procest_register.json'; $register = json_decode((string)file_get_contents($registerPath), true); - $proposal = $register['components']['schemas']['voorstel'] ?? []; + $proposal = $register['components']['schemas']['proposal'] ?? []; $this->lifecycle = ($proposal['configuration']['x-openregister-lifecycle'] ?? []); }//end setUp() diff --git a/tests/Unit/Listener/ApprovalStepNotificationListenerTest.php b/tests/Unit/Listener/ApprovalStepNotificationListenerTest.php index 35372ceab..cae73de4d 100644 --- a/tests/Unit/Listener/ApprovalStepNotificationListenerTest.php +++ b/tests/Unit/Listener/ApprovalStepNotificationListenerTest.php @@ -161,7 +161,7 @@ public function find(string $id, ...$kw): array { $this->settings->method('getObjectService')->willReturn($objectService); $this->settings->method('getConfigValue')->willReturnCallback( static function (string $key): string { - return $key === 'register' ? 'reg' : 'voorstel'; + return $key === 'register' ? 'reg' : 'proposal'; } ); }//end stubVoorstel() diff --git a/tests/Unit/Listener/ParaferingAuditListenerTest.php b/tests/Unit/Listener/ParaferingAuditListenerTest.php index 66c5fd150..716220606 100644 --- a/tests/Unit/Listener/ParaferingAuditListenerTest.php +++ b/tests/Unit/Listener/ParaferingAuditListenerTest.php @@ -136,7 +136,7 @@ public function testApprovedTransitionEmitsOrAuditEntry(): void { $this->settings->method('getConfigValue')->willReturnMap( [ ['register', '', 'procest'], - ['voorstel_schema', '', 'voorstel'], + ['voorstel_schema', '', 'proposal'], ] ); @@ -186,7 +186,7 @@ public function testTransitionWithoutReasonOmitsComment(): void { $this->settings->method('getConfigValue')->willReturnMap( [ ['register', '', 'procest'], - ['voorstel_schema', '', 'voorstel'], + ['voorstel_schema', '', 'proposal'], ] ); @@ -230,7 +230,7 @@ public function testUnresolvableVoorstelSkipsWriteAndDoesNotThrow(): void { $this->settings->method('getConfigValue')->willReturnMap( [ ['register', '', 'procest'], - ['voorstel_schema', '', 'voorstel'], + ['voorstel_schema', '', 'proposal'], ] ); @@ -262,7 +262,7 @@ public function testRawTransitionNameNamespacedVerbatim(): void { $this->settings->method('getConfigValue')->willReturnMap( [ ['register', '', 'procest'], - ['voorstel_schema', '', 'voorstel'], + ['voorstel_schema', '', 'proposal'], ] ); diff --git a/tests/Unit/Repair/RenameDutchSchemaSlugDecisionsTest.php b/tests/Unit/Repair/RenameDutchSchemaSlugDecisionsTest.php new file mode 100644 index 000000000..d67ad0ef6 --- /dev/null +++ b/tests/Unit/Repair/RenameDutchSchemaSlugDecisionsTest.php @@ -0,0 +1,313 @@ + + * @copyright 2026 Conduction B.V. + * @license EUPL-1.2 https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12 + * @link https://www.conduction.nl + * + * SPDX-FileCopyrightText: 2026 Conduction B.V. + * SPDX-License-Identifier: EUPL-1.2 + */ + +declare(strict_types=1); + +namespace OCA\Procest\Tests\Unit\Repair; + +use OCA\Procest\Repair\RenameDutchSchemaSlugDecisions; +use OCA\Procest\Repair\RenameDutchSchemaSlugs; +use OCP\DB\IResult; +use OCP\IDBConnection; +use OCP\Migration\IOutput; +use Psr\Log\LoggerInterface; +use PHPUnit\Framework\TestCase; + +/** + * The slug migration's decisions, exercised without a database. + * + * PHPUnit assertions take positional arguments; the named-parameter sniff does + * not apply to them. + * + * phpcs:disable CustomSniffs.Functions.NamedParameters + * + * @covers \OCA\Procest\Repair\RenameDutchSchemaSlugDecisions + * @covers \OCA\Procest\Repair\RenameDutchSchemaSlugs + * + * @spec exclude No canonical spec covers the Dutch-to-English vocabulary + * migration. Pointing this at an existing spec would report conformance to a + * requirement that says nothing about it. + */ +final class RenameDutchSchemaSlugDecisionsTest extends TestCase { + + /** + * The decisions under test. + * + * @var RenameDutchSchemaSlugDecisions + */ + private RenameDutchSchemaSlugDecisions $decisions; + + /** + * Set up the subject. + * + * @return void + * + * @spec exclude No canonical spec covers the Dutch-to-English vocabulary + * migration. Pointing this at an existing spec would report conformance to a + * requirement that says nothing about it. + */ + protected function setUp(): void { + parent::setUp(); + $this->decisions = new RenameDutchSchemaSlugDecisions(); + + }//end setUp() + + /** + * A slug present on the install is renamed; one that is absent is skipped. + * + * @return void + * + * @spec exclude No canonical spec covers the Dutch-to-English vocabulary + * migration. Pointing this at an existing spec would report conformance to a + * requirement that says nothing about it. + */ + public function testPlanRenamesOnlyWhatIsPresent(): void { + $plan = $this->decisions->plan( + ['catalogus' => 'catalog', 'voorstel' => 'proposal'], + ['catalogus', 'module'] + ); + + self::assertSame(['catalogus' => 'catalog'], $plan['renames']); + self::assertSame([], $plan['refused'], 'an absent slug is nothing to do, not a refusal'); + + }//end testPlanRenamesOnlyWhatIsPresent() + + /** + * A target that already exists refuses the rename rather than merging. + * + * Two schemas cannot share a slug, and combining them is a decision about + * data — never something a repair step should do on its own. + * + * @return void + * + * @spec exclude No canonical spec covers the Dutch-to-English vocabulary + * migration. Pointing this at an existing spec would report conformance to a + * requirement that says nothing about it. + */ + public function testPlanRefusesWhenTheTargetSlugExists(): void { + $plan = $this->decisions->plan( + ['catalogus' => 'catalog'], + ['catalogus', 'catalog'] + ); + + self::assertSame([], $plan['renames']); + self::assertArrayHasKey('catalogus', $plan['refused']); + self::assertStringContainsString('catalog', $plan['refused']['catalogus']); + + }//end testPlanRefusesWhenTheTargetSlugExists() + + /** + * A rename earlier in the map is visible to a later collision check. + * + * Without carrying the freshly taken name forward, two entries aiming at the + * same target would both read as safe and the second would collide at the + * database rather than here. + * + * @return void + * + * @spec exclude No canonical spec covers the Dutch-to-English vocabulary + * migration. Pointing this at an existing spec would report conformance to a + * requirement that says nothing about it. + */ + public function testPlanSeesItsOwnEarlierRenames(): void { + $plan = $this->decisions->plan( + ['catalogus' => 'catalog', 'catalogus2' => 'catalog'], + ['catalogus', 'catalogus2'] + ); + + self::assertSame(['catalogus' => 'catalog'], $plan['renames']); + self::assertArrayHasKey('catalogus2', $plan['refused']); + + }//end testPlanSeesItsOwnEarlierRenames() + + /** + * Schema ids are read out of the registers' JSON column defensively. + * + * A null, a malformed value or a non-numeric entry must yield no ids rather + * than a fatal: this runs inside a repair step, where an exception aborts + * the upgrade. + * + * @return void + * + * @spec exclude No canonical spec covers the Dutch-to-English vocabulary + * migration. Pointing this at an existing spec would report conformance to a + * requirement that says nothing about it. + */ + public function testSchemaIdsFromToleratesMalformedRows(): void { + $ids = $this->decisions->schemaIdsFrom([ + ['schemas' => '[34,35,35]'], + ['schemas' => '[40,"not-a-number",null]'], + ['schemas' => 'not json at all'], + ['schemas' => null], + [], + ]); + + self::assertSame([34, 35, 40], $ids, 'deduplicated, numeric only, no fatal'); + + }//end testSchemaIdsFromToleratesMalformedRows() + + + /** + * Every target in the shipped map is English and distinct. + * + * A duplicate target would mean two schemas aimed at one name; a target that + * is also somebody else's OLD name would mean the order of the map decides + * the outcome. + * + * @return void + * + * @spec exclude No canonical spec covers the Dutch-to-English vocabulary + * migration. Pointing this at an existing spec would report conformance to a + * requirement that says nothing about it. + */ + public function testShippedMapTargetsAreDistinctAndDoNotCollideWithSources(): void { + $map = RenameDutchSchemaSlugs::SLUG_MAP; + + self::assertSame( + count($map), + count(array_unique(array_values($map))), + 'two slugs must not target one name' + ); + + $sources = array_keys($map); + foreach ($map as $old => $new) { + self::assertNotContains( + $new, + $sources, + sprintf("target '%s' is also a source slug, so the map order would decide the result", $new) + ); + } + + }//end testShippedMapTargetsAreDistinctAndDoNotCollideWithSources() + /** + * The IN-clause placeholder list matches the parameter count. + * + * A mismatch between placeholders and bound parameters only shows up at + * runtime, inside a repair step, on somebody else's install. + * + * @return void + * + * @spec exclude No canonical spec covers the Dutch-to-English vocabulary + * migration. Pointing this at an existing spec would report conformance to a + * requirement that says nothing about it. + */ + public function testPlaceholdersMatchTheParameterCount(): void { + self::assertSame('?,?,?', $this->decisions->placeholders(3)); + self::assertSame('?', $this->decisions->placeholders(1)); + self::assertSame('', $this->decisions->placeholders(0), 'an empty IN list must not emit a stray ?'); + self::assertSame('', $this->decisions->placeholders(-1), 'a negative count is not a crash'); + + }//end testPlaceholdersMatchTheParameterCount() + + /** + * The shipped step names itself and its map is well formed. + * + * @return void + * + * @spec exclude No canonical spec covers the Dutch-to-English vocabulary + * migration. Pointing this at an existing spec would report conformance to a + * requirement that says nothing about it. + */ + public function testShippedStepNamesItself(): void { + $step = (new \ReflectionClass(RenameDutchSchemaSlugs::class))->newInstanceWithoutConstructor(); + self::assertNotSame('', $step->getName()); + self::assertStringContainsString('slug', strtolower($step->getName())); + + }//end testShippedStepNamesItself() + /** + * Slugs are read out of schema rows defensively. + * + * A null slug must yield an empty string, not a TypeError inside a repair + * step where an exception aborts the upgrade. + * + * @return void + * + * @spec exclude No canonical spec covers the Dutch-to-English vocabulary + * migration. Pointing this at an existing spec would report conformance to a + * requirement that says nothing about it. + */ + public function testSlugsFromToleratesMissingSlugs(): void { + self::assertSame( + ['catalogus', '', 'module'], + $this->decisions->slugsFrom([ + ['id' => 1, 'slug' => 'catalogus'], + ['id' => 2, 'slug' => null], + ['id' => 3, 'slug' => 'module'], + ]) + ); + self::assertSame([], $this->decisions->slugsFrom([])); + + }//end testSlugsFromToleratesMissingSlugs() + /** + * With no registers resolvable the step reports it and renames nothing. + * + * The failure mode this guards is the opposite of a crash: a repair step + * that cannot read the registers must say so and stop, not proceed against + * an empty id list and issue an UPDATE with an empty IN clause. + * + * @return void + * + * @spec exclude No canonical spec covers the Dutch-to-English vocabulary + * migration. Pointing this at an existing spec would report conformance to a + * requirement that says nothing about it. + */ + public function testNoRegistersIsANoOp(): void { + // An EMPTY result, not a thrown exception: the step catches + // OCP\DB\Exception specifically, so a RuntimeException from a mock + // escapes the try/catch and the test measures the mock rather than the + // step. The mirror of that trap — a mock throwing a type the step DOES + // catch — is how a broken step once read as a green no-op. + $result = $this->createMock(IResult::class); + $result->method('fetchAll')->willReturn([]); + + $db = $this->createMock(IDBConnection::class); + $db->method('executeQuery')->willReturn($result); + $db->expects(self::never())->method('executeStatement'); + + $step = new RenameDutchSchemaSlugs($db, $this->createMock(LoggerInterface::class)); + + $output = $this->createMock(IOutput::class); + $output->expects(self::once())->method('info')->with(self::stringContains('nothing to do')); + + $step->run($output); + + }//end testNoRegistersIsANoOp() + + /** + * The step is a repair step and its map is non-empty snake-free slugs. + * + * @return void + * + * @spec exclude No canonical spec covers the Dutch-to-English vocabulary + * migration. Pointing this at an existing spec would report conformance to a + * requirement that says nothing about it. + */ + public function testShippedMapIsWellFormed(): void { + $map = RenameDutchSchemaSlugs::SLUG_MAP; + self::assertNotSame([], $map); + + foreach ($map as $old => $new) { + self::assertNotSame($old, $new, "`$old` maps to itself"); + self::assertMatchesRegularExpression('/^[A-Za-z][A-Za-z0-9-]*$/', (string)$old); + self::assertMatchesRegularExpression('/^[A-Za-z][A-Za-z0-9-]*$/', (string)$new); + } + + self::assertTrue( + (new \ReflectionClass(RenameDutchSchemaSlugs::class))->implementsInterface(\OCP\Migration\IRepairStep::class) + ); + + }//end testShippedMapIsWellFormed() +}//end class diff --git a/tests/Unit/Service/BerichtenboxRoutingServiceTest.php b/tests/Unit/Service/BerichtenboxRoutingServiceTest.php index e384315ce..a099cddab 100644 --- a/tests/Unit/Service/BerichtenboxRoutingServiceTest.php +++ b/tests/Unit/Service/BerichtenboxRoutingServiceTest.php @@ -68,7 +68,7 @@ public function testBurgerRoutesToMijnOverheid(): void { ], ]); - $this->assertSame('berichtenbox-mijnoverheid', $result['kanaal']); + $this->assertSame('berichtenbox-mijnoverheid', $result['notificationChannel']); $this->assertNotEmpty($result['messageId']); $this->assertSame('systeem', $result['sentBy']); }//end testBurgerRoutesToMijnOverheid() @@ -88,7 +88,7 @@ public function testBedrijfRoutesToEherkenning(): void { ], ]); - $this->assertSame('berichtenbox-eherkenning', $result['kanaal']); + $this->assertSame('berichtenbox-eherkenning', $result['notificationChannel']); }//end testBedrijfRoutesToEherkenning() /** @@ -106,6 +106,6 @@ public function testFallbackToPrint(): void { ], ]); - $this->assertSame('print-post', $result['kanaal']); + $this->assertSame('print-post', $result['notificationChannel']); }//end testFallbackToPrint() }//end class diff --git a/tests/Unit/Service/DeadlineDailyScanServiceTest.php b/tests/Unit/Service/DeadlineDailyScanServiceTest.php index 17f1f5ac4..a93805e56 100644 --- a/tests/Unit/Service/DeadlineDailyScanServiceTest.php +++ b/tests/Unit/Service/DeadlineDailyScanServiceTest.php @@ -56,8 +56,8 @@ protected function setUp(): void { static function (string $key): string { return match ($key) { 'register' => 'procest', - 'termijn_definitie_schema' => 'termijnDefinitie', - 'termijn_instance_schema' => 'termijnInstance', + 'termijn_definitie_schema' => 'deadlineDefinition', + 'termijn_instance_schema' => 'deadlineInstance', 'termijn_gebeurtenis_schema' => 'termijnGebeurtenis', default => '', }; @@ -82,9 +82,9 @@ static function (string $key): string { * @return array */ private function seedInstance(string $deadline, string $status = 'lopend'): array { - return $this->objects->saveObject('procest', 'termijnInstance', [ + return $this->objects->saveObject('procest', 'deadlineInstance', [ 'case' => 'Z/2026/X', - 'termijnDefinitie' => 'td-ov', + 'deadlineDefinition' => 'td-ov', 'startDate' => '2026-01-01T10:00:00+00:00', 'endDateCalculated' => $deadline, 'endDateCurrent' => $deadline, @@ -134,7 +134,7 @@ public function testScanFlipsOverdueInstanceToOverschreden(): void { self::assertSame(1, $counts['overschreden']); self::assertSame(1, $counts['escalated']); - $rows = array_values($this->objects->store['termijnInstance']); + $rows = array_values($this->objects->store['deadlineInstance']); self::assertSame('overschreden', $rows[0]['status']); $events = array_values($this->objects->store['termijnGebeurtenis'] ?? []); @@ -148,7 +148,7 @@ public function testScanFlipsOverdueInstanceToOverschreden(): void { public function testScanRaisesPauseExpiredEvent(): void { $row = $this->seedInstance('2026-07-01', 'gepauzeerd'); $row['pauseDeadline'] = '2026-05-30'; - $this->objects->store['termijnInstance'][$row['id']] = $row; + $this->objects->store['deadlineInstance'][$row['id']] = $row; $counts = $this->scan->run(new DateTimeImmutable('2026-06-01T10:00:00+00:00')); self::assertSame(1, $counts['pauseExpired']); @@ -188,10 +188,10 @@ public function testScanAccruesEveryLopendDwangsomBerekening(): void { static function (string $key): string { return match ($key) { 'register' => 'procest', - 'termijn_definitie_schema' => 'termijnDefinitie', - 'termijn_instance_schema' => 'termijnInstance', + 'termijn_definitie_schema' => 'deadlineDefinition', + 'termijn_instance_schema' => 'deadlineInstance', 'termijn_gebeurtenis_schema' => 'termijnGebeurtenis', - 'dwangsom_berekening_schema' => 'dwangsomBerekening', + 'dwangsom_berekening_schema' => 'penaltyPaymentCalculation', default => '', }; }, @@ -208,9 +208,9 @@ static function (string $key): string { // Three lopend rows on day 0 — tier-1 increment is €23 (2300 cents). foreach (['b1', 'b2', 'b3'] as $id) { - $this->objects->saveObject('procest', 'dwangsomBerekening', [ + $this->objects->saveObject('procest', 'penaltyPaymentCalculation', [ 'id' => $id, - 'termijnInstance' => 'ti-' . $id, + 'deadlineInstance' => 'ti-' . $id, 'currentDag' => 0, 'cumulativeAmount' => 0, 'plafondBereikt' => false, @@ -218,9 +218,9 @@ static function (string $key): string { ]); } // One stopped row must be skipped. - $this->objects->saveObject('procest', 'dwangsomBerekening', [ + $this->objects->saveObject('procest', 'penaltyPaymentCalculation', [ 'id' => 'b-stopped', - 'termijnInstance' => 'ti-stopped', + 'deadlineInstance' => 'ti-stopped', 'currentDag' => 99, 'cumulativeAmount' => 999999, 'plafondBereikt' => false, @@ -233,11 +233,11 @@ static function (string $key): string { // Verify each lopend row advanced one tier-1 day; stopped row untouched. foreach (['b1', 'b2', 'b3'] as $id) { - $row = $this->objects->store['dwangsomBerekening'][$id]; + $row = $this->objects->store['penaltyPaymentCalculation'][$id]; self::assertSame(1, $row['currentDag'], $id . ' must advance huidigeDag by 1.'); self::assertSame(2300, $row['cumulativeAmount'], $id . ' must add tier-1 (2300 cents) once.'); } - $stopped = $this->objects->store['dwangsomBerekening']['b-stopped']; + $stopped = $this->objects->store['penaltyPaymentCalculation']['b-stopped']; self::assertSame(99, $stopped['currentDag'], 'stopped row must not advance.'); self::assertSame(999999, $stopped['cumulativeAmount'], 'stopped row must not accrue.'); } diff --git a/tests/Unit/Service/DeadlineMonitoringEndToEndTest.php b/tests/Unit/Service/DeadlineMonitoringEndToEndTest.php index 5a719a408..9a3fcbb74 100644 --- a/tests/Unit/Service/DeadlineMonitoringEndToEndTest.php +++ b/tests/Unit/Service/DeadlineMonitoringEndToEndTest.php @@ -69,11 +69,11 @@ protected function setUp(): void { static function (string $key): string { return match ($key) { 'register' => 'procest', - 'termijn_definitie_schema' => 'termijnDefinitie', - 'termijn_instance_schema' => 'termijnInstance', + 'termijn_definitie_schema' => 'deadlineDefinition', + 'termijn_instance_schema' => 'deadlineInstance', 'termijn_gebeurtenis_schema' => 'termijnGebeurtenis', - 'ingebrekestelling_schema' => 'ingebrekestelling', - 'dwangsom_berekening_schema' => 'dwangsomBerekening', + 'ingebrekestelling_schema' => 'noticeOfDefault', + 'dwangsom_berekening_schema' => 'penaltyPaymentCalculation', 'dwangsom_uitbetaling_schema' => 'dwangsomUitbetaling', default => '', }; @@ -103,7 +103,7 @@ static function (string $key): string { ); // Seed AWB-default Wmo definition. - $this->objects->saveObject('procest', 'termijnDefinitie', [ + $this->objects->saveObject('procest', 'deadlineDefinition', [ 'id' => 'td-ov', 'caseType' => 'omgevingsvergunning-regulier', 'wettelijkeGrondslag' => 'Wabo 3.9 lid 1', @@ -192,9 +192,9 @@ public function testScenario3ExtensionCase(): void { */ public function testScenario4OverschrijdingAndDwangsom(): void { // Seed overdue instance directly to simulate elapsed time without sleeping. - $instance = $this->objects->saveObject('procest', 'termijnInstance', [ + $instance = $this->objects->saveObject('procest', 'deadlineInstance', [ 'case' => 'Z/2026/S4', - 'termijnDefinitie' => 'td-ov', + 'deadlineDefinition' => 'td-ov', 'startDate' => '2026-01-01T10:00:00+00:00', 'endDateCalculated' => '2026-02-26', 'endDateCurrent' => '2026-02-26', @@ -211,14 +211,14 @@ public function testScenario4OverschrijdingAndDwangsom(): void { 'doc:notice' ); self::assertTrue($row['gevalideerd']); - self::assertArrayHasKey('dwangsomBerekening', $row); - $calculationId = (string)$row['dwangsomBerekening']['id']; + self::assertArrayHasKey('penaltyPaymentCalculation', $row); + $calculationId = (string)$row['penaltyPaymentCalculation']['id']; // Accrue 5 days. for ($i = 0; $i < 5; $i++) { $this->calcService->calculateDaily($calculationId); } - $accrued = $this->objects->store['dwangsomBerekening'][$calculationId]; + $accrued = $this->objects->store['penaltyPaymentCalculation'][$calculationId]; self::assertSame(5, $accrued['currentDag']); self::assertSame(11500, $accrued['cumulativeAmount']); @@ -254,15 +254,15 @@ public function testScenario4OverschrijdingAndDwangsom(): void { */ public function testScenario5Bezwaar(): void { // Stand up a stopped berekening + linked uitbetaling. - $this->objects->saveObject('procest', 'dwangsomBerekening', [ + $this->objects->saveObject('procest', 'penaltyPaymentCalculation', [ 'id' => 'b-s5', - 'termijnInstance' => 'ti-s5', + 'deadlineInstance' => 'ti-s5', 'status' => 'gestopt-wegens-beschikking', 'definitiveAmount' => 50000, ]); $this->objects->saveObject('procest', 'dwangsomUitbetaling', [ 'id' => 'u-s5', - 'dwangsomBerekening' => 'b-s5', + 'penaltyPaymentCalculation' => 'b-s5', 'amount' => 50000, 'status' => 'voorbereid', ]); diff --git a/tests/Unit/Service/DeadlineMonitoringSeedDataServiceTest.php b/tests/Unit/Service/DeadlineMonitoringSeedDataServiceTest.php index da460be1e..77e9e178b 100644 --- a/tests/Unit/Service/DeadlineMonitoringSeedDataServiceTest.php +++ b/tests/Unit/Service/DeadlineMonitoringSeedDataServiceTest.php @@ -48,7 +48,7 @@ protected function setUp(): void { static function (string $key): string { return match ($key) { 'register' => 'procest', - 'termijn_definitie_schema' => 'termijnDefinitie', + 'termijn_definitie_schema' => 'deadlineDefinition', default => '', }; }, @@ -69,7 +69,7 @@ public function testSeedCreatesThreeDefinitions(): void { self::assertSame(true, $result['success']); self::assertSame(3, $result['definities']); self::assertSame(0, $result['skipped']); - self::assertCount(3, $this->objects->store['termijnDefinitie']); + self::assertCount(3, $this->objects->store['deadlineDefinition']); } /** @@ -82,7 +82,7 @@ public function testSeedIsIdempotent(): void { self::assertSame(true, $second['success']); self::assertSame(0, $second['definities']); self::assertSame(3, $second['skipped']); - self::assertCount(3, $this->objects->store['termijnDefinitie']); + self::assertCount(3, $this->objects->store['deadlineDefinition']); } /** @@ -91,7 +91,7 @@ public function testSeedIsIdempotent(): void { public function testWooSeedHasCustomRegime(): void { $this->service->seed(); - $woo = $this->objects->store['termijnDefinitie']['td-woo-verzoek']; + $woo = $this->objects->store['deadlineDefinition']['td-woo-verzoek']; self::assertSame('woo-verzoek', $woo['caseType']); self::assertSame(28, $woo['standardDurationDays']); self::assertSame(1500, $woo['deviatingPenaltyPaymentRegime']['dailyTariff']); @@ -104,7 +104,7 @@ public function testWooSeedHasCustomRegime(): void { public function testWmoSeedHas42DayDuration(): void { $this->service->seed(); - $wmo = $this->objects->store['termijnDefinitie']['td-wmo-aanvraag']; + $wmo = $this->objects->store['deadlineDefinition']['td-wmo-aanvraag']; self::assertSame('wmo-melding', $wmo['caseType']); self::assertSame(42, $wmo['standardDurationDays']); self::assertSame(0, $wmo['countExtensions']); diff --git a/tests/Unit/Service/DeadlinePauseExtensionServiceTest.php b/tests/Unit/Service/DeadlinePauseExtensionServiceTest.php index 1ba6fcb7b..ac06034b7 100644 --- a/tests/Unit/Service/DeadlinePauseExtensionServiceTest.php +++ b/tests/Unit/Service/DeadlinePauseExtensionServiceTest.php @@ -57,8 +57,8 @@ protected function setUp(): void { static function (string $key): string { return match ($key) { 'register' => 'procest', - 'termijn_definitie_schema' => 'termijnDefinitie', - 'termijn_instance_schema' => 'termijnInstance', + 'termijn_definitie_schema' => 'deadlineDefinition', + 'termijn_instance_schema' => 'deadlineInstance', 'termijn_gebeurtenis_schema' => 'termijnGebeurtenis', default => '', }; @@ -71,7 +71,7 @@ static function (string $key): string { $this->extService = new DeadlineExtensionService($this->termService); // Seed an Omgevingsvergunning definition (max 1 extension). - $this->objects->saveObject('procest', 'termijnDefinitie', [ + $this->objects->saveObject('procest', 'deadlineDefinition', [ 'id' => 'td-ov', 'caseType' => 'omgevingsvergunning-regulier', 'wettelijkeGrondslag' => 'Wabo 3.9 lid 1', diff --git a/tests/Unit/Service/DeadlineReportingServiceTest.php b/tests/Unit/Service/DeadlineReportingServiceTest.php index f824114ab..01bbdd739 100644 --- a/tests/Unit/Service/DeadlineReportingServiceTest.php +++ b/tests/Unit/Service/DeadlineReportingServiceTest.php @@ -41,7 +41,7 @@ protected function setUp(): void { static function (string $key): string { return match ($key) { 'register' => 'procest', - 'termijn_instance_schema' => 'termijnInstance', + 'termijn_instance_schema' => 'deadlineInstance', 'dwangsom_uitbetaling_schema' => 'dwangsomUitbetaling', default => '', }; @@ -52,7 +52,7 @@ static function (string $key): string { // Seed 5 instances spread across Q2-2026 for one zaaktype. for ($i = 1; $i <= 5; $i++) { - $this->objects->saveObject('procest', 'termijnInstance', [ + $this->objects->saveObject('procest', 'deadlineInstance', [ 'id' => 'ti-q2-' . $i, 'caseType' => 'omgevingsvergunning-regulier', 'case' => 'Z/2026/' . (400 + $i), diff --git a/tests/Unit/Service/DwangsomBezwaarServiceTest.php b/tests/Unit/Service/DwangsomBezwaarServiceTest.php index 8f2707743..1d2e356cf 100644 --- a/tests/Unit/Service/DwangsomBezwaarServiceTest.php +++ b/tests/Unit/Service/DwangsomBezwaarServiceTest.php @@ -46,10 +46,10 @@ protected function setUp(): void { static function (string $key): string { return match ($key) { 'register' => 'procest', - 'termijn_definitie_schema' => 'termijnDefinitie', - 'termijn_instance_schema' => 'termijnInstance', + 'termijn_definitie_schema' => 'deadlineDefinition', + 'termijn_instance_schema' => 'deadlineInstance', 'termijn_gebeurtenis_schema' => 'termijnGebeurtenis', - 'dwangsom_berekening_schema' => 'dwangsomBerekening', + 'dwangsom_berekening_schema' => 'penaltyPaymentCalculation', 'dwangsom_uitbetaling_schema' => 'dwangsomUitbetaling', default => '', }; @@ -64,15 +64,15 @@ static function (string $key): string { ); // Seed berekening + uitbetaling. - $this->objects->saveObject('procest', 'dwangsomBerekening', [ + $this->objects->saveObject('procest', 'penaltyPaymentCalculation', [ 'id' => 'b-1', - 'termijnInstance' => 'ti-1', + 'deadlineInstance' => 'ti-1', 'status' => 'gestopt-wegens-beschikking', 'definitiveAmount' => 50000, ]); $this->objects->saveObject('procest', 'dwangsomUitbetaling', [ 'id' => 'u-1', - 'dwangsomBerekening' => 'b-1', + 'penaltyPaymentCalculation' => 'b-1', 'amount' => 50000, 'status' => 'voorbereid', ]); diff --git a/tests/Unit/Service/DwangsomCalculationServiceTest.php b/tests/Unit/Service/DwangsomCalculationServiceTest.php index a1c250446..4e8585cb6 100644 --- a/tests/Unit/Service/DwangsomCalculationServiceTest.php +++ b/tests/Unit/Service/DwangsomCalculationServiceTest.php @@ -45,9 +45,9 @@ protected function setUp(): void { static function (string $key): string { return match ($key) { 'register' => 'procest', - 'termijn_definitie_schema' => 'termijnDefinitie', - 'termijn_instance_schema' => 'termijnInstance', - 'dwangsom_berekening_schema' => 'dwangsomBerekening', + 'termijn_definitie_schema' => 'deadlineDefinition', + 'termijn_instance_schema' => 'deadlineInstance', + 'dwangsom_berekening_schema' => 'penaltyPaymentCalculation', default => '', }; }, @@ -72,10 +72,10 @@ public function testAwbTierBoundaries(): void { * @return void */ public function testCalculateDailyAdvancesOneDayAtTier1(): void { - $this->objects->saveObject('procest', 'dwangsomBerekening', [ + $this->objects->saveObject('procest', 'penaltyPaymentCalculation', [ 'id' => 'b1', - 'ingebrekestelling' => 'ig-1', - 'termijnInstance' => 'ti-1', + 'noticeOfDefault' => 'ig-1', + 'deadlineInstance' => 'ti-1', 'startDate' => '2026-03-29', 'currentDag' => 0, 'cumulativeAmount' => 0, @@ -96,10 +96,10 @@ public function testCalculateDailyAdvancesOneDayAtTier1(): void { * @return void */ public function testCalculateDailyTransitionsToTier2OnDay15(): void { - $this->objects->saveObject('procest', 'dwangsomBerekening', [ + $this->objects->saveObject('procest', 'penaltyPaymentCalculation', [ 'id' => 'b2', - 'ingebrekestelling' => 'ig-1', - 'termijnInstance' => 'ti-1', + 'noticeOfDefault' => 'ig-1', + 'deadlineInstance' => 'ti-1', 'startDate' => '2026-03-29', 'currentDag' => 14, 'cumulativeAmount' => 32200, @@ -119,10 +119,10 @@ public function testCalculateDailyTransitionsToTier2OnDay15(): void { * @return void */ public function testCalculateDailyTransitionsToTier3OnDay29(): void { - $this->objects->saveObject('procest', 'dwangsomBerekening', [ + $this->objects->saveObject('procest', 'penaltyPaymentCalculation', [ 'id' => 'b3', - 'ingebrekestelling' => 'ig-1', - 'termijnInstance' => 'ti-1', + 'noticeOfDefault' => 'ig-1', + 'deadlineInstance' => 'ti-1', 'startDate' => '2026-03-29', 'currentDag' => 28, 'cumulativeAmount' => 81200, @@ -142,10 +142,10 @@ public function testCalculateDailyTransitionsToTier3OnDay29(): void { * @return void */ public function testCalculateDailyCapsAtPlafond(): void { - $this->objects->saveObject('procest', 'dwangsomBerekening', [ + $this->objects->saveObject('procest', 'penaltyPaymentCalculation', [ 'id' => 'b4', - 'ingebrekestelling' => 'ig-1', - 'termijnInstance' => 'ti-1', + 'noticeOfDefault' => 'ig-1', + 'deadlineInstance' => 'ti-1', 'startDate' => '2026-03-29', 'currentDag' => 41, 'cumulativeAmount' => 142000, @@ -168,10 +168,10 @@ public function testCalculateDailyCapsAtPlafond(): void { * @return void */ public function testStopForBeschikkingLocksDefinitievBedrag(): void { - $this->objects->saveObject('procest', 'dwangsomBerekening', [ + $this->objects->saveObject('procest', 'penaltyPaymentCalculation', [ 'id' => 'b5', - 'ingebrekestelling' => 'ig-1', - 'termijnInstance' => 'ti-1', + 'noticeOfDefault' => 'ig-1', + 'deadlineInstance' => 'ti-1', 'startDate' => '2026-03-29', 'currentDag' => 5, 'cumulativeAmount' => 11500, @@ -194,20 +194,20 @@ public function testStopForBeschikkingLocksDefinitievBedrag(): void { */ public function testCustomRegimeUsesDefinitionTariff(): void { // Seed Woo definition + instance. - $this->objects->saveObject('procest', 'termijnDefinitie', [ + $this->objects->saveObject('procest', 'deadlineDefinition', [ 'id' => 'td-woo', 'caseType' => 'woo-verzoek', 'deviatingPenaltyPaymentRegime' => ['dailyTariff' => 1500, 'plafond' => 50000, 'grace' => 14], 'validFrom' => '2026-01-01', ]); - $this->objects->saveObject('procest', 'termijnInstance', [ + $this->objects->saveObject('procest', 'deadlineInstance', [ 'id' => 'ti-woo', - 'termijnDefinitie' => 'td-woo', + 'deadlineDefinition' => 'td-woo', ]); - $this->objects->saveObject('procest', 'dwangsomBerekening', [ + $this->objects->saveObject('procest', 'penaltyPaymentCalculation', [ 'id' => 'b-woo', - 'ingebrekestelling' => 'ig-woo', - 'termijnInstance' => 'ti-woo', + 'noticeOfDefault' => 'ig-woo', + 'deadlineInstance' => 'ti-woo', 'startDate' => '2026-03-29', 'currentDag' => 0, 'cumulativeAmount' => 0, diff --git a/tests/Unit/Service/DwangsomUitbetalingServiceTest.php b/tests/Unit/Service/DwangsomUitbetalingServiceTest.php index 9732e5130..6f46176d0 100644 --- a/tests/Unit/Service/DwangsomUitbetalingServiceTest.php +++ b/tests/Unit/Service/DwangsomUitbetalingServiceTest.php @@ -43,7 +43,7 @@ protected function setUp(): void { static function (string $key): string { return match ($key) { 'register' => 'procest', - 'dwangsom_berekening_schema' => 'dwangsomBerekening', + 'dwangsom_berekening_schema' => 'penaltyPaymentCalculation', 'dwangsom_uitbetaling_schema' => 'dwangsomUitbetaling', default => '', }; @@ -53,10 +53,10 @@ static function (string $key): string { $this->service = new DwangsomUitbetalingService($settings); // Seed a stopped berekening. - $this->objects->saveObject('procest', 'dwangsomBerekening', [ + $this->objects->saveObject('procest', 'penaltyPaymentCalculation', [ 'id' => 'b-stopped', - 'ingebrekestelling' => 'ig-1', - 'termijnInstance' => 'ti-1', + 'noticeOfDefault' => 'ig-1', + 'deadlineInstance' => 'ti-1', 'status' => 'gestopt-wegens-beschikking', 'definitiveAmount' => 35700, ]); @@ -112,7 +112,7 @@ public function testPrepareBetalingRejectsInvalidIban(): void { * @return void */ public function testPrepareBetalingRejectsZeroAmount(): void { - $this->objects->saveObject('procest', 'dwangsomBerekening', [ + $this->objects->saveObject('procest', 'penaltyPaymentCalculation', [ 'id' => 'b-zero', 'status' => 'gestopt-wegens-beschikking', 'definitiveAmount' => 0, diff --git a/tests/Unit/Service/NoticeOfDefaultServiceTest.php b/tests/Unit/Service/NoticeOfDefaultServiceTest.php index 1f380fe96..ebb511b37 100644 --- a/tests/Unit/Service/NoticeOfDefaultServiceTest.php +++ b/tests/Unit/Service/NoticeOfDefaultServiceTest.php @@ -51,11 +51,11 @@ protected function setUp(): void { static function (string $key): string { return match ($key) { 'register' => 'procest', - 'termijn_definitie_schema' => 'termijnDefinitie', - 'termijn_instance_schema' => 'termijnInstance', + 'termijn_definitie_schema' => 'deadlineDefinition', + 'termijn_instance_schema' => 'deadlineInstance', 'termijn_gebeurtenis_schema' => 'termijnGebeurtenis', - 'ingebrekestelling_schema' => 'ingebrekestelling', - 'dwangsom_berekening_schema' => 'dwangsomBerekening', + 'ingebrekestelling_schema' => 'noticeOfDefault', + 'dwangsom_berekening_schema' => 'penaltyPaymentCalculation', default => '', }; }, @@ -66,7 +66,7 @@ static function (string $key): string { $this->service = new NoticeOfDefaultService($settings, $this->termService, $logger); // Seed an AWB-default definition. - $this->objects->saveObject('procest', 'termijnDefinitie', [ + $this->objects->saveObject('procest', 'deadlineDefinition', [ 'id' => 'td-ov', 'caseType' => 'omgevingsvergunning-regulier', 'wettelijkeGrondslag' => 'Wabo 3.9 lid 1', @@ -76,10 +76,10 @@ static function (string $key): string { ]); // Seed an overdue TermijnInstance. - $this->objects->saveObject('procest', 'termijnInstance', [ + $this->objects->saveObject('procest', 'deadlineInstance', [ 'id' => 'ti-1', 'case' => 'Z/2026/300', - 'termijnDefinitie' => 'td-ov', + 'deadlineDefinition' => 'td-ov', 'startDate' => '2026-01-01T10:00:00+00:00', 'endDateCalculated' => '2026-02-25', 'endDateCurrent' => '2026-02-25', @@ -101,16 +101,16 @@ public function testValidNoticeCreatesBerekeningWithCorrectGrace(): void { self::assertTrue($row['gevalideerd']); self::assertSame('geldig', $row['validityStatus']); - self::assertArrayHasKey('dwangsomBerekening', $row); + self::assertArrayHasKey('penaltyPaymentCalculation', $row); - $b = $row['dwangsomBerekening']; + $b = $row['penaltyPaymentCalculation']; self::assertSame('2026-03-29', $b['startDate']); self::assertSame(144200, $b['plafondCalculated']); self::assertSame('awb-default', $b['regime']); self::assertSame('lopend', $b['status']); // Instance has the notice linked. - $updated = $this->objects->store['termijnInstance']['ti-1']; + $updated = $this->objects->store['deadlineInstance']['ti-1']; self::assertSame((string)$row['id'], $updated['relevantIngbrekes']); } @@ -119,10 +119,10 @@ public function testValidNoticeCreatesBerekeningWithCorrectGrace(): void { */ public function testPrematureNoticeIsRejected(): void { // Use a different instance still in lopend (not overschreden). - $this->objects->saveObject('procest', 'termijnInstance', [ + $this->objects->saveObject('procest', 'deadlineInstance', [ 'id' => 'ti-lopend', 'case' => 'Z/2026/301', - 'termijnDefinitie' => 'td-ov', + 'deadlineDefinition' => 'td-ov', 'startDate' => '2026-01-01T10:00:00+00:00', 'endDateCalculated' => '2026-12-31', 'endDateCurrent' => '2026-12-31', @@ -138,7 +138,7 @@ public function testPrematureNoticeIsRejected(): void { self::assertFalse($row['gevalideerd']); self::assertSame('premaat', $row['validityStatus']); - self::assertArrayNotHasKey('dwangsomBerekening', $row); + self::assertArrayNotHasKey('penaltyPaymentCalculation', $row); } /** @@ -150,7 +150,7 @@ public function testSecondNoticeDoesNotSpawnSecondBerekening(): void { new DateTimeImmutable('2026-03-15'), 'email' ); - self::assertArrayHasKey('dwangsomBerekening', $first); + self::assertArrayHasKey('penaltyPaymentCalculation', $first); $second = $this->service->registerNoticeOfDefault( 'ti-1', @@ -158,17 +158,17 @@ public function testSecondNoticeDoesNotSpawnSecondBerekening(): void { 'post' ); self::assertTrue($second['gevalideerd']); - self::assertArrayNotHasKey('dwangsomBerekening', $second); + self::assertArrayNotHasKey('penaltyPaymentCalculation', $second); // Only one berekening in the store. - self::assertCount(1, $this->objects->store['dwangsomBerekening'] ?? []); + self::assertCount(1, $this->objects->store['penaltyPaymentCalculation'] ?? []); } /** * @return void */ public function testCustomRegimeIsResolvedFromDefinition(): void { - $this->objects->saveObject('procest', 'termijnDefinitie', [ + $this->objects->saveObject('procest', 'deadlineDefinition', [ 'id' => 'td-woo', 'caseType' => 'woo-verzoek', 'wettelijkeGrondslag' => 'Woo art 4.4', @@ -177,10 +177,10 @@ public function testCustomRegimeIsResolvedFromDefinition(): void { 'deviatingPenaltyPaymentRegime' => ['dailyTariff' => 1500, 'plafond' => 50000, 'grace' => 14], 'validFrom' => '2026-01-01', ]); - $this->objects->saveObject('procest', 'termijnInstance', [ + $this->objects->saveObject('procest', 'deadlineInstance', [ 'id' => 'ti-woo', 'case' => 'Z/2026/302', - 'termijnDefinitie' => 'td-woo', + 'deadlineDefinition' => 'td-woo', 'startDate' => '2026-01-01T10:00:00+00:00', 'endDateCalculated' => '2026-01-29', 'endDateCurrent' => '2026-01-29', @@ -193,7 +193,7 @@ public function testCustomRegimeIsResolvedFromDefinition(): void { new DateTimeImmutable('2026-02-15'), 'post' ); - $b = $row['dwangsomBerekening']; + $b = $row['penaltyPaymentCalculation']; self::assertSame('afwijkend', $b['regime']); self::assertSame(50000, $b['plafondCalculated']); } diff --git a/tests/Unit/Service/RemainingDecisionDelegationTest.php b/tests/Unit/Service/RemainingDecisionDelegationTest.php index f916ab4eb..f2ce9c2bd 100644 --- a/tests/Unit/Service/RemainingDecisionDelegationTest.php +++ b/tests/Unit/Service/RemainingDecisionDelegationTest.php @@ -147,7 +147,7 @@ public function testVoorstelBesluitRaisesReportAdoption(): void { 'ra-1', function (DecisionRequestedEvent $event): void { $this->assertSame('report-adoption', $event->getDecisionType()); - $this->assertSame('voorstel', $event->getSubjectSchema()); + $this->assertSame('proposal', $event->getSubjectSchema()); } ); diff --git a/tests/Unit/Service/TermijnNotificationServiceTest.php b/tests/Unit/Service/TermijnNotificationServiceTest.php index b56372168..5854c8d52 100644 --- a/tests/Unit/Service/TermijnNotificationServiceTest.php +++ b/tests/Unit/Service/TermijnNotificationServiceTest.php @@ -49,13 +49,13 @@ protected function setUp(): void { static function (string $key): string { return match ($key) { 'register' => 'procest', - 'termijn_instance_schema' => 'termijnInstance', + 'termijn_instance_schema' => 'deadlineInstance', default => '', }; }, ); - $objects->saveObject('procest', 'termijnInstance', [ + $objects->saveObject('procest', 'deadlineInstance', [ 'id' => 'ti-1', 'case' => 'Z/2026/300', 'endDateCurrent' => '2026-07-27', @@ -78,7 +78,7 @@ public function testOntvangstbevestigingRendersZaakAndDeadline(): void { self::assertSame('Ontvangstbevestiging zaak Z/2026/300', $payload['subject']); self::assertStringContainsString('2026-07-27', $payload['body']); self::assertSame('burger-1', $payload['recipient']); - self::assertSame('ti-1', $payload['termijnInstance']); + self::assertSame('ti-1', $payload['deadlineInstance']); } /** diff --git a/tests/Unit/Service/TermijnServiceTest.php b/tests/Unit/Service/TermijnServiceTest.php index abf956eb5..c2271e919 100644 --- a/tests/Unit/Service/TermijnServiceTest.php +++ b/tests/Unit/Service/TermijnServiceTest.php @@ -49,8 +49,8 @@ protected function setUp(): void { static function (string $key): string { return match ($key) { 'register' => 'procest', - 'termijn_definitie_schema' => 'termijnDefinitie', - 'termijn_instance_schema' => 'termijnInstance', + 'termijn_definitie_schema' => 'deadlineDefinition', + 'termijn_instance_schema' => 'deadlineInstance', 'termijn_gebeurtenis_schema' => 'termijnGebeurtenis', default => '', }; @@ -62,7 +62,7 @@ static function (string $key): string { // Seed two definitions: omgevingsvergunning 56d (active) + Wmo 42d (active). $this->objects->saveObject( 'procest', - 'termijnDefinitie', + 'deadlineDefinition', [ 'id' => 'td-omgevingsvergunning-regulier', 'caseType' => 'omgevingsvergunning-regulier', @@ -74,7 +74,7 @@ static function (string $key): string { ); $this->objects->saveObject( 'procest', - 'termijnDefinitie', + 'deadlineDefinition', [ 'id' => 'td-wmo-aanvraag', 'caseType' => 'wmo-melding', @@ -94,7 +94,7 @@ public function testCreateTermijnInstanceForOmgevingsvergunningHas56DayDeadline( $instance = $this->service->createTermijnInstance('Z/2026/123', 'omgevingsvergunning-regulier', $start); self::assertSame('Z/2026/123', $instance['case']); - self::assertSame('td-omgevingsvergunning-regulier', $instance['termijnDefinitie']); + self::assertSame('td-omgevingsvergunning-regulier', $instance['deadlineDefinition']); self::assertSame('lopend', $instance['status']); self::assertSame('2026-07-27', $instance['endDateCalculated']); self::assertSame('2026-07-27', $instance['endDateCurrent']); @@ -135,7 +135,7 @@ public function testGetTermijnDefinitieReturnsLatestActiveVersion(): void { // Add a newer version of the omgevingsvergunning definition. $this->objects->saveObject( 'procest', - 'termijnDefinitie', + 'deadlineDefinition', [ 'id' => 'td-omgevingsvergunning-regulier-v2', 'caseType' => 'omgevingsvergunning-regulier', @@ -152,8 +152,8 @@ public function testGetTermijnDefinitieReturnsLatestActiveVersion(): void { static function (string $key): string { return match ($key) { 'register' => 'procest', - 'termijn_definitie_schema' => 'termijnDefinitie', - 'termijn_instance_schema' => 'termijnInstance', + 'termijn_definitie_schema' => 'deadlineDefinition', + 'termijn_instance_schema' => 'deadlineInstance', 'termijn_gebeurtenis_schema' => 'termijnGebeurtenis', default => '', }; @@ -223,14 +223,14 @@ public function testExistingTermijnInstanceRetainsOriginalDefinitieAfterVersionB 'omgevingsvergunning-regulier', new DateTimeImmutable('2026-01-15T09:00:00+00:00') ); - self::assertSame('td-omgevingsvergunning-regulier', $existing['termijnDefinitie']); + self::assertSame('td-omgevingsvergunning-regulier', $existing['deadlineDefinition']); // 2026-01-15 + 56 days = 2026-03-12. self::assertSame('2026-03-12', $existing['endDateCalculated']); // Phase 2 — publish a new v2 (70 days) for the same zaaktype. $this->objects->saveObject( 'procest', - 'termijnDefinitie', + 'deadlineDefinition', [ 'id' => 'td-omgevingsvergunning-regulier-v2', 'caseType' => 'omgevingsvergunning-regulier', @@ -245,7 +245,7 @@ public function testExistingTermijnInstanceRetainsOriginalDefinitieAfterVersionB // at creation time and is never re-resolved against the catalogue. $reloaded = $this->service->getTermijnInstance((string)$existing['id']); self::assertNotNull($reloaded); - self::assertSame('td-omgevingsvergunning-regulier', $reloaded['termijnDefinitie']); + self::assertSame('td-omgevingsvergunning-regulier', $reloaded['deadlineDefinition']); self::assertSame('2026-03-12', $reloaded['endDateCalculated']); // Phase 4 — a brand-new instance for the same zaaktype binds to v2. @@ -257,8 +257,8 @@ public function testExistingTermijnInstanceRetainsOriginalDefinitieAfterVersionB static function (string $key): string { return match ($key) { 'register' => 'procest', - 'termijn_definitie_schema' => 'termijnDefinitie', - 'termijn_instance_schema' => 'termijnInstance', + 'termijn_definitie_schema' => 'deadlineDefinition', + 'termijn_instance_schema' => 'deadlineInstance', 'termijn_gebeurtenis_schema' => 'termijnGebeurtenis', default => '', }; @@ -271,7 +271,7 @@ static function (string $key): string { 'omgevingsvergunning-regulier', new DateTimeImmutable('2026-04-01T09:00:00+00:00') ); - self::assertSame('td-omgevingsvergunning-regulier-v2', $fresh['termijnDefinitie']); + self::assertSame('td-omgevingsvergunning-regulier-v2', $fresh['deadlineDefinition']); // 2026-04-01 + 70 days = 2026-06-10. self::assertSame('2026-06-10', $fresh['endDateCalculated']); }//end testExistingTermijnInstanceRetainsOriginalDefinitieAfterVersionBump() diff --git a/tests/Unit/Service/WorkQueueServiceTest.php b/tests/Unit/Service/WorkQueueServiceTest.php index ed87f957d..b95c1f07d 100644 --- a/tests/Unit/Service/WorkQueueServiceTest.php +++ b/tests/Unit/Service/WorkQueueServiceTest.php @@ -58,7 +58,7 @@ static function (string $key): string { 'register' => 'procest', 'case_schema' => 'case', 'task_schema' => 'task', - 'termijn_instance_schema' => 'termijnInstance', + 'termijn_instance_schema' => 'deadlineInstance', default => '', }; } @@ -243,7 +243,7 @@ public function testComputeQueuePrefersActiveTermijnDeadlineOverCaseField(): voi 'deadline' => '2026-08-01', 'priority' => 'normal', ]); - $this->objects->saveObject('termijnInstance', [ + $this->objects->saveObject('deadlineInstance', [ 'id' => 'ti-1', 'case' => 'case-1', 'status' => 'lopend', diff --git a/tests/Unit/Settings/BezwaarCalculationRegistryTest.php b/tests/Unit/Settings/BezwaarCalculationRegistryTest.php index 0deadf6df..3f0ff5973 100644 --- a/tests/Unit/Settings/BezwaarCalculationRegistryTest.php +++ b/tests/Unit/Settings/BezwaarCalculationRegistryTest.php @@ -192,22 +192,22 @@ public function testDwangsomMatchesWorkedAwbExample(): void { $now = new DateTimeImmutable('2026-03-01T00:00:00+00:00'); // No ingebrekestelling -> no penalty clock -> EUR0 (not the plafond). - $none = $this->eval($expr, ['ingebrekestelling' => null], $now); + $none = $this->eval($expr, ['noticeOfDefault' => null], $now); $this->assertSame(0.0, (float)$none, 'null ingebrekestelling must yield EUR0, never the EUR1442 cap'); // Ingebrekestelling 2026-02-25: grace ends 2026-03-11 -> at 2026-03-01 the // grace has not lapsed -> EUR0. - $withinGrace = $this->eval($expr, ['ingebrekestelling' => '2026-02-25'], $now); + $withinGrace = $this->eval($expr, ['noticeOfDefault' => '2026-02-25'], $now); $this->assertSame(0.0, (float)$withinGrace, 'within the 14-day grace no dwangsom accrues'); // Ingebrekestelling 2026-01-25: grace ends 2026-02-08; at 2026-03-01 that // is 21 penalty days -> tier1 14*23=322 + tier2 7*35=245 = EUR567. - $midTier = $this->eval($expr, ['ingebrekestelling' => '2026-01-25'], $now); + $midTier = $this->eval($expr, ['noticeOfDefault' => '2026-01-25'], $now); $this->assertSame(567.0, (float)$midTier, '21 penalty days = 322 + 245 = 567'); // Ingebrekestelling 2026-01-01: grace ends 2026-01-15; at 2026-03-01 that // is 45 penalty days -> past 42 -> plafond EUR1442. - $capped = $this->eval($expr, ['ingebrekestelling' => '2026-01-01'], $now); + $capped = $this->eval($expr, ['noticeOfDefault' => '2026-01-01'], $now); $this->assertSame(1442.0, (float)$capped, '45 penalty days exceeds 42 -> capped at EUR1442'); }//end testDwangsomMatchesWorkedAwbExample() diff --git a/tests/Unit/Settings/SociaalDomeinFragmentTest.php b/tests/Unit/Settings/SociaalDomeinFragmentTest.php index 2c6fafaeb..5b46a125e 100644 --- a/tests/Unit/Settings/SociaalDomeinFragmentTest.php +++ b/tests/Unit/Settings/SociaalDomeinFragmentTest.php @@ -89,7 +89,7 @@ public function testSupportingSchemasPresent(): void { $this->assertArrayHasKey('mdoOverleg', $schemas); $this->assertArrayHasKey('reIntegratieTraject', $schemas); $this->assertArrayHasKey('toestemming', $schemas); - $this->assertArrayHasKey('avgClassificatie', $schemas); + $this->assertArrayHasKey('gdprClassification', $schemas); $this->assertArrayHasKey('sociaalDomeinAuditLog', $schemas); $this->assertArrayHasKey('avgIncident', $schemas); }//end testSupportingSchemasPresent() @@ -117,12 +117,12 @@ public function testZaaktypesRequireAvgClassificatie(): void { foreach (['wmoZaak', 'jeugdwetZaak', 'participatiewetZaak'] as $caseType) { $this->assertContains( - 'avgClassificatie', + 'gdprClassification', $schemas[$caseType]['required'], $caseType . ' must require an avgClassificatie block' ); $this->assertArrayHasKey( - 'avgClassificatie', + 'gdprClassification', $schemas[$caseType]['properties'], $caseType . ' must expose the avgClassificatie property' ); @@ -147,7 +147,7 @@ public function testRegisterMembershipUnioned(): void { 'participatiewetZaak', 'reIntegratieTraject', 'toestemming', - 'avgClassificatie', + 'gdprClassification', 'sociaalDomeinAuditLog', 'avgIncident', ] as $name) { @@ -200,9 +200,9 @@ public function testSeedRetentionTermsMatchSelectielijst(): void { } } - $this->assertSame(15, $bySlug['zaak-2026-wmo-04832']['avgClassificatie']['retentionTermYears']); - $this->assertSame(20, $bySlug['zaak-2026-jeugd-00921']['avgClassificatie']['retentionTermYears']); - $this->assertSame(10, $bySlug['zaak-2026-pw-01278']['avgClassificatie']['retentionTermYears']); + $this->assertSame(15, $bySlug['zaak-2026-wmo-04832']['gdprClassification']['retentionTermYears']); + $this->assertSame(20, $bySlug['zaak-2026-jeugd-00921']['gdprClassification']['retentionTermYears']); + $this->assertSame(10, $bySlug['zaak-2026-pw-01278']['gdprClassification']['retentionTermYears']); }//end testSeedRetentionTermsMatchSelectielijst() /** diff --git a/tests/Unit/Settings/SubsidieFragmentTest.php b/tests/Unit/Settings/SubsidieFragmentTest.php index 04f37a338..25f199a4e 100644 --- a/tests/Unit/Settings/SubsidieFragmentTest.php +++ b/tests/Unit/Settings/SubsidieFragmentTest.php @@ -102,7 +102,7 @@ public function testSubsidieSchemasPresent(): void { public function testBaseSchemasPreserved(): void { $schemas = $this->merged['components']['schemas']; $this->assertArrayHasKey('case', $schemas); - $this->assertArrayHasKey('voorstel', $schemas); + $this->assertArrayHasKey('proposal', $schemas); }//end testBaseSchemasPreserved() /** diff --git a/tests/e2e/spec-coverage/parafering-audit-via-or.spec.ts b/tests/e2e/spec-coverage/parafering-audit-via-or.spec.ts index a4981d9f6..40afb24e2 100644 --- a/tests/e2e/spec-coverage/parafering-audit-via-or.spec.ts +++ b/tests/e2e/spec-coverage/parafering-audit-via-or.spec.ts @@ -32,7 +32,7 @@ const REPO_ROOT = resolve(__dirname, '../../..') * even when the dev instance has not seeded data. */ function registerConfig(): { register: string; voorstelSchema: string } { - return { register: 'procest', voorstelSchema: 'voorstel' } + return { register: 'procest', voorstelSchema: 'proposal' } } test.describe('Parafering audit via OR — spec coverage', () => { diff --git a/tests/vitest/searchableSchemas.spec.js b/tests/vitest/searchableSchemas.spec.js index 7f510041d..84d3b4cd7 100644 --- a/tests/vitest/searchableSchemas.spec.js +++ b/tests/vitest/searchableSchemas.spec.js @@ -21,7 +21,7 @@ const REGISTER_PATH = path.resolve( ) const MANIFEST_PATH = path.resolve(__dirname, '../../src/manifest.json') -const EXPECTED_SEARCHABLE_SLUGS = ['case', 'task', 'bezwaar', 'voorstel', 'beroep'] +const EXPECTED_SEARCHABLE_SLUGS = ['case', 'task', 'bezwaar', 'proposal', 'beroep'] const loadJson = (filePath) => JSON.parse(fs.readFileSync(filePath, 'utf8')) @@ -61,7 +61,7 @@ describe('deep links cover all searchable schemas', () => { case: '/apps/procest/cases/{uuid}', task: '/apps/procest/tasks/{uuid}', bezwaar: '/apps/procest/bezwaren/{uuid}', - voorstel: '/apps/procest/voorstellen/{uuid}', + proposal: '/apps/procest/voorstellen/{uuid}', beroep: '/apps/procest/beroepen/{uuid}', } @@ -69,7 +69,7 @@ describe('deep links cover all searchable schemas', () => { case: '/cases/:id', task: '/tasks/:id', bezwaar: '/bezwaren/:id', - voorstel: '/voorstellen/:id', + proposal: '/voorstellen/:id', beroep: '/beroepen/:id', }