Complete repository delegation - remove remaining direct db operations
- Add commit() method to AvailabilityRepository for transaction control - Add refresh() method to UserRepository - Update AvailabilityService to use repository.commit() instead of db.commit() - Update AuthService to use UserRepository.refresh() instead of db.refresh() - All services now consistently delegate ALL persistence to repositories
This commit is contained in:
parent
33aa8ad13b
commit
db181b338c
4 changed files with 13 additions and 4 deletions
|
|
@ -118,7 +118,7 @@ class AvailabilityService:
|
|||
for slot in slots
|
||||
]
|
||||
await self.availability_repo.create_multiple(availabilities)
|
||||
await self.db.commit()
|
||||
await self.availability_repo.commit()
|
||||
|
||||
return AvailabilityDay(date=target_date, slots=slots)
|
||||
|
||||
|
|
@ -188,7 +188,7 @@ class AvailabilityService:
|
|||
)
|
||||
|
||||
# Commit all changes atomically
|
||||
await self.db.commit()
|
||||
await self.availability_repo.commit()
|
||||
except Exception:
|
||||
# Rollback on any error to maintain atomicity
|
||||
await self.db.rollback()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue