package cn.axzo.msg.center.service.enums;

import com.google.common.collect.Sets;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Set;

/**
 * @description
 *   消息分类的类型枚举
 * @author cold_blade
 * @date 2023/11/6
 * @version 1.0
 */
@Getter
@AllArgsConstructor(access = AccessLevel.PRIVATE)
public enum MessageGroupCategoryEnum {

    /**
     * 通知
     */
    NOTIFICATION(MessageGroupNodeCategoryEnum.NOTIFICATION, Sets.newHashSet(MessageCategoryEnum.GENERAL_MESSAGE)),
    /**
     * 待办
     */
    PENDING(MessageGroupNodeCategoryEnum.PENDING,
            Sets.newHashSet(MessageCategoryEnum.BIZ_PENDING_MESSAGE, MessageCategoryEnum.APPROVAL_PENDING_MESSAGE));

    private final Set<MessageGroupNodeCategoryEnum> msgGroupNodeCategories;
    private final Set<MessageCategoryEnum> msgCategories;

    public boolean isGroupCategory(MessageGroupNodeCategoryEnum category) {
        return msgGroupNodeCategories.contains(category);
    }
}
