Conversation
…tpx, email-validato), .env.example(Added DATABASE_URL), oconfig.py (added database_url), main.py (Added DB lifespan), router.py (usuarios_router.py)
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.
**IMPORTANT TO CHECK: ** I don't know if it has pulled with the requirements the CRUD and Tests for "Dispositivos"
New Files Created
entities/dispositivo.py: ORM model — FK to usuario.id, trusted boolean, first_seen / last_seen timestamps
models/dispositivo.py: Pydantic CreateDispositivoRequest, UpdateDispositivoRequest, DispositivoResponse
repositories/dispositivo_repository.py: create, get_by_id, get_all, update, touch, delete
api/dispositivos.py: 6 routes under /api/dispositivos
tests/test_dispositivos.py: 10 tests
Notes
One extra compared to cuenta: POST /api/dispositivos/{id}/touch — stamps last_seen to now, which you'll need every time a device is seen during a session or transaction.
New Files Created
backend/app/database/base.py
backend/app/database/session.py
backend/app/entities/usuario.py
backend/app/models/usuario.py
backend/app/repositories/usuario_repository.py
backend/app/api/usuarios.py
backend/tests/init.py
backend/tests/conftest.py
backend/tests/test_usuarios.py
backend/pytest.ini
Files Modified
backend/requirements.txt: Added SQLAlchemy, asyncpg, aiosqlite, pytest, httpx, email-validator
backend/.env.example: Added DATABASE_URL
backend/app/core/config.py: Added database_url field
backend/app/main.py: Added DB lifespan (create_all on startup)
backend/app/api/router.py: Registered usuarios_router