class InviteUserServiceImpl extends BaseTransactionalService implements InviteUserService {

    @Override
    public ServiceResult<Void> resendInvite(long inviteId) {
        return findRoleInvite(inviteId)
                .andOnSuccess(invite -> {
                    if (externalRolesToInvite().contains(invite.getTarget())) {
                        return inviteExternalUser(invite);
                    } else if (internalRoles().contains(invite.getTarget())) {
                        return inviteInternalUser(invite);
                    } else {
                        return serviceFailure(NOT_AN_INTERNAL_USER_ROLE);
                    }
                });
    }

}