|
| 1 | +# Writing NTFS fares |
| 2 | +## Introduction |
| 3 | +This document describes how fares specified in Navitia Transit Model are transformed into a [NTFS fare feed](https://github.com/CanalTP/navitia/blob/dev/documentation/ntfs/ntfs_fare_extension_fr.md). |
| 4 | + |
| 5 | +In this initial version: |
| 6 | +- only tickets on origin-destination stops are taken into account |
| 7 | +- only constraints on physical modes are taken into account (if a ticket is specified for a specific line or network, this information is ignored) |
| 8 | +- the validity duration and the transfers allowed for a ticket, if specified, are ignored |
| 9 | +- tickets specified in a currency different than EUR are ignored. |
| 10 | + |
| 11 | +These limitations will be adressed in a later version. |
| 12 | + |
| 13 | +In the following, the NTFS fields that are not specified are ignored and not detailed. |
| 14 | + |
| 15 | +### prices.csv |
| 16 | +As a reminder, this file has no header and the order of the NTFS fields must be respected. |
| 17 | + |
| 18 | +NTFS field | NTM object | NTM property | Notes/Mapping rule |
| 19 | +--- | --- | --- | --- |
| 20 | +\*clef de ticket\* | Ticket | ticket_id | |
| 21 | +\*date de début de validité\* | Ticket | start_date | Starting date of the validity period of the fare structure in the form YYYYMMDD. |
| 22 | +\*date de fin de validité\* | Ticket | end_date | The date after the specified end date in the form YYYYMMDD. |
| 23 | +\*prix\* | Ticket | price | The specified value is converted into euro cents. |
| 24 | +\*name\* | | | Fixed value `Ticket Orgine-Destination`. |
| 25 | +\*champ ignoré\* | | | This field is explicitly left empty. |
| 26 | +\*commentaire\* | | | This field is explicitly left empty. |
| 27 | +\*devise\* | Ticket | currency_type | The value is set to `centime` provided that the currency used for the ticket is EUR. |
| 28 | + |
| 29 | +### od_fares.csv |
| 30 | + |
| 31 | +NTFS field | NTM object | NTM property | Notes/Mapping rule |
| 32 | +--- | --- | --- | --- |
| 33 | +Origin ID | OD Rules | origin_stoparea_id | The id is prefixed with `stop_area:`. |
| 34 | +Origin mode | | | Fixed value `stop`. |
| 35 | +Destination ID | OD Rules | dest_stoparea_id | The id is prefixed with `stop_area:`. |
| 36 | +Destination mode | | | Fixed value `stop`. |
| 37 | +ticket_id | OD Rules | ticket_id | Link to the ticket specified in [prices](#pricescsv) |
| 38 | + |
| 39 | +### fares.csv |
| 40 | +For each distinct physical mode specified in `OD Rules`, a row is created in this file in order to allow to represent transitions for the origin-destination tickets. |
| 41 | + |
| 42 | +NTFS field | NTM object | NTM property | Notes/Mapping rule |
| 43 | +--- | --- | --- | --- |
| 44 | +avant changement | | | Fixed value `*`. |
| 45 | +après changement | OD Rules | physical_mode_id | The id is prefixed with `mode=physical_mode:`. |
| 46 | +début trajet | | | This field is explicitly left empty. |
| 47 | +fin trajet | | | This field is explicitly left empty. |
| 48 | +condition globale | | | Fixed value `with_changes`. |
| 49 | +clef ticket | | | This field is explicitly left empty. |
0 commit comments