@classmethod
def register(cls, command: Register) -> User:
    user = cls(id=command.id, email=command.email, name=command.name, password_hash=command.password_hash)
    user.raise_(Registered(id=command.id, email=command.email, name=command.name, password_hash=command.password_hash))
    current_domain.repository_for(User).add(user)
    return user
@classmethod
def register(cls, command: Register) -> User:
    user = cls(id=command.id, email=command.email, name=command.name, password_hash=command.password_hash)
    user.raise_(Registered(id=command.id, email=command.email, name=command.name, password_hash=command.password_hash))
    current_domain.repository_for(User).add(user)
    return user