> ## Documentation Index
> Fetch the complete documentation index at: https://docs.younegotiate.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Manage Consumers

> EcoMail Hub users review consumers grouped by identity and inspect their notice responses.

## Real-World Example

Jane Doe has three notice responses from different collection notices. Maya opens Manage Consumers, searches Jane by name or last four SSN, and sees Jane grouped once with counts for pending, completed, and returned responses.

From Jane's detail page, Maya can review all matching notice responses, export them, and send a manual email or SMS when Jane's communication permissions allow it.

## Visual Flow

```mermaid placement="top-right" actions={true} theme={"system"}
flowchart TD
    A["User searches Manage Consumers"] --> B["Portal groups consumers by PII identity"]
    B --> C["Show pending, completed, and returned counts"]
    C --> D["User opens consumer detail"]
    D --> E{"Manual message needed?"}
    E -->|No| F["Review or export notice responses"]
    E -->|Yes| G["Check permission and send email/SMS"]
    classDef default fill:#F8FAFC,stroke:#64748B,stroke-width:1.5px,color:#0F172A;
    classDef actor fill:#E0F2FE,stroke:#0284C7,stroke-width:2px,color:#0C4A6E;
    classDef system fill:#F8FAFC,stroke:#64748B,stroke-width:1.5px,color:#0F172A;
    classDef decision fill:#FEF3C7,stroke:#D97706,stroke-width:2px,color:#78350F;
    classDef risk fill:#FEE2E2,stroke:#DC2626,stroke-width:2px,color:#7F1D1D;
    classDef outcome fill:#DCFCE7,stroke:#16A34A,stroke-width:2px,color:#14532D;
    class A,D actor;
    class B,C system;
    class E decision;
    class F,G outcome;
    linkStyle default stroke:#94A3B8,stroke-width:2px;
```

## Consumer Detail View Actions

| Detail Area            | What It Should Show Or Do                                                                                           |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------- |
| Consumer summary       | First name, last name, date of birth, last four SSN, and address from the consumer profile/account context.         |
| Notice response counts | Pending Delivery, Delivered Pending, Delivered/Added, and Return To Sender counts.                                  |
| Communication profile  | Whether the consumer can receive Email, Text, Both, or neither.                                                     |
| Manual email           | Available only when email permission is enabled; requires subject and body.                                         |
| Manual SMS             | Available only when text permission is enabled and a phone exists; rate-limited to avoid duplicate sends.           |
| Notice response table  | Shows sender, account number, balance, response type, creditor member status, notice offer status, and View Notice. |
| Export                 | Downloads matching notice responses only when records exist.                                                        |

Sender links in the detail table should open the creditor profile edit view for profile senders or the company view for active company senders.

## Notice Response Status Badges

Consumer detail notice-response rows should show the sender's creditor member status with the same member-status abbreviations.

| Badge | Full Label            | Meaning                                                               |
| ----- | --------------------- | --------------------------------------------------------------------- |
| `AM`  | Active Member         | Active company sender, or profile linked to an active company.        |
| `PM`  | Pending Member        | Non-active company sender, or profile linked to a non-active company. |
| `YP`  | YouNegotiate Prospect | Unlinked creditor profile owned by an EcoMail Hub user.               |
| `CP`  | Consumer Prospect     | Unlinked creditor profile created from a consumer-submitted notice.   |

The creditor member status badge is separate from the notice offer status, which uses Pending/Delivery, Delivered/Pending, Completed/Added, Closed/Return to Sender, or Closed By YN.

## How It Should Work

* It should group consumer records by last name, date of birth, and last four SSN.
* It should show response counts so the user can understand workload quickly.
* It should respect consumer email and text permissions before manual outreach.
* Manual SMS should rate-limit repeated sends to the same consumer.

## How It Should Not Work

* It should not create separate list rows for the same PII identity when the intent is one consumer view.
* It should not send email when the consumer disabled email permission.
* It should not send SMS when the consumer disabled text permission or has no usable phone number.

## Developer Notes

* Manual email uses the EcoMail Hub mail bucket.
* Manual SMS uses Twilio and a short cooldown to prevent accidental duplicate messages.
* Consumer detail pulls notice responses by matching blind indexes, not by one account row only.
* Creditor member status is computed per notice response from the sender detail, not from the grouped consumer row.

## Related App Areas

* `app/Livewire/ConsumerResponseManager/ManageConsumers/ListPage.php`
* `app/Livewire/ConsumerResponseManager/ManageConsumers/ViewPage.php`
* `app/Services/ConsumerResponseManager/ConsumerService.php`
* `resources/views/components/consumer-response-manager/profile-status-badge.blade.php`
* `app/Services/TwilioService.php`
