Skip to content

Commit

Permalink
feat(bookings-v2) Amend fare schema, booking schema and associated sc…
Browse files Browse the repository at this point in the history
…heamas
  • Loading branch information
konker committed Apr 10, 2018
1 parent 3695457 commit 4000162
Show file tree
Hide file tree
Showing 53 changed files with 28,032 additions and 19,735 deletions.
8,992 changes: 7,966 additions & 1,026 deletions prebuilt/core/booking.json

Large diffs are not rendered by default.

185 changes: 162 additions & 23 deletions prebuilt/core/components/fare.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,172 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "A fare/price as billed to the user in WMPs or in tokens",
"type": "object",
"properties": {
"amount": {
"anyOf": [
{
"description": "A fare/price as billed to the user",
"oneOf": [
{
"type": "object",
"properties": {
"amount": {
"description": "amount of the fare in the given currency",
"type": "integer",
"multipleOf": 0.01,
"minimum": 0
},
{
"type": "null"
"currency": {
"description": "currency of the fare amount",
"type": "string",
"enum": [
"EUR",
"GBP"
]
},
"wmp": {
"description": "The fare amount in the WMP internal currency",
"type": "integer",
"multipleOf": 1,
"minimum": 0
},
"region": {
"description": "The fare in the home currency associated with the region of the user's subscription",
"type": "Object",
"properties": {
"amount": {
"description": "amount of the fare in the given currency",
"type": "integer",
"multipleOf": 0.01,
"minimum": 0
},
"currency": {
"description": "currency of the fare amount",
"type": "string",
"enum": [
"EUR",
"GBP"
]
}
},
"required": [
"amount",
"currency"
],
"additionalProperties": false
}
]
},
"required": [
"amount",
"currency",
"wmps",
"region"
],
"additionalProperties": false
},
"currency": {
"type": "string",
"enum": [
"WMP",
"TOKEN"
]
},
"tokenId": {
"type": "string"
{
"type": "object",
"properties": {
"amount": {
"description": "number of tokens",
"type": "integer",
"multipleOf": 1,
"minimum": 0
},
"currency": {
"description": "TOKEN internal currency",
"value": "TOKEN"
},
"tokenId": {
"description": "Token id field used if the currency is TOKEN",
"type": "string"
}
},
"required": [
"amount",
"currency",
"tokenId"
],
"additionalProperties": false
}
},
"required": [
"amount",
"currency"
],
"additionalProperties": false
"definitions": {
"currencyFare": {
"type": "object",
"properties": {
"amount": {
"description": "amount of the fare in the given currency",
"type": "integer",
"multipleOf": 0.01,
"minimum": 0
},
"currency": {
"description": "currency of the fare amount",
"type": "string",
"enum": [
"EUR",
"GBP"
]
},
"wmp": {
"description": "The fare amount in the WMP internal currency",
"type": "integer",
"multipleOf": 1,
"minimum": 0
},
"region": {
"description": "The fare in the home currency associated with the region of the user's subscription",
"type": "Object",
"properties": {
"amount": {
"description": "amount of the fare in the given currency",
"type": "integer",
"multipleOf": 0.01,
"minimum": 0
},
"currency": {
"description": "currency of the fare amount",
"type": "string",
"enum": [
"EUR",
"GBP"
]
}
},
"required": [
"amount",
"currency"
],
"additionalProperties": false
}
},
"required": [
"amount",
"currency",
"wmps",
"region"
],
"additionalProperties": false
},
"tokenFare": {
"type": "object",
"properties": {
"amount": {
"description": "number of tokens",
"type": "integer",
"multipleOf": 1,
"minimum": 0
},
"currency": {
"description": "TOKEN internal currency",
"value": "TOKEN"
},
"tokenId": {
"description": "Token id field used if the currency is TOKEN",
"type": "string"
}
},
"required": [
"amount",
"currency",
"tokenId"
],
"additionalProperties": false
}
}
}
10 changes: 9 additions & 1 deletion prebuilt/core/components/units.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,15 @@
"type": "string",
"pattern": "^[aepsu]{2}\\-[0-9A-Z_a-z]{4}\\-[0-9]:[0-9a-f]{8}(\\-[0-9a-f]{4}){3}\\-[0-9a-f]{12}$"
},
"currency": {
"internalCurrency": {
"description": "Internal monetary unit in ISO 4127 format, see https://en.wikipedia.org/wiki/ISO_4217#cite_note-1",
"type": "string",
"enum": [
"WMP",
"TOKEN"
]
},
"actualCurrency": {
"description": "Accepted monetary unit in ISO 4127 format, see https://en.wikipedia.org/wiki/ISO_4217#cite_note-1",
"type": "string",
"enum": [
Expand Down
Loading

0 comments on commit 4000162

Please sign in to comment.