# Failed Charges Info

Contains detailed information about failed charging sessions and their associated error data. 
Tracks technical failures, error codes, and charging session metrics.

**SQL:** `failed_charges_info`

## Schema

| Column Name                 | Data Type     | Description                                                                               |
|:----------------------------|:--------------|:------------------------------------------------------------------------------------------|
| **Primary ID**              |               |                                                                                           |
| id                          | INTEGER       | Primary key (is charge_id)                                                                |
| **Other IDs**               |               |                                                                                           |
| charge_point_id             | INTEGER       | References the charge point where the failed charging session occurred                    |
| **Timestamps**              |               |                                                                                           |
| created_at                  | TIMESTAMP_NTZ | Timestamp when the failed charging session was initiated                                  |
| completed_at                | TIMESTAMP_NTZ | Timestamp when the failed charging session ended                                          |
| **Attributes**              |               |                                                                                           |
| failed_reason               | VARCHAR       | High-level categorization of why the charging session failed                              |
| kwh                         | NUMBER        | Amount of energy delivered before the charging session failed, measured in kilowatt-hours |
| firmware                    | VARCHAR       | Version of firmware running on the charge point at time of failure                        |
| ocpp_reported_failure       | VARCHAR       | Raw failure message reported by the charge point via OCPP protocol                        |
| ocpp_end_reason             | VARCHAR       | Standardized OCPP reason code for why the charging session terminated                     |
| ocpp_end_reason_description | VARCHAR       | Detailed description explaining the OCPP end reason code                                  |
| ocpp_vendor_error_code      | VARCHAR       | Vendor-specific error code reported by the charge point                                   |
| ocpp_reported_info          | VARCHAR       | Additional diagnostic information reported by the charge point via OCPP                   |

## Data inclusion criteria
- the `charge_point_id` is among ids of the operator's `charge_points`

## Data flow
| Upstream tables         | Downstream tables |
|:------------------------|:------------------|
| `charge_points` | none              |

### The `failed_charges_info` table
- To match `failed_charges_info` one needs to align `charge_points` with `charge_points`
