Skip to content

feat: add user model with serialization - #10

Merged
vinimachadosantana merged 3 commits into
developfrom
feat/user-model
Aug 7, 2026
Merged

feat: add user model with serialization#10
vinimachadosantana merged 3 commits into
developfrom
feat/user-model

Conversation

@vinimachadosantana

Copy link
Copy Markdown
Owner

What

Adds the User model with validations, an Alba serializer, a GET /api/v1/users/:id endpoint, and specs covering both the model and the endpoint.

Why

The first domain object, and the one authentication builds on next phase. It also exercises the error contract end to end.

How

  • Alba instead of AMS.
  • The serializer as an explicit allowlist.
  • Uniqueness is enforced by a database index as well as a validation, as only the index actually guarantees correctness.
  • User.find raises RecordNotFound, which the base controller already converts to a structured 404, so the controller needs no branching.
  • Emails are normalised before validation so case and whitespace can't create duplicates.

Testing

  • Model specs cover validations, normalisation and format
  • Request specs cover the happy path and the 404 error contract
  • RuboCop and Brakeman clean, CI green

@vinimachadosantana vinimachadosantana self-assigned this Aug 7, 2026
@vinimachadosantana
vinimachadosantana merged commit 64283aa into develop Aug 7, 2026
3 checks passed
@vinimachadosantana
vinimachadosantana deleted the feat/user-model branch August 7, 2026 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant