diff --git a/src/Predictalytics.Api/ApiConfiguration.cs b/src/Predictalytics.Api/ApiConfiguration.cs
index c9da848..6c0174c 100644
--- a/src/Predictalytics.Api/ApiConfiguration.cs
+++ b/src/Predictalytics.Api/ApiConfiguration.cs
@@ -23,20 +23,34 @@ public static class ApiConfiguration
app.UseSwagger();
app.UseSwaggerUI();
app.UseDefaultFiles();
- app.UseStaticFiles();
+ app.UseStaticFiles(new StaticFileOptions
+ {
+ // Internal dashboard: always revalidate so UI fixes reach the browser immediately.
+ OnPrepareResponse = ctx => ctx.Context.Response.Headers.CacheControl = "no-cache"
+ });
- // Map endpoints
+ app.MapPredictalyticsEndpoints();
+
+ return app;
+ }
+
+ ///
+ /// Single source of truth for ALL API endpoint registrations.
+ /// Both the standalone API and the embedded WinForms Kestrel server MUST use
+ /// this method — never register endpoints individually in either host, or the
+ /// two servers drift apart (missing /api/watchlist in the embedded host was
+ /// exactly this class of bug).
+ ///
+ public static void MapPredictalyticsEndpoints(this WebApplication app)
+ {
app.MapDashboardEndpoints();
app.MapTraderEndpoints();
app.MapAlertEndpoints();
app.MapMarketEndpoints();
+ app.MapSearchEndpoints();
app.MapJobEndpoints();
app.MapDevEndpoints();
app.MapWatchlistEndpoints();
-
- // Health check
app.MapGet("/api/health", () => Results.Ok(new { Status = "OK", Timestamp = DateTime.UtcNow }));
-
- return app;
}
}
diff --git a/src/Predictalytics.Api/Endpoints/WatchlistEndpoints.cs b/src/Predictalytics.Api/Endpoints/WatchlistEndpoints.cs
index 45306eb..28ac86c 100644
--- a/src/Predictalytics.Api/Endpoints/WatchlistEndpoints.cs
+++ b/src/Predictalytics.Api/Endpoints/WatchlistEndpoints.cs
@@ -15,11 +15,12 @@ public static class WatchlistEndpoints
return Results.Ok(list.Select(w => new
{
w.TraderId,
- w.Trader.DisplayName,
- w.Trader.PlatformUserId,
- w.Trader.TotalPnl,
- w.Trader.WinRate,
- CopytradingScore = w.Trader.CurrentScore?.CombinedScore ?? 0,
+ DisplayName = w.Trader?.DisplayName ?? "?",
+ PlatformUserId = w.Trader?.PlatformUserId ?? "",
+ Platform = w.Trader?.Platform.ToString() ?? "Unknown",
+ TotalPnl = w.Trader?.TotalPnl ?? 0,
+ WinRate = w.Trader?.WinRate ?? 0,
+ CopytradingScore = w.Trader?.Analytics?.CopytradingScore ?? 0,
w.Label,
w.Notes,
CreatedAt = w.AddedAt
diff --git a/src/Predictalytics.Api/wwwroot/index.html b/src/Predictalytics.Api/wwwroot/index.html
index 76c962b..e7441f2 100644
--- a/src/Predictalytics.Api/wwwroot/index.html
+++ b/src/Predictalytics.Api/wwwroot/index.html
@@ -7,7 +7,7 @@
Predictalytics
-
+
@@ -472,6 +472,6 @@
-
+