from __future__ import annotations from typing import ClassVar, Optional from sqlmodel import Field, SQLModel class MaterialRow(SQLModel, table=True): """Defensive view of the externally-owned ``material`` catalogue table. Declares only the columns the modelling backend reads to price a Measure Option; other columns (r-values, labour breakdowns, etc.) are left off so schema churn elsewhere doesn't ripple in. `total_cost` is the fully-loaded cost per the row's `cost_unit` (GBP/m^2 for fabric measures). """ __tablename__: ClassVar[str] = "material" # pyright: ignore[reportIncompatibleVariableOverride] id: int = Field(primary_key=True) type: str total_cost: Optional[float] = Field(default=None) cost_unit: Optional[str] = Field(default=None) description: Optional[str] = Field(default=None) is_active: bool = Field(default=True)