Skip to content

refactor: extract base classes to reduce SDK data integration duplication#1451

Draft
milosdjakovic-vicert wants to merge 15 commits intofeat/KOALA-3744-sdk-data-integrationfrom
refactor/reduce-data-integration-duplication
Draft

refactor: extract base classes to reduce SDK data integration duplication#1451
milosdjakovic-vicert wants to merge 15 commits intofeat/KOALA-3744-sdk-data-integrationfrom
refactor/reduce-data-integration-duplication

Conversation

@milosdjakovic-vicert
Copy link

Summary

  • Create _BaseDocumentEffect base class for shared validation logic across document effects
  • Create BaseReportTemplateQuerySet base class for common filtering methods across template querysets
  • Use models.Manager.from_queryset() pattern for SpecialtyReportTemplate to match other template models
  • Use database codes directly in ReviewMode enum to eliminate mapping dictionary

Changes

Effects Layer:

  • New _BaseDocumentEffect in canvas_sdk/effects/data_integration/base.py
  • Updated 5 effect classes to inherit from base class
  • Extracted validate_confidence_scores_keys and _validate_document_id_not_empty to base

Data Layer:

  • New BaseReportTemplateQuerySet in canvas_sdk/v1/data/base.py
  • Updated 3 template querysets to inherit common active(), inactive(), search(), custom(), builtin() methods
  • Aligned SpecialtyReportTemplate manager pattern with LabReportTemplate and ImagingReportTemplate

admir-vicert and others added 15 commits December 19, 2025 10:26
Co-authored-by: admir-vicert <admir.ihtijarevic@vicert.com>
Co-authored-by: nikola-milev-vicert <nikola.milev@vicert.com>
Co-authored-by: imran-vicert <imran.agic@vicert.com>
Co-authored-by: irfan-vicert <irfan.cajo@vicert.com>
Co-authored-by: admir-vicert <admir.ihtijarevic@vicert.com>
Co-authored-by: admir-vicert <admir.ihtijarevic@vicert.com>
Co-authored-by: imran-vicert <imran.agic@vicert.com>
Co-authored-by: nikola-milev-vicert <nikola.milev@vicert.com>
Co-authored-by: admir-vicert <admir.ihtijarevic@vicert.com>
Create base class for document effects with shared confidence score validation
and document ID validation logic. Simplify ReviewMode enum to use database
codes directly.
Create base QuerySet for report templates with shared filtering methods.
Simplify SpecialtyReportTemplate manager to use standard Django pattern.
@snyk-io
Copy link

snyk-io bot commented Jan 19, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@nikola-milev-vicert nikola-milev-vicert force-pushed the feat/KOALA-3744-sdk-data-integration branch 2 times, most recently from 8694ff1 to b63e4f6 Compare February 6, 2026 15:02
@github-actions github-actions bot added the Jira: Not Linked PR body does not contain a Jira link label Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Jira: Not Linked PR body does not contain a Jira link PR: Conflicts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants