[fix]: Apply rules using trigger section/row period#185
Open
deeonwuli wants to merge 1 commit intodevelopmentfrom
Open
[fix]: Apply rules using trigger section/row period#185deeonwuli wants to merge 1 commit intodevelopmentfrom
deeonwuli wants to merge 1 commit intodevelopmentfrom
Conversation
BundleMonNo change in files bundle size Groups updated (1)
Final result: ✅ View report in BundleMon website ➡️ |
MatiasArriola
requested changes
May 6, 2026
Contributor
MatiasArriola
left a comment
There was a problem hiding this comment.
Good refactor for getValueAndVerifyCondition to receive an options object instead a lot of positional parameters. Also, getApplicablePeriod is a nice and well-focused abstraction. The intent aligns well with the PR description.
Only some comments that might be worth reviewing:
getValueAndVerifyCondtion: We are usingperiodinstead ofapplicablePeriodin theevaluateTotalRulecall. Is that correct? Maybe this is just a smell, but wanted to raise the question. I think we should confirm and test around this, and if no change is needed, add comment on whyperiodis used.FormRuleOptionstype includesdataElementTotalRule: Maybe<DataElementTotalRule | SectionTotalRule>;but `SectionTotalRule seems to be not needed
Thanks @deeonwuli!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 References
📝 Implementation
PR #177 made rule condition lookups always use the form's base period. That broke rules whose trigger DE lives in a section with a period offset: in PAHO country TUB sections 6.2 / 6.4 (
startOffset/endOffset: -1) the trigger's value sits at the cohort year, not the form year, so the lookup found nothing and the dependent rows in 6.3 / 6.5 stayed disabled.getApplicablePeriodnow resolves the period from the row period when the trigger's section has data there (so multi-period sections evaluate per-row), otherwise the form's base period.🎨 Screenshots
Screen.Recording.2026-04-30.at.14.20.18.mov
🔥 Notes to the tester
#869cmxcc8