feat(backend): include last-used date in product LLM details
This commit is contained in:
parent
40d26514a1
commit
7a66a7911d
5 changed files with 91 additions and 7 deletions
|
|
@ -154,3 +154,24 @@ def test_shopping_tool_handlers_return_payloads(session: Session):
|
|||
assert details["products"][0]["inci"] == ["Water", "Niacinamide"]
|
||||
assert details["products"][0]["actives"][0]["name"] == "Niacinamide"
|
||||
assert "context_rules" in details["products"][0]
|
||||
assert details["products"][0]["last_used_on"] is None
|
||||
|
||||
|
||||
def test_shopping_tool_handler_includes_last_used_on_from_mapping(session: Session):
|
||||
product = Product(
|
||||
id=uuid.uuid4(),
|
||||
name="Mapped Product",
|
||||
brand="Brand",
|
||||
category="serum",
|
||||
recommended_time="both",
|
||||
leave_on=True,
|
||||
product_effect_profile={},
|
||||
)
|
||||
|
||||
payload = {"product_ids": [str(product.id)]}
|
||||
details = build_product_details_tool_handler(
|
||||
[product],
|
||||
last_used_on_by_product={str(product.id): date(2026, 3, 1)},
|
||||
)(payload)
|
||||
|
||||
assert details["products"][0]["last_used_on"] == "2026-03-01"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue