Files
Inboxintel/src/InboxIntel.Application/DTOs/SearchDtos.cs
T
cesnimda 01fb74eb38
CI / backend (pull_request) Successful in 1m18s
CI / frontend (pull_request) Successful in 22s
CI / format (pull_request) Successful in 1m8s
CI / db-tests (pull_request) Successful in 1m13s
Security / secrets (pull_request) Successful in 5s
Security / dependencies (pull_request) Successful in 1m7s
perf(search): keyset pagination + fix the format-gate line-ending flip-flop
RECOMMENDATIONS #8: additive AfterSentAtUtc+AfterId cursor — browse windows fetch
via a (SentAtUtc, Id) keyset filter, O(pageSize) at any depth, COUNT skipped
(TotalCount=-1). Adds the Id tie-break to browse ordering (fixes latent
duplicate/skip on equal timestamps). Verified: InMemory continuation test + a
live-Postgres throwaway proving the Guid cursor comparison translates (removed).

Also root-causes the recurring pre-commit/CI format failures: dotnet-format on
Windows defaulted to CRLF while .gitattributes stores LF — the two fought forever.
Adds .editorconfig (end_of_line=lf etc.) so every tool agrees, and normalises the
straggler files. This bug bit three separate commits before being diagnosed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-02 17:53:18 +02:00

32 lines
1.2 KiB
C#

namespace InboxIntel.Application.DTOs;
/// <summary>
/// Advanced search request. <see cref="Query"/> accepts Gmail-like syntax
/// (e.g. "from:github.com is:unread has:attachment newsletter") which the
/// query parser decomposes into structured filters; remaining free text runs
/// through PostgreSQL full-text search.
/// </summary>
public record SearchRequestDto(
string? Query,
string? Sender,
string? Domain,
DateOnly? From,
DateOnly? To,
bool? IsUnread,
bool? HasAttachments,
bool FuzzyMatch = false,
int Page = 1,
int PageSize = 50,
// Folder / label filters
bool? IsInInbox = null,
bool? IsStarred = null,
bool? IsTrashed = null,
string? GmailLabel = null, // e.g. "SENT", "DRAFT", "SPAM"
string? Category = null, // EmailCategory name, e.g. "Finance"
long? MinSizeBytes = null,
// Keyset cursor for the date-ordered browse path (RECOMMENDATIONS #8): pass the last
// row's SentAtUtc+Id to fetch the next window without OFFSET (O(pageSize), not O(page)).
// When set, TotalCount is not recomputed (-1). Additive; offset paging still works.
DateTimeOffset? AfterSentAtUtc = null,
Guid? AfterId = null);