Files
DentalManagementMH06/apps/Backend/src/queue/queues.ts
ff e644d21cee feat: add BCBS MA eligibility check with OTP flow
- New Selenium worker (fresh Chrome per run, no persistent session)
  login → OTP modal → eTools → ConnectCenter → Verification →
  New Eligibility Request → fill form (NPI, member ID, DOB) →
  Expand All → CDP PDF back to app
- Backend route fetches BCBS_MA credentials + provider NPI from settings
- Frontend OTP modal with 6-digit code entry
- BCBS MA added to insurance credentials dropdown in settings

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-01 00:36:11 -04:00

62 lines
1.7 KiB
TypeScript

import { Queue } from "bullmq";
import { redisConnection } from "./connection";
/** Job types dispatched to the selenium Python worker. */
export type SeleniumJobType =
| "eligibility-check"
| "claim-status-check"
| "claim-submit"
| "claim-pre-auth"
| "ddma-eligibility-check"
| "deltains-eligibility-check"
| "unitedsco-eligibility-check"
| "cca-eligibility-check"
| "cca-claim-submit"
| "cca-preauth-submit"
| "ddma-claim-submit"
| "tuftssco-claim-submit"
| "uniteddh-claim-submit"
| "tuftssco-eligibility-check"
| "mh-eligibility-history-check"
| "cmsp-eligibility-history-remaining-check"
| "bcbs-ma-eligibility-check";
export interface SeleniumJobData {
jobType: SeleniumJobType;
userId: number;
socketId?: string;
/** Fully-enriched payload sent to the Python service. */
enrichedPayload: any;
/** Extra fields used for DB post-processing */
insuranceId?: string;
formFirstName?: string;
formLastName?: string;
formDob?: string;
claimId?: number;
/** Base64-encoded files for claim submit */
files?: { originalname: string; bufferBase64: string; mimetype: string }[];
}
export interface OcrJobData {
userId: number;
socketId?: string;
files: { originalname: string; bufferBase64: string; mimetype: string }[];
}
const defaultOpts = {
removeOnComplete: { count: 100 },
removeOnFail: { count: 50 },
attempts: 1,
backoff: { type: "exponential" as const, delay: 5000 },
};
export const seleniumQueue = new Queue<SeleniumJobData>("selenium-jobs", {
connection: redisConnection,
defaultJobOptions: defaultOpts,
});
export const ocrQueue = new Queue<OcrJobData>("ocr-jobs", {
connection: redisConnection,
defaultJobOptions: { ...defaultOpts, attempts: 2 },
});