Copies the DDMA flow: persistent Chrome profile, OTP from app or browser, queued job, credentials under site key DDWA, and a real Delta WA button in place of the placeholder. Login follows the WA portal: provider page, header Sign in, then username + CONTINUE before the password page. Password, OTP, dashboard and search selectors are still DDMA's and unverified on this portal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
72 lines
2.0 KiB
TypeScript
72 lines
2.0 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"
|
|
| "ddwa-eligibility-check"
|
|
| "deltains-eligibility-check"
|
|
| "deltaindiv-eligibility-check"
|
|
| "unitedsco-eligibility-check"
|
|
| "uniteducard-eligibility-check"
|
|
| "cca-eligibility-check"
|
|
| "cca-claim-submit"
|
|
| "cca-preauth-submit"
|
|
| "ddma-claim-submit"
|
|
| "metlife-claim-submit"
|
|
| "deltains-claim-submit"
|
|
| "tuftssco-claim-submit"
|
|
| "uniteducard-claim-submit"
|
|
| "uniteddh-claim-submit"
|
|
| "uniteddh-preauth-submit"
|
|
| "tuftssco-preauth-submit"
|
|
| "tuftssco-eligibility-check"
|
|
| "mh-eligibility-history-check"
|
|
| "cmsp-eligibility-history-remaining-check"
|
|
| "bcbs-ma-eligibility-check"
|
|
| "metlife-eligibility-check"
|
|
| "altus-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 },
|
|
});
|