test+chore: real-SQLite query coverage, batch detect writes, finish date centralization

Review follow-ups:
- (HIGH) Add real-SQLite round-trip tests for the new query methods so the load-bearing
  lexical O-format date ordering is verified, not just mocked: Anomaly
  ListByDateRange/CountSince, Snapshot CountSince/ListByEvents grouping, Event Query/GetMany.
- (MED) DetectAnomaliesUseCase: one SaveChanges per event instead of per anomaly.
- (LOW) Route PlacedBetRepository + ExcelExporter date bounds through SqliteDateText.
- (LOW) Backtest: reject a one-sided date range (was silently ignored).
- (LOW) Refresh stale comments after the detector fan-out.
This commit is contained in:
2026-05-29 01:25:25 +03:00
parent c9eee9f907
commit b67030ae7f
5 changed files with 107 additions and 11 deletions
@@ -33,6 +33,10 @@ public sealed class BacktestForm
{
if (StartingBankroll <= 0m) { error = "Bankroll must be positive."; return false; }
if (MinScore is < 0m or > 1m) { error = "Min score must be in [0, 1]."; return false; }
// A one-sided range would be silently ignored (ToDateRange needs both bounds), so
// require both-or-neither and give the user explicit feedback.
if (From.HasValue != To.HasValue)
{ error = "Set both From and To dates, or leave both empty."; return false; }
if (From is { } f && To is { } t && f.Date > t.Date)
{ error = "From date must be on or before To date."; return false; }
switch (StakeRule)