Date validations#13596
Conversation
WalkthroughIntroduces explicit start/end date field creation and cross-field validation in ActivityAsCaseForm and ExposureForm using DateComparisonValidator. START_DATE and END_DATE are excluded from bulk field addition and validated as a pair to enforce start-before-end constraints. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor U as User
participant F as UI Form (ActivityAsCase/Exposure)
participant S as START_DATE Field
participant E as END_DATE Field
participant V as DateComparisonValidator
U->>F: Open form / edit dates
F->>S: Initialize/get startDate
F->>E: Initialize/get endDate
F->>V: addStartEndValidators(S, E)
Note right of V: Cross-field constraint registered
U->>F: Submit or change date values
F->>V: Validate(S.value, E.value)
alt start after end or invalid range
V-->>F: Validation error(s)
F-->>U: Show error on START_DATE/END_DATE
else valid range
V-->>F: OK
F-->>U: Accept values / proceed
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks (1 passed, 2 warnings)❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
Poem
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. 📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (4)
✨ Finishing touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
SonarCloud analysis: https://sonarcloud.io/dashboard?id=SORMAS-Project&pullRequest=13596 |
Fixes #
Summary by CodeRabbit