diff --git a/src/components/portal/data.ts b/src/components/portal/data.ts index f388e46..752391e 100644 --- a/src/components/portal/data.ts +++ b/src/components/portal/data.ts @@ -75,11 +75,12 @@ export const countryCodes: CountryCode[] = [ ]; export const relationshipOptions = [ - "Homeowner", + "Customer", + "Employee", + "Owner", "Contractor", - "Property Manager", - "Tenant", - "Authorized Representative", + "Sub-Con", + "Vendor", ]; export const sectors = [ diff --git a/src/components/portal/register-flow.tsx b/src/components/portal/register-flow.tsx index 0832111..0c755ee 100644 --- a/src/components/portal/register-flow.tsx +++ b/src/components/portal/register-flow.tsx @@ -27,7 +27,7 @@ export function RegisterFlow() { const [cc, setCc] = useState("+1"); const [phone, setPhone] = useState(""); const [pw, setPw] = useState(""); - const [relationship, setRelationship] = useState("Homeowner"); + const [relationship, setRelationship] = useState("Customer"); const [alloeNo, setAlloeNo] = useState(""); const [alloeFirst, setAlloeFirst] = useState(""); const [alloeLast, setAlloeLast] = useState(""); @@ -42,15 +42,16 @@ export function RegisterFlow() { const [emailVerified, setEmailVerified] = useState(false); const [phoneVerified, setPhoneVerified] = useState(false); - const isSelf = relationship === "Homeowner"; + const isSelf = relationship === "Customer" || relationship === "Owner"; + const isEmployee = relationship === "Employee"; const country = countryCodes.find((c) => c.code === cc)!; const phoneOk = phone.replace(/\D/g, "").length === country.digits; const pwOk = sso ? true : passwordStrength(pw).score >= 3; - const alloeIdOk = /^(?=.*[a-zA-Z])(?=.*\d).{8,}$/.test(alloeNo); + const alloeIdOk = /^(?=.*[a-zA-Z])(?=.*\d).{4,}$/.test(alloeNo); const step0Valid = first.trim() && last.trim() && EMAIL_RE.test(sso?.email || email) && phoneOk && pwOk && - termsOk && privacyOk && (isSelf || (alloeIdOk && alloeFirst.trim() && alloeLast.trim())); + termsOk && privacyOk && (isSelf || (alloeIdOk && (isEmployee || (alloeFirst.trim() && alloeLast.trim())))); const step1Valid = /^LUP-\d{6}$/.test(allotment) || plotVerified; const step2Valid = emailVerified && phoneVerified; @@ -221,26 +222,38 @@ function StepAccount(p: { {p.isSelf ? ( -