Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
felixguendling committed Mar 1, 2025
1 parent ac0770d commit 40a9ec5
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .pkg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[nigiri]
[email protected]:motis-project/nigiri.git
branch=master
commit=078e5b83a0d1c6e6511e6380cc3427897d76b4a5
commit=2443157e8d1beba3191c7e283d2348e9b887260b
[cista]
[email protected]:felixguendling/cista.git
branch=master
Expand Down
4 changes: 2 additions & 2 deletions .pkg.lock
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
18146914859608609654
11670583791245091624
cista e03a1ff0a84d3f638bf4bff7357d19e542640288
zlib-ng 68ab3e2d80253ec5dc3c83691d9ff70477b32cd3
boost 4a9aca6cb8af75be6e58f28c09cc7e39f61e6173
Expand Down Expand Up @@ -28,7 +28,7 @@ opentelemetry-cpp 60770dc9dc63e3543fc87d605b2e88fd53d7a414
pugixml 60175e80e2f5e97e027ac78f7e14c5acc009ce50
unordered_dense 2c7230ae7f9c30849a5b089fb4a5d11896b45dcf
wyhash 1e012b57fc2227a9e583a57e2eacb3da99816d99
nigiri 078e5b83a0d1c6e6511e6380cc3427897d76b4a5
nigiri 2443157e8d1beba3191c7e283d2348e9b887260b
conf f9bf4bd83bf55a2170725707e526cbacc45dcc66
expat 636c9861e8e7c119f3626d1e6c260603ab624516
libosmium 6e6d6b3081cc8bdf25dda89730e25c36eb995516
Expand Down
74 changes: 73 additions & 1 deletion openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,14 @@ paths:
schema:
type: integer
minimum: 1

- name: computeFares
in: query
required: false
description: Optional. Experimental. If set to true, the response will contain fare information.
schema:
type: boolean
default: false
responses:
'200':
description: routing result
Expand Down Expand Up @@ -1053,7 +1061,6 @@ components:
Duration:
description: Object containing duration if a path was found or none if no path was found
type: object
required: [ ]
properties:
duration:
type: number
Expand Down Expand Up @@ -1641,6 +1648,66 @@ components:
rental:
$ref: '#/components/schemas/Rental'

FareProduct:
type: object
required:
- name
- amount
- currency
properties:
name:
description: The name of the fare product as displayed to riders.
type: string
amount:
description: The cost of the fare product. May be negative to represent transfer discounts. May be zero to represent a fare product that is free.
type: number
currency:
description: ISO 4217 currency code. The currency of the cost of the fare product.
type: string

FareTransferRule:
type: string
enum:
- A_AB
- A_AB_B
- AB

FareTransfer:
type: object
description: |
The concept is derived from: https://gtfs.org/documentation/schedule/reference/#fare_transfer_rulestxt
Terminology:
- **Leg**: An itinerary leg as described by the `Leg` type of this API description.
- **Effective Fare Leg**: Itinerary legs can be joined together to form one *effective fare leg*.
- **Fare Transfer**: A fare transfer groups two or more effective fare legs.
- **A** is the first *effective fare leg* of potentially multiple consecutive legs contained in a fare transfer
- **B** is any *effective fare leg* following the first *effective fare leg* in this transfer
- **AB** are all changes between *effective fare legs* contained in this transfer
The fare transfer rule is used to derive the final set of products of the itinerary legs contained in this transfer:
- A_AB means that any product from the first effective fare leg combined with the product attached to the transfer itself (AB) which can be empty (= free). Note that all subsequent effective fare leg products need to be ignored in this case.
- A_AB_B mean that a product for each effective fare leg needs to be purchased in a addition to the product attached to the transfer itself (AB) which can be empty (= free)
- AB only the transfer product itself has to be purchased. Note that all fare products attached to the contained effective fare legs need to be ignored in this case.
An itineraray `Leg` references the index of the fare transfer and the index of the effective fare leg in this transfer it belongs to.
required:
- rule
- effectiveFareLegProducts
properties:
rule:
$ref: '#/components/schemas/FareTransferRule'
transferProduct:
$ref: '#/components/schemas/FareProduct'
effectiveFareLegProducts:
description: |
Lists all valid fare products for the effective fare legs.
type: array
items:
type: array
items:
$ref: '#/components/schemas/FareProduct'

Itinerary:
type: object
required:
Expand Down Expand Up @@ -1669,6 +1736,11 @@ components:
type: array
items:
$ref: '#/components/schemas/Leg'
fareTransfers:
description: Fare information
type: array
items:
$ref: '#/components/schemas/FareTransfer'

Footpath:
description: footpath from one location to another
Expand Down

0 comments on commit 40a9ec5

Please sign in to comment.