33from typing import TypedDict
44from uuid import UUID
55
6+ from app .application .common .ports .flusher import Flusher
67from app .application .common .ports .transaction_manager import TransactionManager
78from app .application .common .ports .user_command_gateway import UserCommandGateway
89from app .application .common .services .current_user import CurrentUserService
@@ -48,15 +49,17 @@ class SignUpHandler:
4849
4950 def __init__ (
5051 self ,
51- user_command_gateway : UserCommandGateway ,
52- transaction_manager : TransactionManager ,
5352 current_user_service : CurrentUserService ,
5453 user_service : UserService ,
54+ user_command_gateway : UserCommandGateway ,
55+ flusher : Flusher ,
56+ transaction_manager : TransactionManager ,
5557 ):
56- self ._user_command_gateway = user_command_gateway
57- self ._transaction_manager = transaction_manager
5858 self ._current_user_service = current_user_service
5959 self ._user_service = user_service
60+ self ._user_command_gateway = user_command_gateway
61+ self ._flusher = flusher
62+ self ._transaction_manager = transaction_manager
6063
6164 async def __call__ (self , request_data : SignUpRequest ) -> SignUpResponse :
6265 log .info ("Sign up: started. Username: '%s'." , request_data .username )
@@ -75,7 +78,7 @@ async def __call__(self, request_data: SignUpRequest) -> SignUpResponse:
7578 self ._user_command_gateway .add (user )
7679
7780 try :
78- await self ._transaction_manager .flush ()
81+ await self ._flusher .flush ()
7982 except UsernameAlreadyExistsError :
8083 raise
8184
0 commit comments