Files
What you'll learn
- Document a whole API with @nestjs/swagger: tags per controller, bearer authentication on the routes that need it, and DTO schemas with the same limits the validators enforce
- Derive an update DTO with @nestjs/swagger's PartialType so the document describes it too
- Announce a change from a service through a gateway the service injects
- Announce only what was committed: after the transaction, never inside it
Press Run tests to start the app. Its log appears here.Graded endpoints
A screen that listens for adoptions
Another screen
Unchanged
Every route with its tag, a bearer token required exactly where the API requires one, and the DTOs' schemas with the validators' limits
CORS is unchanged
Refused
Serialized, no hash
The database filter's 409
Staff
An adopter
From the database, serialized
The third sign-in this minute
The sign-in limit
Staff only
Staff only
Staff only
A new cat is not an adoption: nobody is told
Validation is unchanged
Staff updates
The breed filter
Committed, then announced to every screen
Refused, and nothing is announced
Announced
Written, then rolled back by the limit: an announcement made inside the transaction would have told every screen about an adoption that never happened
The rollback
Tom and Milo
Staff only
The same two
204
404
401
Run the tests first.