1---2name: fewshot-attempt-03-273description: CRM Support Console — Reusable Skill4---5# CRM Support Console — Reusable Skill67## Base URL89Use the URL from `environment_access.md`. Ignore `127.0.0.1` / `localhost` in task prompts.10Known public base: `http://34.46.77.124:8003` (verify against environment_access.md).1112---1314## Core API Reference1516| Endpoint | Use |17|---|---|18| `GET /api/tickets/<id>` | Ticket detail: status, account_id, service_type, area |19| `GET /api/accounts/<id>` | Account status (active / suspended / hold), service_area |20| `GET /api/outages?service_area=<area>` | Active outages → list of `{outage_id, service_type, area}` |21| `GET /api/diagnostics/<id>` | Flags: latency, stability, bandwidth, packet_loss |22| `GET /api/troubleshooting/<id>` | Auto-fix attempt result |23| `GET /api/cases/<id>` | Case detail: customer_id, line_id, status |24| `GET /api/lines/<id>` | Line state: status, roaming, network_mode, data_saver, vpn, apn, mobile_data, permissions |25| `GET /api/devices/<id>` | Device model, capabilities |26| `GET /api/plans/<id>` | Plan features, roaming support |27| `GET /api/enterprise/incidents/<id>` | Incident detail: account, severity, engineering_owner, account_owner |28| `GET /api/enterprise/export-runs?incident_id=<id>` | Export history: success/failure per date |29| `GET /api/enterprise/messages?query=<text>` | Search messages for root-cause clues |30| `GET /api/enterprise/sla/<enterprise_account_id>` | SLA terms, credit percentages |3132---3334## Ticket Triage Rules (Internet / Video / Voice)3536### Step 1 — Account Lookup37- Call `GET /api/accounts/<account_id>`.38- If the account does **not exist** or the account_id is malformed (e.g., `BAD-*`): **FAILED** / `INVALID_ACCOUNT`.39- If the account is **suspended / on hold / overdue**: **FAILED** / `INELIGIBLE_ACCOUNT` (or `OVERDUE_SUSPENSION` with route `ACCOUNTS_PAYABLE` in SLA-review contexts).4041### Step 2 — Outage Check42- Extract the `service_area` from the account.43- Call `GET /api/outages?service_area=<area>`.44- If an active outage matches the ticket's **service_type** (internet / video / voice): **PENDING_ACTION** / `OUTAGE_WAIT` (route: `ACTIVE_OUTAGE`). No diagnostic needed. Include the `outage_id`.4546### Step 3 — Diagnostics & Resolution47- If account is valid and no outage: call `GET /api/diagnostics/<ticket_id>`.48- Map diagnostic flags directly to the boolean issue fields (`latency_issue`, `stability_issue`, `bandwidth_issue`).4950**Resolution routing by symptom/root-cause:**5152| Symptom / Root Cause | Status | Route | Escalation |53|---|---|---|---|54| Performance issues (latency/packet-loss/jitter), valid account, no outage, auto-fix succeeds | RESOLVED | AUTO_TROUBLESHOOTING | NONE |55| Active matching outage | PENDING_ACTION | OUTAGE_WAIT | NONE |56| Physical infrastructure (line work, field damage, cable cut) | ESCALATED | ESCALATION | FIELD_OPS |57| Backbone / capacity errors | ESCALATED | ESCALATION | NETWORK_ENGINEERING |58| Provisioning mismatch / stale config | ESCALATED | ESCALATION | TIER2_SUPPORT |59| Account suspended / on hold | FAILED | INELIGIBLE_ACCOUNT | NONE |60| Overdue suspension (SLA review context) | FAILED | — | ACCOUNTS_PAYABLE |61| Auth failure / credentials broken | FAILED | AUTH_FAILED | NONE |62| Invalid / non-existent account | FAILED | INVALID_ACCOUNT | NONE |6364### Diagnostic Flag Convention65- `diagnostic_needed: true` → RESOLVED and ESCALATED technical tickets.66- `diagnostic_needed: false` → FAILED tickets, outage-wait tickets.67- When diagnostics run, ALL flags reflect what the API returns (do not zero them out just because one is false).6869---7071## Mobile Case Queue Rules7273### Step 1 — Case Lookup74- `GET /api/cases/<case_id>` → extract `customer_id`, `line_id`.75- `GET /api/lines/<line_id>` → line status, roaming, network_mode, data_saver, vpn, mobile_data, permissions.7677### Step 2 — Issue → Action Mapping7879| Reported Issue | Primary Action | Secondary | Final Route | Notes |80|---|---|---|---|---|81| No service after movement / commute | RESEAT_SIM | NO_ACTION | SELF_SERVICE | Physical SIM reseat |82| Line suspended, customer ready to pay | SEND_PAYMENT_REQUEST | RESUME_LINE_REBOOT | BILLING_RECOVERY | Fetch bill_id from line/account; charge = bill amount |83| Traveling abroad, no mobile data | TOGGLE_ROAMING | NO_ACTION | SELF_SERVICE | If line roaming already toggled on but still no data → ENABLE_LINE_ROAMING (carrier-side) |84| Can't send photos in messaging | GRANT_MESSAGING_PERMISSION | NO_ACTION | SELF_SERVICE | Permission = `storage` for MMS |85| Mobile data works but slow + VPN active | DISCONNECT_VPN | NO_ACTION | SELF_SERVICE | |86| Data stopped after usage limit | REFUEL_DATA | NO_ACTION | DATA_RECOVERY | Use customer's accepted GB; $2.00/GB |87| Traveler: roaming ON phone but line not provisioned | ENABLE_LINE_ROAMING | NO_ACTION | CARRIER_UPDATE | carrier_update_required=true |88| Slow data + data-saver icon visible | TOGGLE_DATA_SAVER | NO_ACTION | DEVICE_SETTING_FIX | |89| Slow data on older network mode | SET_NETWORK_MODE | NO_ACTION | DEVICE_SETTING_FIX | |90| No data after settings change | TOGGLE_MOBILE_DATA | NO_ACTION | DEVICE_SETTING_FIX | |9192### Permission Field93- `NONE` unless the action is `GRANT_MESSAGING_PERMISSION` → then use `storage`.94- In some task variants, `sms` or `sms_and_storage` may appear; check line permissions API.9596### Bill / Charge Rules97- `bill_id`: empty string `""` unless a bill payment is involved (SEND_PAYMENT_REQUEST).98- `charge_amount_usd`: always a number with two decimals. For billing cases, use the actual bill amount from the API. For data refuel: `refuel_gb × 2.00`.99- Data refuel pricing: **$2.00 per GB**.100101---102103## Enterprise Incident Response Rules104105### Step 1 — Incident Lookup106- `GET /api/enterprise/incidents/<incident_id>` → `enterprise_account_id`, severity, engineering_owner, account_owner.107108### Step 2 — Export Runs109- `GET /api/enterprise/export-runs?incident_id=<id>` → find the contiguous failed window.110- `start_date` = first failed day, `end_date` = last failed day.111- `failed_days` = count of consecutive failures in the window.112- `backfill_days` = same as `failed_days` (manual backfill covers every failed day).113114### Step 3 — Root Cause115- `GET /api/enterprise/messages?query=<keywords>` with terms from the complaint (e.g., "export", "credential", "rotation", "pipeline").116- Derive a concise root-cause string (e.g., `"stale credential after rotation"`).117- Check for alert mentions. If alerts were archived before the failure: `contributing_alert_issue = "ARCHIVED_ALERT_ROUTE"`. Otherwise `NONE` or `UNKNOWN`.118119### Step 4 — SLA120- `GET /api/enterprise/sla/<enterprise_account_id>` → credit percentage for the failure duration/severity.121122### Naming Conventions123- **channel_name**: Client name lowercase, hyphenated. E.g., `"Asteri Retail Inc."` → `"asteri-retail-inc"`.124- **evidence_folder**: `"<Client Name> <Month> <Year> Investigation"`. E.g., `"Asteri Retail Inc. May 2026 Investigation"`.125- **report_title**: `"<Client Name> Export Failure - Resolution Report"`.126127### Share Permissions128- Always a list of `{user, permission}` objects.129- Order: match the order in `permission_users_to_include` from requirements.130- Permission values: `view`, `edit`, or `upload_only`.131132### Severity Triage133- Multi-day export failure blocking executive reporting → **Critical**.134- Use the severity from the incident API if available; otherwise infer from impact.135136### Response Status137- If SLA credit > 0% → `NEEDS_FINANCE_REVIEW`.138- If root cause uncertain → `UNDER_INVESTIGATION` or `NEEDS_ENGINEERING_REVIEW`.139- Fully resolved with no credit → `READY_TO_SEND`.140141---142143## SLA Queue Review Rules (Train 004 variant)144145Same triage as ticket rules above, with these additional `key_blocker` mappings:146147| Condition | key_blocker | route_team |148|---|---|---|149| Active outage match | ACTIVE_OUTAGE | NONE |150| Account doesn't exist / malformed ID | INVALID_ACCOUNT | NONE |151| Auth credentials broken | AUTH_FAILED | NONE |152| Account suspended — overdue | OVERDUE_SUSPENSION | ACCOUNTS_PAYABLE |153| Account suspended — fraud | FRAUD_SUSPENSION | NONE |154| Backbone / capacity errors | NETWORK_CAPACITY | NETWORK_ENGINEERING |155| Provisioning mismatch / stale | PROVISIONING_STALE | TIER2_SUPPORT |156| Physical line fault | PHYSICAL_LINE_FAULT | FIELD_OPS |157| No blocker (auto-fixable) | NONE | NONE |158159---160161## Output Conventions (Checklist)1621631. **Preserve input order** — tickets/cases in output must match the order in the input payload.1642. **All enum values** — copy exactly from the answer template. No invented values.1653. **Empty strings vs null** — use `""` for absent IDs (outage_id, bill_id). Never `null`.1664. **Numeric types**:167 - `charge_amount_usd`: always two decimals (`0.00`, `86.40`, `4.00`).168 - `data_refuel_gb`: one decimal (`2.0`, `0.0`).169 - Counts / percentages: plain integers.1705. **Booleans** — lowercase `true` / `false`.1716. **Summary counts must sum correctly** — verify each summary field against the decision list before returning.1727. **Date format** — `YYYY-MM-DD` strings.1738. **Never fabricate data** — always pull from API responses. If an API field is absent, default to the zero-value for its type.174175---176177## Common Pitfalls178179- **Forgetting to override localhost** — always use the `environment_access.md` base URL, never `127.0.0.1`.180- **Calling diagnostics for outage tickets** — skip diagnostics when an active outage is found; the ticket is PENDING_ACTION.181- **Calling diagnostics for FAILED tickets** — skip for INVALID_ACCOUNT, INELIGIBLE_ACCOUNT, AUTH_FAILED.182- **Missing the outage check** — always check outages BEFORE diagnostics; an outage changes the entire resolution path.183- **Wrong escalation team** — FIELD_OPS for physical/field issues, NETWORK_ENGINEERING for capacity/backbone, TIER2_SUPPORT for provisioning/config.184- **Forgetting customer_preferences** — when the payload includes `customer_preferences`, check the case_id key for `accepted_refuel_gb` and `does_not_want_plan_change`.185- **Mixing up TOGGLE_ROAMING vs ENABLE_LINE_ROAMING** — TOGGLE_ROAMING is a device-side action (phone setting), ENABLE_LINE_ROAMING is a carrier-side provisioning change (`carrier_update_required: true`).186- **Missing secondary_action** — always include it even when `NO_ACTION`; never omit the field.187- **Summary miscounts** — double-check that `batch_summary` / `queue_summary` / `worklist_summary` counts exactly match the decisions array.188189---190191## Compact SOP1921931. **Read** the answer template first — it defines the output shape and enums.1942. **Read** all input payloads (CSV, JSON, email).1953. **For each ticket/case in order:**196 a. Fetch the entity from the API (ticket, case, incident).197 b. Fetch related records (account, line, plan, device, outage, SLA).198 c. Apply the triage rules above to determine status, route, blockers, and flags.199 d. Populate one entry in the decisions array.2004. **Compute summaries** by counting across the decisions array.2015. **Validate** enum values, numeric formats, and summary counts.2026. **Return** only the JSON object matching the answer template — no markdown, no explanation.