Add API Layer — REST endpoints serving real data (section 9)
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
This commit is contained in:
@@ -1,8 +1,30 @@
|
||||
using UsingCash.Api.Configuration;
|
||||
using UsingCash.Api.Endpoints;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
builder.Services.AddUsingCashServices(builder.Configuration);
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
app.MapGet("/api/health", () => Results.Ok(new { status = "healthy" }));
|
||||
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();
|
||||
|
||||
Reference in New Issue
Block a user