···11+-- Add default NCMEC queue to ncmec_org_settings so Enqueue to NCMEC can target a specific queue.
22+ALTER TABLE ncmec_reporting.ncmec_org_settings
33+ ADD COLUMN IF NOT EXISTS default_ncmec_queue_id character varying(255) NULL;
44+55+ALTER TABLE ncmec_reporting.ncmec_org_settings
66+ ADD CONSTRAINT ncmec_org_settings_default_ncmec_queue_fkey
77+ FOREIGN KEY (default_ncmec_queue_id)
88+ REFERENCES manual_review_tool.manual_review_queues(id)
99+ ON DELETE SET NULL;
1010+1111+COMMENT ON COLUMN ncmec_reporting.ncmec_org_settings.default_ncmec_queue_id IS
1212+ 'When set, Enqueue to NCMEC sends jobs to this queue instead of the org default.';
+1
README.md
···52523. Make sure the `.env` files for `/server` and `.devops/migrator` are populated (including ClickHouse credentials). Run database migrations:
5353 ```bash
5454 npm run db:update -- --env staging --db api-server-pg
5555+ npm run db:update -- --env staging --db scylla
5556 npm run db:update -- --env staging --db clickhouse
5657 ```
5758### Alternative: Single Command for Steps 2-3
···5757 item: ItemSubmissionWithTypeIdentifier;
5858 correlationId: RuleExecutionCorrelationId | ActionExecutionCorrelationId;
5959 reenqueuedFrom?: OriginJobInfo;
6060+ /** When set, NCMEC jobs are enqueued to this queue instead of the org default. */
6161+ targetQueueId?: string;
6062 } & (
6163 | {
6264 enqueueSource: 'RULE_EXECUTION';
···181183 }
182184183185 // TODO: Write this to a snowflake table and enqueue based off of a job instead
184184- await this.manualReviewToolService.enqueue({
185185- orgId,
186186- createdAt,
187187- // TODO: Pass policies through NcmecService.eventuallyEnqueue into
188188- // snowflake and ultimately into here. Note that
189189- // NcmecService.eventuallyEnqueue is called inside submitReport, which has
190190- // access to the policies passed in with the report, and inside the
191191- // ActionPublisher, which has the policies that come along with the
192192- // action. This should be sufficient to pass the policies through to here.
193193- policyIds: [],
194194- payload: {
195195- kind: 'NCMEC',
196196- item: itemSubmissionToItemSubmissionWithTypeIdentifier(userSubmission),
197197- allMediaItems,
198198- reportHistory: [],
186186+ await this.manualReviewToolService.enqueue(
187187+ {
188188+ orgId,
189189+ createdAt,
190190+ // TODO: Pass policies through NcmecService.eventuallyEnqueue into
191191+ // snowflake and ultimately into here. Note that
192192+ // NcmecService.eventuallyEnqueue is called inside submitReport, which has
193193+ // access to the policies passed in with the report, and inside the
194194+ // ActionPublisher, which has the policies that come along with the
195195+ // action. This should be sufficient to pass the policies through to here.
196196+ policyIds: [],
197197+ payload: {
198198+ kind: 'NCMEC',
199199+ item: itemSubmissionToItemSubmissionWithTypeIdentifier(userSubmission),
200200+ allMediaItems,
201201+ reportHistory: [],
202202+ },
203203+ correlationId: input.correlationId,
204204+ // Safe pick to preserve correlation
205205+ ...safePick(input, [
206206+ 'enqueueSource',
207207+ 'enqueueSourceInfo',
208208+ 'reenqueuedFrom',
209209+ ]),
199210 },
200200- correlationId: input.correlationId,
201201- // Safe pick to preserve correlation
202202- ...safePick(input, [
203203- 'enqueueSource',
204204- 'enqueueSourceInfo',
205205- 'reenqueuedFrom',
206206- ]),
207207- });
211211+ input.targetQueueId,
212212+ );
208213 // eslint-disable-next-line no-console
209214 console.log('[NCMEC] ✅ Successfully created NCMEC manual review job!');
210215 return { status: 'ENQUEUED' };