You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The API has no idea who is calling it. There's no users table, so we can't sign anyone in, limit what they see, or record who made a decision.
Goal
Users exist in the database, each with a Google identity, and each can be linked to the hotels they work for.
Scope
A users table: Google account ID (unique), email, name, created at, last signed in at.
A link table between users and hotels, so a hotel can have several users and a user can belong to more than one hotel later. A user with no hotel is allowed (they've just signed up).
Models, repository and services through every layer, following the Widget slice.
An Alembic migration that applies and rolls back.
A command to link a user to a hotel by email (e.g. just link-user <email> <hotel_id>), until there's a way to do it in the app.
Not in scope: passwords; sign-in is Google only.
Considerations
Identify users by Google's account ID (sub), not their email: emails can change.
Keep the link table simple (user, hotel, created at). Roles can be added later if needed.
Acceptance criteria
The migration upgrades and downgrades cleanly.
A user can be created, found by Google account ID, and linked to a hotel.
Linking the same user to the same hotel twice doesn't create a duplicate.
Activity