Skip to content

Conversation

@OrriMandarin
Copy link
Contributor

This pull request introduces a new feature for managing screening monitoring configurations in the backend. It adds the necessary API endpoints, data models, database migration, repository logic, usecase layer, and security enforcement for creating, reading, updating, and listing screening monitoring configs. The changes are grouped below by theme.

API and Routing

  • Added new HTTP endpoints for listing, creating, retrieving, and updating screening monitoring configs in routes.go and implemented their handlers in handle_screening_monitoring.go. [1] [2]

Data Modeling and DTOs

  • Introduced ScreeningMonitoringConfig model and related create/update types in models/screening_monitoring_config.go.
  • Added corresponding DTOs and adaptation/validation logic in dto/screening_monitoring_config.go.

Database Layer

  • Added a migration to create the screening_monitoring_configs table, including fields and constraints, and an index for organization ID.
  • Implemented repository methods for CRUD operations on screening monitoring configs in screening_monitoring_repository.go and related DB model adaptation in db_screening_monitoring_config.go. [1] [2]

Usecase and Security Enforcement

  • Added a usecase layer for screening monitoring configs, including security checks for read/write operations. [1] [2]
  • Implemented security enforcement for screening monitoring config permissions, including new permission types. [1] [2] [3] [4]

Integration

  • Registered the new usecase and security enforcement in the usecases factory.

These changes together enable full lifecycle management of screening monitoring configuration entities, including secure access control and persistence.

@OrriMandarin OrriMandarin requested a review from Copilot October 23, 2025 16:52
@OrriMandarin OrriMandarin self-assigned this Oct 23, 2025
@OrriMandarin OrriMandarin added enhancement New feature or request WIP go Pull requests that update Go code labels Oct 23, 2025
@linear
Copy link

linear bot commented Oct 23, 2025

@OrriMandarin OrriMandarin marked this pull request as draft October 23, 2025 16:52
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a comprehensive screening monitoring configuration management feature for the backend system. The implementation adds secure CRUD operations for managing screening monitoring configurations at the organization level.

Key Changes:

  • Added new REST API endpoints for managing screening monitoring configurations (list, create, retrieve, update)
  • Implemented complete data persistence layer with database migration, repository methods, and model adapters
  • Integrated permission-based security enforcement for read/write operations on screening monitoring configurations

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
api/routes.go Registered four new HTTP endpoints for screening monitoring config operations
api/handle_screening_monitoring.go Implemented HTTP handlers for all screening monitoring config endpoints
dto/screening_monitoring_config.go Defined DTOs with validation and model adaptation for API layer
models/screening_monitoring_config.go Created domain models for screening monitoring config and CRUD operations
models/permission.go Added two new permission types for screening monitoring read/write access
repositories/migrations/20251023145610_screening_monitoring_config.sql Created database table with constraints and indexes
repositories/dbmodels/db_screening_monitoring_config.go Implemented database model and adapter for screening monitoring config
repositories/screening_monitoring_repository.go Implemented repository methods for database CRUD operations
usecases/screening_monitoring/usecase.go Created usecase layer structure with repository interface
usecases/screening_monitoring/config.go Implemented business logic for all screening monitoring config operations
usecases/security/enforce_security_screening_monitoring.go Implemented permission enforcement for screening monitoring operations
usecases/usecases_with_creds.go Registered new usecase and security enforcement in factory

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

UpdatedAt time.Time

// TODO: Implement this
Enabled bool
Copy link

Copilot AI Oct 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Enabled field is defined in the model with a TODO comment but is not included in the database migration, repository operations, or DTOs. This creates an inconsistency where the field exists in the domain model but cannot be persisted or accessed. Either implement full support for this field across all layers, or remove it from the model until it's ready to be implemented.

Suggested change
Enabled bool

Copilot uses AI. Check for mistakes.
Comment on lines +13 to +23
type DBScreeningMonitoringConfig struct {
Id uuid.UUID `db:"id"`
OrgId string `db:"org_id"`
Name string `db:"name"`
Description *string `db:"description"`
Datasets []string `db:"datasets"`
MatchThreshold int `db:"match_threshold"`
MatchLimit int `db:"match_limit"`
UpdatedAt time.Time `db:"updated_at"`
CreatedAt time.Time `db:"created_at"`
}
Copy link

Copilot AI Oct 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The DBScreeningMonitoringConfig struct is missing the Enabled field that exists in the database migration (line 14 of the SQL file). This inconsistency will cause the field to be ignored when reading from or writing to the database. Add the Enabled bool \db:"enabled"`` field to match the database schema.

Copilot uses AI. Check for mistakes.
@OrriMandarin OrriMandarin force-pushed the leoji/mar-1325-create-monitoring-screening-configuration branch from 60ad550 to 919eb06 Compare October 23, 2025 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request go Pull requests that update Go code WIP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant