Skip to content

CRUD for "Usuarios" and 9 tests (it is not connected yet to DB)#6

Merged
salog0d merged 8 commits into
mainfrom
feat/bank
Apr 10, 2026
Merged

CRUD for "Usuarios" and 9 tests (it is not connected yet to DB)#6
salog0d merged 8 commits into
mainfrom
feat/bank

Conversation

@herrdelta83
Copy link
Copy Markdown
Collaborator

changes made:
New Files Created
database/base.py: DeclarativeBase — shared by all ORM models

database/session.py: Async engine + get_db dependency

entities/usuario.py: SQLAlchemy ORM model matching the DB schema

models/usuario.py: Pydantic CreateUsuarioRequest, UpdateUsuarioRequest, UsuarioResponse

repositories/usuario_repository.py: All DB queries — create, get_by_id, get_all, update, delete

api/usuarios.py: 5 routes: POST /api/usuarios, GET /api/usuarios, GET /api/usuarios/{id}, PATCH /api/usuarios/{id}, DELETE /api/usuarios/{id}

tests/conftest.py: In-memory SQLite fixtures, no PostgreSQL needed to test

tests/test_usuarios.py: 9 tests covering all operations + edge cases

pytest.ini: asyncio_mode = auto

Files Updated
router.py, main.py (lifespan), config.py (database_url), requirements.txt, .env.example

Notes
Default DB is SQLite (temis.db) so it runs without PostgreSQL. Point DATABASE_URL in .env to your PostgreSQL instance when ready.

@salog0d salog0d merged commit cdf8fa9 into main Apr 10, 2026
1 of 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