Full ASP.NET Core minimal API with 13 endpoint groups: - Auth: login (session cookies), logout, me, password reset - Accounts: CRUD for chart of accounts with budget owner - Ledger: inspect with running balance, balance sheet, P&L, transactions - Expense Claims: list, create (with VAT), attest, validate - Invoices: inbound (with OOD), outbound (with VAT), attestation - Payouts: list, create - Crypto: treasury overview, addresses, UTXOs - Documents: upload (multipart), download - Dashboard: task groups, YTD P&L - Organizations: list, get, update settings - Users: CRUD, role assignment/removal - End of Month: checklist, close year - Dev: impersonation (disabled in production) Tested live against migrated production data — all endpoints returning correct financial data from the v6 database. Made-with: Cursor
36 lines
861 B
C#
36 lines
861 B
C#
using UsingCash.Api.Configuration;
|
|
using UsingCash.Api.Endpoints;
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
builder.Services.AddUsingCashServices(builder.Configuration);
|
|
|
|
var app = builder.Build();
|
|
|
|
app.UseMiddleware<ErrorMiddleware>();
|
|
app.UseMiddleware<AuthMiddleware>();
|
|
|
|
app.MapGet("/api/health", () => Results.Ok(new { status = "healthy", version = "6.0.0" }));
|
|
|
|
app.MapAuthEndpoints();
|
|
app.MapAccountEndpoints();
|
|
app.MapLedgerEndpoints();
|
|
app.MapExpenseClaimEndpoints();
|
|
app.MapInvoiceEndpoints();
|
|
app.MapPayoutEndpoints();
|
|
app.MapCryptoEndpoints();
|
|
app.MapDocumentEndpoints();
|
|
app.MapDashboardEndpoints();
|
|
app.MapOrganizationEndpoints();
|
|
app.MapUserEndpoints();
|
|
app.MapEndOfMonthEndpoints();
|
|
app.MapDevEndpoints();
|
|
|
|
app.UseDefaultFiles();
|
|
app.UseStaticFiles();
|
|
app.MapFallbackToFile("index.html");
|
|
|
|
app.Run();
|
|
|
|
public partial class Program { }
|