|
|
|
@ -7,20 +7,6 @@ from uuid import UUID
|
|
|
|
from pydantic import Field
|
|
|
|
from pydantic import Field
|
|
|
|
from src.models import DefultBase
|
|
|
|
from src.models import DefultBase
|
|
|
|
|
|
|
|
|
|
|
|
# {
|
|
|
|
|
|
|
|
# "costPerFailure": 733.614,
|
|
|
|
|
|
|
|
# "availableScopes": ["A", "B"],
|
|
|
|
|
|
|
|
# "recommendedScope": "B",
|
|
|
|
|
|
|
|
# "historicalData": {
|
|
|
|
|
|
|
|
# "averageOverhaulCost": 10000000,
|
|
|
|
|
|
|
|
# "lastCalculation": {
|
|
|
|
|
|
|
|
# "id": "calc_122",
|
|
|
|
|
|
|
|
# "date": "2024-10-15",
|
|
|
|
|
|
|
|
# "scope": "B"
|
|
|
|
|
|
|
|
# }
|
|
|
|
|
|
|
|
# }
|
|
|
|
|
|
|
|
# }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class CalculationTimeConstrainsBase(DefultBase):
|
|
|
|
class CalculationTimeConstrainsBase(DefultBase):
|
|
|
|
pass
|
|
|
|
pass
|
|
|
|
@ -33,47 +19,23 @@ class CalculationTimeConstrainsParametersRead(CalculationTimeConstrainsBase):
|
|
|
|
historicalData: Dict[str, Any] = Field(..., description="Historical data")
|
|
|
|
historicalData: Dict[str, Any] = Field(..., description="Historical data")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# {
|
|
|
|
|
|
|
|
# "overhaulCost": 10000000,
|
|
|
|
|
|
|
|
# "scopeOH": "B",
|
|
|
|
|
|
|
|
# "costPerFailure": 733.614,
|
|
|
|
|
|
|
|
# "metadata": {
|
|
|
|
|
|
|
|
# "unit": "PLTU1",
|
|
|
|
|
|
|
|
# "calculatedBy": "user123",
|
|
|
|
|
|
|
|
# "timestamp": "2024-11-28T10:00:00Z"
|
|
|
|
|
|
|
|
# }
|
|
|
|
|
|
|
|
# }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class CalculationTimeConstrainsCreate(CalculationTimeConstrainsBase):
|
|
|
|
class CalculationTimeConstrainsCreate(CalculationTimeConstrainsBase):
|
|
|
|
overhaulCost: float = Field(..., description="Overhaul cost")
|
|
|
|
overhaulCost: float = Field(..., description="Overhaul cost")
|
|
|
|
scopeOH: str = Field(..., description="Scope OH")
|
|
|
|
scopeOH: str = Field(..., description="Scope OH")
|
|
|
|
costPerFailure: float = Field(..., description="Cost per failure")
|
|
|
|
costPerFailure: float = Field(..., description="Cost per failure")
|
|
|
|
metadata: Dict[str, Any] = Field(..., description="Metadata")
|
|
|
|
metadata: Dict[str, Any] = Field(..., description="Metadata")
|
|
|
|
|
|
|
|
|
|
|
|
# {
|
|
|
|
|
|
|
|
# "calculationId": "calc_123",
|
|
|
|
|
|
|
|
# "result": {
|
|
|
|
|
|
|
|
# "summary": {
|
|
|
|
|
|
|
|
# "scope": "B",
|
|
|
|
|
|
|
|
# "numberOfFailures": 59,
|
|
|
|
|
|
|
|
# "optimumOHTime": 90,
|
|
|
|
|
|
|
|
# "optimumTotalCost": 500000000
|
|
|
|
|
|
|
|
# },
|
|
|
|
|
|
|
|
# "chartData": {/* ... */},
|
|
|
|
|
|
|
|
# "comparisons": {
|
|
|
|
|
|
|
|
# "vsLastCalculation": {
|
|
|
|
|
|
|
|
# "costDifference": -50000000,
|
|
|
|
|
|
|
|
# "timeChange": "+15 days"
|
|
|
|
|
|
|
|
# }
|
|
|
|
|
|
|
|
# }
|
|
|
|
|
|
|
|
# },
|
|
|
|
|
|
|
|
# "simulationLimits": {
|
|
|
|
|
|
|
|
# "minInterval": 30,
|
|
|
|
|
|
|
|
# "maxInterval": 180
|
|
|
|
|
|
|
|
# }
|
|
|
|
|
|
|
|
# }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class CalculationTimeConstrainsRead(CalculationTimeConstrainsBase):
|
|
|
|
class CalculationTimeConstrainsRead(CalculationTimeConstrainsBase):
|
|
|
|
id: Union[UUID, str]
|
|
|
|
id: Union[UUID, str]
|
|
|
|
result: Dict[str, Any]
|
|
|
|
result: Dict[str, Any]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
"calculationId": "calc_123",
|
|
|
|
|
|
|
|
"intervalDays": 45,
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class CalculationTimeConstrainsSimulationRead(CalculationTimeConstrainsBase):
|
|
|
|
|
|
|
|
simulation: Dict[str, Any]
|
|
|
|
|
|
|
|
comparison: Dict[str, Any]
|