package tech.easyflow.chatlog.service;

import tech.easyflow.chatlog.domain.dto.ChatHistoryPage;
import tech.easyflow.chatlog.domain.dto.ChatMessageRecord;
import tech.easyflow.chatlog.domain.dto.ChatSessionPage;
import tech.easyflow.chatlog.domain.dto.ChatSessionSummary;
import tech.easyflow.chatlog.domain.query.ChatPageQuery;
import tech.easyflow.chatlog.domain.query.ChatSessionFilterQuery;

import java.math.BigInteger;
import java.util.List;

public interface ChatHistoryManageService {

    ChatSessionPage queryUserSessions(BigInteger userId, BigInteger assistantId, ChatPageQuery query);

    ChatSessionPage queryAdminSessions(ChatSessionFilterQuery query);

    ChatSessionSummary getUserSession(BigInteger userId, BigInteger sessionId);

    ChatSessionSummary getAdminSession(BigInteger sessionId);

    ChatHistoryPage queryUserMessages(BigInteger userId, BigInteger sessionId, ChatPageQuery query);

    ChatHistoryPage queryAdminMessages(BigInteger sessionId, ChatPageQuery query);

    void renameUserSession(BigInteger userId, BigInteger sessionId, String title, BigInteger operatorId);

    void deleteUserSession(BigInteger userId, BigInteger sessionId, BigInteger operatorId);

    List<ChatMessageRecord> listUserRoundVariants(BigInteger userId, BigInteger sessionId, BigInteger roundId);

    ChatMessageRecord selectUserRoundVariant(BigInteger userId, BigInteger sessionId, BigInteger roundId, Integer variantIndex, BigInteger operatorId);

    List<ChatMessageRecord> listAdminRoundVariants(BigInteger sessionId, BigInteger roundId);

    ChatMessageRecord selectAdminRoundVariant(BigInteger sessionId, BigInteger roundId, Integer variantIndex, BigInteger operatorId);
}
