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

# Pay Terms Offers

> ABC Collections has a master creditor account and two subaccounts: Retail Accounts and Medical Accounts.

## Real-World Example

ABC Collections has a master creditor account and two subaccounts: Retail Accounts and Medical Accounts.

The company wants a normal offer for most consumers, but it also wants different rules for a medical portfolio and a short-term campaign for recently placed accounts.

For a consumer with a \$1,000 balance, the creditor configures this plan:

| Rule                          | Example Setting                                              | What the Consumer Sees                                                                         |
| ----------------------------- | ------------------------------------------------------------ | ---------------------------------------------------------------------------------------------- |
| Settlement Discount Offer     | 15%                                                          | A pay-in-full settlement offer of \$850.                                                       |
| Pay Plan Balance Discount     | 15%                                                          | A payment plan payoff balance of \$850.                                                        |
| First Payment Due Within      | 30 days                                                      | The first payment date must be within 30 days for the standard offer.                          |
| Minimum Monthly Payment       | 10%                                                          | The plan should require about \$100/month on a \$1,000 balance in the displayed example.       |
| Settlement Auto-Approval      | 60% of balance or higher                                     | A consumer counteroffer of \$600 or more can be accepted automatically.                        |
| Payment Plan Auto-Approval    | First payment within 45 days and monthly payment at least 7% | A plan with first payment within 45 days and \$70/month or more can be accepted automatically. |
| Minimum Settlement Limit      | 50% of balance                                               | The portal should not allow settlement offers below \$500.                                     |
| Minimum Monthly Payment Limit | 5% of balance                                                | The portal should not allow payment plans below \$50/month.                                    |

This means Jane can immediately accept the creditor's \$850 settlement offer or \$850 payment plan offer. If Jane makes a counteroffer of \$625, the portal can auto-approve it because it is above the 60% settlement rule. If Jane offers \$400, the portal should reject it because it is below the minimum settlement limit.

## Where Terms Apply

Pay terms are selected from **Apply To**. The selected scope decides which consumers receive the rules.

| Scope                 | Meaning                                                 | Real-World Use                                                                                                            |
| --------------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| Master - All Accounts | Default rules for the whole creditor company.           | ABC Collections sets its normal offer rules for every account unless a more specific rule applies.                        |
| Subaccount            | Rules for one subaccount or portfolio.                  | Medical Accounts gets softer terms than Retail Accounts because the creditor wants a higher payment-plan conversion rate. |
| Group                 | Company-wide rules for consumers matching a date range. | All accounts placed between January 1 and March 31 get a special campaign offer.                                          |
| Subaccount Group      | Group rules inside one subaccount.                      | Medical Accounts placed in Q1 gets a special offer, while Retail Accounts still uses the normal Retail subaccount rules.  |

## Priority Order

When a consumer opens the portal, the system should use the most specific matching rule.

1. Individual Custom Offer, if one exists for that consumer.
2. Subaccount Group terms, when the consumer belongs to that subaccount and matches the placement or expiration date range.
3. Group terms, when the consumer matches the company-wide placement or expiration date range.
4. Subaccount terms, when the consumer belongs to that subaccount.
5. Master terms, when no more specific rule applies.

## Visual Flow

```mermaid placement="top-right" actions={true} theme={"system"}
flowchart TD
    A["Creditor chooses Apply To scope"] --> B["Creditor enters offer terms and rules"]
    B --> C["Consumer opens account in portal"]
    C --> D{"Which pay terms match this consumer?"}
    D --> E["Use individual, group, subaccount, or master terms"]
    E --> F["Portal shows standard settlement and payment plan offers"]
    F --> G{"Consumer accepts standard offer?"}
    G -->|Yes| H["Consumer continues to payment setup"]
    G -->|No, sends counteroffer| I{"Counteroffer meets minimum limits?"}
    I -->|No| J["Portal blocks or rejects the offer"]
    I -->|Yes| K{"Counteroffer meets auto-approval rules?"}
    K -->|Yes| L["Offer is auto-approved"]
    K -->|No| M["Offer goes to creditor for review"]
    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,B,C actor;
    class E,F,H,L,M system;
    class D,G,I,K decision;
    class J risk;
    class H,L,M outcome;
    linkStyle default stroke:#94A3B8,stroke-width:2px;
```

## How It Should Work

* It should let the creditor define reusable settlement and payment plan offers.
* It should let the creditor apply rules to master, subaccount, group, or subaccount group scopes.
* Group and subaccount group terms should require a placement date range or expiration date range so the portal knows which consumers belong in that group.
* Consumers should see the offer from the most specific matching scope.
* If pay terms change, eligible joined consumers should be notified that their account offer was updated.
* Counteroffers should be checked against minimum limits first, then auto-approval rules.
* Counteroffers that pass the minimum limits but fail auto-approval should go to Open Negotiations for creditor review.

## How It Should Not Work

* It should not apply master terms when a more specific subaccount or group rule matches.
* It should not let a group term save without a placement or expiration date range.
* It should not show one creditor's terms to another creditor's consumers.
* It should not auto-approve a consumer counteroffer below the creditor's configured rule.
* It should not deliver counteroffers below the minimum offer limits.
* It should not leave consumers using stale terms after the creditor updates an active rule.

## Developer Notes

* Current application pay-term resolution uses this order: individual terms, matching subaccount group terms, matching company group terms, subaccount terms, then master terms.
* Group matching is based on consumer placement date or expiration date ranges.
* The Pay Terms page saves master terms on the company, subaccount terms on the subclient, and group terms in group pay term records.
* After a pay-term update, the notification job checks which joined consumers now use that pay-term type and dispatches the account-offer-updated communication.
* Keep the visible preview math aligned with the calculation service. If the UI says "\$100/month on a \$1,000 balance", the backend and consumer offer page should explain the same basis.

## Related App Areas

* `routes/creditor/index.php`
* `app/Livewire/Creditor/PayTerms/IndexPage.php`
* `app/Livewire/Creditor/Forms/PayTermsForm.php`
* `app/Services/Consumer/DiscountService.php`
* `app/Services/GroupPayTermService.php`
* `app/Support/ResolvesConsumerPayTerms.php`
* `app/Jobs/NotifyConsumersOfPayTermUpdateJob.php`
* `app/Enums/PayTermType.php`
