TOMP-WG / TOMP-API

Transport Operator to Mobility-as-a-Service Provider-API development for Mobility as a Service
Apache License 2.0
96 stars 41 forks source link

create endpoints for listing made trips/legs #75

Closed edwinvandenbelt closed 4 years ago

edwinvandenbelt commented 4 years ago

As well the TO's and MSP's should be able to request the 'book keeping' part on both sides.

edwinvandenbelt commented 4 years ago

Is grouping required? Or is this a long list of book keeping lines that fulfil the request?

edwinvandenbelt commented 4 years ago

Request parameters: from, to, category?

edwinvandenbelt commented 4 years ago

I think of this endpoint GET /payment/journal-entry/{from}/{to}/{state}/{category} where from and to are timestamps, state can be ALL, OPEN, PAYED, DISCUSS category can be ALL, DAMAGE, LOSS, EXTRA_USAGE, REFUND, FINE, OTHER_ASSET_USED, OTHER

edwinvandenbelt commented 4 years ago

it should return journal-entries. Details below. Main idea: a list of journal entries, that do have a state and expiration date. The entries can be a fare or are extra-costs. I extended the money object with tax.

journal-entry: type: object properties: id: description: id of the leg type: string external-url: description: an optional external invoice. type: string format: url state: type: string enum: [OPEN, PAYED, DISCUSS] expiration-date: $ref: '#/components/schemas/timestamp' comment: type: string details: type: object oneOf:

extra-costs: type: object description: Costs that the TO is charging the MSP required:

fare-part: type: object description: this describes a part of the fare (or discount). It contains a for instance the startup costs (fixed) or the flex part (e.g. 1.25 EUR per 2.0 MILES). The amount is tax included. In case of discounts, the values are negative allOf:

money: type: object properties: amount: description: fare price for specific leg request [amended from MaaS-API] This should be in the base unit as defined by the ISO 4217 currency code with the appropriate number of decimal places and omitting the currency symbol. e.g. if the price is in US Dollars the price would be 9.95 type: number example: 9.95 currency-code: description: ISO 4217 currency code type: string minLength: 3 maxLength: 3 tax-rate: type: number description: tax rate (percentage of amount) example: 21.0

edwinvandenbelt commented 4 years ago

i also included #78 in this part

edwinvandenbelt commented 4 years ago

maybe 'fare-part' is not intuitive enough. a trip can have this as fare:

fare: [ { "amount": 2.40, "currency-code": "EUR", "tax-rate": 21.0, "type": "FLEX", "unit-type": "HOUR", "units": 1 } , { "amount": 5.0, "currency-code": "EUR", "tax-rate": 21.0, "type": "FIXED" } ]

meaning 5 euro's as start up costs and after that 2.4 euro for every our.