async def _register_user(cls, cmd: Dict[str, Any],
                          do_authorize: bool) -> Optional[str]:
     plain_email = (UserEmailMother.create(cmd['email']) if 'email' in cmd
                    else UserEmailMother.random()).value()
     plain_password = cmd[
         'password'] if 'password' in cmd else UserPasswordMother.random(
         ).value()
     await container().get(CommandBus).dispatch(
         RegisterUserCommand(
             **{
                 'id': (UserIdMother.create(cmd['id']) if 'id' in
                        cmd else UserIdMother.random()).value(),
                 'email':
                 plain_email,
                 'password':
                 plain_password,
             }))
     if do_authorize:
         return await cls._authorize_user(cmd={
             'email': plain_email,
             'password': plain_password
         })
     return None
 async def _find_full_user(user_id: str) -> UserFullFinderResponse:
     return (await container().get(QueryBus).ask(
         FindFullUserQuery(**{
             'user_id': (UserIdMother.create(user_id)).value(),
         })))