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

from __future__ import annotations

from pydantic import BaseModel
from typing import Optional


class StateInstanceSummaryPM(BaseModel):
    # -----------------
    # metadata
    # -----------------
    created_at: Optional[str] = None

    # -----------------
    # changes
    # -----------------
    num_changes: int = 0

    # -----------------
    # Domain model (base)
    # -----------------
    base_status: Optional[str] = None
    base_has_state: Optional[bool] = None
    base_has_action: Optional[bool] = None

    # -----------------
    # Domain model (state predicates)
    # -----------------
    num_state_preds_total: Optional[int] = None
    num_state_preds_matched: Optional[int] = None
    num_state_preds_valid_logic: Optional[int] = None
    num_state_preds_errored: Optional[int] = None

    # -----------------
    # Domain model (action predicates)
    # -----------------
    num_action_preds_total: Optional[int] = None
    num_action_preds_matched: Optional[int] = None
    num_action_preds_valid_logic: Optional[int] = None
    num_action_preds_errored: Optional[int] = None

    # -----------------
    # Domain model (predicate totals)
    # -----------------
    num_preds_total: Optional[int] = None
    num_preds_matched: Optional[int] = None
    num_preds_valid_logic: Optional[int] = None
    num_preds_errored: Optional[int] = None

    # -----------------
    # Domain model (transitions)
    # -----------------
    num_trans_total: Optional[int] = None
    num_trans_matched: Optional[int] = None
    num_trans_valid_logic: Optional[int] = None
    num_trans_errored: Optional[int] = None

    # -----------------
    # Scenarios
    # -----------------
    num_sc_total: Optional[int] = None
    num_sc_missing: Optional[int] = None
    num_sc_matched: Optional[int] = None
    num_sc_inconsistent: Optional[int] = None

    # -----------------
    # Conflicts (spec-level)
    # -----------------
    num_sc_conflicted: Optional[int] = None
    num_sc_overlap: Optional[int] = None
    num_sc_consumed: Optional[int] = None

    # -----------------
    # Test traces
    # -----------------
    num_test_traces_total: Optional[int] = None
    num_test_traces_matched: Optional[int] = None
    num_test_traces_logic_good: Optional[int] = None

    # -----------------
    # Log traces
    # -----------------
    num_log_traces_total: Optional[int] = None
    num_log_traces_matched: Optional[int] = None
    num_log_traces_logic_good: Optional[int] = None

    # -----------------
    # Source code artifacts
    # -----------------
    num_src_code_arts_total: Optional[int] = None
    num_src_code_arts_matched: Optional[int] = None

    # -----------------
    # Doc artifacts
    # -----------------
    num_doc_arts_total: Optional[int] = None
    num_doc_arts_matched: Optional[int] = None