from dataclasses import dataclass, field
from datetime import datetime
from typing import Dict, List, Optional


# ===== Sensor Geometry =====
@dataclass
class Sensor:
    label: str
    x: float
    y: float
    side: str = "right"
    offset_x: float = 0.0
    offset_y: float = 0.0


# ===== Data Row =====
@dataclass
class DataRecord:
    time: float
    values: List[float] = field(default_factory=list)


# ===== Parsed Z-Wafer Container =====
@dataclass
class ZWaferData:
    date: datetime = field(default_factory=lambda: datetime.min)
    serial: Optional[str] = None
    header: Dict[str, str] = field(default_factory=dict)
    sensors: List[Sensor] = field(default_factory=list)
    csv_headers: List[str] = field(default_factory=list)
