"""Auto-generated schema model descriptor."""
from __future__ import annotations

from dataclasses import dataclass
import json
from pathlib import Path
from typing import Any

SCHEMA_TITLE = 'SELL_EXECUTION_TIMING_V1'
SCHEMA_ID = 'schema://formula/SELL_EXECUTION_TIMING_V1'
SCHEMA_PATH = 'schemas/generated/sell_execution_timing_v1.schema.json'
SCHEMA_PROPERTIES = ['formula_id', 'owner', 'status', 'inputs', 'outputs']
SCHEMA_REQUIRED = ['formula_id', 'owner', 'status', 'inputs', 'outputs']

@dataclass(frozen=True)
class SchemaModel:
    title: str
    schema_id: str
    path: str
    properties: list[str]
    required: list[str]

def load_schema() -> dict[str, Any]:
    return json.loads(Path(__file__).with_suffix('.schema.json').read_text(encoding='utf-8'))

def describe() -> SchemaModel:
    return SchemaModel(
        title=SCHEMA_TITLE,
        schema_id=SCHEMA_ID,
        path=SCHEMA_PATH,
        properties=list(SCHEMA_PROPERTIES),
        required=list(SCHEMA_REQUIRED),
    )
