> ## 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.

# Open Negotiations

> Review digital consumer counteroffers submitted against creditor-initiated settlement or payment plan offers.

## Real-World Example

ABC Collections sends Jane a settlement offer for \$800 on a \$1,000 balance. The offer was generated from the group-level payment terms that applied when the creditor sent the offer.

Jane responds with a \$600 settlement counteroffer. Before the counteroffer is routed to ABC Collections, the system should validate Jane's counteroffer against the group-level terms that were actually delivered to her.

If Jane's counteroffer needs manual review, it should appear in Open Negotiations and the sidebar badge counts should increase. If the counteroffer qualifies for auto-approval or auto-decline rules, it should bypass Open Negotiations and move through the correct automatic outcome.

## Visual Flow

```mermaid placement="top-right" actions={true} theme={"system"}
flowchart TD
    A["Creditor sends settlement or payment plan offer"] --> B["Delivered offer terms are captured"]
    B --> C["Consumer submits counteroffer"]
    C --> D["Validate against delivered offer terms"]
    D --> E{"Validation outcome"}
    E -->|Auto-approved| F["Bypass queue and execute acceptance flow"]
    E -->|Auto-declined| G["Bypass queue and notify consumer"]
    E -->|Manual review| H["Show in Open Negotiations"]
    H --> I["Sidebar badge increases"]
    I --> J["Creditor accepts, declines, or counters"]
    J --> K{"Final outcome?"}
    K -->|Resolved or declined| L["Remove from Open Negotiations"]
    K -->|Countered| M["Negotiation remains active"]
    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,D,H,I,J,M system;
    class E,K decision;
    class G risk;
    class F,L outcome;
    linkStyle default stroke:#94A3B8,stroke-width:2px;
```

## Purpose

Open Negotiations manages digital consumer counteroffers submitted in response to creditor-initiated settlement or payment plan offers.

This section only applies to:

* Creditor-initiated digital offers.
* Consumer counteroffers to those offers.

This section does not handle:

* Written notice responses.
* Disputes related to written notices.
* Independent consumer settlement or payment offers.

Those items should route to Notice Responses or their respective workflows.

## Workflow Overview

### Creditor Sends Offer

The creditor sends a settlement offer or payment plan offer. The delivered offer may be based on:

* Master payment terms.
* Sub-account payment terms.
* Group payment terms.

### Consumer Submits Counteroffer

The consumer may submit a settlement counteroffer or payment plan counteroffer.

Example:

* Balance: \$1,000.
* Creditor offer: \$800.
* Consumer counteroffer: \$600.

## Validation Engine

Before routing the counteroffer to the creditor, the system validates the consumer's counteroffer against the specific offer terms originally delivered to that consumer.

The counteroffer is not checked against all available term sets. It must be validated only against the offer level applied when the creditor's original offer was sent.

Possible delivered offer levels:

* Master payment terms.
* Sub-account payment terms.
* Group payment terms.
* Phase 2: auto-approval threshold.
* Phase 2: minimum allowable threshold.

Examples:

* If the consumer received a group-level offer, validate only against group terms.
* If the consumer received a sub-account offer, validate only against sub-account terms.

This prevents counteroffers from being compared against unrelated creditor configurations.

### Validation Flow

```mermaid placement="top-right" actions={true} theme={"system"}
flowchart TD
    A["Counteroffer received"] --> B["Load original delivered offer"]
    B --> C{"Delivered offer level"}
    C -->|Master| D["Validate against master terms only"]
    C -->|Sub-account| E["Validate against sub-account terms only"]
    C -->|Group| F["Validate against group terms only"]
    D --> G{"Threshold result"}
    E --> G
    F --> G
    G -->|Meets auto-approval| H["Auto-approve"]
    G -->|Below minimum| I["Auto-decline"]
    G -->|Between thresholds| J["Route to manual review"]
    H --> K["Bypass Open Negotiations"]
    I --> K
    J --> L["Create Open Negotiations item"]
    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 actor;
    class B,D,E,F,J,L system;
    class C,G decision;
    class I risk;
    class H,K outcome;
    linkStyle default stroke:#94A3B8,stroke-width:2px;
```

## Validation Outcomes

### Auto-Approved

If the counteroffer meets auto-approval thresholds:

* The offer is automatically accepted.
* The consumer is notified.
* The negotiation is marked resolved.
* The offer does not enter Open Negotiations.

If a payment method is present, a settlement should auto-process or a payment plan should auto-activate. If a payment method is missing, the status should become `Needs Payment Method`, and the consumer must add a payment method before expiration.

### Auto-Declined

If the counteroffer is below minimum thresholds:

* The offer is automatically declined.
* The consumer is notified.
* The offer does not enter Open Negotiations.

### Manual Review Required

If the counteroffer is not auto-approved or auto-declined, it should route to:

* `Negotiations -> Open Negotiations`.
* `Dashboard -> Performance -> Open Negotiations`.

The Negotiations badge and Dashboard > Performance badge counts should increase when the manual-review item becomes active.

## Creditor Actions

* Accept.
* Decline.
* Counter.

No term editing is allowed in Open Negotiations. This is a review and respond workflow only.

## Action Flows

### Accept Flow

If a payment method exists:

* Settlement processes automatically, or the payment plan activates.
* Negotiation is marked resolved.
* Open count decreases.

If a payment method is missing:

* Consumer is notified.
* Status becomes `Needs Payment Method`.
* Consumer must add a payment method before expiration.
* Negotiation remains pending until resolved or expired.

### Decline Flow

* Consumer is notified.
* Negotiation is marked declined.
* Open count decreases.

The consumer may restart negotiations or submit another counteroffer only when the business rules allow it.

### Counteroffer Flow

* Consumer receives the creditor counteroffer.
* Negotiation remains active.
* Badge remains active.

The consumer can accept, reject, or counter again.

### Creditor Review Flow

```mermaid placement="top-right" actions={true} theme={"system"}
flowchart TD
    A["Open Negotiations item"] --> B["Creditor user reviews counteroffer"]
    B --> C{"Creditor action"}
    C -->|Accept| D{"Payment method present?"}
    D -->|Yes| E["Process settlement or activate payment plan"]
    D -->|No| F["Set Needs Payment Method"]
    C -->|Decline| G["Notify consumer and mark declined"]
    C -->|Counter| H["Send creditor counteroffer"]
    E --> I["Resolve negotiation"]
    F --> J["Wait for consumer payment method or expiration"]
    G --> K["Remove from Open Negotiations"]
    H --> L["Keep negotiation active"]
    I --> K
    J --> M{"Resolved before expiration?"}
    M -->|Yes| I
    M -->|No| N["Expire negotiation"]
    N --> K
    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 B actor;
    class A,H,J,L system;
    class C,D,M decision;
    class F,G,N risk;
    class E,I,K outcome;
    linkStyle default stroke:#94A3B8,stroke-width:2px;
```

## Visibility And Badge Rules

* Creditors only see their own negotiations.
* Resolved negotiations are hidden from Open Negotiations.
* Expired negotiations are hidden from Open Negotiations.
* History must be preserved.

Badge count should increase when a new negotiation arrives or a new counteroffer arrives.

Badge count should decrease when the item is reviewed, resolved, declined, marked read, or expired.

## Status Definitions

| Status               | Description                            |
| -------------------- | -------------------------------------- |
| Pending Review       | Awaiting creditor action.              |
| Auto-Approved        | System accepted the counteroffer.      |
| Auto-Declined        | System rejected the counteroffer.      |
| Accepted             | Creditor accepted the counteroffer.    |
| Declined             | Creditor declined the counteroffer.    |
| Countered            | Creditor countered the consumer offer. |
| Needs Payment Method | Awaiting consumer payment method.      |
| Expired              | Timed out before resolution.           |
| Resolved             | Completed.                             |

## How It Should Work

* Only digital counteroffers to creditor-initiated offers should appear here.
* Counteroffer validation should occur before routing to Open Negotiations.
* Auto-approved and auto-declined counteroffers should bypass this queue.
* Badge counts should reflect real unread or unresolved activity.
* Accepted offers should trigger the correct settlement or payment plan execution flow.
* Missing payment methods should create a `Needs Payment Method` state.
* Completed, resolved, declined, or expired negotiations should be removed from Open Negotiations while preserving history.

## How It Should Not Work

* It should not show notice responses, written-notice disputes, or independent consumer offers in this queue.
* It should not show negotiations from another creditor.
* It should not allow term editing in Open Negotiations.
* It should not leave stale badge counts after activity is handled.
* It should not route invalid offers to manual review.
* It should not create duplicate negotiation threads for the same active offer.

## Developer Notes

* Badge updates must be real-time and accurate.
* Preserve the full audit trail for every offer, counteroffer, status change, read state, expiration, and resolution.
* Do not allow term updates from Open Negotiations.
* Validation must use the delivered offer level, not every available creditor term set.
* This page is a review and response workflow only.

## Architecture Recommendation

Each negotiation should be represented as a persistent thread tied to:

* Consumer.
* Creditor.
* Account.
* Original offer.

The thread should include:

* All offers and counteroffers.
* Status history.
* Read and unread state.
* Expiration.
* Resolution.
* Payment method state.

This model helps prevent duplicate records, badge inconsistencies, lost history, and broken workflow transitions.

## Related App Areas

* `app/Livewire/Creditor/ConsumerOffers`
* `app/Livewire/Creditor/Dashboard`
* `app/Livewire/Creditor/Dashboard/Stats`
