Skip to content

74 add yield field#84

Open
m-lyon wants to merge 9 commits intomainfrom
74-add-yield-field
Open

74 add yield field#84
m-lyon wants to merge 9 commits intomainfrom
74-add-yield-field

Conversation

@m-lyon
Copy link
Copy Markdown
Owner

@m-lyon m-lyon commented Mar 30, 2026

No description provided.

m-lyon added 9 commits March 29, 2026 21:56
Add optional yield field (quantity + unit) to Recipe mongoose model with
validation. Extend RecipeTC with a resolved yield.unit field so GraphQL
queries can fetch the full Unit object. Include migration script to set
yield: null on existing documents.
Address roborev finding: replace iterate-then-update pattern with a
single updateMany call, which is more efficient on large collections.
Add yield { quantity, unit { ...UnitFields } } to RECIPE_FIELDS_FULL
fragment. Export scaleQuantity helper from quantity.ts for use in the
yield view component.
Address roborev finding: return original quantity unchanged when
origServings is 0 to prevent division-by-zero errors.
Add YieldSlice Zustand store, EditableYield (Mantine) component for
edit flow, Yield (Mantine) view component with scaling support, and
wire everything through IngredientsTabLayout, SubmitButton, and
EditRecipe page loader.
…tButton

- Wrap fraction() calls in Yield.tsx with try/catch to handle invalid inputs
- Include sign property (.s) in fraction numeric calculation for correctness
- Add VALID_NUMBER_REGEX validation for yield quantity in SubmitButton validate()
- Fix missing return before drop() in Mongoose afterEach
- Rename misleading scaleQuantity test, add actual fraction result case
- Add range + zero origServings edge case test for scaleQuantity
- Add integration test for unit-without-quantity edge case
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant