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
|
|
@ -79,9 +79,10 @@ class AuthService:
|
|||
invite.status = InviteStatus.SPENT
|
||||
invite.used_by_id = user.id
|
||||
invite.spent_at = datetime.now(UTC)
|
||||
await self.invite_repo.update(invite)
|
||||
|
||||
await self.db.commit()
|
||||
await self.db.refresh(user)
|
||||
# Refresh user to ensure it's up to date
|
||||
await self.user_repo.refresh(user)
|
||||
|
||||
# Create access token
|
||||
access_token = create_access_token(data={"sub": str(user.id)})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue