package com.sikey.wa04.business.domain.usecase;

import com.sikey.wa04.business.domain.entity.ChatSessionId;
import com.sikey.wa04.business.domain.entity.ChildId;
import com.sikey.wa04.business.domain.entity.GroupId;
import com.sikey.wa04.business.domain.entity.UserId;

public class ChatSessionFactory {

    /**
     * 创建会话ID
     *
     * @param id      会话ID
     * @param isGroup 是否是群聊
     * @return 会话ID
     */
    public static ChatSessionId createSessionId(String id, Boolean isGroup) {
        return new ChatSessionId(id, isGroup);
    }

    /**
     * 创建群聊会话ID
     *
     * @param groupId 群聊ID
     * @return 群聊会话ID
     */
    public static ChatSessionId createGroupSessionId(GroupId groupId) {
        return createSessionId(groupId.getId(), true);
    }

    /**
     * 创建私聊会话ID
     *
     * @param userId 用户ID
     * @return 私聊会话ID
     */
    public static ChatSessionId createPrivateSessionId(UserId userId) {
        return createSessionId(userId.getId(), false);
    }

    /**
     * 创建私聊会话ID
     *
     * @param childId 小孩ID
     * @return 私聊会话ID
     */
    public static ChatSessionId createPrivateSessionId(ChildId childId) {
        return createSessionId(childId.getId(), false);
    }
}
