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

# 2.4 Crosscutting Concepts

> Crosscutting Concepts for ReportGeneratorTool.

## 2.4.1 Domain Entity Model

```mermaid theme={null}
classDiagram
    direction LR

    class ReportRequest {
        +string url
        +string fromDate
        +string toDate
        +string[] sentTo
    }

    class ClientInput {
        +string username
        +string password
        +string name
        +string logo
    }

    class DeviceInput {
        +string device_id
    }

    class TemperatureThreshold {
        +number min
        +number max
    }

    class CSVMeasurement {
        +Date Time
        +string Temperature
    }

    class ReportSummary {
        +number highestTemp
        +number meanTemp
        +number lowestTemp
        +number highAlarmCount
        +number lowAlarmCount
        +number alarmCount
        +number highAlarmDuration
        +number lowAlarmDuration
    }

    class GeneratedPDF {
        +string pdfFilename
        +string blobContainer
    }

    class EmailDelivery {
        +string[] recipients
        +string attachmentFilename
    }

    ReportRequest "1" *-- "1" ClientInput : client
    ReportRequest "1" *-- "1..*" DeviceInput : devices
    DeviceInput "1" *-- "1" TemperatureThreshold : temp_threshold
    DeviceInput "1" --> "0..*" CSVMeasurement : exported readings
    CSVMeasurement "0..*" --> "1" ReportSummary : calculated from
    TemperatureThreshold "1" --> "1" ReportSummary : defines alarm limits
    ReportSummary "1" --> "1" GeneratedPDF : rendered in
    ReportRequest "1" --> "1" GeneratedPDF : supplies dates and client
    DeviceInput "1" --> "1" GeneratedPDF : identifies device
    GeneratedPDF "1" --> "1" EmailDelivery : attached to
    ReportRequest "1" --> "1" EmailDelivery : supplies sentTo
```

| **Term** | **Definition** |
| - | - |
| Report Request | The input that starts report generation. It supplies the portal URL, date range, client information, devices, and email recipients. |
| Client Input | Client details used to access the source portal and format the report: username, password, name, and logo. |
| Device Input | A device identified by `device_id` and configured with temperature thresholds. The current implementation generates a report for the first device in the request. |
| Temperature Threshold | The device’s minimum and maximum temperature limits, used to identify low and high alarm readings. |
| CSV Measurement | A row in the downloaded CSV export. The calculations use its `Time` and `Temperature` values; other columns depend on the export. |
| Report Summary | Values calculated from the CSV measurements, including highest, mean, and lowest temperature, alarm counts, and alarm durations. Alarm counts represent readings that meet a threshold, not distinct alarm events. |
| Generated PDF | The report containing the selected device, date range, chart, and calculated summary. It is uploaded to the `report-files` Blob container. |
| Email Delivery | The sending of the generated PDF as an attachment to the request’s `sentTo` recipients. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.