#
#   Imandra Inc.
#
#   speclogician/presentation/models/smart_find.py
#

from __future__ import annotations

from typing import Literal
from pydantic import BaseModel, Field

from speclogician.presentation.models.trace import TestTracePM, LogTracePM
from speclogician.presentation.models.data_artifact import DocRefPM, SrcCodeRefPM


class SmartFindCountsPM(BaseModel):
    needle: str
    num_test_traces: int = 0
    num_log_traces: int = 0
    num_doc_refs: int = 0
    num_src_code_refs: int = 0


class SmartFindItemsPM(BaseModel):
    test_traces: list[TestTracePM] = Field(default_factory=list)
    log_traces: list[LogTracePM] = Field(default_factory=list)
    doc_refs: list[DocRefPM] = Field(default_factory=list)
    src_code_refs: list[SrcCodeRefPM] = Field(default_factory=list)


class SmartFindPM(BaseModel):
    kind: Literal["smart_find"] = "smart_find"
    counts: SmartFindCountsPM
    items: SmartFindItemsPM