public Mono<UpdateResult> updateGroupsInformation(
            @NotNull Set<Long> groupIds,
            @Nullable Long typeId,
            @Nullable Long creatorId,
            @Nullable Long ownerId,
            @Nullable String name,
            @Nullable String intro,
            @Nullable String announcement,
            @Nullable @Min(0) Integer minimumScore,
            @Nullable Boolean isActive,
            @Nullable @PastOrPresent Date creationDate,
            @Nullable @PastOrPresent Date deletionDate,
            @Nullable Date muteEndDate,
            @Nullable Map<String, Object> userDefinedAttributes,
            @Nullable ClientSession session) {
        try {
            Validator.notEmpty(groupIds, "groupIds");
            Validator.min(minimumScore, "minimumScore", 0);
            Validator.pastOrPresent(creationDate, "creationDate");
            Validator.pastOrPresent(deletionDate, "deletionDate");
            Validator.before(creationDate, deletionDate, "creationDate", "deletionDate");
        } catch (ResponseException e) {
            return Mono.error(e);
        }
        if (Validator.areAllNull(typeId,
                creatorId,
                ownerId,
                name,
                intro,
                announcement,
                minimumScore,
                isActive,
                creationDate,
                deletionDate,
                muteEndDate)
                && (userDefinedAttributes == null || userDefinedAttributes.isEmpty())) {
            return OperationResultPublisherPool.ACKNOWLEDGED_UPDATE_RESULT;
        }
        if (!elasticsearchManager.isGroupUseCaseEnabled() || name == null) {
            return groupRepository.updateGroups(groupIds,
                    typeId,
                    creatorId,
                    ownerId,
                    name,
                    intro,
                    announcement,
                    minimumScore,
                    isActive,
                    creationDate,
                    deletionDate,
                    muteEndDate,
                    new Date(),
                    userDefinedAttributes,
                    session);
        }
        if (elasticsearchManager.isTransactionWithMongoEnabledForGroup()) {
            if (session == null) {
                return groupRepository.inTransaction(clientSession -> groupRepository
                        .updateGroups(groupIds,
                                typeId,
                                creatorId,
                                ownerId,
                                name,
                                intro,
                                announcement,
                                minimumScore,
                                isActive,
                                creationDate,
                                deletionDate,
                                muteEndDate,
                                new Date(),
                                userDefinedAttributes,
                                clientSession)
                        .flatMap(updateResult -> (StringUtil.isBlank(name)
                                ? elasticsearchManager.deleteGroupDocs(groupIds)
                                : elasticsearchManager.putGroupDocs(groupIds, name))
                                .thenReturn(updateResult)));
            } else {
                return groupRepository
                        .updateGroups(groupIds,
                                typeId,
                                creatorId,
                                ownerId,
                                name,
                                intro,
                                announcement,
                                minimumScore,
                                isActive,
                                creationDate,
                                deletionDate,
                                muteEndDate,
                                new Date(),
                                userDefinedAttributes,
                                session)
                        .flatMap(updateResult -> (StringUtil.isBlank(name)
                                ? elasticsearchManager.deleteGroupDocs(groupIds)
                                : elasticsearchManager.putGroupDocs(groupIds, name))
                                .thenReturn(updateResult));
            }
        }
        return groupRepository
                .updateGroups(groupIds,
                        typeId,
                        creatorId,
                        ownerId,
                        name,
                        intro,
                        announcement,
                        minimumScore,
                        isActive,
                        creationDate,
                        deletionDate,
                        muteEndDate,
                        new Date(),
                        userDefinedAttributes,
                        session)
                .doOnSuccess(updateResult -> (StringUtil.isBlank(name)
                        ? elasticsearchManager.deleteGroupDocs(groupIds)
                        : elasticsearchManager.putGroupDocs(groupIds, name)).subscribe(null,
                                t -> LOGGER.error("Failed to update the docs of the groups: "
                                        + groupIds, t)));
    }
TODO: remove and keep {@link GroupService#queryGroupTypeIfActiveAndNotDeleted(Long, boolean)}
only.
turms-service/src/main/java/im/turms/service/domain/group/service/GroupService.java