feat: add RemoveBrokers tRPC router, service layer, broker registry, and removal engine

- Create Valibot schemas for removal request CRUD, scan, and listing filters
- Implement broker registry with 48 major data brokers and removal metadata
- Build removal engine with automated, form, email, and status tracking support
- Add service layer with subscription-scoped operations: create/get/scan/stats/process
- Wire removebrokers router into root app router
- Write 20 passing unit tests (router + service layer)
This commit is contained in:
2026-05-25 16:47:31 -04:00
parent a3fee924d8
commit d84595bf72
8 changed files with 1584 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
import { object, string, minLength, optional, number, picklist } from "valibot";
export const PersonalInfoSchema = object({
fullName: string([minLength(1)]),
email: optional(string()),
phone: optional(string()),
address: optional(string()),
city: optional(string()),
state: optional(string()),
zip: optional(string()),
dob: optional(string()),
});
export const CreateRemovalRequestSchema = object({
brokerId: string([minLength(1)]),
personalInfo: PersonalInfoSchema,
});
export const RequestStatusSchema = object({
requestId: string([minLength(1)]),
});
export const ScanListingsSchema = object({
brokerId: optional(string()),
});
export const BrokerListingsFilterSchema = object({
brokerId: optional(string()),
page: optional(number(), 1),
limit: optional(number(), 20),
});
export const RemovalRequestsFilterSchema = object({
status: optional(picklist(["PENDING", "SUBMITTED", "IN_PROGRESS", "COMPLETED", "FAILED", "REJECTED", "CANCELLED"])),
page: optional(number(), 1),
limit: optional(number(), 20),
});