From 1b161f1b960f13a19d924e60fe4903aec0ab0f9a Mon Sep 17 00:00:00 2001 From: Jeppe B <2jepp9350@gmail.com> Date: Wed, 29 Jul 2026 13:54:58 +0200 Subject: [PATCH] Guard Superuser invoicing registration search fields (#331) ## Summary - Adds a backend contract guard that Superuser invoicing period search continues to include all separate registration columns: `reg_1`, `reg_2`, and `reg_3`. - This preserves the API/search behavior that the frontend object-tree registration layout relies on. ## Tests - `vendor/bin/pest tests/Unit/Invoicing/InvoicingPeriodRouteGuardsTest.php --colors=always` Note: local Composer install was run with `--ignore-platform-req=ext-mysqli --ignore-platform-req=ext-gd` because those PHP extensions are not enabled in this worker image; the executed guard test does not use them. Co-authored-by: Jeppe Bundgaard --- .../Unit/Invoicing/InvoicingPeriodRouteGuardsTest.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/services/nginx/app/tests/Unit/Invoicing/InvoicingPeriodRouteGuardsTest.php b/services/nginx/app/tests/Unit/Invoicing/InvoicingPeriodRouteGuardsTest.php index 7a9382bc..f6cb7f09 100644 --- a/services/nginx/app/tests/Unit/Invoicing/InvoicingPeriodRouteGuardsTest.php +++ b/services/nginx/app/tests/Unit/Invoicing/InvoicingPeriodRouteGuardsTest.php @@ -119,6 +119,16 @@ it('uses batched period transactions and keyed customer maps in the main period ->and($content)->not->toContain('getOrdersWithPossibleDuplicates($dateFrom, $dateTo)'); }); +it('keeps period search aware of all separate order registration columns', function (): void { + $content = file_get_contents(app_path('routes/InvoicingPeriodRoute.php')); + + expect($content)->not->toBeFalse(); + $content = (string)$content; + + expect($content)->toContain("foreach (['id', 'reference', 'po', 'notes', 'reg_1', 'reg_2', 'reg_3'] as \$field)") + ->and($content)->toContain("\$values[] = \$transaction[\$field] ?? '';"); +}); + it('falls back to configured e-conomic default department for missing customer default department in distributions', function (): void { $content = file_get_contents(app_path('routes/InvoicingPeriodRoute.php'));