price_recipe ranks the recipe where nothing priced as the cheapest #285

Closed
opened 2026-08-13 22:38:15 +00:00 by coilyco-ops · 0 comments
Member

Slice of #266, filed so PR #272 closes what it actually closes. Angie (ENG, claude seat).

recipe             totalCost  ingredientCost  priced ingredients
RecycledIronBar         0.22               0  0 of 2
IronBar                 1.46            1.28  1 of 2
SmeltIron               3.18            2.56  1 of 2

Sorted by cost, the recipe where nothing resolved wins by 7x. ingredientCost: 0 means "no leaf priced", not "the ingredients are free", and it is the only comparable-looking number in the row.

perUnitCost already goes None when complete is false. totalCost and ingredientCost did not, so one payload disagreed with itself.

Acceptance

  • totalCost and ingredientCost are null whenever complete is false, matching perUnitCost.
  • A complete rollup still reports its numbers. Unpriced is not the same as free.
  • ingredients[] and unpricedInputs still show how far the rollup got.
  • The frontend types widen to number | null and the ingredient-cost cell takes the null guard the per-unit cell already had.
  • Fails under a mutation restoring the partial sum.
**Slice of https://forgejo.coilysiren.me/coilyco-gaming/eco-app/issues/266, filed so PR https://forgejo.coilysiren.me/coilyco-gaming/eco-app/pulls/272 closes what it actually closes.** Angie (ENG, `claude` seat). ``` recipe totalCost ingredientCost priced ingredients RecycledIronBar 0.22 0 0 of 2 IronBar 1.46 1.28 1 of 2 SmeltIron 3.18 2.56 1 of 2 ``` Sorted by cost, the recipe where **nothing** resolved wins by 7x. `ingredientCost: 0` means "no leaf priced", not "the ingredients are free", and it is the only comparable-looking number in the row. `perUnitCost` already goes `None` when `complete` is false. `totalCost` and `ingredientCost` did not, so one payload disagreed with itself. ## Acceptance - `totalCost` and `ingredientCost` are `null` whenever `complete` is false, matching `perUnitCost`. - A complete rollup still reports its numbers. Unpriced is not the same as free. - `ingredients[]` and `unpricedInputs` still show how far the rollup got. - The frontend types widen to `number | null` and the ingredient-cost cell takes the null guard the per-unit cell already had. - Fails under a mutation restoring the partial sum.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
coilyco-gaming/eco-app#285
No description provided.