---
# System prepended metadata

title: IRT System X
tags: ["\U0001F5D1️ Corbeille"]

---

---
tags: 🗑️ Corbeille
---

# IRT System X

XP lancée à partir du lundi 27 janvier
OVX + RidyGo
15 équipages ~ sur la période d'XP

RidyGo veut être sur la prod pour l'XP (pas liés au 8 janvier).

Envoie des preuves fonctionne sur l'acquisition mais après ne passe pas jusqu'au front.

IRT donne un operator_journey_id aux opérateurs qui gardent leur partie de la preuve
besoin : pouvoir envoyer des 1/2 preuves qui sont consolidées chez nous
envoie de la preuve complète une fois que c'est fait (chaque opérateur envoie sa partie)

> faire un proto pour faire le tampon d'acquisition qui renvoie vers le pipeline normal à posteriori.

mm operator_journey_id
! modifs de schemas
- concatenation des niveaux de preuve (B+B=C)
- operator_id dans le passager et le conducteur

- Créer un opérateur temporaire pour l'expérimentation pour ne pas casser le schema actuel.
- nom de l'opérateur consolidé : nom de l'XP créé pour l'occasion
- politique de la campagne configurée par Margot. >> passer l'enveloppe à 1000 points
- vues SQL pour le reporting de l'XP. Pas faire de développement spé pour ça.

> Note : afficher une modale d'infos pour les opérateurs pour qu'ils modifient leur visibilité opérateur.
> Issue : changer le rôle d'un utilisateur

TODO
- partager l'email de Gilles.
- ajouter les schemas existants et les modifier ici pour ce cas d'usage

```json
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Journey Schema V2 - Proto LyonXP IRT SystemX + OVX + RidyGo",
  "$id": "rpc.journey.v2",
  "definitions": {
    "macros": {
      "varchar": {
        "type": "string",
        "minLength": 1,
        "maxLength": 255
      },
      "longchar": {
        "type": "string",
        "minLength": 1,
        "maxLength": 511
      },
      "email": {
        "type": "string",
        "format": "email",
        "minLength": 5,
        "maxLength": 256
      },
      "phone": {
        "type": "string",
        "format": "phone",
        "minLength": 10,
        "maxLength": 15
      },
      "phone_trunc": {
        "type": "string",
        "minLength": 8,
        "maxLength": 15
      },
      "timestamp": {
        "type": "string",
        "format": "date-time"
      },
      "lat": {
        "type": "number",
        "minimum": -90,
        "maximum": 90
      },
      "lon": {
        "type": "number",
        "minimum": -180,
        "maximum": 180
      },
      "insee": {
        "type": "string",
        "format": "insee",
        "minLength": 5,
        "maxLength": 5
      },
      "siret": {
        "type": "string",
        "format": "siret",
        "minLength": 14,
        "maxLength": 14
      }
    },
    "travelpass": {
      "type": "object",
      "minProperties": 2,
      "additionalProperties": false,
      "properties": {
        "name": {
          "enum": ["navigo"]
        },
        "user_id": {
          "$ref": "#/definitions/macros/varchar"
        }
      }
    },
    "identity": {
      "type": "object",
      "anyOf": [
        {"required": ["phone"]},
        {"required": ["operator_user_id", "phone_trunc"]}
      ],
      "additionalProperties": false,
      "properties": {
        "firstname": {
          "$ref": "#/definitions/macros/varchar"
        },
        "lastname": {
          "$ref": "#/definitions/macros/varchar"
        },
        "email": {
          "$ref": "#/definitions/macros/email"
        },
        "phone": {
          "$ref": "#/definitions/macros/phone"
        },
        "phone_trunc": {
          "$ref": "#/definitions/macros/phone_trunc"
        },
        "operator_user_id": {
          "$ref": "#/definitions/macros/varchar"
        },
        "company": {
          "$ref": "#/definitions/macros/varchar"
        },
        "over_18": {
          "enum": [true, false, null],
          "default": null
        },
        "travel_pass": { "$ref": "#/definitions/travelpass" }
      }
    },
    "position": {
      "type": "object",
      "required": ["datetime"],
      "additionalProperties": false,
      "minProperties": 2,
      "dependencies": {
        "lat": ["lon"],
        "lon": ["lat"],
        "country": ["literal"]
      },
      "properties": {
        "datetime": {
          "$ref": "#/definitions/macros/timestamp"
        },
        "lat": {
          "$ref": "#/definitions/macros/lat"
        },
        "lon": {
          "$ref": "#/definitions/macros/lon"
        },
        "insee": {
          "$ref": "#/definitions/macros/insee"
        },
        "country": {
          "$ref": "#/definitions/macros/varchar"
        },
        "literal": {
          "$ref": "#/definitions/macros/longchar"
        }
      }
    },
    "incentive": {
      "type": "object",
      "required": ["index", "siret", "amount"],
      "additionalProperties": false,
      "properties": {
        "index": {
          "type": "integer",
          "minimum": 0
        },
        "siret": {
          "$ref": "#/definitions/macros/siret"
        },
        "amount": {
          "type": "number",
          "minimum": 0,
          "maximum": 20000
        }
      }
    },
    "payment": {
      "type": "object",
      "required": ["pass", "amount"],
      "additionalProperties": false,
      "properties": {
        "index": {
          "type": "integer",
          "minimum": 0,
          "maximum": 42
        },
        "siret": {
          "$ref": "#/definitions/macros/siret"
        },
        "type": {
          "$ref": "#/definitions/macros/varchar"
        },
        "amount": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100000
        }
      }
    },
    "passenger": {
      "type": "object",
      "required": ["identity", "start", "end", "contribution", "incentives"],
      "additionalProperties": false,
      "properties": {
        // TODO ajouter operator_id, operator_class
        "identity": { "$ref": "#/definitions/identity" },
        "start": { "$ref": "#/definitions/position" },
        "end": { "$ref": "#/definitions/position" },
        "seats": {
          "type": "integer",
          "default": 1,
          "minimum": 1,
          "maximum": 8
        },
        "contribution": {
          "type": "integer",
          "minimum": 0,
          "maximum": 1000000,
          "$comment": "Montant après que toutes les incitations aient été attribuées"
        },
        "incentives": {
          "type": "array",
          "minItems": 0,
          "items": { "$ref": "#/definitions/incentive" }
        },
        "payments": {
          "type": "array",
          "minItems": 0,
          "items": { "$ref": "#/definitions/payment" }
        },
        "distance": {
          "type": "integer",
          "minimum": 0,
          "maximum": 1000000
        },
        "duration": {
          "type": "integer",
          "minimum": 0,
          "maximum": 86400
        }
      }
    },
    "driver": {
      "type": "object",
      "required": ["identity", "start", "end", "revenue", "incentives"],
      "additionalProperties": false,
      "properties": {
        // TODO ajouter operator_id, operator_class
        "identity": { "$ref": "#/definitions/identity" },
        "start": { "$ref": "#/definitions/position" },
        "end": { "$ref": "#/definitions/position" },
        "revenue": {
          "type": "integer",
          "minimum": 0,
          "maximum": 1000000,
          "$comment": "Montant perçu après que toutes les incitations et contributions des passagers aient été attribuées"
        },
        "incentives": {
          "type": "array",
          "minItems": 0,
          "maxItems": 20,
          "items": { "$ref": "#/definitions/incentive" }
        },
        "payments": {
          "type": "array",
          "minItems": 0,
          "items": { "$ref": "#/definitions/payment" }
        },
        "distance": {
          "type": "integer",
          "minimum": 0,
          "maximum": 1000000
        },
        "duration": {
          "type": "integer",
          "minimum": 0,
          "maximum": 86400
        }
      }
    }
  },
  "type": "object",
  "required": ["journey_id", "operator_class"],
  "anyOf": [
    {"required": ["passenger"]},
    {"required": ["driver"]}
  ],
  "additionalProperties": false,
  "properties": {
    "journey_id": {
      "$ref": "#/definitions/macros/varchar"
    },
    "operator_journey_id": {
      "$ref": "#/definitions/macros/varchar"
    },
    "operator_class": {
      "enum": ["A", "B", "C"] // TODO déplacer dans passenger et driver
    },
    "passenger": { "$ref": "#/definitions/passenger" },
    "driver": { "$ref": "#/definitions/driver" }
  }
}
```