Assignments
How a lawyer lists, accepts, reviews and decides property verification assignments in the mobile app.
An assignment is a request for a lawyer to verify one property listing. It is created on the backend, either when an agent or landlord assigns a contracted lawyer to a listing or when a newly published listing is handed to the platform's default lawyer. The mobile app covers the lawyer's side: list, accept, start review, submit a decision.
Where it lives
| Screen route | File | Who sees it |
|---|---|---|
/(tabs)/assignments | app/(tabs)/assignments/index.tsx | LAWYER only (the tab is hidden for other roles) |
/(tabs)/assignments/[id] | app/(tabs)/assignments/[id].tsx | LAWYER only. id is the assignment id |
| Stack wrapper | app/(tabs)/assignments/_layout.tsx | Headerless stack holding the two screens above |
API hooks are in services/legal/legal-api.ts. Status types and badge colours are in interface/legal.types.ts (ASSIGNMENT_STATUS_COLORS).
Before you start
- Signed in with the
LAWYERrole. Every endpoint on this page is restricted to lawyers on the backend, and the detail and action endpoints also check that the assignment belongs to the caller ("You do not have access to this assignment"). - At least one assignment must exist. The mobile app has no screen for creating one.
- No device permissions are needed.
Flow
Status values and badges
The badge text is the raw status with the underscore replaced by a space, in capitals.
| Status value | Badge | Colour | Set when |
|---|---|---|---|
assigned | ASSIGNED | Blue | The assignment is created |
accepted | ACCEPTED | Purple | The lawyer taps Accept Assignment |
in_review | IN REVIEW | Amber | The lawyer taps Start Review, or the lister answers a change request with documents |
changes_requested | CHANGES REQUESTED | Orange | Decision submitted with outcome "Req Changes" |
verified | VERIFIED | Green | Decision submitted with outcome "Verify" |
rejected | REJECTED | Red | Decision submitted with outcome "Reject" |
reassigned | REASSIGNED | Grey | The lister moved the work to another lawyer; this copy is closed |
The normal path is assigned → accepted → in_review → one of verified, rejected or changes_requested.
Browse and filter the list
- Opening the tab fires
GET /api/v1/legal/assignments. The header reads "Legal Assignments" with the subtitle "Review properties assigned to you for legal verification." - Four filter chips sit under the header. Choosing one refetches from the server with a
statusquery parameter.
| Chip | Request |
|---|---|
| All | GET /api/v1/legal/assignments |
| Assigned | GET /api/v1/legal/assignments?status=assigned |
| In Review | GET /api/v1/legal/assignments?status=in_review |
| Completed | GET /api/v1/legal/assignments?status=verified |
- Each card shows the property title ("Unknown Property" if the property is not populated), the location as street and state ("Unknown Location" as fallback), the status badge with a coloured dot, "Assigned by" plus the lister's name ("Agent" as fallback) and the creation date. The list is newest first.
- Pull down to refresh the current filter.
- Tap a card to open
/(tabs)/assignments/[id].
Filter gaps
"Completed" asks for verified only, so rejected assignments are not listed there. Assignments in accepted, changes_requested, rejected or reassigned can only be found under "All".
Open an assignment
- The detail screen fires
GET /api/v1/legal/assignments/:assignmentIdand shows the full-screen loader "Loading assignment…" until data arrives. - The header reads "Assignment Details" with a back arrow.
- The status card shows the badge and "Last updated on" with date and time.
- The "Property" card shows the title, the location and, when the lister left a note, a "NOTES FROM AGENT" block with the note in quotes.
- Below that, exactly one action card is shown depending on the status (next three sub-flows). Statuses
verified,rejectedandreassignedshow no action card.
Accept the assignment
- Status
assignedshows a card titled "Accept Assignment" with the text "Please review the property details and accept the assignment to begin the legal verification process." - Tap Accept Assignment. The app fires
PATCH /api/v1/legal/assignments/:assignmentId/accept. The button shows a spinner while it runs. - On success a toast "Assignment Accepted" appears. The mutation invalidates the detail and list caches, the screen refetches and the badge changes to ACCEPTED.
- On failure an alert titled "Error" shows the server message or "Failed to accept assignment".
Start the review
- Status
acceptedorchanges_requestedshows a card titled "Start Verification" with the text "Click below when you are ready to review documents and perform the legal checks for this property." - Tap Start Review. The app fires
PATCH /api/v1/legal/assignments/:assignmentId/start-review. - On success a toast "Review Started" appears and the badge changes to IN REVIEW.
- On failure an alert titled "Error" shows the server message or "Failed to start review".
Start Review fails after a change request
The app shows Start Review for changes_requested as well, but the backend only accepts the call from accepted. Tapping it on a changes_requested assignment returns a 400 and the alert reads "Cannot start review. Current status is 'changes_requested', expected 'accepted'". On the backend a changes_requested assignment returns to in_review when the lister sends documents through POST /api/v1/legal/assignments/:assignmentId/documents, which the mobile app does not implement on the agent side.
Submit a decision
- Status
in_reviewshows a card titled "Review in Progress" with the text "You are currently reviewing this property. Once you have completed your legal checks, you can submit your decision." - Tap Submit Decision. The card is replaced by the "Final Decision" form.
- Fill in the form:
| Field | Options and rule |
|---|---|
| Outcome | One of three buttons. Verify sends verified and is selected by default. Req Changes sends changes_requested. Reject sends rejected |
| Notes | Required. Multi-line, placeholder "Provide detailed reasons for your decision...". If the trimmed text is empty an alert titled "Required" says "Please provide notes for your decision." and nothing is sent. No length limit is enforced on the device |
- Tap Submit. The app fires
PATCH /api/v1/legal/assignments/:assignmentId/decisionwith this body:
{ "outcome": "verified", "notes": "Title documents checked and consistent." }- On success a toast "Decision Submitted Successfully" appears, the form closes, and the screen refetches with the new status badge.
- On failure an alert titled "Error" shows the server message or "Failed to submit decision". The backend rejects the call unless the assignment is
in_reviewand bothoutcomeandnotesare present ("Decision outcome and notes are required"). - Cancel closes the form without sending. Typed notes stay in memory until the screen is left.
- Once a decision exists and the status is no longer
in_review, a "Submitted Decision" card shows Outcome: (the raw outcome in capitals, for exampleCHANGES_REQUESTED) and Notes:.
Document viewing
Not available in the mobile app
The detail screen shows only the property title, location and the lister's note. It does not show the listing's photos or videos, the documents a lister submitted, a checklist, or the due date, even though the API returns the property media and documentSubmissions. The checklist field of the decision request is typed in interface/legal.types.ts but the form never sends it. A lawyer who needs to read documents has to use another client.
States and edge cases
- List loading: centred spinner under the header.
- List empty: "No Assignments" with "You do not have any property verification assignments in this category."
- Detail loading or failing: the screen shows "Loading assignment…" whenever there is no data. If the request fails (bad id, not your assignment, network) the loader stays on screen with no error message and no retry; leave with the system back gesture.
- No pull to refresh on the detail screen: it updates only through the cache invalidation after each action or when it is reopened.
- Stale status: if the status changed elsewhere, the server refuses the action with messages such as "Cannot accept assignment. Current status is 'accepted', expected 'assigned'", shown in the "Error" alert.
- Reassigned: when a lister reassigns the work, the old assignment stays in the first lawyer's list with the REASSIGNED badge and no actions; the new lawyer gets a fresh
assignedone. - List errors: a failed list request falls through to the empty state.
What happens next
- Assignment created: the lawyer receives an in-app and push notification "New Legal Assignment" and an email. The property's
legalStatusbecomesunder_legal_review. - Accept: the person who assigned it gets a notification titled "Legal Review Started" and an email "Legal Assignment Accepted".
- Start Review: the assigner gets an email "Legal Review Has Started". No in-app notification is created for this step.
- Decision
verified: the property'slegalStatusbecomeslegally_verified,verification.isVerifiedis set with the lawyer and timestamp, the notes are stored as verification notes, and a property that waspending_verificationmoves tolisted, unless it carries an open duplicate flag, in which case it stays held until an admin clears the flag. - Decision
rejected: the property'slegalStatusbecomeslegally_rejectedand it stays unverified. - Decision
changes_requested: the property'slegalStatusbecomeschanges_requested. The assignment stays open, waiting for the lister's documents. - Any decision: the assigner gets a notification titled "Legal Review Decision:" followed by the outcome value. Each step is also written to the backend's legal audit log.