package com.infoepoch.pms.agent.platform.chat.domain.irepository;

import com.infoepoch.pms.agent.common.utils.AbstractCriteria;

/**
 * @author jiangyz
 * @date 2026/4/17 17:17
 * 对话会话表查询条件类
 */
public class SessionCriteria extends AbstractCriteria {

    //region 用户标识，由调用方传入，不做格式约束
    public boolean byUserId() {
        return this.andMap.containsKey("UserId");
    }

    private String userId;

    public String getUserId() {
        if (byUserId())
            return userId;
        return null;
    }

    public void setUserId(String value) {
        this.userId = value;
        this.andMap.put("UserId", value);
    }
    //endregion

    //region active / completed / abandoned
    public boolean byStatus() {
        return this.andMap.containsKey("Status");
    }

    private String status;

    public String getStatus() {
        if (byStatus())
            return status;
        return null;
    }

    public void setStatus(String value) {
        this.status = value;
        this.andMap.put("Status", value);
    }
    //endregion

    //region 会话标题
    public boolean byTitle() {
        return this.andMap.containsKey("Title");
    }

    private String title;

    public String getTitle() {
        if (byTitle())
            return title;
        return null;
    }

    public void setTitle(String value) {
        this.title = value;
        this.andMap.put("Title", value);
    }
    //endregion

    //region 会话标题模糊查询
    public boolean byTitleContain() {
        return this.andMap.containsKey("TitleContain");
    }

    private String titleContain;

    public String getTitleContain() {
        if (byTitleContain())
            return titleContain;
        return null;
    }

    public void setTitleContain(String value) {
        this.titleContain = value;
        this.andMap.put("TitleContain", value);
    }
    //endregion

    //region 所属聊天机器人主键
    public boolean byChatbotId() {
        return this.andMap.containsKey("ChatbotId");
    }

    private String chatbotId;

    public String getChatbotId() {
        if (byChatbotId())
            return chatbotId;
        return null;
    }

    public void setChatbotId(String value) {
        this.chatbotId = value;
        this.andMap.put("ChatbotId", value);
    }
    //endregion

    //region 当前活跃上下文线程 ID
    public boolean byActiveThreadId() {
        return this.andMap.containsKey("ActiveThreadId");
    }

    private String activeThreadId;

    public String getActiveThreadId() {
        if (byActiveThreadId())
            return activeThreadId;
        return null;
    }

    public void setActiveThreadId(String value) {
        this.activeThreadId = value;
        this.andMap.put("ActiveThreadId", value);
    }
    //endregion

    //region 是否已标记清除上下文待生效
    public boolean byContextResetPending() {
        return this.andMap.containsKey("ContextResetPending");
    }

    private Boolean contextResetPending;

    public Boolean getContextResetPending() {
        if (byContextResetPending())
            return contextResetPending;
        return null;
    }

    public void setContextResetPending(Boolean value) {
        this.contextResetPending = value;
        this.andMap.put("ContextResetPending", value);
    }
    //endregion

}