# Operators

Contains operator data filtered for specific operator relationships including direct matches 
and parent-child operator hierarchies. Enriches the base operator data with matching flags 
to identify the main operator and parent operator relationships for downstream processing.

**SQL:** `operators`

## Schema

| Column Name              | Data Type     | Description                                                                           |
|:-------------------------|:--------------|:--------------------------------------------------------------------------------------|
| **Primary ID**           |               |                                                                                       |
| id                       | INTEGER       | Primary key                                                                           |
| **Other IDs**            |               |                                                                                       |
| parent_operator_id       | INTEGER       | References the parent operator when this operator is part of a hierarchical structure |
| country_id               | INTEGER       | Foreign key reference to the country where the operator is located                    |
| currency_id              | INTEGER       | References the primary currency used by the operator for transactions                 |
| language_id              | INTEGER       | References the default language setting for the operator                              |
| **Timestamps**           |               |                                                                                       |
| created_at               | TIMESTAMP_NTZ | Timestamp when the operator record was originally created in the system               |
| updated_at               | TIMESTAMP_NTZ | Timestamp of the most recent update to the operator record                            |
| deleted_at               | TIMESTAMP_NTZ | Soft deletion timestamp indicating when the operator was marked as deleted            |
| frozen_at                | TIMESTAMP_NTZ | Timestamp when the operator account was frozen or suspended                           |
| negative_balance_at      | TIMESTAMP_NTZ | Timestamp when the operator's balance first went negative                             |
| balances_updated_at      | TIMESTAMP_NTZ | Timestamp of the last balance calculation or update for the operator                  |
| churned_at               | TIMESTAMP_NTZ | Timestamp when the operator was marked as churned or inactive                         |
| **Filters**              |               |                                                                                       |
| is_main_operator_match   | BOOLEAN       | Indicates whether this record matches the specified operator ID directly              |
| is_parent_operator_match | BOOLEAN       | Indicates whether this record has the specified operator as its parent operator       |
| **Attributes**           |               |                                                                                       |
| name                     | VARCHAR       | Display name or business name of the operator                                         |
| identifier               | VARCHAR       | Unique business identifier or code assigned to the operator                           |
| vat_number               | VARCHAR       | Value Added Tax registration number for the operator                                  |
| tax_number               | VARCHAR       | Tax identification number assigned by local tax authorities                           |
| address1                 | VARCHAR       | Primary street address line for the operator's business location                      |
| address2                 | VARCHAR       | Secondary address line such as suite or apartment number                              |
| address3                 | VARCHAR       | Additional address line for extended addressing requirements                          |
| city                     | VARCHAR       | City or municipality where the operator is located                                    |
| zip                      | VARCHAR       | Postal or ZIP code for the operator's address                                         |
| province                 | VARCHAR       | Province, state, or administrative region of the operator's location                  |
| country_subdivision_code | VARCHAR       | Standard code for the country subdivision such as state or province                   |
| email                    | VARCHAR       | Primary email address for general operator communications                             |
| support_phone_number     | VARCHAR       | Phone number designated for customer support inquiries                                |
| finance_email            | VARCHAR       | Email address for financial and billing related communications                        |
| legal_email              | VARCHAR       | Email address for legal matters and official correspondence                           |
| company_name             | VARCHAR       | Official registered company name of the operator organization                         |

## Data inclusion criteria
This table works with `operator_id` or `parent_operator_id`must match the operator's ID.

## Data flow 
| Upstream tables | Downstream tables                  |
|:----------------|:-----------------------------------|
| ---             | `application_users`        |
| ---             | `subscription_purchases`   |
| ---             | `subscriptions`            |
| ---             | `charge_point_sites`       |
| ---             | `tariff_prices`            |
| ---             | `tariff_recurring_periods` |
| ---             | `tariff_period_groups`     |

## Alignment
### Monta API
- Aligns with Monta API [get/operators](https://developer.monta.com/api/v1/operators) endpoint 
-
