add new schema folder
This commit is contained in:
320
plugins/schemas/ondc_trv10/v2.0.0/on_init.json
Normal file
320
plugins/schemas/ondc_trv10/v2.0.0/on_init.json
Normal file
@@ -0,0 +1,320 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://ondc.org/trv10/2.0.0/on_init",
|
||||
"type": "object",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "../core/v1.1.0/on_init.json#"
|
||||
},
|
||||
{
|
||||
"$ref": "https://beckn.org/schema/on_init#"
|
||||
},
|
||||
{
|
||||
"$ref": "./init.json#/allOf/2"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"message": {
|
||||
"properties": {
|
||||
"order": {
|
||||
"properties": {
|
||||
"provider": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["id"]
|
||||
}
|
||||
},
|
||||
"required": ["provider"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"$ref": "./on_select.json#/allOf/5"
|
||||
},
|
||||
{
|
||||
"$ref": "./on_select.json#/allOf/6"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"message": {
|
||||
"properties": {
|
||||
"order": {
|
||||
"properties": {
|
||||
"items": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"fulfillment_ids": {
|
||||
"minItems": 1
|
||||
},
|
||||
"location_ids": {
|
||||
"minItems": 1
|
||||
}
|
||||
},
|
||||
"required": ["fulfillment_ids", "location_ids"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"$ref": "./confirm.json#/allOf/5/allOf/1"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"message": {
|
||||
"properties": {
|
||||
"order": {
|
||||
"properties": {
|
||||
"fulfillments": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["DELIVERY"]
|
||||
}
|
||||
},
|
||||
"required": ["type"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"allOf": [
|
||||
{
|
||||
"properties": {
|
||||
"message": {
|
||||
"properties": {
|
||||
"order": {
|
||||
"properties": {
|
||||
"quote": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"price": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"currency": {
|
||||
"type": "string"
|
||||
},
|
||||
"value": {
|
||||
"type": "string",
|
||||
"pattern": "^\\d+(\\.\\d{1,2})?$"
|
||||
}
|
||||
},
|
||||
"required": ["currency", "value"]
|
||||
},
|
||||
"breakup": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"price": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"currency": {
|
||||
"type": "string"
|
||||
},
|
||||
"value": {
|
||||
"type": "string",
|
||||
"pattern": "^\\d+(\\.\\d{1,2})?$"
|
||||
}
|
||||
},
|
||||
"required": ["currency", "value"]
|
||||
},
|
||||
"title": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"BASE_FARE",
|
||||
"DISTANCE_FARE",
|
||||
"TAX",
|
||||
"DISCOUNT",
|
||||
"WAITING_CHARGE"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["price", "title"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": ["price", "breakup"]
|
||||
}
|
||||
},
|
||||
"required": ["quote"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"message": {
|
||||
"properties": {
|
||||
"order": {
|
||||
"properties": {
|
||||
"quote": {
|
||||
"properties": {
|
||||
"breakup": {
|
||||
"allOf": [
|
||||
{
|
||||
"contains": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"title": {
|
||||
"const": "BASE_FARE"
|
||||
},
|
||||
"price": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"value": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["value"]
|
||||
}
|
||||
},
|
||||
"required": ["title", "price"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"contains": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"title": {
|
||||
"const": "DISTANCE_FARE"
|
||||
},
|
||||
"price": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"value": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["value"]
|
||||
}
|
||||
},
|
||||
"required": ["title", "price"]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"$ref": "./confirm.json#/allOf/7"
|
||||
},
|
||||
{
|
||||
"allOf": [
|
||||
{
|
||||
"properties": {
|
||||
"message": {
|
||||
"properties": {
|
||||
"order": {
|
||||
"properties": {
|
||||
"cancellation_terms": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"fulfillment_state": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"descriptor": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"code": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"RIDE_ASSIGNED",
|
||||
"RIDE_ENROUTE_PICKUP",
|
||||
"RIDE_ARRIVED_PICKUP",
|
||||
"RIDE_STARTED"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["code"]
|
||||
}
|
||||
},
|
||||
"required": ["descriptor"]
|
||||
},
|
||||
"cancellation_fee": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"percentage": {
|
||||
"type": "string",
|
||||
"pattern": "^(100(\\.0{1,2})?|([0-9]{1,2})(\\.\\d{1,2})?)$"
|
||||
}
|
||||
},
|
||||
"required": ["percentage"]
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"amount": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"value": {
|
||||
"type": "string",
|
||||
"pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)$"
|
||||
},
|
||||
"currency": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["currency", "value"]
|
||||
}
|
||||
},
|
||||
"required": ["amount"]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["fulfillment_state", "cancellation_fee"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": ["cancellation_terms"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"message": {
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"required": ["message"]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user