Extract a SearchFilters record for the document search signatures #683

Open
opened 2026-05-27 19:10:23 +02:00 by marcel · 0 comments
Owner

Context

Follow-up flagged in the review of PR #682 (Phase 6 undated documents, #668) — Felix (developer).

After threading the undated filter through search, DocumentService.searchDocuments(...) and findIdsForFilter(...) (and the controller that calls them) now take ~13 positional parameters. That's hard to read and easy to mis-call (positional args of the same type are a swap-bug risk).

Suggested approach

  • Introduce a SearchFilters record (q, from, to, tags, sender, receiver, status, scriptType, undated, sort, direction, page, size — whatever the real set is) in the document package.
  • Replace the long positional signatures on the service + the /search and /ids paths; the controller binds query params into the record.
  • Pure refactor — no behavior change; existing search/undated tests must stay green.

Out of scope / notes

  • Deliberately NOT done in #682 to keep that PR focused; Felix explicitly flagged it as a follow-up.
  • No API/behavior change intended.
## Context Follow-up flagged in the review of PR #682 (Phase 6 undated documents, #668) — Felix (developer). After threading the `undated` filter through search, `DocumentService.searchDocuments(...)` and `findIdsForFilter(...)` (and the controller that calls them) now take **~13 positional parameters**. That's hard to read and easy to mis-call (positional args of the same type are a swap-bug risk). ## Suggested approach - Introduce a `SearchFilters` record (q, from, to, tags, sender, receiver, status, scriptType, undated, sort, direction, page, size — whatever the real set is) in the `document` package. - Replace the long positional signatures on the service + the `/search` and `/ids` paths; the controller binds query params into the record. - Pure refactor — no behavior change; existing search/undated tests must stay green. ## Out of scope / notes - Deliberately NOT done in #682 to keep that PR focused; Felix explicitly flagged it as a follow-up. - No API/behavior change intended.
marcel added the P3-laterrefactor labels 2026-05-27 19:10:35 +02:00
Sign in to join this conversation.
No Label P3-later refactor
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: marcel/familienarchiv#683