Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QualiCharge ♼ Carbure TIRUERT data exchange #400

Open
jmaupetit opened this issue Feb 14, 2025 · 6 comments
Open

QualiCharge ♼ Carbure TIRUERT data exchange #400

jmaupetit opened this issue Feb 14, 2025 · 6 comments
Assignees
Labels
schema Discussions around data schemas TIRUERT Everything related to the TIRUERT calculation

Comments

@jmaupetit
Copy link
Member

Purpose

As discussed lately with the CaburRe team, we need an exchange data format to automate TIRUERT volumes declaration from QualiCharge to Carbure.

Proposal

Here is a draft proposal expressed as a JSON schema:

{
  "type": "array",
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "",
  "minItems": 1,
  "uniqueItems": true,
  "items": {
    "type": "object",
    "required": [
      "entity",
      "siren",
      "operational_units"
    ],
    "properties": {
      "entity": {
        "type": "string",
        "minLength": 1
      },
      "siren": {
        "type": "string",
        "minLength": 9,
        "maxLength": 9
      },
      "operational_units": {
        "type": "array",
        "uniqueItems": true,
        "minItems": 1,
        "items": {
          "required": [
            "code",
            "from",
            "to"
          ],
          "properties": {
            "code": {
              "type": "string",
              "minLength": 5,
              "maxLength": 5
            },
            "from": {
              "type": "string",
              "format": "date",
              "minLength": 8,
              "maxLength": 10
            },
            "to": {
              "type": "string",
              "format": "date",
              "minLength": 8,
              "maxLength": 10
            },
            "stations": {
              "type": "array",
              "uniqueItems": true,
              "minItems": 1,
              "items": {
                "required": [
                  "id",
                  "energy",
                  "is_controlled"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "FR[A-Z]{3}P.*",
                    "minLength": 7
                  },
                  "energy": {
                    "type": "number",
                    "minimum": 1
                  },
                  "is_controlled": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

Example data may look like the following:

[
  {
    "entity": "Foo Inc.",
    "siren": "123456789",
    "operational_units": [
      {
        "code": "FRXXX",
        "from": "2025-01-01",
        "to": "2025-01-31",
        "stations": [
          {
            "id": "FRXXXP001",
            "energy": 123.4,
            "is_controlled": true
          },
          {
            "id": "FRXXXP002",
            "energy": 567.8,
            "is_controlled": false
          }
        ]
      },
      {
        "code": "FRYYY",
        "from": "2025-01-01",
        "to": "2025-01-31",
        "stations": [
          {
            "id": "FRYYYP001",
            "energy": 123.4,
            "is_controlled": true
          },
          {
            "id": "FRYYYP002",
            "energy": 567.8,
            "is_controlled": false
          }
        ]
      }
    ]
  },
  {
    "entity": "BAR Inc.",
    "siren": "987654321",
    "operational_units": [
      {
        "code": "FRZZZ",
        "from": "2025-01-01",
        "to": "2025-01-31",
        "stations": [
          {
            "id": "FRZZZP001",
            "energy": 123.4,
            "is_controlled": true
          },
          {
            "id": "FRZZZP002",
            "energy": 567.8,
            "is_controlled": false
          },
          {
            "id": "FRZZZP003",
            "energy": 901.2,
            "is_controlled": false
          }
        ]
      }
    ]
  }
]
@jmaupetit jmaupetit added schema Discussions around data schemas TIRUERT Everything related to the TIRUERT calculation labels Feb 14, 2025
@jmaupetit jmaupetit self-assigned this Feb 14, 2025
@loco-philippe
Copy link
Collaborator

I agree with the JSON schema.

Concerning properties :

  • is entity property equivalent to operator property ?
  • how is_controlled property is calculated (not in Qualicharge schema)
  • is it allowed to have stations that are not in Qualicharge (if yes, an additional boolean is required)

@jmaupetit
Copy link
Member Author

* is `entity` property equivalent to `operator` property ?

This is a human-readable name representing a corporation that perceives the TIRUERT.

* how `is_controlled` property is calculated (not in Qualicharge schema)

is_controlled will be calculated on our side: it corresponds to a station connected to Enedis using a dedicated delivery point (DC).

* is it allowed to have `stations` that are not in Qualicharge (if yes, an additional boolean is required)

Nope, we will only send volumes for stations registered in our system.

@loco-philippe
Copy link
Collaborator

* is `entity` property equivalent to `operator` property ?

This is a human-readable name representing a corporation that perceives the TIRUERT.

Which field in Qualicharge Schema is associated to entity ( is it : Table group, field name ) ?

@jmaupetit
Copy link
Member Author

Which field in Qualicharge Schema is associated to entity ( is it : Table group, field name ) ?

I think more of Amenageur.nom_amenageur.

@jfalxa
Copy link

jfalxa commented Feb 18, 2025

Ok looking good! About the energy field, what unit is used? Also, will it be the raw energy delivered to the station, or just its renewable share? In any case, it would be useful to have both of those if you can get them.

@jmaupetit
Copy link
Member Author

Ok looking good! About the energy field, what unit is used? Also, will it be the raw energy delivered to the station, or just its renewable share? In any case, it would be useful to have both of those if you can get them.

After internal discussions:

  • The energy field unit will be MWh
  • We would like to provide raw energy, thus, the renewable share and TIRUERT amounts would be calculated on your side.

WDYT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
schema Discussions around data schemas TIRUERT Everything related to the TIRUERT calculation
Projects
None yet
Development

No branches or pull requests

3 participants