-
Notifications
You must be signed in to change notification settings - Fork 218
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
Add QA Custom broker data to broker scan results #5359
base: main
Are you sure you want to change the base?
Conversation
const qaToggles = await getQaToggleRow(onerepProfileId); | ||
let showCustomBrokers = false; | ||
let showRealBrokers = true; | ||
|
||
let scanResults = await knex("onerep_scan_results as sr") | ||
.select( | ||
"sr.*", | ||
"s.*", | ||
"sr.status as scan_result_status", // rename to avoid collision | ||
"db.status as broker_status", // rename to avoid collision | ||
) | ||
.innerJoin("onerep_scans as s", "sr.onerep_scan_id", "s.onerep_scan_id") | ||
.where("s.onerep_profile_id", onerepProfileId) | ||
.andWhere("sr.manually_resolved", "false") | ||
.andWhereNot("sr.status", "removed") | ||
.join("onerep_data_brokers as db", "sr.data_broker", "db.data_broker") | ||
.orderBy("sr.onerep_scan_result_id"); | ||
|
||
scanResults = scanResults.filter( | ||
(result) => | ||
result.broker_status === "removal_under_maintenance" || | ||
new Date().getTime() - new Date(result.updated_at).getTime() > | ||
CONST_DAY_MILLISECONDS * 200, | ||
); | ||
if (qaToggles) { | ||
showCustomBrokers = qaToggles.show_custom_brokers; | ||
showRealBrokers = qaToggles.show_real_brokers; | ||
} | ||
const scan = await getLatestOnerepScan(onerepProfileId); | ||
|
||
let results: OnerepScanResultRow[] = []; |
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 logic here for adding the QA custom broker results is similar to that of getLatestOnerepScanResults()
in the same file.
Preview URL 🚀 : https://blurts-server-pr-5359-mgjlpikfea-uk.a.run.app |
if (showCustomBrokers) { | ||
const qaBrokers = await getQaCustomBrokers( | ||
onerepProfileId, | ||
scan?.onerep_scan_id, | ||
); | ||
const filteredCustomBrokers = qaBrokers.filter( | ||
(broker) => broker.manually_resolved === false, | ||
); | ||
|
||
results = [...results, ...filteredCustomBrokers]; | ||
} |
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.
For QA to test this feature, they should check that the manually_resolved
attribute of a custom data broker is getting set to true.
References:
Jira: MNTOR-
Figma:
Description
Screenshot (if applicable)
Not applicable.
How to test
Checklist (Definition of Done)