# v0.1.6 Lead Management + Live Refresh

This patch focuses on lead handling after the AI Assistant captures a call.

## Changes

- Added a visible **Phone number** field on the lead detail page.
- Hid **Call Back** buttons on desktop; they now display only on mobile-sized screens/PWA.
- Added editable lead fields for owner, dispatcher, and office use:
  - Customer name
  - Phone number
  - Service needed
  - Service address
  - City
  - Preferred time
  - Urgency
  - Property type
  - Status
  - AI confidence
  - AI summary
  - Recommended action
  - Internal note
- Added **Delete Lead** button on lead detail.
- Added API route: `DELETE /api/leads/:id`.
- Added dashboard live polling every 10 seconds so a newly saved lead appears without waiting for the full 60-second refresh.
- Kept full page auto-refresh at 60 seconds.
- Improved transcript display fallback: the lead page now checks `lead.transcript`, `lead.call.transcript`, and raw tool payload transcript fields.
- Added `transcript` to Telnyx tool schema as an optional body parameter.

## Important: transcript setup

The dashboard can only show a transcript if Telnyx sends one to the app. There are two ways to get transcript text into the dashboard:

1. Add a `transcript` body parameter to the Telnyx Assistant webhook tool, if Telnyx makes transcript text available during or after the tool call.
2. Configure Telnyx Assistant post-call insights/transcript webhooks to send POST requests to:

```text
https://pestdemo.recovermissedcall.com/telnyx/events
```

If transcript text is not sent by Telnyx, the app can still show the lead summary and structured lead fields, but the Transcript box will remain empty.

## Upload reminder

Back up and keep your live:

```text
.env
data/db.json
```

Then upload/extract this version and restart the Node app.
