feat: Implement automatic updated_at timestamp management in BaseModel and update BaseRepository to reflect changes
Some checks failed
Backend CI / lint (push) Failing after 5m0s
Backend CI / test (push) Successful in 3m46s

This commit is contained in:
JSC
2025-08-16 00:07:15 +02:00
parent 87d6e6ed67
commit b691649f7e
2 changed files with 9 additions and 0 deletions

View File

@@ -114,6 +114,7 @@ class BaseRepository[ModelType]:
for field, value in update_data.items():
setattr(entity, field, value)
# The updated_at timestamp will be automatically set by the SQLAlchemy event listener
self.session.add(entity)
await self.session.commit()
await self.session.refresh(entity)