Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding domain specific rules/restrictions in the mobility on demand layer2 config #78

Open
wants to merge 12 commits into
base: draft
Choose a base branch
from
Open
2 changes: 2 additions & 0 deletions api/l2-config/ONDC/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
how to compile final.yaml from other components:
swagger-cli bundle mobility_ondemandride_1.1.0_openapi_3.1.yaml --outfile final.yaml --type yaml
64 changes: 64 additions & 0 deletions api/l2-config/ONDC/example-jsons/requests/cancel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
Cancel a ride with selected reason:
value:
context:
action: cancel
bap_id: api.beckn.juspay.in/pilot/bap/cab/v1
bap_uri: https://api.example-bap.com/pilot/bap/cab/v1
bpp_id: api.beckn.juspay.in/dobpp/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f
bpp_uri: https://api.example-bpp.com/dobpp/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f
domain: nic2004:60221
location:
city:
code: std:080
country:
code: IND
message_id: be6a495a-e941-4fbf-9d59-f1e6166cccc8
timestamp: '2023-03-23T05:15:08Z'
version: 1.1.0
message:
cancellation_reason_id: '5'
order_id: b4232ad4-19ee-4c67-9223-a5189b13a741
Cancel a ride with user provided information:
value:
context:
action: cancel
bap_id: api.beckn.juspay.in/pilot/bap/cab/v1
bap_uri: https://api.example-bap.com/pilot/bap/cab/v1
bpp_id: api.beckn.juspay.in/dobpp/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f
bpp_uri: https://api.example-bpp.com/dobpp/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f
domain: nic2004:60221
location:
city:
code: std:080
country:
code: IND
message_id: be6a495a-e941-4fbf-9d59-f1e6166cccc8
timestamp: '2023-03-23T05:15:08Z'
version: 1.1.0
message:
cancellation_reason_id: '7'
descriptor:
short_desc: Accidenally booked the ride
order_id: b4232ad4-19ee-4c67-9223-a5189b13a741
Cancel a transit ticket booking before the cancellation period:
value:
context:
action: cancel
bap_id: https://example-bap.com
bap_uri: https://api.example-bap.com/beckn/
bpp_id: https://transit-solutions.com
bpp_uri: https://api.transit-solutions.com/beckn/
domain: nic2008:49213
location:
city:
code: std:080
country:
code: IND
message_id: fde8b8b6-c2e5-49f7-b254-720843d528bd
timestamp: '2021-03-23T10:00:40.065Z'
transaction_id: 6f339232-2bc3-44d2-915c-30d2b053ce1d
version: 1.1.0
message:
order:
cancellation_reason_id: '2'
id: '123413'
105 changes: 105 additions & 0 deletions api/l2-config/ONDC/example-jsons/requests/confirm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
Confirm ride booking:
value:
context:
action: confirm
bap_id: example-bap.com
bap_uri: https://api.example-bap.com/pilot/bap/cab/v1
bpp_id: example-bpp.com
bpp_uri: https://api.example-bpp.com/dobpp/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f
domain: nic2004:60221
location:
city:
code: std:080
country:
code: IND
message_id: 8926b747-0362-4fcc-b795-0994a6287700
timestamp: '2023-03-23T04:48:53Z'
transaction_id: b580c989-f84d-4abe-af28-2c818aafce3b
version: 1.1.0
message:
order:
fulfillments:
- customer:
contact:
phone: +91-9897867564
person:
language:
code: en
name: English
name: John Doe
id: fulf_5cf064d5-4c0a-42d3-b73d-5f19a6f7468e
stops:
- location:
address: 98 A, 6th Main Rd, Uttarahalli Hobli, Ramanjaneyanagar
area_code: 560061
city:
name: Bengaluru
country:
name: India
district: Ramanjaneyanagar
gps: 12.910458, 77.543089
state:
name: Karnataka
type: start
- location:
address: Basavanagudi, Chikkanna Garden, Rangadore Memorial
Hospital
area_code: 560061
city:
name: Bengaluru
country:
name: India
district: Chikkanna Garden
gps: 12.9535139, 77.5710434
state:
name: Karnataka
type: end
vehicle:
category: AUTO_RICKSHAW
items:
- fulfillment_ids:
- fb5c84d4-1b59-4b9d-96b5-9d79107432c5
id: 5777a0bf-9a08-49aa-a97d-1e5561a9622e
payment_ids:
- '1'
payments:
- id: 7f7896dd-787e-4a0b-8675-e9e6fe93bb8f
params:
amount: '81'
currency: INR
status: NOT-PAID
type: ON-FULFILLMENT
provider:
id: '1'
Confirm ticket booking:
value:
context:
action: confirm
bap_id: https://example-bap.com
bap_uri: https://mock_bap.com/beckn/
bpp_id: https://kmrl-bpp.com
bpp_uri: https://kmrl-bpp.com/beckn/
domain: nic2004:60221
location:
city:
code: std:080
country:
code: IND
message_id: fde8b8b6-c2e5-49f7-b254-720843d528bd
timestamp: '2021-03-23T10:00:40.065Z'
transaction_id: 6f339232-2bc3-44d2-915c-30d2b053ce1d
version: 1.1.0
message:
order:
billing:
email: [email protected]
name: John Doe
items:
- id: '1'
payment:
params:
amount: '55'
currency: INR
transaction_id: '24566345563'
provider:
id: '1'
95 changes: 95 additions & 0 deletions api/l2-config/ONDC/example-jsons/requests/init.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
Initialize draft order and request for terms of service:
value:
context:
action: init
bap_id: example-bap.com
bap_uri: https://api.example-bap.com/pilot/bap/cab/v1
bpp_id: example-bpp.com
bpp_uri: https://api.example-bpp.com/dobpp/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f
domain: nic2004:60221
location:
city:
code: std:080
country:
code: IND
message_id: 8926b747-0362-4fcc-b795-0994a6287700
timestamp: '2023-03-23T04:48:53Z'
transaction_id: b580c989-f84d-4abe-af28-2c818aafce3b
version: 1.1.0
message:
order:
fulfillments:
- customer:
contact:
phone: +91-9897867564
person:
language:
code: en
name: English
name: John Doe
id: fulf_5cf064d5-4c0a-42d3-b73d-5f19a6f7468e
stops:
- location:
address: 98 A, 6th Main Rd, Uttarahalli Hobli, Ramanjaneyanagar
area_code: 560061
city:
name: Bengaluru
country:
name: India
district: Ramanjaneyanagar
gps: 12.910458, 77.543089
state:
name: Karnataka
type: start
- location:
address: Basavanagudi, Chikkanna Garden, Rangadore Memorial
Hospital
area_code: 560061
city:
name: Bengaluru
country:
name: India
district: Chikkanna Garden
gps: 12.9535139, 77.5710434
state:
name: Karnataka
type: end
items:
- fulfillment_ids:
- fulf_5cf064d5-4c0a-42d3-b73d-5f19a6f7468e
id: 5777a0bf-9a08-49aa-a97d-1e5561a9622e
payment_ids:
- 7f7896dd-787e-4a0b-8675-e9e6fe93bb8f
payment:
- collected_by: BPP
id: 7f7896dd-787e-4a0b-8675-e9e6fe93bb8f
type: ON-FULFILLMENT
provider:
id: '1'
Initialize the order by providing billing details:
value:
context:
action: init
bap_id: https://example-bap.com
bap_uri: https://mock_bap.com/beckn/
bpp_id: https://kmrl-bpp.com
bpp_uri: https://kmrl-bpp.com/beckn/
domain: nic2004:60221
location:
city:
code: std:080
country:
code: IND
message_id: fde8b8b6-c2e5-49f7-b254-720843d528bd
timestamp: '2021-03-23T10:00:40.065Z'
transaction_id: 6f339232-2bc3-44d2-915c-30d2b053ce1d
version: 1.1.0
message:
order:
billing:
email: [email protected]
name: John Doe
items:
- id: '1'
provider:
id: '1'
23 changes: 23 additions & 0 deletions api/l2-config/ONDC/example-jsons/requests/rating.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Provide a rating:
value:
context:
action: rating
bap_id: example-bap.com
bap_uri: https://api.example-bap.com/pilot/bap/cab/v1
bpp_id: example-bpp.com
bpp_uri: https://api.example-bpp.com/dobpp/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f
domain: nic2004:60221
location:
city:
code: std:080
country:
code: IND
message_id: 432fdfd6-0457-47b6-9fac-80cbe5c0a75b
timestamp: '2023-03-23T04:46:45Z'
transaction_id: 870782be-6757-43f1-945c-8eeaf9536259
version: 1.1.0
message:
ratings:
- id: b0462745-f6c9-4100-bbe7-4fa3648b6b40
rating_category: DRIVER
value: 4
57 changes: 57 additions & 0 deletions api/l2-config/ONDC/example-jsons/requests/search.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
Search for services in the city of Bengaluru by pickup and drop location:
value:
context:
action: search
bap_id: example-bap.com
bap_uri: https://api.example-bap.com/pilot/bap/cab/v1
domain: nic2004:60221
location:
city:
code: std:080
country:
code: IND
message_id: 6743e9e2-4fb5-487c-92b7-13ba8018f176
timestamp: '2023-03-23T04:41:16Z'
transaction_id: 6743e9e2-4fb5-487c-92b7-13ba8018f176
version: 1.1.0
message:
intent:
fulfillment:
stops:
- location:
gps: 12.923608703179461, 77.61462964117527
type: start
- location:
gps: 12.9346302, 77.61533969999999
type: end
Search by pickup and drop location with localization info:
value:
context:
action: search
bap_id: example-bap.com
bap_uri: https://api.example-bap.com/pilot/bap/cab/v1
domain: nic2004:60221
location:
city:
code: std:080
country:
code: IND
message_id: 6743e9e2-4fb5-487c-92b7-13ba8018f176
timestamp: '2023-03-23T04:41:16Z'
transaction_id: 6743e9e2-4fb5-487c-92b7-13ba8018f176
version: 1.1.0
message:
intent:
fulfillment:
customer:
person:
languages:
- code: en
name: English
stops:
- location:
gps: 12.923608703179461, 77.61462964117527
type: start
- location:
gps: 12.9346302, 77.61533969999999
type: end
Loading