Add pre-fill review notice on every step, fix CORES address detection
- Yellow banner on each step: "We've pre-filled this from your FCC records. Please review carefully and correct any information that is inaccurate." - Only shows when accessed via token/FRN (post-payment intake) - CORES address: filter by company name suffix (LLC/Inc/Corp) instead of requiring a number — addresses like "PO Box 123" now work Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
42f331101e
commit
1f87ad4554
2 changed files with 18 additions and 1 deletions
|
|
@ -131,6 +131,11 @@ const STEP_LABELS: Record<string, string> = {
|
|||
|
||||
<style is:global>
|
||||
.pw-wizard { max-width: 820px; margin: 0 auto; padding: 1rem; }
|
||||
.pw-prefill-notice {
|
||||
background: #fef3c7; border: 1px solid #fbbf24; border-radius: 8px;
|
||||
padding: 0.6rem 0.85rem; margin-bottom: 1rem; font-size: 0.82rem;
|
||||
color: #92400e; line-height: 1.5;
|
||||
}
|
||||
.pw-wizard-header h1 { margin: 0 0 1rem; color: var(--pw-navy, #1a2744); }
|
||||
.pw-wizard-stepbar {
|
||||
display: flex; align-items: center; flex-wrap: wrap;
|
||||
|
|
@ -389,6 +394,17 @@ const STEP_LABELS: Record<string, string> = {
|
|||
window.dispatchEvent(new CustomEvent("pw:step-shown", {
|
||||
detail: { step: steps[idx], idx },
|
||||
}));
|
||||
|
||||
// Show "review this info" notice on pre-filled steps (when accessed via token)
|
||||
if (urlParams.has("token") || urlParams.has("frn")) {
|
||||
const activeStep = wizard.querySelector<HTMLElement>(`.pw-wizard-body > [data-step="${steps[idx]}"]`);
|
||||
if (activeStep && !activeStep.querySelector(".pw-prefill-notice")) {
|
||||
const notice = document.createElement("div");
|
||||
notice.className = "pw-prefill-notice";
|
||||
notice.innerHTML = "We've pre-filled this from your FCC records. Please review carefully and correct any information that is inaccurate or outdated.";
|
||||
activeStep.prepend(notice);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
document.getElementById("pw-back")!.addEventListener("click", () => {
|
||||
|
|
|
|||
|
|
@ -170,7 +170,8 @@
|
|||
// CORES address — only if it looks like an actual street address
|
||||
// (skip if it's just the company name, which CORES sometimes returns)
|
||||
const coresAddr = (d.cores?.address || "").trim();
|
||||
const looksLikeStreet = coresAddr && /\d/.test(coresAddr) && !/^[A-Z].*\b(LLC|Inc|Corp|Ltd|LP|LLP)\b/i.test(coresAddr);
|
||||
const isCompanyName = /\b(LLC|Inc\.?|Corp\.?|Ltd\.?|L\.?P\.?|LLP|PLLC|Co\.)\s*\.?\s*$/i.test(coresAddr) || coresAddr === d.entity_name;
|
||||
const looksLikeStreet = coresAddr && !isCompanyName;
|
||||
if (looksLikeStreet && d.cores.city) {
|
||||
suggestions.push({
|
||||
name: "",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue