public Mono<Group> createGroup(
            @NotNull Long creatorId,
            @NotNull Long ownerId,
            @Nullable String groupName,
            @Nullable String intro,
            @Nullable String announcement,
            @Nullable @Min(value = 0) Integer minimumScore,
            @Nullable Long groupTypeId,
            @Nullable @PastOrPresent Date creationDate,
            @Nullable @PastOrPresent Date deletionDate,
            @Nullable Date muteEndDate,
            @Nullable Boolean isActive) {
        try {
            Validator.notNull(creatorId, "creatorId");
            Validator.notNull(ownerId, "ownerId");
            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);
        }
        isActive = isActive == null
                ? activateGroupWhenCreated
                : isActive;
        Long groupId = node.nextLargeGapId(ServiceType.GROUP);
        Date now = new Date();
        Group group = new Group(
                groupId,
                groupTypeId,
                creatorId,
                ownerId,
                groupName,
                intro,
                announcement,
                minimumScore == null
                        ? 0
                        : minimumScore,
                creationDate == null
                        ? now
                        : creationDate,
                deletionDate,
                now,
                muteEndDate,
                isActive,
                null);

        Boolean putEsDocInTransaction =
                elasticsearchManager.isGroupUseCaseEnabled() && StringUtil.isNotBlank(groupName)
                        ? elasticsearchManager.isTransactionWithMongoEnabledForGroup()
                        : null;

        Mono<Group> addGroup = groupRepository.inTransaction(session -> {
            Mono<Void> mono = groupRepository.insert(group, session);
            if (Boolean.TRUE.equals(putEsDocInTransaction)) {
                mono = mono.then(elasticsearchManager.putGroupDoc(groupId, groupName));
            }
            return mono
                    .then(groupMemberService.addGroupMember(group
                            .getId(), creatorId, GroupMemberRole.OWNER, null, now, null, session))
                    .then(Mono.defer(() -> {
                        createdGroupsCounter.increment();
                        return groupVersionService.upsert(groupId, now)
                                .onErrorComplete(t -> {
                                    LOGGER.error(
                                            "Caught an error while upserting a version for the group ({}) after creating the group",
                                            groupId,
                                            t);
                                    return true;
                                });
                    }))
                    .thenReturn(group);
        })
                .retryWhen(TRANSACTION_RETRY);
        if (Boolean.FALSE.equals(putEsDocInTransaction)) {
            addGroup = addGroup.doOnSuccess(ignored -> elasticsearchManager
                    .putGroupDoc(groupId, groupName)
                    .subscribe(null,
                            t -> LOGGER.error("Caught an error while putting the doc of the group: "
                                    + groupId, t)));
        }
        return addGroup;
    }
@param messageService is lazy because messageService -> groupService -> messageService
turms-service/src/main/java/im/turms/service/domain/group/service/GroupService.java