Date: 2026-01-22
- API builds and runs with:
- Swagger
- Serilog request logging
- /health
- EF Core migrations created and applied
- Identity + JWT auth:
- POST /auth/register
- POST /auth/login
- GET /auth/me
- Multi-tenancy foundation:
- Tenant resolved from
X-Org-Idheader into TenantContext
- Tenant resolved from
- Org + Membership:
- POST /orgs creates org and creator is Owner
- GET /orgs lists orgs for current user
- Org Members controller:
- GET /orgs/{orgId}/members (Admin+)
- PATCH /orgs/{orgId}/members/{userId} (Owner only)
- Integration testing infrastructure:
- Testcontainers PostgreSQL (self-contained)
- EF migrations applied automatically in fixture
- Respawn reset between tests
- Most tests pass.
- Two tests currently fail because expected 400, but API returns 403:
- Missing tenant header
- Mismatched route orgId vs header orgId
Authorization (policy checks) runs before MVC action filters. If tenant header is missing/mismatched, the RBAC policy fails first and returns 403.
- Update tests to accept 403 (current behavior).
- Improve pipeline to return 400 for tenant issues by moving validation earlier:
- Implement tenant requirement as
IAsyncAuthorizationFilteror a custom AuthorizationRequirement that checks tenant header and route orgId match. - Or add middleware after TenantResolutionMiddleware and before Authorization to validate route/header match for specific route patterns.
- Implement tenant requirement as
- FluentAssertions prints a license warning (Xceed). Consider replacing with:
- xUnit
Assert.*or - another assertion lib without commercial warning.
- xUnit
- Decide how to handle tenant header errors (keep 403 vs change to 400) and adjust tests accordingly.
- Start Phase 2: Helpdesk module (Tickets/Categories/Comments) + tenant query filters + RBAC rules.
- Add pagination/filtering conventions + DTOs for tickets.
- Add audit logs later.
- Run tests:
dotnet test
- Run API:
dotnet run --project src/OmniDesk.Api
- Local DB migrations:
dotnet ef database update --project src/OmniDesk.Infrastructure --startup-project src/OmniDesk.Api