fix: address code review findings for info broker removal service

- Fix Prisma enum casing: snake_case -> UPPERCASE to match TypeScript types
- Add admin auth guard on POST /process endpoint (P0 security)
- Fix DELETE /request/:id to return valid enum status (REJECTED not cancelled)
- Fix brokerName bug: was set to brokerId, now resolves actual broker name
- Add missing BrokerCategory enum export to types package
- Add HOME_TITLE to AlertSource enum
- Replace unsafe 'as any' casts with proper enum imports
- Fix broker ID with space (familytree Now -> familytreenow)
- Add missing Prisma relation fields for RemovalRequest and BrokerListing
- Add FALSE_POSITIVE to CorrelationStatus enum

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
2026-05-17 01:45:54 -04:00
parent bd881045f4
commit e9e547be78
5 changed files with 64 additions and 48 deletions

View File

@@ -27,6 +27,7 @@ export const AlertSource = {
SPAMSHIELD: "SPAMSHIELD",
VOICEPRINT: "VOICEPRINT",
CALL_ANALYSIS: "CALL_ANALYSIS",
HOME_TITLE: "HOME_TITLE",
INFO_BROKER: "INFO_BROKER",
} as const;
export type AlertSource = (typeof AlertSource)[keyof typeof AlertSource];
@@ -375,6 +376,15 @@ export interface SecurityReportOutput {
// Info Broker Removal Types
// ============================================
export const BrokerCategory = {
PEOPLE_SEARCH: "PEOPLE_SEARCH",
BACKGROUND_CHECK: "BACKGROUND_CHECK",
PUBLIC_RECORDS: "PUBLIC_RECORDS",
REVERSE_LOOKUP: "REVERSE_LOOKUP",
SOCIAL_MEDIA: "SOCIAL_MEDIA",
} as const;
export type BrokerCategory = (typeof BrokerCategory)[keyof typeof BrokerCategory];
export const BrokerStatus = {
ACTIVE: "ACTIVE",
INACTIVE: "INACTIVE",