feat: Add currency and unit support across models, routes, and templates; enhance UI for consumption, costs, and production
This commit is contained in:
@@ -25,6 +25,8 @@ def test_create_production_record(client: TestClient) -> None:
|
||||
"scenario_id": scenario_id,
|
||||
"amount": 475.25,
|
||||
"description": "Daily output",
|
||||
"unit_name": "Tonnes",
|
||||
"unit_symbol": "t",
|
||||
}
|
||||
|
||||
response = client.post("/api/production/", json=payload)
|
||||
@@ -33,6 +35,7 @@ def test_create_production_record(client: TestClient) -> None:
|
||||
assert created["scenario_id"] == scenario_id
|
||||
assert created["amount"] == pytest.approx(475.25)
|
||||
assert created["description"] == "Daily output"
|
||||
assert created["unit_symbol"] == "t"
|
||||
|
||||
|
||||
def test_list_production_filters_by_scenario(client: TestClient) -> None:
|
||||
@@ -46,6 +49,8 @@ def test_list_production_filters_by_scenario(client: TestClient) -> None:
|
||||
"scenario_id": scenario_id,
|
||||
"amount": amount,
|
||||
"description": f"Output {amount}",
|
||||
"unit_name": "Kilograms",
|
||||
"unit_symbol": "kg",
|
||||
},
|
||||
)
|
||||
assert response.status_code == 201
|
||||
|
||||
Reference in New Issue
Block a user