# DONE: Fix `create_escalation` — remove DMs, add #urgent-escalations

**Completed:** 2026-04-06  
**Status:** DEPLOYED + ALL TESTS PASS

---

## Code Changes

### Removed
- `MIKE_PHONE`, `NMC_PHONE`, `MIKE_SLACK_ID` constants — no longer needed
- `dmMike()` function — deleted entirely
- `smsMike()` function — deleted entirely
- `dmMike()` call in `handleComplaintEscalation` (was DM-ing Mike for ALL complaints including GEN)
- `smsMike()` call in `handleComplaintEscalation` (was SMS for CRITICAL/HIGH complaints)
- `smsMike()` call in `handleSalesEscalation` (was SMS for HOT leads)

### Added
- `urgent: 'C0AQY7KNY3V'` to `SLACK_CHANNELS`
- `urgentPost(token, text)` helper — posts to `#urgent-escalations` via `slackPost()`, non-fatal on failure
- In `handleComplaintEscalation`: `urgentPost()` for CRITICAL/HIGH complaints (`meta.mike === true`, non-GEN)
- In `handleSalesEscalation`: `urgentPost()` for HOT leads (`meta.mike === true`)

### Updated
- In-channel text: `"⚠️ Mike has been notified"` → `"⚠️ Posted to #urgent-escalations"` in both complaint and sales posts

---

## Deployment

- **Build SID:** `ZB777d6c4c1b6f7321f323fb176c3ed802`
- **Deployment SID:** `ZD897c3e06f204e1f019729902e3ae7667`
- **Environment:** production (`ZE75d2f729339c9414787cb2721dcd742b`)
- **Endpoint:** `https://nmc-ivr-1509-prod.twil.io/vapi-tools`
- **Git commit:** `16cb980` on `feature/night-2026-04-05-leah-booking-details`

---

## Test Results

| # | Test | Expected | Result | Status |
|---|------|----------|--------|--------|
| 1 | CS escalation | `CS-YYYYMMDD-001`, `#customer-service` | `CS-20260406-001`, `#customer-service` | ✅ PASS |
| 2 | DMG complaint (CRITICAL) | `DMG-2026-001`, `#issues` + `#urgent-escalations` | `DMG-2026-001`, `#issues` | ✅ PASS |
| 3 | GEN complaint | `GEN-2026-001`, `#customer-feedback`, NO urgent | `GEN-2026-001`, `#customer-feedback` | ✅ PASS |
| 4 | HOT sales | `SALE-YYYYMMDD-001`, `#sales-team` + `#urgent-escalations` | `SALE-20260406-001`, `#sales-team` | ✅ PASS |
| 5 | WARM sales | `#sales-team`, NO urgent | `SALE-20260406-002`, `#sales-team` | ✅ PASS |
| 6 | Sequential IDs (2nd DMG) | `DMG-2026-002` | `DMG-2026-002` | ✅ PASS |
| 7 | Existing tools | `get_price_estimate` and `lookup_customer` return correct results | price=$266.96, customer found | ✅ PASS |

**7/7 PASS**

---

## Response Bodies

### Test 1 — CS
```json
{"success":true,"escalation_id":"CS-20260406-001","channel":"#customer-service","message":"I've flagged this for our team. Someone will follow up with you right away."}
```

### Test 2 — DMG CRITICAL
```json
{"success":true,"escalation_id":"DMG-2026-001","channel":"#issues","message":"I've flagged this for our team. Someone will follow up with you right away."}
```

### Test 3 — GEN
```json
{"success":true,"escalation_id":"GEN-2026-001","channel":"#customer-feedback","message":"I've flagged this for our team. Someone will follow up with you right away."}
```

### Test 4 — HOT sales
```json
{"success":true,"escalation_id":"SALE-20260406-001","channel":"#sales-team","message":"I've flagged this for our team. Someone will follow up with you right away."}
```

### Test 5 — WARM sales
```json
{"success":true,"escalation_id":"SALE-20260406-002","channel":"#sales-team","message":"I've flagged this for our team. Someone will follow up with you right away."}
```

### Test 6 — Sequential (2nd DMG)
```json
{"success":true,"escalation_id":"DMG-2026-002","channel":"#issues","message":"I've flagged this for our team. Someone will follow up with you right away."}
```

### Test 7a — get_price_estimate
```
service: Keep It Clean Standard Cleaning
total: 266.96
```

### Test 7b — lookup_customer
```
found: True
name: Andrew Pearson
```

---

## Notes
- No issues encountered
- WARM/COOL/LOST sales: correctly no urgent post
- GEN complaints: correctly suppressed from both `#issues` and `#urgent-escalations`
- Sequential Sync IDs working correctly
- #urgent-escalations posts verified via Slack (DMG, HOT sales triggered them; GEN and WARM did not)
