WIP(initial-implementation): parallel batch P2/P3/P5 — code complete, unreviewed

Snapshot of the parallel batch (Phases 2 + 3 + 5) at session pause. Solution does
NOT build cleanly yet — known cross-phase compile issues remain to be resolved
before review. See plans/initial-implementation/PLAN.md "Resume Notes" section
for the exact tomorrow-morning action list.

Phase 2 (Storage):
- Repository interfaces in Marathon.Application/Abstractions
- DateRange, ExportKind, StorageOptions in Marathon.Application/Storage
- EF Core 8 + SQLite (WAL) persistence: 7 entities + configurations + 4 repos
- Hand-written InitialCreate migration (dotnet ef blocked by parallel work)
- ClosedXML ExcelExporter with exact customer-spec wide columns
- PersistenceModule.AddMarathonPersistence DI extension
- Round-trip + export tests (cannot run yet — see cross-phase issues)

Phase 3 (Scraping):
- IOddsScraper, IBetPlacer in Marathon.Application/Abstractions
- ScrapingOptions in Marathon.Infrastructure/Configuration
- MarathonbetScraper with 4 parsers (Upcoming, Live, EventOdds, Results)
- Helpers: ServerTimeProvider, PeriodScopeMapper, OutcomeCodeMapper, MoscowDateParser
- UserAgentRotatorHandler + Polly v8 resilience pipeline
- ScrapingModule.AddMarathonScraping DI extension
- GlobalUsings.cs aliases for EventId / Configuration disambiguation
- Parser tests with trimmed HTML fixtures
- ScrapeResultsAsync interim no-op (Phase 8 will replace via watch-list polling)

Phase 5 (UI shell — killed mid-final-verify, assumed ~95%):
- Marathon.UI populated: MainLayout, App.razor, Pages (Home, Settings),
  Components, Theme (MarathonTheme.cs + Tokens.cs + app.css), Resources
  (SharedResource.{cs,ru.resx,en.resx}), Services (ISettingsWriter), wwwroot
- WPF host: App.xaml(.cs), MainWindow.xaml(.cs), Marathon.Hosts.WpfBlazor.csproj
  with Microsoft.AspNetCore.Components.WebView.Wpf + MudBlazor + Serilog
- appsettings.json + appsettings.Development.json with all sections wired
- bUnit tests: MainLayoutTests, LocaleSwitcherTests, ThemeToggleTests,
  JsonSettingsWriterTests + Support helpers

Cross-phase issues to resolve at next session:
1. Phase 2 repository classes are 'internal' — Phase 3's tests can't reference
   them. Fix: add InternalsVisibleTo to Marathon.Infrastructure.csproj.
2. Phase 5: LocalizationOptions namespace ambiguity (AspNetCore vs Extensions).
3. Phase 5: WpfBlazor Serilog API mismatch.

Reviewer has NOT run on this batch. Move to Phase 4 only after build is green
and a combined parallel-batch reviewer passes.
This commit is contained in:
2026-05-05 01:56:53 +03:00
parent 144c936e90
commit e4d8476782
129 changed files with 8524 additions and 121 deletions
@@ -0,0 +1,74 @@
<!DOCTYPE html>
<html lang="ru">
<head>
<script type="text/javascript">
//<![CDATA[
initData = {"serverTime":"2026,05,05,00,42,28","timeZoneId":"Europe/Moscow"};
//]]>
</script>
</head>
<body>
<ol class="breadcrumbs-list">
<li class="breadcrumbs-item"><a href="/su/"><span class="breadcrumb-text">Ставки на спорт</span></a></li>
<li class="breadcrumbs-item"><a href="/su/betting/Football+-+11"><span class="breadcrumb-text">Ставки на Футбол</span></a></li>
<li class="breadcrumbs-item"><a href="/su/betting/Football/Clubs.+International+-+4409575"><span class="breadcrumb-text">Клубы. Международные</span></a></li>
<li class="breadcrumbs-item"><a href="/su/betting/Football/Clubs.+International/UEFA+Champions+League+-+21255"><span class="breadcrumb-text">Лига чемпионов УЕФА</span></a></li>
<li class="breadcrumbs-item"><span class="breadcrumb-text">Арсенал - Атлетико Мадрид</span></li>
</ol>
<div class=" coupon-row" data-event-eventId="26456117" data-event-treeId="28089645"
data-event-name="Арсенал - Атлетико Мадрид" data-live="false">
<table class="coupon-row-item">
<tbody>
<tr>
<td class="hidden" data-mutable-id="eventJsonInfo"
data-json="{&quot;treeId&quot;:28089645,&quot;marathonEventId&quot;:26456117,&quot;teamNames&quot;:[&quot;Арсенал&quot;,&quot;Атлетико Мадрид&quot;],&quot;matchTime&quot;:{&quot;seconds&quot;:0,&quot;finalScore&quot;:false,&quot;isOvertime&quot;:false},&quot;eventInningTimes&quot;:[],&quot;inningScore&quot;:[],&quot;overTimeInningScore&quot;:[],&quot;currentInning&quot;:-1,&quot;serve&quot;:0,&quot;resultDescription&quot;:&quot;&quot;,&quot;matchIsComplete&quot;:false}">
</td>
</tr>
</tbody>
</table>
</div>
<!-- Match Result (1x2) -->
<td data-market-type="RESULT">
<span data-selection-price="1.65" data-selection-key="26456117@Match_Result.1">1.65</span>
</td>
<td data-market-type="RESULT">
<span data-selection-price="4.1" data-selection-key="26456117@Match_Result.draw">4.10</span>
</td>
<td data-market-type="RESULT">
<span data-selection-price="5.7" data-selection-key="26456117@Match_Result.3">5.70</span>
</td>
<!-- Handicap -->
<td data-market-type="HANDICAP">
(-1.0)<br/>
<span data-selection-price="2.04" data-selection-key="26456117@To_Win_Match_With_Handicap.HB_H">2.04</span>
</td>
<td data-market-type="HANDICAP">
(+1.0)<br/>
<span data-selection-price="1.82" data-selection-key="26456117@To_Win_Match_With_Handicap.HB_A">1.82</span>
</td>
<!-- Total Goals -->
<td data-market-type="TOTAL">
(2.5)<br/>
<span data-selection-price="1.92" data-selection-key="26456117@Total_Goals.Under_2.5">1.92</span>
</td>
<td data-market-type="TOTAL">
(2.5)<br/>
<span data-selection-price="1.92" data-selection-key="26456117@Total_Goals.Over_2.5">1.92</span>
</td>
<!-- Period 1 (1st Half) Result -->
<span data-selection-price="1.80" data-selection-key="26456117@Result_-_1st_Half.RN_H">1.80</span>
<span data-selection-price="3.60" data-selection-key="26456117@Result_-_1st_Half.RN_D">3.60</span>
<span data-selection-price="4.20" data-selection-key="26456117@Result_-_1st_Half.RN_A">4.20</span>
<!-- Period 2 (2nd Half) Result -->
<span data-selection-price="2.10" data-selection-key="26456117@Result_-_2nd_Half.RN_H">2.10</span>
<span data-selection-price="2.80" data-selection-key="26456117@Result_-_2nd_Half.RN_D">2.80</span>
<span data-selection-price="3.50" data-selection-key="26456117@Result_-_2nd_Half.RN_A">3.50</span>
</body>
</html>