Skip to content

CRUD Dispositivos + requieiremens(Added SQLAlchemy, asyncpg, aiosqlite, pytest, ht…) #19

Merged
salog0d merged 1 commit into
mainfrom
feat/bank
Apr 10, 2026
Merged

CRUD Dispositivos + requieiremens(Added SQLAlchemy, asyncpg, aiosqlite, pytest, ht…) #19
salog0d merged 1 commit into
mainfrom
feat/bank

Conversation

@herrdelta83
Copy link
Copy Markdown
Collaborator

**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

…tpx, email-validato), .env.example(Added DATABASE_URL), oconfig.py (added database_url), main.py (Added DB lifespan), router.py (usuarios_router.py)
Copy link
Copy Markdown
Owner

@salog0d salog0d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no trae crud ni tests

@salog0d salog0d merged commit 346af6c into main Apr 10, 2026
2 checks passed
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.

2 participants