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

# Generate a Report

> EcoMail Hub users generate one-time CSV reports for creditor profiles, notice responses, or consumer profiles.

## Real-World Example

Maya needs a one-time report for last month. She chooses Notice Responses, selects the start and end dates, and downloads the CSV. The portal limits the date range so a one-time report cannot accidentally request too much data.

## Visual Flow

```mermaid placement="top-right" actions={true} theme={"system"}
flowchart TD
    A["User selects report type"] --> B["User selects date range"]
    B --> C{"Date range valid?"}
    C -->|No| D["Show validation error"]
    C -->|Yes| E["Build matching report data"]
    E --> F{"Rows found?"}
    F -->|No| G["Show empty report warning"]
    F -->|Yes| H["Download CSV"]
    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 actor;
    class E system;
    class C,F decision;
    class D,G risk;
    class H outcome;
    linkStyle default stroke:#94A3B8,stroke-width:2px;
```

## Report Types

| Report Type       | What It Exports                                                |
| ----------------- | -------------------------------------------------------------- |
| Creditor Profiles | Creditor profile records and related response metrics.         |
| Notice Responses  | Notice response records in the selected date range.            |
| Consumer Profiles | Consumer profile/report data tied to notice-response activity. |

## Notice Response Report Statuses

Notice response reports should export both sender classification and response lifecycle status.

| Export Field                   | Values                                                        |
| ------------------------------ | ------------------------------------------------------------- |
| Creditor/member profile status | Active Member, Pending Member, Yn Prospect, Consumer Prospect |
| Creditor response status       | Pending, Delivered, Added, Returned, YN Cancel                |

The UI often shows the sender classification as `AM`, `PM`, `YP`, or `CP`, but notice-response CSV exports use the full labels.

## How It Should Work

* It should require report type, start date, and end date.
* It should reject future dates.
* It should require the end date to be on or after the start date.
* It should limit one-time report ranges to two months.
* It should download CSV only when matching records exist.

## How It Should Not Work

* It should not generate reports with unbounded date ranges.
* It should not silently return an empty CSV as a successful report.
* It should not mix report types in one file.

## Developer Notes

* Dates are interpreted using EST and converted for the report query.
* The report type enum controls the allowed report list.
* Notice-response export mapping keeps creditor member/profile status separate from creditor response status.

## Related App Areas

* `app/Livewire/ConsumerResponseManager/Reports/GenerateReport/IndexPage.php`
* `app/Livewire/ConsumerResponseManager/Forms/GenerateReportForm.php`
* `app/Livewire/ConsumerResponseManager/Traits/NoticeResponseGenerateReport.php`
* `app/Enums/NoticeResponseReportType.php`
* `app/Exports/ConsumerResponseManager/NoticeResponseExport.php`
* `app/Exports/ConsumerResponseManager/NoticeResponsesExport.php`
