-
Notifications
You must be signed in to change notification settings - Fork 18
feat(screening_monitoring): add configuration part #1274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat(screening_monitoring): add configuration part #1274
Conversation
There was a problem hiding this 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 |
Copilot
AI
Oct 23, 2025
There was a problem hiding this comment.
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.
| Enabled bool |
| 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"` | ||
| } |
Copilot
AI
Oct 23, 2025
There was a problem hiding this comment.
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.
60ad550 to
919eb06
Compare
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
routes.goand implemented their handlers inhandle_screening_monitoring.go. [1] [2]Data Modeling and DTOs
ScreeningMonitoringConfigmodel and related create/update types inmodels/screening_monitoring_config.go.dto/screening_monitoring_config.go.Database Layer
screening_monitoring_configstable, including fields and constraints, and an index for organization ID.screening_monitoring_repository.goand related DB model adaptation indb_screening_monitoring_config.go. [1] [2]Usecase and Security Enforcement
Integration
These changes together enable full lifecycle management of screening monitoring configuration entities, including secure access control and persistence.