From Agreement to Release in One Click
From Agreement to Release in One Click
Available from: v0.1.333
Overview
When a negotiation reaches full agreement — both parties settle on a £0 gap — the platform now automatically creates a draft deposit release pre-filled with the agreed return amount. The agent receives a notification and needs only a single "Review & Propose" confirmation to move the case forward.
This removes the manual handoff that previously existed between the end of a negotiation and the start of the deposit release process.
How It Works
1. Agreement Detection
During an active negotiation, the system continuously evaluates the gap between the landlord/agent's deduction position and the tenant's counter-proposal. When currentGap reaches £0, the agreement state is set:
agreementReached === true // currentGap === 0
The negotiation inbox (negotiation-inbox.tsx) surfaces this visually with an "Agreement reached!" banner.
2. Inngest Event Dispatch
Simultaneously, the negotiation router fires a background event:
negotiation.agreement_reached
This event carries the tenancy ID and the agreedReturn value derived from the settled proposals.
3. Draft Deposit Release Creation
An Inngest function subscribed to negotiation.agreement_reached runs automatically. It:
- Checks whether a deposit release record already exists for the tenancy (idempotency guard).
- If none exists, creates a draft deposit release with:
agreedReturnpre-populated from the negotiation outcome.- Status set to
draft— no funds are moved until the agent confirms.
- Notifies the assigned agent.
4. One-Click Agent Confirmation
The agent receives a notification directing them to the pre-filled deposit release. A single "Review & Propose" action is all that is required to progress the release — no manual data entry, no navigating back through the case.
Conditions for Auto-Initiation
The draft deposit release is auto-created only when all of the following are true:
| Condition | Value |
|---|---|
| Negotiation gap | £0 (currentGap === 0) |
agreementReached flag | true |
| Existing deposit release record | None (prevents duplicates) |
If a deposit release record already exists for the tenancy (e.g. one was created manually before agreement was reached), the Inngest function skips creation and does not overwrite it.
Agent Workflow
Negotiation settles at £0 gap
│
▼
"Agreement reached!" banner shown in negotiation inbox
│
▼
[Background] Draft deposit release auto-created
│
▼
Agent notified → opens pre-filled release
│
▼
Agent clicks "Review & Propose" ✓
│
▼
Deposit release enters standard proposal workflow
Notes for Developers
- The Inngest event
negotiation.agreement_reachedis dispatched from the negotiation router, not the UI layer — ensuring the draft is created regardless of which client surface the agreement occurs on. - The function is idempotent: re-firing the event for a tenancy that already has a deposit release record is a safe no-op.
- The
agreedReturnvalue written to the draft release is sourced directly from the resolved negotiation proposals, not re-calculated client-side.