-
Notifications
You must be signed in to change notification settings - Fork 18
refacto(continuous_screening): use unique table to store monitored ob… #1351
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?
refacto(continuous_screening): use unique table to store monitored ob… #1351
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 pull request refactors the continuous screening feature to use a unified table structure for storing monitored objects. Instead of creating separate tables for each object type (e.g., _monitored_objects_transactions, _monitored_objects_customers), the system now uses a single _monitored_objects table with an object_type column to distinguish between different types. This simplifies schema management and improves maintainability.
Key changes include:
- Consolidated table schema with a new
object_typecolumn and updated indexes - Simplified table creation logic to run once per organization instead of per object type
- Updated repository methods to accept
objectTypeparameter instead oftableName
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
repositories/continuous_screening_client_repository.go |
Refactored table creation to use a single unified table with object_type column; updated insert, get, and list methods to work with the new schema |
repositories/dbmodels/db_continuous_screening.go |
Added ObjectType field to DBContinuousScreeningMonitoredObject struct and updated adapter function |
models/continuous_screening.go |
Added ObjectType field to ContinuousScreeningMonitoredObject model |
usecases/continuous_screening/usecase.go |
Updated interface definition to remove tableName parameter and use objectType instead |
usecases/continuous_screening/org_config.go |
Simplified table creation logic to run once per organization; renamed processObjectTypes to checkDataModelConfiguration to reflect its new purpose of validation only |
usecases/continuous_screening/org_config_test.go |
Updated test mocks to match new method signatures with simplified table creation calls |
mocks/continuous_screening_repository.go |
Updated CreateInternalContinuousScreeningTable mock signature to remove tableName parameter |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
5551e79 to
3c84f86
Compare
bd0638f to
8ec491f
Compare
7cf9a25 to
64ee841
Compare
8ec491f to
f300424
Compare
64ee841 to
83ba862
Compare
…ject instead per object type
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
f300424 to
c8afcfe
Compare
Pascal-Delange
left a comment
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.
👍
This pull request refactors the way internal tables for continuous screening monitored objects are created and managed. Instead of creating separate tables per object type, the system now uses a single table (
_monitored_objects) with anobject_typecolumn to distinguish between different types. This simplifies schema management and improves query efficiency. The changes also update related repository and usecase logic, as well as tests and mocks, to align with the new table structure.Database schema and repository changes:
_monitored_objects) that includes a newobject_typecolumn, and updated unique and regular indexes to use this column. [1] [2]CreateInternalContinuousScreeningTable,InsertContinuousScreeningObject,GetMonitoredObject,ListMonitoredObjectsByObjectIds) to use the unified table and acceptobject_typeas a parameter instead of table name. [1] [2] [3] [4] [5]Model and DTO changes:
ObjectTypefield toContinuousScreeningMonitoredObjectmodel and its corresponding DB representation and adapters. [1] [2] [3]Usecase logic changes:
Test and mock updates: