Closed edwinvandenbelt closed 4 years ago
Is grouping required? Or is this a long list of book keeping lines that fulfil the request?
Request parameters: from, to, category?
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
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
i also included #78 in this part
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.
As well the TO's and MSP's should be able to request the 'book keeping' part on both sides.