53 lines
1.3 KiB
Python
53 lines
1.3 KiB
Python
from __future__ import annotations
|
|
|
|
from dataclasses import dataclass, field
|
|
from typing import Any
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class RationLineSnapshot:
|
|
id: str | None
|
|
component_id: str | None
|
|
ingredient_name: str | None
|
|
row_index: int
|
|
daily_kg: float | None
|
|
in_ration: bool
|
|
in_compound: bool
|
|
dry_matter: float | None
|
|
price_per_kg: float | None
|
|
nutrients: dict[str, Any]
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class RationSnapshot:
|
|
recipe_id: str
|
|
recipe_name: str
|
|
ration_type: str
|
|
heads_per_trip: int
|
|
animal_profile_id: str | None
|
|
params: dict[str, Any]
|
|
lines: tuple[RationLineSnapshot, ...] = field(default_factory=tuple)
|
|
norms: dict[str, dict[str, float | None]] = field(default_factory=dict)
|
|
ration_results: dict[str, Any] = field(default_factory=dict)
|
|
compound_results: dict[str, Any] = field(default_factory=dict)
|
|
calculated_at: str | None = None
|
|
exists: bool = True
|
|
norms_profile_key: str | None = None
|
|
legacy_norms_remapped: bool = False
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class ExecutionLineSnapshot:
|
|
ingredient_id: str
|
|
component_id: str | None
|
|
name: str
|
|
weight_per_head: float
|
|
daily_kg_total: float
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class ExecutionSnapshot:
|
|
recipe_id: str
|
|
heads_per_trip: int
|
|
lines: tuple[ExecutionLineSnapshot, ...] = field(default_factory=tuple)
|