Feature #365
openProduction plan: cook sheet read path + print layout (W8 D34)
0%
Description
Continuation of W8 (D33 built ProductionPlanLine generation from a frozen meal sheet, but the plan was write-only -- no read endpoint, no portal page, no print layout). D34 closes that loop with a real cook sheet, per the prototype's production.html.
Backend:
- IProductionPlanService.GetForDateAsync -- every plan line for a service date, recipe name/code/portion/cost resolved via the same RecipeCostCalculator every other page uses.
- New ProductionController (GET /api/canteen/production/plan?date=), gated on the Kitchen capability + the pre-existing (until now unused) canteen.production.read permission key.
- Honest about two real gaps rather than fabricating: CanteenForecastPortions stays 0 (forecast service F4-1 does not exist) and ActualServed stays 0 (nothing posts a completed POS sale back to the plan yet) -- both called out in a DomainFootnote on the page, not hidden or invented.
Frontend:
- queries/production.ts + components/shared/production-view.ts (pure grouping/progress helpers, unit tested).
- production/page.tsx rewritten: the old build-time EmptyState placeholder (written before Dietary existed) replaced with a real cook sheet grouped by meal slot, 4 StatCards matching the prototype, and a Print cook sheet button.
- New (print)/production/cook-sheet/page.tsx + cook-sheet.css, A4 layout, same window.print()-on-load pattern as the POS receipt.
9 new backend tests (5 service + 4 auth matrix) + 7 new frontend tests, all green. Full suite: 849/851 backend (the 2 failures are the pre-existing, date-dependent Coupon_liability tests already flagged as unrelated in 9ad7fd5), 530/530 frontend.
NP Updated by Navya P. about 1 month ago
- Status changed from New to Resolved
- Resolved By set to Navya P.
Done. Commit ba89eb4 on integration/canteen-v1 (originally resolved same day, but the note never went through -- Redmine started 500ing right after this shipped and stayed down into the next session).
- GET /api/canteen/production/plan?date= -- recipe name/code/portion/cost resolved per plan line
- Real cook sheet on /production: grouped by meal slot, 4 StatCards, DomainFootnote honest about the two still-zero fields (canteen forecast, served so far)
- Print cook sheet -> new (print)/production/cook-sheet route, A4, window.print()-on-load
13 backend tests (merged into D33's existing test file, not overwritten -- caught before commit), 530/530 frontend. Two follow-up fix commits same day: 797cd52 (formatItems null-safety), 0c2180f + e43f517 (layout).
NP Updated by Navya P. about 1 month ago
- Assignee set to Navya P.