Repository navigation
Conversation
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
userstable (one row per Google account) and auser_hotelslink table, so users exist and can be linked to hotels. Storage only: no sign-in or auth yet. Closes #79.Type of change
feat— new featurefix— bug fixdocs— documentation onlyrefactor— code change that neither fixes a bug nor adds a featureperf— performance improvementtest— adding or updating testschore/build/ci— tooling, deps, or pipeline changesChanges
This adds a
userstable with each person's Google account ID (unique), email, name, creation time and last sign-in time. A second table,user_hotels, links a user to a hotel. The user and hotel together form its primary key, so linking the same pair twice does nothing.The model, repository and service layers can create a user, find one by Google ID or email, and link a user to a hotel idempotently. There are no routes. Until the app can link users itself,
just link-user <email> <hotel_id>(incli.py) does it from the command line.The repository and service are covered by tests in
tests/test_user.py. Decision 0032 records why the Google ID is the identity, and 0033 records how CLI commands work.Database migrations
just migrate-create "...")just migrate) and rolls back (just migrate-down)Checklist
just lint) and code is formatted (just format)just hooksinstalled).env.examplewhere relevantjust dev) and verified the API athttp://localhost:8000/docsHow to test
just migrate, thenjust testjust link-user <email> <hotel_id>twice. Expect "Linked", then "already linked".Notes for reviewers