> ## 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 Notice Response

> EcoMail Hub users review, reassign, view, and close consumer notice responses.

## Real-World Example

Jane uploads a collection notice, but the sender is matched to a prospect creditor profile instead of an active creditor company. Maya opens Manage Notice Response, filters Pending/Delivery, reviews the notice image, searches for the correct creditor profile or active company, and changes the sender target.

If the response cannot be delivered or should be closed by YouNegotiate, Maya enters a reason and closes it.

## Visual Flow

```mermaid placement="top-right" actions={true} theme={"system"}
flowchart TD
    A["User filters notice responses"] --> B["Portal loads matching responses"]
    B --> C["User views notice image and sender"]
    C --> D{"Needs reassignment?"}
    D -->|Yes| E["Change creditor profile or company"]
    D -->|No| F{"Needs YN close?"}
    F -->|Yes| G["Enter reason and close response"]
    F -->|No| H["Leave response for normal flow"]
    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,C actor;
    class B,E,G,H system;
    class D,F decision;
    linkStyle default stroke:#94A3B8,stroke-width:2px;
```

## Action Menu Rules

| Action                  | When It Should Be Available                                                                                           |
| ----------------------- | --------------------------------------------------------------------------------------------------------------------- |
| View Notice             | Available for a response row; shows the uploaded notice image when one exists.                                        |
| Change Creditor Profile | Available only before the response is completed, returned, or closed, and only when the sender is a creditor profile. |
| Close                   | Available only before final response statuses; requires a reason and closes through the YouNegotiate close path.      |
| Consumer link           | Opens the consumer detail route so the user can review all matching responses for that consumer.                      |

These same action rules appear in Manage Notice Response, consumer detail, creditor profile view, and company view.

## Status Fields

Notice responses have two different status concepts. Keep them separate in API/backend work.

| Status Field                   | What It Means                                                 | Values Or Badges                                                                            |
| ------------------------------ | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| Creditor response status       | Operational lifecycle of the notice response.                 | Pending/Delivery, Delivered/Pending, Completed/Added, Closed/Return to Sender, Closed By YN |
| Creditor member/profile status | Classification of the notice sender attached to the response. | `AM`, `PM`, `YP`, `CP`                                                                      |

## Creditor Member Status Badges

| Badge | Full Label            | When It Appears                                                                       |
| ----- | --------------------- | ------------------------------------------------------------------------------------- |
| `AM`  | Active Member         | Sender is an active company, or a creditor profile linked to an active company.       |
| `PM`  | Pending Member        | Sender is a non-active company, or a creditor profile linked to a non-active company. |
| `YP`  | YouNegotiate Prospect | Sender is an unlinked creditor profile created or owned by an EcoMail Hub user.       |
| `CP`  | Consumer Prospect     | Sender is an unlinked creditor profile created from a consumer notice response.       |

These badges appear in dashboard member/prospect counts, Manage Consumers notice-response rows, Manage Creditors profile rows, and notice-response exports. They are not the same thing as the response bucket filter.

## How It Should Work

* It should support filtering by all dashboard response buckets.
* It should let users search by company, consumer name, notice balance, and account number.
* It should allow changing creditor profile only while the response is still Pending/Delivery.
* It should allow viewing the notice image when one exists.
* It should require a reason when YouNegotiate closes a response.
* It should preserve the `AM`, `PM`, `YP`, and `CP` creditor member status wherever notice-response views or exports show sender classification.

## API Mapping

| UI Area                                      | Endpoint                                                      |
| -------------------------------------------- | ------------------------------------------------------------- |
| Table list, search, filter, sort, pagination | `GET /manage-notice-response`                                 |
| Change Creditor Profile search               | `GET /manage-notice-response/{noticeResponse}/sender-options` |
| Change Creditor Profile submit               | `PATCH /manage-notice-response/{noticeResponse}/sender`       |
| Close reason submit                          | `POST /manage-notice-response/{noticeResponse}/close`         |

The list endpoint returns `actions.can_change_creditor_profile`, `actions.can_close`, and `actions.can_view_notice` so the frontend can render the row menu without reimplementing backend status rules.

## How It Should Not Work

* It should not change creditor profile after the response has completed or returned.
* It should not close a notice response without a reason.
* It should not expose notice images outside the matching operational context.

## Developer Notes

* Reassignment can target a pending/prospect creditor profile or an active creditor company.
* Closing by YouNegotiate creates a reason and calls the notice-response close negotiation service path.
* Creditor member status is resolved from the sender target: `Company` rows use company active/non-active status; `CreditorProfile` rows use linked company status, EcoMail Hub ownership, or consumer-created prospect state.

## Related App Areas

* `app/Livewire/ConsumerResponseManager/ManageNoticeResponse/ListPage.php`
* `app/Livewire/ConsumerResponseManager/ChangeCreditorProfile.php`
* `app/Livewire/ConsumerResponseManager/Traits/CloseByYouNegotiate.php`
* `app/Services/ConsumerResponseManager/NoticeResponseService.php`
* `resources/views/components/consumer-response-manager/profile-status-badge.blade.php`
