# Features — task-ledger-api

Evidence date: 2026-10-01.

Source: `git@bitbucket.org:overdrive/task-ledger-api.git`, `main` at `8ab244e` (2026-01-03).

"Current" means present in the `main` tree and reachable from `Program.cs` or from the test project. There is no issue tracker or roadmap in the repository. A behaviour is marked planned only when a file describes it and the code does not do it. Commit messages that do not match any source file are listed as discrepancies, not as a roadmap.

## Current features

### F-01 — Create a task

`POST /api/Tasks` → `TasksController.CreateTask` → `TaskService.CreateTaskAsync`.

Body: `Title` (required), `Description` (optional). Title and description are trimmed. Whitespace-only title returns 400 `{ "error": "Title is required." }`. Success returns 201 and the entity. `IsCompleted` is false. `CreatedUtc` is UTC now. `Id` comes from the database.

Source: `TaskLedger.Api/Controllers/TasksController.cs`, `TaskLedger.Api/Services/TaskService.cs`.

Origin: `98c614a`. Status: **current**. Confidence: high.

### F-02 — List all tasks

`GET /api/Tasks` → `TasksController.GetAllTasks` → `TaskService.GetAllTasksAsync`.

Returns every row ordered by `CreatedUtc` ascending. No paging or filter. Empty table returns an empty list.

Source: same service and controller. Tests: `GetAllTasksAsync_WithNoTasks_ShouldReturnEmptyList`, `GetAllTasksAsync_WithMultipleTasks_ShouldReturnAllTasksOrderedByCreatedUtc`.

Origin: `98c614a`. Status: **current**. Confidence: high.

### F-03 — SQL Server persistence

`AppDbContext` maps `TaskLedger.Api.Domain.Entities.Task` to table `Tasks`. Columns: `Id` identity, `Title` nvarchar(200) required, `Description` nvarchar(1000) nullable, `IsCompleted` bit required, `CreatedUtc` datetime2 required. Primary key `PK_Tasks`.

Source: `TaskLedger.Api/Infrastructure/Data/AppDbContext.cs`, `TaskLedger.Api/Migrations/20260101150955_InitialCreate.cs`, `TaskLedger.Api/Migrations/InitialCreate.sql`.

Origin: entity and first context in `e12e94a`; current shape in `310c137`. Status: **current**. Confidence: high.

### F-04 — LocalDB connection and SQL retry

`DefaultConnection` in `appsettings.json` and `appsettings.Development.json`:

`Server=(localdb)\mssqllocaldb;Database=TaskLedgerDb;Trusted_Connection=true;TrustServerCertificate=true;`

`Program.cs` enables EF Core retry on failure: 5 attempts, max delay 30 seconds, no added error numbers.

Origin: localhost connection before `8ab244e`; LocalDB and retry in `8ab244e`. Status: **current**. Confidence: high.

### F-05 — Development Swagger

`AddEndpointsApiExplorer` and `AddSwaggerGen` are always registered. `UseSwagger` and `UseSwaggerUI` run only when the environment is Development. Launch profiles `http`, `https`, and `IIS Express` set `ASPNETCORE_ENVIRONMENT=Development` and open `swagger`.

Source: `TaskLedger.Api/Program.cs`, `TaskLedger.Api/Properties/launchSettings.json`.

Status: **current**. Confidence: high.

### F-06 — Weather forecast sample

`GET /weatherforecast` returns five generated forecasts. It does not use `TaskService`. `TaskLedger.Api.http` calls this route on `http://localhost:5037`.

Source: `TaskLedger.Api/Program.cs`, `TaskLedger.Api/TaskLedger.Api.http`.

Origin: template in `e12e94a`, still present. Status: **current**, and unrelated to tasks. Confidence: high.

### F-07 — Service unit tests

`TaskLedger.Api.Tests/Services/TaskServiceTests.cs` uses a new EF Core in-memory database per test. Covered cases: valid create, null title, empty title, whitespace title, null description, `CreatedUtc` kind and window, trim of title and description, empty list, order of three creates.

Status: **current**. Confidence: high.

The test project also contains `UnitTest1.Test1`, which has an empty body. Status: **current** as a template test that asserts nothing. Confidence: high.

### F-08 — Idempotent initial SQL script

`Migrations/InitialCreate.sql` creates `__EFMigrationsHistory` and table `Tasks` when migration id `20260101150955_InitialCreate` is not already recorded, then inserts that history row. The application does not run this script on startup.

Status: **current** as a file. Whether it has been applied to a database is **Unknown**. Confidence: high for the file.

## Completed features

The repository has no release notes. These are the changes that landed and are still the current behaviour:

- Initial web and test projects, `cursor.rules.md` (`e12e94a`, 2026-01-01).
- Task table and EF Core SQL Server mapping (`310c137`, 2026-01-01).
- Create and list API with service tests (`98c614a`, 2026-01-01).
- `bin/` and `obj/` removed from git; `.gitignore` added (`a7a3fa1` through `88a7add`, 2026-01-02).
- LocalDB connection string and retry (`8ab244e`, 2026-01-03).

## Changed features

### F-09 — Timestamp and context rename

**Removed** from the tree at `310c137`. At `e12e94a` the context was `TaskLedgerDbContext` and the entity had `CreatedAt` and `UpdatedAt`. Migration `20260101145453_InitialCreate` matched that shape. `main` has `AppDbContext`, `CreatedUtc`, and no `UpdatedAt`. The old migration files are not on `main`.

Status: **changed**. The old columns are not a current feature. Confidence: high.

### F-10 — Connection string host

**Changed** in `8ab244e` from `Server=localhost` to `Server=(localdb)\mssqllocaldb`. Development settings gained the same connection string, which they did not have before.

Status: **changed**. Confidence: high.

## Not in the source, despite commit messages

These are not planned features. They are messages that do not match the tree.

### F-11 — Task repository

`22a5d61` says "Add TaskRepository for data access operations". The commit changes assembly-info files under `obj/` only. `git log -S TaskRepository -- "*.cs"` is empty.

Status: **not implemented**. Confidence: high.

### F-12 — Update and delete tasks

`8f0658b` says `UpdateTaskAsync` and `DeleteTaskAsync` were added to `ITaskService`, implemented, and tested. The commit deletes `bin/` outputs. `git log -S UpdateTaskAsync -- "*.cs"` and the same search for `DeleteTaskAsync` are empty. `ITaskService` on `main` has `CreateTaskAsync` and `GetAllTasksAsync` only.

Status: **not implemented**. Confidence: high.

## Not present

No feature in the tree does any of the following:

- Get one task by id.
- Mark a task complete or incomplete after create.
- Assign a task to a user.
- Authenticate the caller.
- Page or filter the list.
- Deploy, scan, or run in CI.

`Moq` is a package reference in the test project and is unused by the test sources.

`sonar-project.properties` and `sonarqube_scan.bat` were named in the 2026-09-28 discovery snapshot of the scan-host working tree. They are not in git. Status: **Unknown / Requires Confirmation**.

## Deprecated / removed

No file marks a feature deprecated. The only removed product shape is F-09 (`UpdatedAt`, `CreatedAt`, `TaskLedgerDbContext`, migration `20260101145453_InitialCreate`).

## In development

`feature/task-service` and `feature/ef-core` both point at `0c1c087`, which is already contained in `main`. `development` points at the same commit as `main` (`8ab244e`). No branch contains source that `main` does not contain.

There is no in-progress feature in git on 2026-10-01.
