informedica / informedica/GenPRES
refactor(genorder): Totals.getTotals takes Order[] (plan 725, O1)
Nobody has claimed this yet.
- Dominant language
- F#
- Stars
- 47
- Forks
- 12
- Avg merge
- 4h 51m
- Merged PRs (30d)
- 285
Description
Plan 725 trailing phase O1, filed as its own issue as the plan decided.
Totals.getTotals takes Dtos and parses them itself, so the same orders are parsed twice on the path that computes an order plan's totals. O1 gives it Order[] and parses once, in OrderService.getTotals and OrderPlan.recalculate.
This is invariant 4 of ADR-0008: domain code never constructs or reads a Dto. The plan records Totals.getTotals among the existing cases it left alone (rule R8), because fixing them was out of scope for a plan already at 3,000 lines.
This touches dosing. The totals are what the intake panel shows and what a nutrition order plan is judged on, so the tests are TotalsTests plus a golden nutrition order plan whose numbers must not move. About 60 changed lines.
Follow-up of #725.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read docs/implementation-plans/725-contract-model-dto-domain-flow.md and docs/adr/0008-contract-model-dto-mapping-boundary.md, then inspect Totals.getTotals, OrderService.getTotals, and OrderPlan.recalculate. Run TotalsTests and the golden nutrition order plan tests; done means Totals.getTotals accepts Order[] and the displayed and judged totals remain unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- fsharp
- Domain
- backend, testing
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100