Project report for the workspace dashboard

C# · ASP.NET Core · intermediate · modification

Adds the per-project report the new dashboard table reads. `ReportsController` gets `GET /api/reports/projects`: it lists the workspace's active projects in name order and counts each project's open, done and overdue tasks, with today's UTC date taken from the injected `TimeProvider`. The response row is the new `ProjectReportRow` record in `ReportDtos.cs`, next to the existing summary record. `ProjectReportTests.cs` adds endpoint tests on the existing `PlannerApiFactory`.

ASP.NET Core 10 Web API on .NET 10 (C# 14, nullable reference types enabled, implicit usings), controllers with `[ApiController]`. EF Core 10 with Npgsql on PostgreSQL 16 in production; the database is a managed instance in the same region as the API. `PlannerDbContext` is unchanged: `Projects` is the `Project` entity (`int Id`, `int WorkspaceId`, `string Name`, `bool Archived`, and the `Tasks` collection navigation), `Tasks` is the `ProjectTask` entity (`int Id`, `int ProjectId` with its `Project` navigation, `string Title`, `TaskState State`, `DateOnly? DueOn` mapped to a `date` column). `TaskState` is an enum, `Todo`, `InProgress` or `Done`, stored as an integer. The `tasks.ProjectId` foreign key has its index (the EF Core convention). No lazy-loading proxies are configured. `Program.cs` is unchanged: it registers the DbContext, `TimeProvider.System` as a singleton, controllers and JWT bearer authentication; every token carries a `workspace_id` claim, read by `User.GetWorkspaceId()` (`Planner.Api.Auth`, existing). Tests use xUnit and the existing `PlannerApiFactory` (`WebApplicationFactory<Program>` over an in-memory SQLite database, `TimeProvider` pinned to 2026-10-15 12:00 UTC, exposed as `PlannerApiFactory.Today`): `NewWorkspaceId()` returns an unused workspace id, `CreateClientFor(workspaceId)` signs requests in as a member of that workspace, and `SeedProjectAsync(workspaceId, name, archived, tasks)` inserts a project with the given `(State, DueOn)` tasks. The dashboard table ships separately in the web app.

Requirements

Files touched

Review this PR

C# practice