Legal Team
How agents and landlords invite lawyers, track invite status and view a partner lawyer's profile in the mobile app.
The Legal Team tab is where an agent or landlord builds a roster of partner lawyers. A partner starts as an email invite and becomes a contracted lawyer once the lawyer accepts it from their own account (see the Lawyer Experience section, Partnerships page).
Where it lives
| Screen route | File | Who sees it |
|---|---|---|
/(tabs)/legal-team | app/(tabs)/legal-team/index.tsx | Every non-lawyer role in the (tabs) navigator (the tab is hidden when role is LAWYER) |
/(tabs)/legal-team/[id] | app/(tabs)/legal-team/[id].tsx | Same, opened from a lawyer card. id is the partnership invite id, not the lawyer's user id |
| Stack wrapper | app/(tabs)/legal-team/_layout.tsx | Headerless stack holding the two screens above |
API hooks live in services/legal/legal-api.ts (RTK Query slice legalApi, base path /api/v1/legal). Types and badge colours are in interface/legal.types.ts.
Before you start
- Signed in as an agent or landlord. The backend allows only
AGENT,LANDLORDandADMINon the partner endpoints; any other role gets a 403 with "You do not have permission to view partner lawyers" or "You do not have permission to invite lawyers". - Agents must have finished agent onboarding, otherwise the
(tabs)layout redirects them to/agent-onboardingbefore this tab can render. - The lawyer you want to invite must already have a HomeLink Hub account with the
LAWYERrole. There is no way to invite someone who has not signed up. - No device permissions are needed.
Flow
Browse and filter partner lawyers
- Opening the tab fires
GET /api/v1/legal/partners. The response is a list of partnership invites sent by the signed-in user, each with the lawyer's public details and two computed stats (mattersHandled,responseRate). Only invites whose status isinvite_pendingorcontractedare returned. - The header shows the title "Legal Team", the subtitle "Manage your contracted lawyers and track invite status." and an Invite Lawyer button.
- The search box (placeholder "Search by name or email...") filters the loaded list on the device by the lawyer's full name or the invited email. A clear icon appears once text is typed.
- Three filter chips sit under the search box, each with a live count: All, Contracted, Invite Pending. Filtering is also done on the device, no new request is sent.
- Each card shows the lawyer's initials, full name, email, a status badge, the invite note in quotes (two lines at most), "Invited" plus the date, "Accepted" plus the date when present, and a View Profile link. Tapping anywhere on the card opens
/(tabs)/legal-team/[id]. - Pull down to refresh; this refetches
GET /api/v1/legal/partners.
Invite statuses and their badges:
| Status value | Badge on the list | Badge on the profile | Meaning |
|---|---|---|---|
invite_pending | Invite Pending (amber) | Pending | Invite sent, the lawyer has not answered yet |
contracted | Contracted (green) | ✓ Ready for Assignment | The lawyer accepted; they can be given legal verification work |
rejected | Not shown | Not shown | The lawyer declined. The backend leaves rejected invites out of the list, so the card simply disappears on the next refresh |
Invite a lawyer by email
- Tap Invite Lawyer in the header (or Invite a Lawyer on the empty state). A bottom sheet titled "Invite Lawyer by Email" slides up with the hint "Enter the email of a lawyer who is already signed up on HomeLinkHub. If found, an invite will be sent."
- Fill in the two fields:
| Field | Rule |
|---|---|
| Lawyer's Email | Required. Send Invite stays disabled while the trimmed value is empty. There is no format check on the device; the server trims and lowercases the value and looks up a user with that email |
| Invite Message | Optional, multi-line. Pre-filled with "We would like to engage you for legal review and title verification across our managed property portfolio." |
- Tap Send Invite. The app fires
POST /api/v1/legal/partnership-invites/emailwithemailandinviteNote(both trimmed). The button shows a spinner while the request runs. - On success the sheet closes, both fields reset (the message goes back to the default text), a success toast "Invite sent successfully!" appears, and the list refetches because the mutation invalidates the
LegalAssignmentscache tag. The new card shows the Invite Pending badge. - On failure an alert titled "Error" shows the server message, or "Failed to send invite." when there is none. Server messages you can expect:
- "No registered lawyer found with this email" (no account, or the account is not a lawyer)
- "An invite is already pending for this lawyer"
- "Lawyer is already contracted with you"
- Cancel, the close icon or a tap on the dimmed backdrop closes the sheet without sending. Text already typed is kept until the next successful send.
View a lawyer's profile
- Tap a card. The detail screen does not call the API again; it reads the same cached
GET /api/v1/legal/partnersresult and picks the entry whose invite id matches the route param. - The header reads "Lawyer Profile" with a back arrow and a badge: "✓ Ready for Assignment" for
contracted, "Pending" forinvite_pending. - The profile card shows initials, full name, the bio (or "No bio added yet.") and four rows: Email, Location (state and country from the lawyer's address, or "Not provided"), Matters Handled and Response Rate.
- The "Assignment Readiness" card repeats Matters Handled and Response Rate and adds Current Status: "Can be assigned to legal verification work" when contracted, otherwise "Awaiting lawyer acceptance of invite".
- The "Relationship Timeline" card lists "Invite Sent" and, once accepted, "Accepted", each with its date.
How the two stats are computed on the server: Matters Handled counts the lawyer's assignments (across all clients) that reached changes_requested, verified or rejected. Response Rate is the share of all their assignments that moved past assigned, rounded to a whole percent.
Assigning a lawyer to a listing, removing a partner, documents
Not available in the mobile app
The profile screen is read-only. There is no button to assign the lawyer to a listing, to cancel a pending invite, to remove a contracted partner, or to send documents to a reviewing lawyer. services/legal/legal-api.ts already defines assignLawyer (POST /api/v1/legal/properties/:propertyId/assign-lawyer), reassignLawyer (PATCH /api/v1/legal/assignments/:assignmentId/reassign) and getPropertyLegalHistory (GET /api/v1/legal/properties/:propertyId/history), but no screen calls them. The backend also exposes POST /api/v1/legal/assignments/:assignmentId/documents for answering a lawyer's change request, and the mobile app has no client for it. The backend has no endpoint at all for removing a partner or withdrawing an invite.
What the backend enforces for assignment, for reference when testing from another client: the chosen lawyer must have a contracted partnership with the person assigning, and a property can hold only one open assignment ("Property already has an active legal assignment. Please reassign instead.").
States and edge cases
- Loading: the list shows a centred spinner on first load. The profile shows the full-screen loader with "Loading details…".
- Empty list: "No Legal Partners Yet" with "Invite a registered lawyer to begin your legal team." and an Invite a Lawyer button.
- No search match: when the search box has text, the empty state changes to "No Lawyers Found" with "Try a different search term." and no button. A filter chip with zero matches and an empty search box shows the "No Legal Partners Yet" copy.
- Profile not in cache: if the invite id is not in the cached list (for example the lawyer rejected the invite in the meantime) the profile shows "Lawyer Not Found" with a Back to Legal Team button.
- Request errors on the list: a failed
GET /api/v1/legal/partnersis not surfaced; the screen falls through to the empty state. - Avatars: the lawyer's photo is never rendered, cards and the profile always show initials.
- Dark mode: both screens are wrapped in
withThemeRemount, so they re-render with the new palette when the appearance setting changes.
What happens next
- Invite sent: the lawyer receives an email titled "You've Been Invited to Partner on HomeLink Hub". No in-app or push notification is created for invites. The invite shows up in the lawyer's Overview and Partnerships tabs.
- Lawyer accepts: the invite status becomes
contractedandacceptedAtis stamped. The inviter gets an email titled "Your Legal Partnership Invite Was Accepted". The card flips to Contracted the next time the list is refreshed; there is no live update. - Lawyer rejects: the status becomes
rejected, nothing is sent to the inviter and the card drops off the list on the next refresh. The same lawyer can be invited again. - Legal review of listings: independently of this tab, when a listing is published the backend hands it to the platform's default lawyer if an admin has set one. That lawyer then sees it under Assignments (see the Lawyer Experience section).