Commit 025d483
fix(schedule10): apply Story 11.2 code-review findings, resolved legacy-first
Four independent review layers over the Schedule 10 write path produced 49
findings. All patches applied; all eight decisions answered by reading
docs/nr-ilcr-2.0.4 rather than by preference.
TWO USER-FACING MESSAGE DEFECTS affected every rejection this story added.
Required fields answered a literal "{0}: Value is required." and all 28 range
constraints answered "Entered value must be between {0} and {1}", because
parameterised bundle keys were wired to Bean Validation annotations, which
supply no positional arguments. Legacy overrides no javax.faces.* key, so JSF
fills {0} from each component's label attribute; invalidRangeErrorMsg appears in
legacy in exactly one place, CheckStatus.java:196, with an args array. Both now
render legacy's resolved bytes. Percentages and side slope use legacy's OWN
existing keys rather than new ones.
TWO PATHS WROTE NULL INTO NOT NULL COLUMNS and surfaced as opaque 500s.
detailedEngineeringCostInd (@pattern treats null as valid) now defaults to "N",
matching legacy's two-item dropdown with no empty option. applyBallastCoupling's
missing default branch now forces material "NA", as legacy already does for its
other non-crushed methods.
DUPLICATE COST ROWS now take the LAST row instead of being summed.
Schedule10DAO:556-600 loops the cost rows and ASSIGNS per item -- legacy never
sums. Story 11.1's summing was an unrecorded deviation, and it was exactly what
made a duplicated value unfixable through the API: the write path's UPDATE sets
every duplicate row, and the read then re-summed them. Correcting the read needs
no row deletion, so AC5 ("a cost row is never deleted by a save") still holds.
ROAD-DETAIL EDITS no longer rewrite the derived moisture pair. Legacy's
filterMoistureCodeLists() rebuilds the dropdown LISTS and never assigns, so an
edit touching only comments must not flip a stored (F, Moist) to (SD, Moist)
through a tie-break invented for this port. This also gives the BEC
classification the unchanged-code exemption, so a stored row whose BEC has
dropped out of the offerable set is editable again -- and findStoredClassification,
previously dead code, is now its implementation.
Also: byte caps on roadName and divisionName, a constructionPeriod month range,
converter keys so a malformed percentage or volume no longer reports a COST
error, the four dead persistence keys wired, and mill/year/category scope added
to all five child UPDATE/DELETE statements so the invariant the file already
asserts is actually true.
THREE DECISIONS NEEDED NO CODE CHANGE -- an unmapped TFL blocking an edit,
HALF_UP rounding, and token-free deletes are all faithful legacy behaviour. A
fourth proved the STORY wrong rather than the code: legacy zeroes the four
stabilizing dimensions for method N only, keeps them for D, and never zeroes
ttTransfer. Pinned deviation (e) is amended to match legacy; deviation (l)'s TFL
key counts are corrected to 21 vs 20, differing only by the unstorable 52B,
which is now demoted to a comment as Schedule 6 had already done.
TEST CORRECTIONS, several of them tests that could not fail: a vacuous
intValue() assertion on a 0.3 input, three of the four "zeroed" dimensions never
asserted, isNotNull() on NOT NULL columns, and a Set-collapse that let
containsExactly pass with a constraint deleted. Added the missing coverage:
Check Status emission order, both unreachable-rule labels asserted positively,
ballast method D, three requireOffered negatives, the road-detail 409 path,
year/category/foreign-mill delete scoping, UPDATE_* re-stamping across all three
tables, and AC8's three untested road-detail endpoints. Schedule10CopyIT and
Schedule10DeleteIT no longer share a (mill, year) -- they passed only because
"Copy" sorts before "Delete".
ONE CLAIM WAS REMOVED RATHER THAN SATISFIED: Schedule10WriteAuthorizationIT
asserted that a controller unit test pins the EDIT action by name. No such test
exists, and because both shipped groups hold both actions, changing mayEdit() to
ask for VIEW_SCHEDULE would pass the entire suite. Recorded in deferred-work.md
instead of left as a claim the tests do not support.
Verification: 1150 unit + 879 integration tests, 0 failures, BUILD SUCCESS; 0
checkstyle violations in schedule10 (1234 pre-existing elsewhere untouched).
Schedule 10 owns 259 tests across 17 classes, up from 243 before the review.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent ff6f0dc commit 025d483
24 files changed
Lines changed: 1243 additions & 177 deletions
File tree
- backend/src
- main
- java/ca/bc/gov/nrs/ilcr
- exception
- schedule10
- dto
- resources
- test
- java/ca/bc/gov/nrs/ilcr/schedule10
- resources/db
Lines changed: 15 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
327 | 338 | | |
328 | 339 | | |
329 | 340 | | |
| |||
Lines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
Lines changed: 27 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
103 | 118 | | |
104 | 119 | | |
105 | 120 | | |
| |||
354 | 369 | | |
355 | 370 | | |
356 | 371 | | |
357 | | - | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
358 | 378 | | |
359 | 379 | | |
360 | 380 | | |
| |||
Lines changed: 40 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
Lines changed: 68 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
655 | 655 | | |
656 | 656 | | |
657 | 657 | | |
| 658 | + | |
| 659 | + | |
658 | 660 | | |
659 | | - | |
660 | | - | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
661 | 664 | | |
662 | 665 | | |
663 | 666 | | |
| |||
673 | 676 | | |
674 | 677 | | |
675 | 678 | | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
676 | 687 | | |
677 | 688 | | |
678 | 689 | | |
679 | | - | |
| 690 | + | |
| 691 | + | |
680 | 692 | | |
681 | 693 | | |
682 | 694 | | |
| |||
708 | 720 | | |
709 | 721 | | |
710 | 722 | | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
711 | 731 | | |
712 | | - | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
713 | 735 | | |
714 | 736 | | |
715 | 737 | | |
| |||
721 | 743 | | |
722 | 744 | | |
723 | 745 | | |
724 | | - | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
725 | 752 | | |
726 | | - | |
| 753 | + | |
| 754 | + | |
727 | 755 | | |
728 | 756 | | |
729 | 757 | | |
730 | 758 | | |
731 | 759 | | |
732 | 760 | | |
733 | 761 | | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
734 | 768 | | |
735 | | - | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
736 | 772 | | |
737 | 773 | | |
738 | 774 | | |
739 | 775 | | |
740 | 776 | | |
741 | 777 | | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
742 | 784 | | |
743 | | - | |
| 785 | + | |
| 786 | + | |
744 | 787 | | |
745 | 788 | | |
746 | 789 | | |
| |||
768 | 811 | | |
769 | 812 | | |
770 | 813 | | |
771 | | - | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
772 | 817 | | |
773 | 818 | | |
774 | 819 | | |
775 | 820 | | |
776 | 821 | | |
777 | 822 | | |
778 | | - | |
779 | | - | |
780 | | - | |
781 | | - | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
782 | 836 | | |
783 | 837 | | |
784 | 838 | | |
785 | | - | |
| 839 | + | |
786 | 840 | | |
787 | 841 | | |
0 commit comments