Harden MCP article and weight workflows
This commit is contained in:
@@ -6,6 +6,7 @@ from typing import Any
|
||||
|
||||
from roll_calculation import (
|
||||
ArticleRepository,
|
||||
calculate_material_weight,
|
||||
calculate_roll,
|
||||
get_article,
|
||||
transport_roll_inputs_from_roll_calculation,
|
||||
@@ -26,6 +27,20 @@ def search_articles_result(query: str) -> dict[str, Any]:
|
||||
return ArticleRepository.load().search(query)
|
||||
|
||||
|
||||
def calculate_material_weight_result(
|
||||
*,
|
||||
roll_length_m: float,
|
||||
width_m: float,
|
||||
area_weight_g_m2: float,
|
||||
) -> dict[str, Any]:
|
||||
"""Delegate material-only weight calculation to the shared domain service."""
|
||||
return calculate_material_weight(
|
||||
roll_length_m=roll_length_m,
|
||||
width_m=width_m,
|
||||
area_weight_g_m2=area_weight_g_m2,
|
||||
)
|
||||
|
||||
|
||||
def calculate_roll_diameter_result(
|
||||
*,
|
||||
article_number: str | None = None,
|
||||
|
||||
Reference in New Issue
Block a user