Creating a Journal Reversal handler.

This commit is contained in:
2026-07-15 17:29:02 +02:00
parent 0376b58a33
commit e109c1c695
7 changed files with 122 additions and 6 deletions
@@ -21,6 +21,7 @@ builder.Services.AddDbContext<AccountDbContext>(options =>
options.UseSqlite(connectionString));
builder.Services.AddScoped<IAccountQuery, AccountQuery>();
builder.Services.AddScoped<IReversalQuery, ReversalQuery>();
// Add services to the container.
// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi
@@ -67,4 +68,10 @@ app.MapPost("/accounts/transfer", async (TransferFundsCommand cmd, IMessageBus b
return Results.Accepted();
});
app.MapPost("/journal/reverse", async (ReverseJournalCommand cmd, IMessageBus bus) =>
{
await bus.InvokeAsync(cmd);
return Results.Accepted();
});
app.Run();