feat(ui): event autocomplete + log-bet deep link, steam-move label

- MyBets: add a "Find event" MudAutocomplete over upcoming events (loaded once,
  filtered client-side) that fills the Event ID; the manual ID field stays as a
  fallback. Backed by IBetJournalService.GetUpcomingEventOptionsAsync.
- Add a "Log bet" CTA on the anomaly detail page that deep-links to
  /my-bets?eventId=<code>; the journal prefills the Event ID from the query.
- Render the new SteamMove anomaly kind with a localized label in the card and
  detail KindLabel switches (was falling through to the raw enum name).
- Localization (en+ru) for all new strings.
This commit is contained in:
2026-05-28 23:08:56 +03:00
parent 2b1025cae3
commit d9d92ea8fd
7 changed files with 103 additions and 0 deletions
@@ -1,4 +1,6 @@
using System.Globalization;
using Marathon.Application.Abstractions;
using Marathon.Application.Storage;
using Marathon.Application.UseCases;
using Marathon.Domain.Entities;
using Marathon.Domain.Enums;
@@ -95,4 +97,21 @@ public sealed class BetJournalService : IBetJournalService
public Task<int> ResolvePendingAsync(CancellationToken ct) =>
_resolve.ExecuteAsync(ct);
public async Task<IReadOnlyList<EventOption>> GetUpcomingEventOptionsAsync(CancellationToken ct)
{
// Generous betting window: recently started through a month out. Loaded once
// by the page; the autocomplete filters this list in memory per keystroke.
var now = MoscowTime.Now;
var range = new DateRange(now.AddDays(-7), now.AddDays(30));
var events = await _events.ListByDateRangeAsync(range, ct).ConfigureAwait(false);
return events
.OrderBy(e => e.ScheduledAt)
.Select(e => new EventOption(
e.Id.Value,
string.Concat(e.Title, " · ", e.ScheduledAt.ToString("yyyy-MM-dd HH:mm", CultureInfo.InvariantCulture)),
e.ScheduledAt))
.ToList();
}
}