feat(eligibility-check) - enhance OTP handling and eligibility status retrieval for DDMA and DentaQuest; improved file processing logic for screenshots and PDFs, and updated frontend components for better user experience

This commit is contained in:
2026-01-29 21:25:18 -05:00
parent 279a6b8dbc
commit 5370a0e445
8 changed files with 737 additions and 309 deletions

View File

@@ -14,6 +14,13 @@ type CredentialFormProps = {
};
};
// Available site keys - must match exactly what the automation buttons expect
const SITE_KEY_OPTIONS = [
{ value: "MH", label: "MassHealth" },
{ value: "DDMA", label: "Delta Dental MA" },
{ value: "DENTAQUEST", label: "Tufts SCO / DentaQuest" },
];
export function CredentialForm({ onClose, userId, defaultValues }: CredentialFormProps) {
const [siteKey, setSiteKey] = useState(defaultValues?.siteKey || "");
const [username, setUsername] = useState(defaultValues?.username || "");
@@ -91,14 +98,19 @@ export function CredentialForm({ onClose, userId, defaultValues }: CredentialFor
</h2>
<form onSubmit={handleSubmit} className="space-y-4">
<div>
<label className="block text-sm font-medium">Site Key</label>
<input
type="text"
<label className="block text-sm font-medium">Insurance Provider</label>
<select
value={siteKey}
onChange={(e) => setSiteKey(e.target.value)}
className="mt-1 p-2 border rounded w-full"
placeholder="e.g., MH, Delta MA, (keep the site key exact same)"
/>
className="mt-1 p-2 border rounded w-full bg-white"
>
<option value="">Select a provider...</option>
{SITE_KEY_OPTIONS.map((opt) => (
<option key={opt.value} value={opt.value}>
{opt.label}
</option>
))}
</select>
</div>
<div>
<label className="block text-sm font-medium">Username</label>

View File

@@ -13,6 +13,17 @@ type Credential = {
password: string;
};
// Map site keys to friendly labels
const SITE_KEY_LABELS: Record<string, string> = {
MH: "MassHealth",
DDMA: "Delta Dental MA",
DENTAQUEST: "Tufts SCO / DentaQuest",
};
function getSiteKeyLabel(siteKey: string): string {
return SITE_KEY_LABELS[siteKey] || siteKey;
}
export function CredentialTable() {
const queryClient = useQueryClient();
@@ -108,7 +119,7 @@ export function CredentialTable() {
<thead className="bg-gray-50">
<tr>
<th className="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Site Key
Provider
</th>
<th className="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Username
@@ -141,7 +152,7 @@ export function CredentialTable() {
) : (
currentCredentials.map((cred) => (
<tr key={cred.id}>
<td className="px-4 py-2">{cred.siteKey}</td>
<td className="px-4 py-2">{getSiteKeyLabel(cred.siteKey)}</td>
<td className="px-4 py-2">{cred.username}</td>
<td className="px-4 py-2"></td>
<td className="px-4 py-2 text-right">
@@ -227,7 +238,7 @@ export function CredentialTable() {
isOpen={isDeleteDialogOpen}
onConfirm={handleConfirmDelete}
onCancel={handleCancelDelete}
entityName={credentialToDelete?.siteKey}
entityName={credentialToDelete ? getSiteKeyLabel(credentialToDelete.siteKey) : undefined}
/>
</div>
);