# Charge Consumption

Contains kilowatt-hour (kWh) consumption breakdown data for individual charges.
This model provides time-series consumption measurements for charges performed
on Monta-connected (OCPP) charge points, enabling detailed energy usage analysis.

**SQL:** `charge_consumption`

## Schema

| Column Name    | Data Type     | Description                                                                                                                            |
|:---------------|:--------------|:---------------------------------------------------------------------------------------------------------------------------------------|
| **Primary ID** |               |                                                                                                                                        |
| id             | INTEGER       | Primary key                                                                                                                            |
| **Other IDs**  |               |                                                                                                                                        |
| charge_id      | INTEGER       | Foreign key reference to the charges table - identifies which charge this consumption measurement belongs to                           |
| **Timestamps** |               |                                                                                                                                        |
| created_at     | TIMESTAMP_NTZ | Timestamp when the consumption measurement record was initially created in the system                                                  |
| updated_at     | TIMESTAMP_NTZ | Timestamp when the consumption measurement record was last modified                                                                    |
| recorded_at    | TIMESTAMP_NTZ | Timestamp of when this specific consumption measurement was recorded during the charging session (rounded to the nearest quarter hour) |
| ended_at       | TIMESTAMP_NTZ | End timestamp for the measurement period (if applicable)                                                                               |
| **Attributes** |               |                                                                                                                                        |
| value_wh       | INTEGER       | Energy consumption value measured in Watt-hours (Wh) for this measurement point                                                        |
| value_kwh      | FLOAT         | Energy consumption value converted to kilowatt-hours (kWh) - calculated as value_wh / 1000                                             |

## Inclusion Criteria
* the `charge_id` must exist in the operator's `charges.id`

## Data flow
| Upstream tables   | Downstream tables |
|:------------------|:------------------|
| `charges` | None              |
