1---2name: reflect-3-attempt-02-343description: CRM Service Ticket Processing — Task Group 003 SOP4---5# CRM Service Ticket Processing — Task Group 003 SOP67## 1. Environment & Endpoints8- **CRM Service API base URL** is provided in `environment_access.md` (e.g., `http://host.docker.internal:8123` in Docker contexts). 9 If the host name does not resolve, fall back to the external URL discovered from the container environment (`GDPEVO_ENV_BASE_URL`).10- **Required endpoints** (inspect the OpenAPI/docs route when available, but prefer these exact paths):11 - `POST /tickets/bulk_resolve` → Ticket-batch style tasks12 - `POST /cases/bulk_prioritize` → Mobile-case-queue style tasks13 - `POST /emails/generate_reply` → Incident/complaint-report style tasks14 - `POST /queue/rebalance` or `POST /queue/enrich` → Queue-snapshot style tasks15 - `POST /cases/bulk_refuel` → Mobile-data-worklist style tasks1617## 2. Input Verification Pitfall18- **Do not trust cached `Read` output for JSON/CSV files.** In this task group the Read tool returned stale/false templates for several trains. 19- **Always verify** with `cat <file>` or a small Python script before building an answer.2021## 3. Answer-Template Conventions22- The answer template can be **deeply nested** (arrays of objects + summary objects). Do not assume a flat structure.23- **Preserve order strictly**:24 - `"preserve payload order"` → emit decisions in the exact order the rows appear in the CSV/JSON payload.25 - `"preserve ascending case_id order"` → sort decisions by `case_id` alphabetically before emitting.26- **Use exact enum strings** from the template schema (e.g., `RESOLVED`, `PENDING_ACTION`, `ESCALATED`, `FAILED`, `TIER2_SUPPORT`, `NETWORK_ENGINEERING`, etc.).27- **Null / not-applicable rules**:28 - Empty string `""` for optional string fields when none applies.29 - `0.0` for numeric refuel fields when not applicable.30 - Boolean fields must be literal `true` or `false` (not strings).3132## 4. Per-Task Processing Rules3334### 4.1 Ticket Batches (`/tickets/bulk_resolve`)35- **Input:** `ticket_batch.csv` (ticket_id, account_id, reported_service_type, customer_report).36- **Output:** `ticket_decisions` array + `batch_summary` counts.37- **Mapping hints from payload text:**38 - `"account hold notice"` / `"no matching account"` → resolution route `INELIGIBLE_ACCOUNT` or `INVALID_ACCOUNT`; escalate team `ACCOUNTS_PAYABLE`.39 - `"latency and packet loss"` / `"intermittent"` → mark `latency_issue=true`, `stability_issue=true`.40 - `"video stream unavailable"` / `"backbone capacity"` → bandwidth-related; route `NETWORK_ENGINEERING`.41 - `"provisioning mismatch"` / `"authentication never recovered"` → route `TIER2_SUPPORT`, blocker `PROVISIONING_STALE` or `AUTH_FAILED`.42 - `"neighborhood service interruption"` → blocker `ACTIVE_OUTAGE`, route `NETWORK_ENGINEERING`.43- Summary counts must **exactly match** the decision array.4445### 4.2 Mobile Case Queue (`/cases/bulk_prioritize`)46- **Input:** `case_queue.json` (cases with `case_id` and `reported_issue` only).47- **Output:** `case_decisions` array (ascending `case_id`) + `queue_summary`.48- **Mapping hints:**49 - `"no service after commute"` → `TOGGLE_AIRPLANE_MODE` / `RESEAT_SIM` → `SELF_SERVICE`.50 - `"line suspended … overdue"` → `SEND_PAYMENT_REQUEST` or `RESUME_LINE_REBOOT` → `BILLING_RECOVERY`.51 - `"traveling abroad … no data"` → `TOGGLE_ROAMING` / `ENABLE_LINE_ROAMING` → `CARRIER_UPDATE`.52 - `"messaging app cannot send photos"` → `GRANT_MESSAGING_PERMISSION` + permission `storage` or `sms_and_storage` → `SELF_SERVICE`.53 - `"mobile data slow"` → `TOGGLE_DATA_SAVER` / `SET_NETWORK_MODE` → `SELF_SERVICE`.54- `bill_id` is empty string when not applicable; `charge_amount_usd` uses **two decimals**.5556### 4.3 Incident Report Generation (`/emails/generate_reply`)57- **Input:** `client_complaint_email.txt` + `response_requirements.json`.58- **Output:** A full incident-report JSON (not a free-text email).59- **Key fields to extract or infer from the email/requirements:**60 - `incident_id`, `enterprise_account_id`, `product` (e.g., `monthly_export`).61 - `failure_window` with `start_date`, `end_date` (YYYY-MM-DD), and `failed_days` (integer).62 - `backfill_days` (integer), `sla_credit_percent` (integer).63 - `severity` enum: `Critical | High | Medium | Low`.64 - `engineering_owner` and `account_owner` as user IDs.65 - `channel_name`: **lowercase-hyphen** per naming-style requirement (e.g., `asteri-retail`).66 - `evidence_folder`: **client-date investigation** format.67 - `report_title`: **client export failure report** format.68 - `share_permissions`: ordered **exactly** as listed in `permission_users_to_include` (`laura.brown`, then `jun.chen`, etc.).69 - `response_status` enum: `READY_TO_SEND | NEEDS_FINANCE_REVIEW | NEEDS_ENGINEERING_REVIEW | UNDER_INVESTIGATION`.7071### 4.4 Queue Rebalance / Enrich (`/queue/rebalance` or `/queue/enrich`)72- **Input:** `queue_snapshot.csv` (ticket_id, account_id, reported_service_type, queue_note).73- **Output:** `ticket_decisions` (preserve payload order) + `queue_summary` (counts per `final_resolution_status` and `route_team`).74- **Mapping hints:**75 - `"No matching account in intake"` → `INVALID_ACCOUNT`, `FAILED`, `NONE`, `diagnostic_required: false`.76 - `"Provisioning mismatch after move"` → `PROVISIONING_STALE`, `ESCALATED`, `TIER2_SUPPORT`, `diagnostic_required: true`.77 - `"Backbone capacity errors"` → `NETWORK_CAPACITY`, `ESCALATED`, `NETWORK_ENGINEERING`.78 - `"Suspended after overdue notice"` → `OVERDUE_SUSPENSION`, `PENDING_ACTION`, `ACCOUNTS_PAYABLE`.79 - `"Authentication never recovered"` → `AUTH_FAILED`, `ESCALATED`, `TIER2_SUPPORT`.80 - `"Voice profile drops calls"` → `PROVISIONING_STALE`, `ESCALATED`, `TIER2_SUPPORT`.81 - `"Neighborhood service interruption"` → `ACTIVE_OUTAGE`, `ESCALATED` or `PENDING_ACTION`, `NETWORK_ENGINEERING`.82- Ensure `queue_summary` totals are **consistent** with the decision list.8384### 4.5 Mobile Data Refuel (`/cases/bulk_refuel`)85- **Input:** `mobile_data_worklist.json` (cases + optional `customer_preferences`).86- **Output:** `case_decisions` (ascending `case_id`) + `worklist_summary`.87- **Mapping hints:**88 - `"Data stopped after usage limit"` + accepted refuel in preferences → `REFUEL_DATA`, `final_route: DATA_RECOVERY`.89 - `"Traveler … roaming … no data"` → `ENABLE_LINE_ROAMING` / `TOGGLE_ROAMING` → `CARRIER_UPDATE`.90 - `"Slow data and data-saver icon visible"` → `TOGGLE_DATA_SAVER` → `DEVICE_SETTING_FIX`.91 - `"Slow data on older network mode"` → `SET_NETWORK_MODE` → `DEVICE_SETTING_FIX`.92 - `"No data after settings change"` → likely `TOGGLE_MOBILE_DATA` or `DISCONNECT_VPN` before escalating; if ambiguous, `TRANSFER_HUMAN` / `HUMAN_TRANSFER` is a fallback.93- `data_refuel_gb`: **one decimal** (e.g., `2.0`).94- `charge_amount_usd`: **two decimals** (e.g., `10.00`).95- `carrier_update_required`: `true` when the action triggers a carrier-side change (e.g., `ENABLE_LINE_ROAMING`).96- `worklist_summary` must sum up `data_refuel_cases`, `carrier_updates`, `device_setting_fixes`, `human_transfers`, and `total_estimated_customer_charge_usd` (two decimals).9798## 5. Sorting & Rounding Rules99- **Order:** ascending alphanumeric `case_id` or payload row order as explicitly required.100- **Decimals:**101 - One decimal place for `data_refuel_gb`.102 - Two decimal places for `charge_amount_usd` and `total_estimated_customer_charge_usd`.103 - Integer for all count/summary fields.104- **Dates:** Use `YYYY-MM-DD` format in incident report windows.105106## 6. General Pitfalls107- **Schema mismatch:** Never hard-code a flat answer (e.g., `resolved_tickets` array) without re-reading the template; the expected schema can be nested decision objects.108- **Count mismatch:** Summary objects must always be derivable from the decision array; a manual mismatch is an automatic score penalty.109- **Missing empty fields:** If a field is not applicable, use the sentinel value (`""`, `0.0`, `false`, `NONE`) rather than omitting the key.110- **Enum case-sensitivity:** Copy enum values exactly as shown in the template (e.g., `Critical` not `critical`).111- **Email vs. structured report:** Task-003 looks like an email reply endpoint, but the answer template is a **structured incident report**. Do not return prose; return the JSON report.