class ApplicationKtaInviteServiceImpl extends InviteService<ApplicationKtaInvite> implements ApplicationKtaInviteService {

    @Override
    @Transactional
    public ServiceResult<Void> acceptInvite(String hash) {
        return getByHash(hash)
                .andOnSuccess(invite -> {
                    applicationKtaInviteRepository.save(invite.open());
                    ProcessRole ktaProcessRole = new ProcessRole(invite.getUser(), invite.getTarget().getId(), Role.KNOWLEDGE_TRANSFER_ADVISER);
                    processRoleRepository.save(ktaProcessRole);
                    return serviceSuccess();

                });
    }

}