LEGLINK-653: Reduce routine validation-result persistence to submittable categories - #1824
Conversation
…to provide access to api functions.
…ategories/validation-categories-management/validation-categories-management.component.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Replaced Result identity generation with a dedicated dbo.result_sequence configured for Hibernate sequence allocation, and added batching settings for insert/update ordering. Included a migration that recreates the result and result_category tables plus sequence so the database matches the new JPA ID strategy.
Remove the explicit schema = "dbo" from the @SequenceGenerator on Result.id. This allows JPA to use the default schema provided by the persistence setup, improving portability across database vendors and avoiding hard-coded SQL Server schema assumptions.
Filter validation results before persisting: ReadyForValidationConsumer now saves only results that have at least one Category with submit=true, avoiding saving uncategorized or non-submittable results. Tests updated to cover the behavior: ReadyForValidationConsumerTest gains scenarios for submitted, non-submitted, multi-category, and no-submit cases. CategoryInitializationJpaTest updated to validate submit flag changes on reimport. This reduces unnecessary DB writes and ensures only intended results are persisted.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthrough
ChangesValidation result persistence
Estimated code review effort: 2 (Simple) | ~10 minutes Mergeability Score: ⚪ Minimal · up to The change narrowly limits persisted validation results to categories marked submit=true, with no actionable merge-blocking risk remaining beyond normal checks and review. Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
🛠️ Description of Changes
Only persist validation results that are categorized with
submit: true.🧪 Testing Performed
Ran Ad Hoc report and observed that only results with
submit: truewere added in the database.🧑🔬 Unit Testing
📓 Documentation Updated
Please update any relevant sections in the project documentation that were impacted by the changes in the PR.
Summary by CodeRabbit
Bug Fixes
Tests