feat(trades): align TradeProposal and TradeAcceptance DTOs, update lifecycle and migrations

This commit is contained in:
2026-08-14 23:55:29 +02:00
parent 1447f0aa4c
commit 2151fd89f0
10 changed files with 780 additions and 85 deletions
+6 -6
View File
@@ -11,22 +11,22 @@ using Microsoft.Extensions.Logging;
var builder = Host.CreateApplicationBuilder(args);
// Register DB Context
// 1. Standard DbContext (Scoped)
builder.Services.AddDbContext<TradesDbContext>(options =>
options.UseNpgsql(builder.Configuration.GetConnectionString("DefaultConnection")));
// Register Domain Services
builder.Services.AddSingleton<ITradeLifecycleService, TradeLifecycleService>();
// 2. Domain Services (Scoped)
builder.Services.AddScoped<ITradeLifecycleService, TradeLifecycleService>();
builder.Services.AddScoped<ISettingsDbService, SettingsDbService>();
// Register Hosted Services
// 3. Hosted Services / Singletons
builder.Services.AddSingleton<TradesMqttClient>();
builder.Services.AddHostedService(sp => sp.GetRequiredService<TradesMqttClient>());
builder.Services.AddHostedService<FeedbackExporterEngine>();
var host = builder.Build();
// Run DB Migrations
// DB Migrations ausführen
using (var scope = host.Services.CreateScope())
{
try
@@ -45,4 +45,4 @@ using (var scope = host.Services.CreateScope())
}
}
await host.RunAsync();
await host.RunAsync();