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 <jb@truckwash.dk>
This commit is contained in:
co-authored by
Jeppe Bundgaard
parent
448e0e50c2
commit
1b161f1b96
@@ -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'));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user