Refactor backend to remove service command models

This commit is contained in:
2026-02-25 11:11:35 +01:00
parent 50f56fdab7
commit 80938e8f25
16 changed files with 146 additions and 203 deletions

4
FAQ.md
View File

@@ -32,6 +32,6 @@ No. The backend loads state from SQLite once during startup into in-memory state
Coverage now includes the entire backend project (`RpgRoller`), including API/hosting/bootstrap code and services. It is no longer restricted to `RpgRoller.Services.*`.
## Why do backend services use `*Command` types instead of API request DTOs?
## Why do backend services avoid API request DTO dependencies?
Service workflows now consume service-layer command models (for example, `CreateCampaignCommand`) so endpoint transport contracts stay isolated in the API layer. This reduces coupling and keeps service code reusable when input shapes evolve at the HTTP boundary.
Service workflows accept explicit parameters (for example, `CreateCampaign(sessionToken, name, rulesetId)`) instead of API request DTOs. This keeps the service layer independent from HTTP transport contracts while avoiding extra service-only wrapper command types.