From 5547d28c628586b0185fa02e1368724cffff3a5f Mon Sep 17 00:00:00 2001 From: Shivansh Joshi <77457296+sniperzee2@users.noreply.github.com> Date: Wed, 16 Aug 2023 12:50:59 +0530 Subject: [PATCH 1/4] Car rentals --- docs/example implementation/Car Rental.md | 1552 +++++++++++++++++++++ 1 file changed, 1552 insertions(+) create mode 100644 docs/example implementation/Car Rental.md diff --git a/docs/example implementation/Car Rental.md b/docs/example implementation/Car Rental.md new file mode 100644 index 0000000..b25faf3 --- /dev/null +++ b/docs/example implementation/Car Rental.md @@ -0,0 +1,1552 @@ +## Car Rental Use Cases + +### Introduction + +Discover unmatched convenience and comfort with our premium car rental services. Choose from a diverse fleet of meticulously maintained vehicles, ensuring a safe and stylish journey. With competitive pricing, flexible options, and a commitment to customer satisfaction, we're here to make your travel experience exceptional. Book your dream car now and elevate your journey. + +### Use Cases considered + +- Car Rentals + + +### Workflow + +**Step 1: Search for various car rental services** + +- The renter searches for car rental services available in the desired location or region. + +**Step 2: Choose a Suitable Car** + +- The renter selects the type of car they need, considering factors like size, model, features, and rental rates,. + +**Step 3: Check Rental Terms and Conditions** + +- The renter reviews the rental terms, including mileage limits, fuel policy, return conditions, and any extra fees. + +**Step 4: Submit required information** + +- Renter provides personal information,chooses the rental start and end dates and times based on their travel plans,selects optional add-ons like GPS navigation, child seats, insurance coverage, etc. + +**Step 5: Get Rental Car Quotation** + +- The system calculates the total cost of the rental, including the base rate, taxes, fees, and selected add-ons adn payment link(if mode is selected as online payment). + +**Step 6: Renter Pays the amount(if online transaction)** + +- The renter provides identification documents, a valid driver's license, and payment for the remaining rental amount. + +**Step 7: Receive the Confirmation message** + +- Renter recieves the final confirmation message and details of the car laong with the details he selected. + + +```mermaid +sequenceDiagram + title Car Rentals + Renter ->> Rental Service: Submits details such as location. + Rental Service ->> Renter: Returns available cars/vehicles + Renter ->> Rental Service: Selects a car/vehicles + Rental Service ->> Renter: Requests for personal details along with final quotations. + Renter ->> Rental Service: Provides details + Rental Service ->> Renter: Sends final quotation + Rental Service ->> Renter: Requests for payment(if online transaction)/confirmation + Renter ->> Rental Service: Makes payment(if online transaction) + Rental Service ->> Renter: Car alloted and confirmation message recieved +``` + +### Example Jsons + +#### An example `search` request + +``` +{ + "context": { + "country": "IND", + "domain": "nic2004:60221", + "timestamp": "2023-03-23T04:41:16Z", + "bap_id": "example-bap.com", + "transaction_id": "6743e9e2-4fb5-487c-92b7-13ba8018f176", + "message_id": "6743e9e2-4fb5-487c-92b7-13ba8018f176", + "city": "std:080", + "core_version": "1.1.0", + "action": "search", + "bap_uri": "https://mock_bap.com/beckn/" + }, + "message": { + "intent": { + "fulfillment": { + "stops": [ + { + "location": { + "descriptor": { + "name": "pickup" + }, + "gps": "12.923608703179461, 77.61462964117527" + } + }, + { + "location": { + "descriptor": { + "name": "dropoff" + }, + "gps": "12.9346302, 77.61533969999999" + } + } + ], + "customer": { + "person": { + "tags": [ + { + "descriptor": { + "name": "Localization" + }, + "list": [ + { + "descriptor": { + "name": "Language" + }, + "value": "en" + } + ], + "display": false + } + ] + } + } + } + } + } + } + +``` + +#### An example `on_search` callback + +``` +{ + "context": { + "domain": "nic2008:49213", + "country": "IND", + "city": "std:011", + "action": "on_search", + "core_version": "1.1.0", + "bap_id": "example-bap.com", + "bap_uri": "https://mock_bap.com/beckn/", + "bpp_id": "example-bpp.com", + "bpp_uri": "https://api.car-rental-provider.com/beckn/", + "transaction_id": "6f339232-2bc3-44d2-915c-30d2b053ce1d", + "message_id": "fde8b8b6-c2e5-49f7-b254-720843d528bd", + "timestamp": "2021-03-23T10:00:40.065Z" + }, + "message": { + "catalog": { + "descriptor": { + "name": "Car Rental Provider", + "images": [ + { + "url": "https://car-rental-provider.com/logos/logo.ico" + } + ] + }, + "providers": [ + { + "id": "1", + "descriptor": { + "name": "ABC Car Rentals", + "images": [ + { + "url": "https://abccarrentals.com/logos/logo.ico" + } + ] + }, + "items": [ + { + "id": "1", + "descriptor": { + "name": "Economy Car", + "images": [ + { + "url": "https://abccarrentals.com/icons/economy.ico" + } + ] + }, + "fulfillment_ids": ["1"], + "price": { + "currency": "INR", + "value": "2000" + } + }, + { + "id": "2", + "descriptor": { + "name": "Standard Car", + "images": [ + { + "url": "https://abccarrentals.com/icons/standard.ico" + } + ] + }, + "fulfillment_ids": ["2"], + "price": { + "currency": "INR", + "value": "3000" + } + }, + { + "id": "3", + "descriptor": { + "name": "Luxury Car", + "images": [ + { + "url": "https://abccarrentals.com/icons/luxury.ico" + } + ] + }, + "fulfillment_ids": ["3"], + "price": { + "currency": "INR", + "value": "5000" + } + } + ], + "fulfillments": [ + { + "id": "1", + "stops": [ + { + "location": { + "descriptor": { + "name": "ABC Car Rentals Office" + }, + "gps": "28.5678901,77.1234567" + } + } + ], + "tags": [ + { + "list": [ + { + "descriptor": { + "name": "Duration" + }, + "value": "24 hours" + }, + { + "descriptor": { + "name": "Fuel Policy" + }, + "value": "Full to full" + } + ] + } + ] + }, + { + "id": "2", + "stops": [ + { + "location": { + "descriptor": { + "name": "ABC Car Rentals Office" + }, + "gps": "28.5678901,77.1234567" + } + } + ], + "tags": [ + { + "list": [ + { + "descriptor": { + "name": "Duration" + }, + "value": "48 hours" + }, + { + "descriptor": { + "name": "Fuel Policy" + }, + "value": "Full to full" + } + ] + } + ] + }, + { + "id": "3", + "stops": [ + { + "location": { + "descriptor": { + "name": "ABC Car Rentals Office" + }, + "gps": "28.5678901,77.1234567" + } + } + ], + "tags": [ + { + "list": [ + { + "descriptor": { + "name": "Duration" + }, + "value": "72 hours" + }, + { + "descriptor": { + "name": "Fuel Policy" + }, + "value": "Full to full" + } + ] + } + ] + } + ] + } + ] + } + } + } + +``` + +#### An example `select` request + +``` +{ + "context": { + "domain": "nic2004:60221", + "country": "IND", + "city": "std:080", + "action": "select", + "core_version": "1.1.0", + "bap_id": "example-bap.com", + "bap_uri": "https://mock_bap.com/beckn/", + "bpp_id": "example-bpp.com", + "bpp_uri": "https://api.car-rental-provider.com/beckn/", + "transaction_id": "6f339232-2bc3-44d2-915c-30d2b053ce1d", + "message_id": "fde8b8b6-c2e5-49f7-b254-720843d528bd", + "timestamp": "2021-03-23T10:00:40.065Z" + }, + "message": { + "order": { + "items": [ + { + "id": "1" + } + ], + "provider": { + "id": "1" + } + } + } + } + +``` + +#### An example `on_select` callback + +``` +{ + "context": { + "domain": "nic2008:49213", + "country": "IND", + "city": "std:011", + "action": "on_select", + "core_version": "1.1.0", + "bap_id": "example-bap.com", + "bap_uri": "https://mock_bap.com/beckn/", + "bpp_id": "example-bpp.com", + "bpp_uri": "https://api.car-rental-provider.com/beckn/", + "transaction_id": "6f339232-2bc3-44d2-915c-30d2b053ce1d", + "message_id": "fde8b8b6-c2e5-49f7-b254-720843d528bd", + "timestamp": "2021-03-23T10:00:40.065Z" + }, + "message": { + "order": { + "id": "123413", + "items": [ + { + "id": "1", + "descriptor": { + "name": "Economy Car" + }, + "fulfillment_id": "1", + "price": { + "currency": "INR", + "value": "2000" + }, + "tags": [ + { + "list": [ + { + "descriptor": { + "name": "Vehicle Category" + }, + "value": "Economy" + }, + { + "descriptor": { + "name": "Fuel Type" + }, + "value": "Petrol" + } + ] + } + ] + } + ], + "provider": { + "id": "1", + "descriptor": { + "name": "ABC Car Rentals", + "images": [ + { + "url": "https://car-rental-provider.com/logos/logo.ico" + } + ] + } + }, + "fulfillment": { + "id": "1", + "stops": [ + { + "location": { + "descriptor": { + "name": "Pick-up Location" + }, + "gps": "28.5811261, 77.0548206" + } + }, + { + "location": { + "descriptor": { + "name": "Drop-off Location" + }, + "gps": "28.6230972, 77.2099917" + } + } + ], + "vehicle": { + "category": "CAR" + }, + "tags": [ + { + "list": [ + { + "descriptor": { + "name": "Duration" + }, + "value": "24 hours" + }, + { + "descriptor": { + "name": "Fuel Included" + }, + "value": "No" + } + ] + } + ] + }, + "quote": { + "value": "2000", + "currency": "INR", + "breakup": [ + { + "title": "Base Fare", + "price": { + "value": "2000", + "currency": "INR" + } + } + ] + } + } + } + } + +``` + +#### An example `init` request + +``` +{ + "context": { + "country": "IND", + "bpp_uri": "https://api.car-rental-provider.com/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f", + "domain": "nic2004:60221", + "timestamp": "2023-03-23T04:48:53Z", + "bap_id": "example-bap.com", + "bpp_id": "example-bpp.com", + "transaction_id": "b580c989-f84d-4abe-af28-2c818aafce3b", + "message_id": "8926b747-0362-4fcc-b795-0994a6287700", + "city": "std:080", + "core_version": "1.1.0", + "action": "init", + "bap_uri": "https://mock_bap.com/beckn/" + }, + "message": { + "order": { + "provider": { + "id": "7f7896dd-787e-4a0b-8675-e9e6fe93bb8f" + }, + "items": [ + { + "id": "5777a0bf-9a08-49aa-a97d-1e5561a9622e", + "fulfillment_ids": [ + "fulf_5cf064d5-4c0a-42d3-b73d-5f19a6f7468e" + ], + "payment_ids": [ + "7f7896dd-787e-4a0b-8675-e9e6fe93bb8f" + ], + "descriptor": { + "name": "Car Rental", + "images": [ + { + "url": "https://carrental.com/icons/car-rental.ico" + } + ] + } + } + ], + "quote": { + "value": "76", + "currency": "INR", + "breakup": [ + { + "title": "Base Fare", + "price": { + "value": "30", + "currency": "INR" + } + }, + { + "title": "Per km fare", + "price": { + "value": "56", + "currency": "INR" + } + } + ] + }, + "fulfillment": { + "id": "fulf_5cf064d5-4c0a-42d3-b73d-5f19a6f7468e", + "stops": [ + { + "location": { + "descriptor": { + "name": "Pick-up Location" + }, + "gps": "13.008935, 77.6444085", + "address": { + "ward": "Uttarahalli Hobli, Ramanjaneyanagar", + "country": "India", + "building": "6th Main Rd", + "state": "Karnataka", + "city": "Bengaluru", + "locality": "Uttarahalli Hobli", + "door": "98A, Sarovarm 2nd cross", + "area_code": "560061", + "street": "Ramanjaneyanagar" + } + } + }, + { + "location": { + "descriptor": { + "name": "Drop-off Location" + }, + "gps": "12.9711869, 77.5868122", + "address": { + "ward": "Basavanagudi, Chikkanna Garden, Rangadore Memorial Hospital", + "country": "India", + "building": "Rangadore Memorial Hospital", + "state": "Karnataka", + "city": "Bengaluru", + "locality": "Basavanagudi", + "street": "Chikkanna Garden" + } + } + } + ], + "agent": { + "name": "RAGHAVENDRA J", + "rateable": true, + "rating": "5" + }, + "vehicle": { + "category": "CAR" + } + }, + "payment": { + "id": "7f7896dd-787e-4a0b-8675-e9e6fe93bb8f", + "type": "ON-FULFILLMENT", + "collected_by": "BPP" + }, + "customer": { + "person": { + "name": "John Doe", + "phone": "+91-9897867564", + "tags": [ + { + "descriptor": { + "name": "Localization" + }, + "list": [ + { + "descriptor": { + "name": "Language" + }, + "value": "en" + } + ], + "display": false + } + ] + } + } + } + } + } + +``` + +#### An example `on_init` callback + +``` +{ + "context": { + "domain": "nic2008:49213", + "country": "IND", + "city": "std:011", + "action": "on_init", + "core_version": "1.1.0", + "bap_id": "example-bap.com", + "bap_uri": "https://mock_bap.com/beckn/", + "bpp_id": "example-bpp.com", + "bpp_uri": "https://api.car-rental-provider.com/beckn/", + "transaction_id": "6f339232-2bc3-44d2-915c-30d2b053ce1d", + "message_id": "fde8b8b6-c2e5-49f7-b254-720843d528bd", + "timestamp": "2021-03-23T10:00:40.065Z" + }, + "message": { + "order": { + "items": [ + { + "id": "3", + "descriptor": { + "name": "Economy Car Rental", + "images": [ + { + "url": "https://carrental.com/icons/economy-car.ico" + } + ] + }, + "fulfillment_ids": [ + "3" + ], + "price": { + "currency": "INR", + "value": "2000" + }, + "tags": [ + { + "list": [ + { + "descriptor": { + "name": "Duration" + }, + "value": "24 hours" + } + ] + } + ] + } + ], + "provider": { + "id": "1", + "descriptor": { + "name": "ABC Car Rentals", + "images": [ + { + "url": "https://carrental.com/logos/logo.ico" + } + ] + } + }, + "fulfillment": { + "id": "3", + "stops": [ + { + "location": { + "descriptor": { + "name": "Pick-up Location" + }, + "gps": "12.923608703179461, 77.61462964117527" + }, + "time": { + "timestamp": "2021-10-15T10:00:00.000Z" + }, + "instructions": "Show this booking confirmation at the car rental desk to pick up your rental car." + }, + { + "location": { + "descriptor": { + "name": "Drop-off Location" + }, + "gps": "12.9346302, 77.61533969999999" + } + } + ], + "vehicle": { + "category": "CAR" + }, + "tags": [ + { + "list": [ + { + "descriptor": { + "name": "Duration" + }, + "value": "24 hours" + } + ] + } + ], + "documents": [ + { + "label": "Rental Agreement", + "url": "https://carrental.com/agreements/rental-agreement.html" + } + ], + "billing": { + "name": "John Doe", + "email": "john.doe@example.com" + }, + "quote": { + "price": { + "currency": "INR", + "value": "2000" + }, + "breakup": [ + { + "title": "Economy Car Rental", + "price": { + "currency": "INR", + "value": "2000" + } + } + ] + }, + "payment": { + "type": "ON-ORDER", + "uri": "https://carrental.com/payment?amt=2000&cur=INR&ref=123456789", + "tl_method": "GET", + "status": "NOT-PAID" + } + } + } + } + } + +``` + +#### An example `confirm` request + +``` +{ + "context": { + "country": "IND", + "bpp_uri": "https://api.car-rental-provider.com/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f", + "domain": "nic2004:60221", + "timestamp": "2023-03-23T04:48:53Z", + "bap_id": "example-bap.com", + "bpp_id": "example-bpp.com", + "transaction_id": "b580c989-f84d-4abe-af28-2c818aafce3b", + "message_id": "8926b747-0362-4fcc-b795-0994a6287700", + "city": "std:080", + "core_version": "1.1.0", + "action": "confirm", + "bap_uri": "https://mock_bap.com/beckn/" + }, + "message": { + "order": { + "id": "7751bd26-3fdc-47ca-9b64-e998dc5abe68", + "provider": { + "id": "e8542642-0f4a-454c-9a9f-f46110c367a3", + "descriptor": { + "name": "Raghavendra J" + } + }, + "items": [ + { + "id": "5777a0bf-9a08-49aa-a97d-1e5561a9622e", + "descriptor": { + "name": "Car Rental", + "code": "RENTAL" + }, + "tags": [ + { + "descriptor": { + "name": "Daytime Charges" + }, + "list": [ + { + "descriptor": { + "name": "Min Fare" + }, + "value": "₹ 2000" + }, + { + "descriptor": { + "name": "Rate above Min. Fare" + }, + "value": "₹ 15 / hr" + } + ], + "display": true + }, + { + "descriptor": { + "name": "Additional Charges" + }, + "list": [ + { + "descriptor": { + "name": "Driver Charges" + }, + "value": "₹ 500" + } + ], + "display": true + } + ], + "fulfillment_ids": [ + "fb5c84d4-1b59-4b9d-96b5-9d79107432c5" + ], + "payment_ids": [ + "1" + ] + } + ], + "quote": { + "value": "3000", + "currency": "INR", + "breakup": [ + { + "title": "Base Fare", + "price": { + "value": "2000", + "currency": "INR" + } + }, + { + "title": "Per hour fare", + "price": { + "value": "15", + "currency": "INR" + } + }, + { + "title": "Driver Charges", + "price": { + "value": "500", + "currency": "INR" + } + }, + { + "title": "CGST @ 5%", + "price": { + "value": "7.5", + "currency": "INR" + } + }, + { + "title": "SGST @ 5%", + "price": { + "value": "7.5", + "currency": "INR" + } + } + ] + }, + "fulfillment": { + "id": "fulf_5cf064d5-4c0a-42d3-b73d-5f19a6f7468e", + "agent": { + "name": "RAGHAVENDRA J", + "rateable": true, + "rating": "5" + }, + "vehicle": { + "category": "CAR" + }, + "customer": { + "person": { + "name": "John Doe", + "phone": "+91-9897867564", + "tags": [ + { + "descriptor": { + "name": "Localization" + }, + "list": [ + { + "descriptor": { + "name": "Language" + }, + "value": "en" + } + ], + "display": false + } + ] + } + } + }, + "payment": { + "id": "7f7896dd-787e-4a0b-8675-e9e6fe93bb8f", + "type": "ON-FULFILLMENT", + "params": { + "amount": "3000", + "currency": "INR", + "transaction_status": "NOT-PAID" + } + } + } + } + } + +``` + +#### An example `on_confirm` callback + +``` +{ + "context": { + "country": "IND", + "bpp_uri": "https://api.car-rental-provider.com/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f", + "domain": "nic2004:60221", + "timestamp": "2023-03-23T04:48:53Z", + "bap_id": "example-bap.com", + "bpp_id": "example-bpp.com", + "transaction_id": "b580c989-f84d-4abe-af28-2c818aafce3b", + "message_id": "8926b747-0362-4fcc-b795-0994a6287700", + "city": "std:080", + "core_version": "1.1.0", + "action": "on_confirm", + "bap_uri": "https://mock_bap.com/beckn/" + }, + "message": { + "order": { + "id": "7751bd26-3fdc-47ca-9b64-e998dc5abe68", + "provider": { + "id": "e8542642-0f4a-454c-9a9f-f46110c367a3", + "descriptor": { + "name": "Raghavendra J" + } + }, + "items": [ + { + "id": "5777a0bf-9a08-49aa-a97d-1e5561a9622e", + "descriptor": { + "name": "Car Rental", + "code": "RENTAL" + }, + "tags": [ + { + "descriptor": { + "name": "Daytime Charges" + }, + "list": [ + { + "descriptor": { + "name": "Min Fare" + }, + "value": "₹ 2000" + }, + { + "descriptor": { + "name": "Rate above Min. Fare" + }, + "value": "₹ 15 / hr" + } + ], + "display": true + }, + { + "descriptor": { + "name": "Additional Charges" + }, + "list": [ + { + "descriptor": { + "name": "Driver Charges" + }, + "value": "₹ 500" + } + ], + "display": true + } + ], + "fulfillment_ids": [ + "fb5c84d4-1b59-4b9d-96b5-9d79107432c5" + ], + "payment_ids": [ + "1" + ] + } + ], + "quote": { + "value": "3000", + "currency": "INR", + "breakup": [ + { + "title": "Base Fare", + "price": { + "value": "2000", + "currency": "INR" + } + }, + { + "title": "Per hour fare", + "price": { + "value": "15", + "currency": "INR" + } + }, + { + "title": "Driver Charges", + "price": { + "value": "500", + "currency": "INR" + } + }, + { + "title": "CGST @ 5%", + "price": { + "value": "7.5", + "currency": "INR" + } + }, + { + "title": "SGST @ 5%", + "price": { + "value": "7.5", + "currency": "INR" + } + } + ] + }, + "fulfillment": { + "id": "fulf_5cf064d5-4c0a-42d3-b73d-5f19a6f7468e", + "state": { + "descriptor": { + "code": "DRIVER_EN_ROUTE", + "name": "Driver is on the way" + } + }, + "stops": [ + { + "authorization": { + "type": "OTP", + "token": "234234" + }, + "location": { + "gps": "13.008935, 77.6444085", + "address": { + "ward": "Uttarahalli Hobli, Ramanjaneyanagar", + "country": "India", + "building": "6th Main Rd", + "state": "Karnataka 560061", + "city": "Bengaluru", + "locality": "Uttarahalli Hobli", + "door": "98A, Sarovarm 2nd cross", + "area_code": "560061", + "street": "Ramanjaneyanagar" + } + } + }, + { + "location": { + "gps": "12.9711869, 77.5868122", + "address": { + "ward": "Basavanagudi, Chikkanna Garden, Rangadore Memorial Hospital", + "country": "India", + "building": "Rangadore Memorial Hospital", + "state": "Karnataka", + "city": "Bengaluru", + "locality": "Basavanagudi", + "door": null, + "area_code": "", + "street": "Chikkanna Garden" + } + } + } + ], + "agent": { + "name": "RAGHAVENDRA J", + "phone": "+91-98978675645", + "rateable": true, + "rating": "5" + }, + "vehicle": { + "category": "CAR", + "registration": "KA01JG1231" + }, + "customer": { + "person": { + "name": "John Doe", + "phone": "+91-9897867564", + "tags": [ + { + "descriptor": { + "name": "Localization" + }, + "list": [ + { + "descriptor": { + "name": "Language" + }, + "value": "en" + } + ], + "display": false + } + ] + } + } + }, + "payment": { + "id": "7f7896dd-787e-4a0b-8675-e9e6fe93bb8f", + "type": "ON-FULFILLMENT", + "params": { + "amount": "3000", + "currency": "INR", + "transaction_status": "NOT-PAID" + } + } + } + } + } + +``` + +#### POST FULFILLMENT(`status`) + +``` +{ + "context": { + "country": "IND", + "bpp_uri": "https://api.car-rental-provider.com/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f", + "domain": "nic2004:60221", + "timestamp": "2023-03-23T04:48:53Z", + "bap_id": "example-bap.com", + "bpp_id": "example-bpp.com", + "transaction_id": "b580c989-f84d-4abe-af28-2c818aafce3b", + "message_id": "8926b747-0362-4fcc-b795-0994a6287700", + "city": "std:080", + "core_version": "1.1.0", + "action": "status", + "bap_uri": "https://mock_bap.com/beckn/" + }, + "message": { + "order_id": "7751bd26-3fdc-47ca-9b64-e998dc5abe68" + } + } +``` + +#### An example `on_status` rental started + +``` +{ + "context": { + "country": "IND", + "bpp_uri": "https://api.car-rental-provider.com/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f", + "domain": "nic2004:60221", + "timestamp": "2023-03-23T04:48:53Z", + "bap_id": "example-bap.com", + "bpp_id": "example-bpp.com", + "transaction_id": "b580c989-f84d-4abe-af28-2c818aafce3b", + "message_id": "8926b747-0362-4fcc-b795-0994a6287700", + "city": "std:080", + "core_version": "1.1.0", + "action": "on_status", + "bap_uri": "https://mock_bap.com/beckn/" + }, + "message": { + "order": { + "id": "7751bd26-3fdc-47ca-9b64-e998dc5abe68", + "provider": { + "id": "e8542642-0f4a-454c-9a9f-f46110c367a3", + "descriptor": { + "name": "Raghavendra J" + } + }, + "items": [ + { + "id": "5777a0bf-9a08-49aa-a97d-1e5561a9622e", + "descriptor": { + "name": "Car Rental", + "code": "RENTAL" + }, + "tags": [ + { + "descriptor": { + "name": "Daytime Charges" + }, + "list": [ + { + "descriptor": { + "name": "Min Fare" + }, + "value": "₹ 2000" + }, + { + "descriptor": { + "name": "Rate above Min. Fare" + }, + "value": "₹ 15 / hour" + } + ], + "display": true + }, + { + "descriptor": { + "name": "Additional Charges" + }, + "list": [ + { + "descriptor": { + "name": "Driver Charges" + }, + "value": "₹ 500" + } + ], + "display": true + } + ], + "fulfillment_ids": [ + "fb5c84d4-1b59-4b9d-96b5-9d79107432c5" + ], + "payment_ids": [ + "1" + ] + } + ], + "quote": { + "value": "3000", + "currency": "INR", + "breakup": [ + { + "title": "Base Fare", + "price": { + "value": "2000", + "currency": "INR" + } + }, + { + "title": "Per hour fare", + "price": { + "value": "15", + "currency": "INR" + } + }, + { + "title": "Driver Charges", + "price": { + "value": "500", + "currency": "INR" + } + }, + { + "title": "CGST @ 5%", + "price": { + "value": "7.5", + "currency": "INR" + } + }, + { + "title": "SGST @ 5%", + "price": { + "value": "7.5", + "currency": "INR" + } + } + ] + }, + "fulfillment": { + "id": "fulf_5cf064d5-4c0a-42d3-b73d-5f19a6f7468e", + "state": { + "descriptor": { + "code": "RENTAL_STARTED", + "name": "Your car rental has started" + } + }, + "stops": [ + { + "authorization": { + "type": "OTP", + "token": "234234" + }, + "location": { + "gps": "13.008935, 77.6444085", + "address": { + "ward": "Uttarahalli Hobli, Ramanjaneyanagar", + "country": "India", + "building": "6th Main Rd", + "state": "Karnataka 560061", + "city": "Bengaluru", + "locality": "Uttarahalli Hobli", + "door": "98A, Sarovarm 2nd cross", + "area_code": "560061", + "street": "Ramanjaneyanagar" + } + } + } + ], + "agent": { + "name": "RAGHAVENDRA J", + "phone": "+91-98978675645", + "rateable": true, + "rating": "5" + }, + "vehicle": { + "category": "CAR", + "registration": "KA01JG1231" + }, + "customer": { + "person": { + "name": "John Doe", + "phone": "+91-9897867564", + "tags": [ + { + "descriptor": { + "name": "Localization" + }, + "list": [ + { + "descriptor": { + "name": "Language" + }, + "value": "en" + } + ], + "display": false + } + ] + } + } + }, + "payment": { + "id": "7f7896dd-787e-4a0b-8675-e9e6fe93bb8f", + "type": "ON-FULFILLMENT", + "params": { + "amount": "3000", + "currency": "INR", + "transaction_status": "NOT-PAID" + } + } + } + } + } + +``` + +#### An Example `on_status` car rental ended + +``` +{ + "context": { + "country": "IND", + "bpp_uri": "https://api.example-bpp.com/dobpp/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f", + "domain": "nic2004:60221", + "timestamp": "2023-03-23T04:48:53Z", + "bap_id": "example-bap.com", + "bpp_id": "example-bpp.com", + "transaction_id": "b580c989-f84d-4abe-af28-2c818aafce3b", + "message_id": "8926b747-0362-4fcc-b795-0994a6287700", + "city": "std:080", + "core_version": "1.1.0", + "action": "on_status", + "bap_uri": "https://api.example-bap.com/pilot/bap/cab/v1" + }, + "message": { + "order": { + "id": "7751bd26-3fdc-47ca-9b64-e998dc5abe68", + "provider": { + "id": "e8542642-0f4a-454c-9a9f-f46110c367a3", + "descriptor": { + "name": "Raghavendra J" + } + }, + "items": [ + { + "id": "5777a0bf-9a08-49aa-a97d-1e5561a9622e", + "descriptor": { + "name": "Car Rental", + "code": "RENTAL" + }, + "tags": [ + { + "descriptor": { + "name": "Daytime Charges" + }, + "list": [ + { + "descriptor": { + "name": "Min Fare" + }, + "value": "₹ 2000" + }, + { + "descriptor": { + "name": "Rate above Min. Fare" + }, + "value": "₹ 15 / hour" + } + ], + "display": true + }, + { + "descriptor": { + "name": "Additional Charges" + }, + "list": [ + { + "descriptor": { + "name": "Driver Charges" + }, + "value": "₹ 500" + } + ], + "display": true + } + ], + "fulfillment_ids": [ + "fb5c84d4-1b59-4b9d-96b5-9d79107432c5" + ], + "payment_ids": [ + "1" + ] + } + ], + "quote": { + "value": "3000", + "currency": "INR", + "breakup": [ + { + "title": "Base Fare", + "price": { + "value": "2000", + "currency": "INR" + } + }, + { + "title": "Per hour fare", + "price": { + "value": "15", + "currency": "INR" + } + }, + { + "title": "Driver Charges", + "price": { + "value": "500", + "currency": "INR" + } + }, + { + "title": "CGST @ 5%", + "price": { + "value": "7.5", + "currency": "INR" + } + }, + { + "title": "SGST @ 5%", + "price": { + "value": "7.5", + "currency": "INR" + } + } + ] + }, + "fulfillment": { + "id": "fulf_5cf064d5-4c0a-42d3-b73d-5f19a6f7468e", + "state": { + "descriptor": { + "code": "RENTAL_ENDED", + "name": "Your car rental has ended" + } + }, + "stops": [ + { + "authorization": { + "type": "OTP", + "token": "234234" + }, + "location": { + "gps": "13.008935, 77.6444085", + "address": { + "ward": "Uttarahalli Hobli, Ramanjaneyanagar", + "country": "India", + "building": "6th Main Rd", + "state": "Karnataka 560061", + "city": "Bengaluru", + "locality": "Uttarahalli Hobli", + "door": "98A, Sarovarm 2nd cross", + "area_code": "560061", + "street": "Ramanjaneyanagar" + } + } + } + ], + "agent": { + "name": "RAGHAVENDRA J", + "phone": "+91-98978675645", + "rateable": true, + "rating": "5" + }, + "vehicle": { + "category": "CAR", + "registration": "KA01JG1231" + }, + "customer": { + "person": { + "name": "John Doe", + "phone": "+91-9897867564", + "tags": [ + { + "descriptor": { + "name": "Localization" + }, + "list": [ + { + "descriptor": { + "name": "Language" + }, + "value": "en" + } + ], + "display": false + } + ] + } + } + }, + "payment": { + "id": "7f7896dd-787e-4a0b-8675-e9e6fe93bb8f", + "type": "ON-FULFILLMENT", + "params": { + "amount": "3000", + "currency": "INR", + "transaction_status": "NOT-PAID" + } + } + } + } + } +``` \ No newline at end of file From 79be2a7fe4ae436456684ec31b26926341a12c71 Mon Sep 17 00:00:00 2001 From: Shivansh Joshi <77457296+sniperzee2@users.noreply.github.com> Date: Sun, 20 Aug 2023 10:16:57 +0530 Subject: [PATCH 2/4] Parking usecase --- docs/example implementation/Parking.md | 892 +++++++++++++++++++++++++ 1 file changed, 892 insertions(+) create mode 100644 docs/example implementation/Parking.md diff --git a/docs/example implementation/Parking.md b/docs/example implementation/Parking.md new file mode 100644 index 0000000..1593d60 --- /dev/null +++ b/docs/example implementation/Parking.md @@ -0,0 +1,892 @@ +## Parking Use Cases + +### Introduction + +Parking is a service that offers individuals a designated area to safely and temporarily store their vehicles when they are not in use. It is an essential component of urban infrastructure, accommodating the transportation needs of people in densely populated areas. Parking facilities can vary widely in terms of size, location, features, and services offered. + +Parking facilities can be found in various locations, including commercial areas, residential neighborhoods, entertainment venues, airports, and public transportation hubs. They play a crucial role in addressing the challenges of limited space and managing traffic congestion in urban environments. + +### Use Cases considered + +- Parking + + +### Workflow + +#### Booking A Parking Slot (Search and Order) + +**Step 1: Search for Parking Facilities** + +- Buyer searches for available parking facilities near their current location using the BECKN search request. +- The request includes the buyer's location and preferences (e.g., covered parking, proximity to destination). + +**Step 2: Receive Parking Options** + +- BECKN responds with a list of available parking facilities along with their details, such as location, availability status, and pricing. + +**Step 3: Check Parking Terms and conditions** + +- The buyer reviews the parking terms and plans. + +**Step 4: Select a Parking Facility** + +- Buyer selects a parking facility based on their preferences and receives a parking token (unique identifier). + +**Step 5: Submit required information** + +- Buyer provides personal information,chooses the parking slot, the time duration and option like open parking or closed including the location of the parking. + +**Step 6: Get Quotations** + +- The system calculates the total cost of the parking slot, including the base rate, taxes, fees, and selected add-ons and payment link(if mode is selected as online payment) + +**Step 7: Make Final Payment(if online payment)** + +- The buyer provides payment through the payment link recieved from the parking service. + +**Step 8: Get Parking ticket** + +- Buyer recieves the final confirmation message and details of the parking slot along with payment status. + +```mermaid +sequenceDiagram + title Search Parking + participant Buyer + participant BG + participant Parking Service + Buyer->>BG: Submits details such as location + BG->>Parking Service: Searching for parking slots + Parking Service ->> BG :Returns available parking slots + BG->>Parking Service 2: Searching for parking slots + Parking Service 2 ->> BG :Returns available parking slots + BG->>Buyer: Compiled list of parking slots +``` + +```mermaid +sequenceDiagram + title Parking after Search + Buyer ->> Parking Service: Selects a car/vehicles + Parking Service ->> Buyer: Requests for personal details along with final quotations. + Buyer ->> Parking Service: Provides details + Parking Service ->> Buyer: Sends final quotation + Parking Service ->> Buyer: Requests for payment(if online transaction)/confirmation + Buyer ->> Parking Service: Makes payment(if online transaction) + Parking Service ->> Buyer: Car alloted and confirmation message recieved +``` + +#### After Booking(Fullfillment) + + +**Step 1: Arrive at the Parking Facility** + +- Vehicle owner arrives at the parking facility. +- They approach the entrance of the parking lot. + +**Step 2: Ticket Validation** + +- The parking system validates the parking ticket and the slot alloted to the car. + +**Step 3: Finding the allocated parking slot** + +- The parking slot booked and mentioned on the ticket is found by the buyer and parking is done. + +**Step 4: Status occupied** + +- Status becomes occupied for the parking slot associated for the ticket. + +```mermaid + sequenceDiagram + title Parking status + Buyer ->> Parking Service: Submits ticket at entry + Parking Service ->> Buyer: Returns status of parking slot and ticket validated + Buyer ->> Parking Service: Occupies the parking + Parking Service ->> Buyer: Parking status becomes occupied +``` + +#### POST FULFILLMENT + +**Step 1: Exit the Parking Facility** + +- The vehicle owner returns to their parked vehicle. +- They drive towards the exit gate. + +**Step 2: Insert Ticket and Exit** + +- At the exit gate, the vehicle owner inserts the validated parking ticket. +- The system raises the gate, allowing the vehicle to exit. +- If the payment was not made using online transaction then the payment is made. +- Also if time limit is exceeded then the additional charges are posted. + +**Step 3: Retrieve Ticket (If Applicable)** + +- Some parking facilities require the validated ticket to be inserted again at the exit. +- The ticket might be retained by the system or returned to the vehicle owner. + +**Step 4: Exit** + +- The vehicle owner exits the parking facility. +- The parking process is complete. + + +### Example Jsons + +#### An example `search` request + +``` +{ + "context": { + "country": "IND", + "bpp_uri": "https://api.example-bpp.com/intercity/beckn/search", + "domain": "nic2004:60221", + "timestamp": "2023-07-13T12:00:00Z", + "bap_id": "example-bap.com", + "bpp_id": "example-bpp.com", + "transaction_id": "e1f94247-76a3-48c9-8f04-7c95d4b5e1b1", + "message_id": "4b38c01a-4a59-4f11-b44a-2303cc50f789", + "city": "std:011", + "core_version": "1.1.0", + "action": "search", + "bap_uri": "https://api.example-bap.com/pilot/bap/intercity/v1" + }, + "message": { + "query": { + "start": { + "location": { + "gps": "28.6139, 77.2090" + }, + "time": { + "timestamp": "2023-07-15T08:00:00Z" + } + } + } + } + } + +``` + +#### An example `on_search` callback + +``` +{ + "context": { + "country": "IND", + "bpp_uri": "https://api.example-bpp.in/path/to/url", + "domain": "nic2004:60221", + "timestamp": "2023-03-23T04:43:02Z", + "bap_id": "example-bap.in", + "transaction_id": "870782be-6757-43f1-945c-8eeaf9536259", + "bpp_id": "example-bpp.in", + "message_id": "21e54d3c-9c3b-47c1-aa3b-b0e7b20818ee", + "city": "std:080", + "core_version": "1.1.0", + "action": "on_search", + "bap_uri": "https://api.example-bpp.in/path/to/url" + }, + "message": { + "catalog": { + "descriptor": { + "name": "Parking Spaces", + "images": [ + { + "url": "https://example-bpp.com/images/logos/parking.ico" + } + ] + }, + "providers": [ + { + "descriptor": { + "name": "City Parking", + "images": [ + { + "url": "https://example-bpp.com/images/logos/city_parking.ico" + } + ] + }, + "items": [ + { + "id": "1", + "descriptor": { + "name": "Hourly Parking" + }, + "price": { + "value": "50", + "currency": "INR" + }, + "fulfillment_ids": [ + "1" + ], + "payment_ids": [ + "1" + ] + }, + { + "id": "2", + "descriptor": { + "name": "Daily Parking" + }, + "price": { + "value": "300", + "currency": "INR" + }, + "fulfillment_ids": [ + "2" + ], + "payment_ids": [ + "1" + ] + }, + { + "id": "3", + "descriptor": { + "name": "Monthly Parking" + }, + "price": { + "value": "2000", + "currency": "INR" + }, + "fulfillment_ids": [ + "3" + ], + "payment_ids": [ + "1" + ] + } + ], + "fulfillments": [ + { + "id": "1", + "stops": [ + { + "location": { + "descriptor": { + "name": "Parking Lot 1" + }, + "gps": "12.9099828, 77.6118226" + } + } + ], + "vehicle": { + "category": "PARKING_SPACE" + } + }, + { + "id": "2", + "stops": [ + { + "location": { + "descriptor": { + "name": "Parking Lot 2" + }, + "gps": "12.9351856, 77.6245996" + } + } + ], + "vehicle": { + "category": "PARKING_SPACE" + } + }, + { + "id": "3", + "stops": [ + { + "location": { + "descriptor": { + "name": "Parking Lot 3" + }, + "gps": "12.9201354, 77.6086488" + } + } + ], + "vehicle": { + "category": "PARKING_SPACE" + } + } + ], + "payments": [ + { + "id": "1", + "type": "ON-FULFILLMENT", + "collected_by": "BPP" + } + ] + }, + { + "descriptor": { + "name": "Secure Parking", + "images": [ + { + "url": "https://example-bpp.com/images/logos/secure_parking.ico" + } + ] + }, + "items": [ + { + "id": "1", + "descriptor": { + "name": "Standard Parking" + }, + "price": { + "value": "40", + "currency": "INR" + }, + "fulfillment_ids": [ + "4" + ], + "payment_ids": [ + "1" + ] + }, + { + "id": "2", + "descriptor": { + "name": "Premium Parking" + }, + "price": { + "value": "80", + "currency": "INR" + }, + "fulfillment_ids": [ + "5" + ], + "payment_ids": [ + "1" + ] + } + ], + "fulfillments": [ + { + "id": "4", + "stops": [ + { + "location": { + "descriptor": { + "name": "Parking Lot 4" + }, + "gps": "12.9015373, 77.5872352" + } + } + ], + "vehicle": { + "category": "PARKING_SPACE" + } + }, + { + "id": "5", + "stops": [ + { + "location": { + "descriptor": { + "name": "Parking Lot 5" + }, + "gps": "12.9037888, 77.5917664" + } + } + ], + "vehicle": { + "category": "PARKING_SPACE" + } + } + ], + "payments": [ + { + "id": "1", + "type": "ON-FULFILLMENT", + "collected_by": "BPP" + } + ] + } + ] + } + } + } + +``` + +#### An example `select` request + +``` +{ + "context": { + "country": "IND", + "bpp_uri": "https://api.example-bpp.in/path/to/url", + "domain": "nic2004:60221", + "timestamp": "2023-07-13T10:15:00Z", + "bap_id": "example-bap.in", + "bpp_id": "example-bpp.in", + "transaction_id": "a1b2c3d4e5f6", + "message_id": "abcdef123456", + "city": "std:080", + "core_version": "1.1.0", + "action": "select", + "bap_uri": "https://api.example-bap.in/path/to/url" + }, + "message": { + "order": { + "id": "a1b2c3d4e5f6", + "provider": { + "id": "c1d2e3f4g5h6", + "descriptor": { + "name": "City Parking" + } + }, + "items": [ + { + "id": "1", + "descriptor": { + "name": "Hourly Parking" + }, + "price": { + "value": "50", + "currency": "INR" + }, + "fulfillment_ids": ["1"], + "payment_ids": ["1"] + }, + { + "id": "2", + "descriptor": { + "name": "Daily Parking" + }, + "price": { + "value": "150", + "currency": "INR" + }, + "fulfillment_ids": ["2"], + "payment_ids": ["1"] + }, + { + "id": "3", + "descriptor": { + "name": "Monthly Parking" + }, + "price": { + "value": "2000", + "currency": "INR" + }, + "fulfillment_ids": ["3"], + "payment_ids": ["1"] + } + ], + "fulfillment": { + "id": "1", + "stops": [ + { + "location": { + "descriptor": { + "name": "Parking Lot 1" + }, + "gps": "12.9099828, 77.6118226" + } + } + ] + } + } + } + } + +``` + +#### An example `on_select` callback + +``` +{ + "context": { + "country": "IND", + "bpp_uri": "https://api.example-bpp.in/path/to/url", + "domain": "nic2004:60221", + "timestamp": "2023-07-13T10:30:00Z", + "bap_id": "example-bap.in", + "bpp_id": "example-bpp.in", + "transaction_id": "a1b2c3d4e5f6", + "message_id": "abcdef123456", + "city": "std:080", + "core_version": "1.1.0", + "action": "on_select", + "bap_uri": "https://api.example-bap.in/path/to/url" + }, + "message": { + "order": { + "id": "a1b2c3d4e5f6", + "provider": { + "id": "c1d2e3f4g5h6", + "descriptor": { + "name": "City Parking" + } + }, + "items": [ + { + "id": "1", + "descriptor": { + "name": "Hourly Parking" + }, + "price": { + "value": "50", + "currency": "INR" + }, + "fulfillment_ids": ["1"], + "payment_ids": ["1"] + }, + { + "id": "2", + "descriptor": { + "name": "Daily Parking" + }, + "price": { + "value": "150", + "currency": "INR" + }, + "fulfillment_ids": ["2"], + "payment_ids": ["1"] + }, + { + "id": "3", + "descriptor": { + "name": "Monthly Parking" + }, + "price": { + "value": "2000", + "currency": "INR" + }, + "fulfillment_ids": ["3"], + "payment_ids": ["1"] + } + ], + "fulfillment": { + "id": "1", + "stops": [ + { + "location": { + "descriptor": { + "name": "Parking Lot 1" + }, + "gps": "12.9099828, 77.6118226" + } + } + ], + "vehicle": { + "category": "SUV" + } + } + } + } + } + +``` + +#### An example `init` callback + +``` +{ + "context": { + "country": "IND", + "bpp_uri": "https://api.example-bpp.in/path/to/url", + "domain": "nic2004:60221", + "timestamp": "2023-07-13T10:00:00Z", + "bap_id": "example-bap.in", + "bpp_id": "example-bpp.in", + "transaction_id": "abcdef123456", + "message_id": "a1b2c3d4e5f6", + "city": "std:080", + "core_version": "1.1.0", + "action": "init", + "bap_uri": "https://api.example-bap.in/path/to/url" + }, + "message": { + "order": { + "items": [ + { + "id": "1" + } + ], + "provider": { + "id": "1" + }, + "billing": { + "name": "John Doe", + "email": "john.doe@example.com" + } + } + } + } + +``` + +#### An example `0n_init` request + +``` +{ + "context": { + "domain": "nic2008:49213", + "country": "IND", + "city": "std:011", + "action": "on_init", + "core_version": "1.1.0", + "bap_id": "example-bap.com", + "bap_uri": "https://api.example-bap.in/path/to/url", + "bpp_id": "example-bpp.com", + "bpp_uri": "https://api.example-bpp.in/path/to/url", + "transaction_id": "6f339232-2bc3-44d2-915c-30d2b053ce1d", + "message_id": "fde8b8b6-c2e5-49f7-b254-720843d528bd", + "timestamp": "2021-03-23T10:00:40.065Z" + }, + "message": { + "order": { + "items": [ + { + "id": "2", + "descriptor": { + "name": "Daily Parking", + "images": [ + { + "url": "https://example-bpp.com/images/parking_daily.ico" + } + ] + }, + "fulfillment_ids": [ + "2" + ], + "price": { + "currency": "INR", + "value": "150" + }, + "tags": [ + { + "list": [ + { + "descriptor": { + "name": "Duration" + }, + "value": "24 hours" + }, + { + "descriptor": { + "name": "Location" + }, + "value": "XYZ Parking Lot, ABC Street" + } + ] + } + ] + } + ], + "provider": { + "id": "1", + "descriptor": { + "name": "City Parking", + "images": [ + { + "url": "https://example-bpp.com/images/logos/city_parking.ico" + } + ] + } + } + } + } + } + +``` + +#### An example `confirm` request + +``` +{ + "context": { + "domain": "nic2008:49213", + "country": "IND", + "city": "std:011", + "action": "confirm", + "core_version": "1.1.0", + "bap_id": "example-bap.com", + "bap_uri": "https://api.example-bap.in/path/to/url", + "bpp_id": "example-bpp.com", + "bpp_uri": "https://api.example-bpp.in/path/to/url", + "transaction_id": "6f339232-2bc3-44d2-915c-30d2b053ce1d", + "message_id": "fde8b8b6-c2e5-49f7-b254-720843d528bd", + "timestamp": "2021-03-23T10:00:40.065Z" + }, + "message": { + "order": { + "id": "7751bd26-3fdc-47ca-9b64-e998dc5abe68", + "provider": { + "id": "1", + "descriptor": { + "name": "City Parking", + "images": [ + { + "url": "https://example-bpp.com/images/logos/city_parking.ico" + } + ] + } + }, + "items": [ + { + "id": "2", + "descriptor": { + "name": "Daily Parking", + "images": [ + { + "url": "https://parking-solutions.com/icons/daily_parking.ico" + } + ] + }, + "fulfillment_ids": ["2"], + "price": { + "currency": "INR", + "value": "150" + }, + "tags": [ + { + "list": [ + { + "descriptor": { + "name": "Duration" + }, + "value": "24 hours" + }, + { + "descriptor": { + "name": "Location" + }, + "value": "ABC Parking Lot, XYZ Street" + } + ] + } + ] + } + ], + "billing": { + "name": "John Doe", + "email": "john.doe@example.com" + }, + "payment": { + "id": "7f7896dd-787e-4a0b-8675-e9e6fe93bb8f", + "type": "ON-FULFILLMENT", + "params": { + "amount": "150", + "currency": "INR", + "transaction_status": "NOT-PAID" + } + } + } + } + } + +``` + +#### An example `on_confirm` callback + +``` +{ + "context": { + "domain": "nic2008:49213", + "country": "IND", + "city": "std:011", + "action": "on_confirm", + "core_version": "1.1.0", + "bap_id": "example-bap.com", + "bap_uri": "https://api.example-bap.in/path/to/url", + "bpp_id": "example-bpp.com", + "bpp_uri": "https://api.example-bpp.in/path/to/url", + "transaction_id": "6f339232-2bc3-44d2-915c-30d2b053ce1d", + "message_id": "fde8b8b6-c2e5-49f7-b254-720843d528bd", + "timestamp": "2021-03-23T10:00:40.065Z" + }, + "message": { + "order": { + "id": "7751bd26-3fdc-47ca-9b64-e998dc5abe68", + "provider": { + "id": "1", + "descriptor": { + "name": "City Parking", + "images": [ + { + "url": "https://example-bpp.com/images/logos/city_parking.ico" + } + ] + } + }, + "items": [ + { + "id": "2", + "descriptor": { + "name": "Daily Parking", + "images": [ + { + "url": "https://parking-solutions.com/icons/daily_parking.ico" + } + ] + }, + "fulfillment_ids": ["2"], + "price": { + "currency": "INR", + "value": "150" + }, + "tags": [ + { + "list": [ + { + "descriptor": { + "name": "Duration" + }, + "value": "24 hours" + }, + { + "descriptor": { + "name": "Location" + }, + "value": "ABC Parking Lot, XYZ Street" + } + ] + } + ] + } + ], + "quote": { + "price": { + "currency": "INR", + "value": "150" + }, + "breakup": [ + { + "title": "Parking Charges", + "price": { + "currency": "INR", + "value": "150" + } + } + ] + }, + "fulfillment": { + "id": "2", + "location": { + "descriptor": { + "name": "ABC Parking Lot, XYZ Street" + }, + "gps": "12.9099828, 77.6118226" + }, + "vehicle": { + "category": "CAR" + }, + "time": { + "timestamp": "2021-10-15T00:32:19.000Z" + }, + "instructions": "Show this confirmation at the parking entrance for hassle-free entry." + }, + "billing": { + "name": "John Doe", + "email": "john.doe@example.com" + }, + "payment": { + "id": "7f7896dd-787e-4a0b-8675-e9e6fe93bb8f", + "type": "ON-FULFILLMENT", + "params": { + "amount": "150", + "currency": "INR", + "transaction_status": "NOT-PAID" + } + } + } + } + } + +``` From ee674baa62f7020383984d055e96ab85c9dad2b0 Mon Sep 17 00:00:00 2001 From: Shivansh Joshi <77457296+sniperzee2@users.noreply.github.com> Date: Wed, 23 Aug 2023 12:03:52 +0530 Subject: [PATCH 3/4] Intercity guide --- docs/example implementation/Intercity.md | 1222 ++++++++++++++++++++++ 1 file changed, 1222 insertions(+) create mode 100644 docs/example implementation/Intercity.md diff --git a/docs/example implementation/Intercity.md b/docs/example implementation/Intercity.md new file mode 100644 index 0000000..5c1c143 --- /dev/null +++ b/docs/example implementation/Intercity.md @@ -0,0 +1,1222 @@ +## Parking Use Cases + +### Introduction + +Parking is a service that offers individuals a designated area to safely and temporarily store their vehicles when they are not in use. It is an essential component of urban infrastructure, accommodating the transportation needs of people in densely populated areas. Parking facilities can vary widely in terms of size, location, features, and services offered. + +Parking facilities can be found in various locations, including commercial areas, residential neighborhoods, entertainment venues, airports, and public transportation hubs. They play a crucial role in addressing the challenges of limited space and managing traffic congestion in urban environments. + +### Use Cases considered + +- Parking + + +### Workflow + +#### Booking A Parking Slot (Search and Order) + +**Step 1: Search for Intercity Travel Options** + +- The buyer initiates a search for intercity travel options by sending a search message to the BPP (Beckn Partner Platform). +- The message includes the location and other relevant details for the starting and ending points of the journey. + +**Step 2: Receive Result with Travel Options** + +- The BPP processes the search request and responds with a result message containing a catalog of available intercity travel options. +- Each option includes details about the vehicle, its capacity, luggage capacity, provider information, schedule, and price. +**Step 3: Select a Travel Option** + +- The buyer reviews the provided travel options and selects a preferred option based on their preferences, budget, and other requirements. +- The selected option's unique ID is noted for further processing. +**Step 4: Initialize the Booking** + +- The buyer sends an init message to the BPP, indicating their intention to book the selected intercity travel option. +- The message includes the unique ID of the selected option, buyer's details, and any other required information. +**Step 5: Receive Booking Confirmation** + +- The BPP processes the initialization request and responds with an init confirmation message, confirming the booking and providing further details. +- The message includes the booking ID, provider information, vehicle details, schedule, and payment instructions. +**Step 6: Confirm the Booking** + +- The buyer reviews the provided booking details and confirms the booking by sending a confirm message to the BPP. +- The confirmation indicates the buyer's commitment to proceed with the booked intercity travel option. +**Step 7: Receive Confirmation Acknowledgment** + +- The BPP processes the confirmation and responds with a confirmation acknowledgment message. +- The message confirms that the booking has been successfully acknowledged and processed. +**Step 8: Receive Status Updates** + +- Throughout the journey, the BPP and the provider may send status updates to keep the buyer informed about the progress of the booked intercity travel. +- Updates may include information about the vehicle's location, estimated time of arrival, and other relevant details. +**Step 9: Complete the Journey** + +- The buyer travels as per the booked intercity travel option's schedule and details. + +```mermaid +sequenceDiagram + sequenceDiagram + title Search Ride + participant Rider + participant BG + participant Ride Service + Rider->>BG: Submits details such as start and end location + BG->>Ride Service: Searching for intercity services + Ride Service ->> BG :Returns available intercity services + BG->>Ride Service 2: Searching for intercity vehicles + Ride Service 2 ->> BG :Returns available intercity vehicles + BG->>Rider: Compiled list of intercity vehicles +``` + +```mermaid +sequenceDiagram + title Parking after Search + Rider ->> Ride Service: Selects a car/vehicles + Ride Service ->> Rider: Requests for personal details along with final quotations. + Rider ->> Ride Service: Provides details + Ride Service ->> Rider: Sends final quotation + Ride Service ->> Rider: Requests for payment(if online transaction)/confirmation + Rider ->> Ride Service: Makes payment(if online transaction)/Confirm booking + Ride Service ->> Rider: Car alloted and confirmation message recieved +``` + +#### POST FULFILLMENT + +**Step 1: Payment(if post-fulfilment)** + +- After completing the journey, the BPP may send a post-fulfillment message with payment instructions to the buyer. +- The buyer follows the payment instructions to settle the payment for the provided service. + +**Step 2: Status update** + +- The ride would be shown completed and the vehicle would be available again in search. + +**Step 3: Feedback(optional)** + +- Additionally, the buyer may provide feedback or rate the service using the BECKN protocol's feedback mechanisms. + + +### Example Jsons + +#### An example `search` request + +``` +{ + "context": { + "country": "IND", + "bpp_uri": "https://api.example-bpp.com/intercity/beckn/search", + "domain": "nic2004:60221", + "timestamp": "2023-07-13T12:00:00Z", + "bap_id": "example-bap.com", + "bpp_id": "example-bpp.com", + "transaction_id": "e1f94247-76a3-48c9-8f04-7c95d4b5e1b1", + "message_id": "4b38c01a-4a59-4f11-b44a-2303cc50f789", + "city": "std:011", + "core_version": "1.1.0", + "action": "search", + "bap_uri": "https://api.example-bap.com/pilot/bap/intercity/v1" + }, + "message": { + "query": { + "start": { + "location": { + "gps": "28.6139, 77.2090" + }, + "time": { + "timestamp": "2023-07-15T08:00:00Z" + } + }, + "end": { + "location": { + "gps": "19.0760, 72.8777" + } + }, + "vehicle": { + "category": "CAR", + "seats": 4 + } + } + } + } + +``` + +#### An example `on_search` callback + +``` +{ + "context": { + "country": "IND", + "bpp_uri": "https://api.example-bpp.com/intercity/beckn/search", + "domain": "nic2004:60221", + "timestamp": "2023-07-13T12:05:30Z", + "bap_id": "example-bap.com", + "bpp_id": "example-bpp.com", + "transaction_id": "e1f94247-76a3-48c9-8f04-7c95d4b5e1b1", + "message_id": "5f7a964b-2450-4e5e-b399-0d9b947c821b", + "city": "std:011", + "core_version": "1.1.0", + "action": "on_search", + "bap_uri": "https://api.example-bap.com/pilot/bap/intercity/v1" + }, + "message": { + "catalog": { + "descriptor": { + "name": "Inter-City Transportation Services", + "images": [ + { + "url": "https://example-bpp.com/images/logos/intercity.ico" + } + ] + }, + "providers": [ + { + "provider": { + "id": "56789", + "descriptor": { + "name": "XYZ Intercity Transport Service" + } + }, + "items": [ + { + "id": "vehicle_1", + "category": "CAR", + "seats": 4, + "features": [ + { + "name": "Air Conditioning", + "description": "Comfortable AC cars for your journey." + }, + { + "name": "English-Speaking Driver", + "description": "Drivers fluent in English for better communication." + } + ], + "price": { + "value": "25000", + "currency": "INR" + } + }, + { + "id": "vehicle_2", + "category": "SUV", + "seats": 6, + "features": [ + { + "name": "Spacious", + "description": "Roomy SUVs with ample space for luggage." + } + ], + "price": { + "value": "32000", + "currency": "INR" + } + } + ], + "pickup": { + "location": { + "gps": "28.6139, 77.2090", + "address": { + "area": "Connaught Place", + "city": "New Delhi", + "state": "Delhi", + "country": "India", + "zip_code": "110001" + } + }, + "time": { + "timestamp": "2023-07-15T08:00:00Z" + } + }, + "dropoff": { + "location": { + "gps": "19.0760, 72.8777", + "address": { + "area": "Colaba", + "city": "Mumbai", + "state": "Maharashtra", + "country": "India", + "zip_code": "400005" + } + } + } + }, + { + "id": "2", + "descriptor": { + "name": "Comfort Rides", + "images": [ + { + "url": "https://example-bpp.com/images/logos/comfortrides.ico" + } + ] + }, + "items": [ + { + "id": "vehicle_3", + "category": "SUV", + "seats": 6, + "features": [ + { + "name": "Wi-Fi", + "description": "Stay connected with complimentary Wi-Fi on-board." + }, + { + "name": "Refreshments", + "description": "Enjoy complimentary refreshments during the journey." + } + ], + "price": { + "value": "35000", + "currency": "INR" + } + } + ], + "pickup": { + "location": { + "gps": "28.6139, 77.2090", + "address": { + "area": "Connaught Place", + "city": "New Delhi", + "state": "Delhi", + "country": "India", + "zip_code": "110001" + } + }, + "time": { + "timestamp": "2023-07-15T08:00:00Z" + } + }, + "dropoff": { + "location": { + "gps": "19.0760, 72.8777", + "address": { + "area": "Colaba", + "city": "Mumbai", + "state": "Maharashtra", + "country": "India", + "zip_code": "400005" + } + } + } + } + ] + } + } + } + +``` + +#### An example `select` request + +``` +{ + "context": { + "country": "IND", + "bpp_uri": "https://api.example-bpp.com/intercity/beckn/select", + "domain": "nic2004:60221", + "timestamp": "2023-07-13T12:30:00Z", + "bap_id": "example-bap.com", + "bpp_id": "example-bpp.com", + "transaction_id": "e1f94247-76a3-48c9-8f04-7c95d4b5e1b1", + "message_id": "e6213d27-cb36-4212-8c03-aae967f7ed9f", + "city": "std:011", + "core_version": "1.1.0", + "action": "select", + "bap_uri": "https://api.example-bap.com/pilot/bap/intercity/v1" + }, + "message": { + "order": { + "id": "78ad0f0f-5411-4d3c-827d-94f4978e73be", + "provider": { + "id": "56789", + "descriptor": { + "name": "XYZ Intercity Transport Service" + } + }, + "items": [ + { + "id": "vehicle_1", + "descriptor": { + "name": "FastRide CAR" + }, + "price": { + "value": "25000", + "currency": "INR" + } + } + ], + "pickup": { + "location": { + "gps": "28.6139, 77.2090", + "address": { + "area": "Connaught Place", + "city": "New Delhi", + "state": "Delhi", + "country": "India", + "zip_code": "110001" + } + }, + "time": { + "timestamp": "2023-07-15T08:00:00Z" + } + }, + "dropoff": { + "location": { + "gps": "19.0760, 72.8777", + "address": { + "area": "Colaba", + "city": "Mumbai", + "state": "Maharashtra", + "country": "India", + "zip_code": "400005" + } + } + } + } + } + } + +``` + +#### An example `on_select` callback + +``` +{ + "context": { + "country": "IND", + "bpp_uri": "https://api.example-bpp.com/intercity/beckn/on_select", + "domain": "nic2004:60221", + "timestamp": "2023-07-13T12:35:00Z", + "bap_id": "example-bap.com", + "bpp_id": "example-bpp.com", + "transaction_id": "e1f94247-76a3-48c9-8f04-7c95d4b5e1b1", + "message_id": "4ad17e92-15e1-4d17-9911-5a983c34a6ec", + "city": "std:011", + "core_version": "1.1.0", + "action": "on_select", + "bap_uri": "https://api.example-bap.com/pilot/bap/intercity/v1" + }, + "message": { + "order": { + "id": "78ad0f0f-5411-4d3c-827d-94f4978e73be", + "provider": { + "id": "56789", + "descriptor": { + "name": "XYZ Intercity Transport Service" + } + }, + "items": [ + { + "id": "vehicle_1", + "descriptor": { + "name": "FastRide CAR" + }, + "price": { + "value": "25000", + "currency": "INR" + } + } + ], + "pickup": { + "location": { + "gps": "28.6139, 77.2090", + "address": { + "area": "Connaught Place", + "city": "New Delhi", + "state": "Delhi", + "country": "India", + "zip_code": "110001" + } + }, + "time": { + "timestamp": "2023-07-15T08:00:00Z" + } + }, + "dropoff": { + "location": { + "gps": "19.0760, 72.8777", + "address": { + "area": "Colaba", + "city": "Mumbai", + "state": "Maharashtra", + "country": "India", + "zip_code": "400005" + } + } + }, + "fulfillment": { + "id": "fb5c84d4-1b59-4b9d-96b5-9d79107432c5", + "end": { + "time": { + "timestamp": "2023-07-15T18:00:00Z" + } + } + }, + "quote": { + "price": { + "currency": "INR", + "value": "25000" + } + } + } + } + } + +``` + +#### An example `init` callback + +``` +{ + "context": { + "country": "IND", + "bpp_uri": "https://api.example-bpp.com/intercity/beckn/on_search", + "domain": "nic2004:60221", + "timestamp": "2023-07-13T10:30:00Z", + "bap_id": "example-bap.com", + "bpp_id": "example-bpp.com", + "transaction_id": "f4352982-9c82-4b06-a7f9-8ed44c1ae6e1", + "message_id": "1257d42f-1208-40d2-837f-1ef3c7d4173f", + "city": "std:011", + "core_version": "1.1.0", + "action": "on_init", + "bap_uri": "https://api.example-bap.com/pilot/bap/intercity/v1" + }, + "message": { + "description": "Intercity Transportation Request", + "items": [ + { + "id": "vehicle_1", + "descriptor": { + "name": "FastRide CAR" + }, + "price": { + "value": "25000", + "currency": "INR" + } + } + ], + "provider": { + "id": "56789", + "descriptor": { + "name": "XYZ Intercity Transport Service" + } + }, + "customer": { + "person": { + "name": "John Doe", + "phone": "+91-9897867564", + "email": "john.doe@example.com" + } + }, + "category": "TRANSPORT", + "fulfillment": { + "start": { + "location": { + "gps": "28.6139, 77.2090", + "address": { + "area": "Connaught Place", + "city": "New Delhi", + "state": "Delhi", + "country": "India", + "zip_code": "110001" + } + }, + "time": { + "timestamp": "2023-07-15T08:00:00Z" + } + }, + "end": { + "location": { + "gps": "19.0760, 72.8777", + "address": { + "area": "Colaba", + "city": "Mumbai", + "state": "Maharashtra", + "country": "India", + "zip_code": "400005" + } + } + } + }, + "quote": { + "value": "25000", + "currency": "INR", + "breakup": [ + { + "title": "Base Fare", + "price": { + "value": "20000", + "currency": "INR" + } + }, + { + "title": "Driver overnight charges", + "price": { + "value": "500", + "currency": "INR" + } + } + ] + }, + "payment": { + "type": "POST-FULFILLMENT", + "status": "NOT-PAID", + "params": { + "amount": "25000", + "currency": "INR" + }, + "time": { + "duration": "P1D" + } + } + } + } + +``` + +#### An example `on_init` request + +``` +{ + "context": { + "country": "IND", + "bpp_uri": "https://api.example-bpp.com/intercity/beckn/on_search", + "domain": "nic2004:60221", + "timestamp": "2023-07-13T10:30:00Z", + "bap_id": "example-bap.com", + "bpp_id": "example-bpp.com", + "transaction_id": "f4352982-9c82-4b06-a7f9-8ed44c1ae6e1", + "message_id": "1257d42f-1208-40d2-837f-1ef3c7d4173f", + "city": "std:011", + "core_version": "1.1.0", + "action": "on_init", + "bap_uri": "https://api.example-bap.com/pilot/bap/intercity/v1" + }, + "message": { + "description": "Intercity Transportation Request", + "items": [ + { + "id": "vehicle_1", + "descriptor": { + "name": "FastRide CAR" + }, + "price": { + "value": "25000", + "currency": "INR" + } + } + ], + "provider": { + "id": "56789", + "descriptor": { + "name": "XYZ Intercity Transport Service" + } + }, + "customer": { + "person": { + "name": "John Doe", + "phone": "+91-9897867564", + "email": "john.doe@example.com" + } + }, + "category": "TRANSPORT", + "fulfillment": { + "start": { + "location": { + "gps": "28.6139, 77.2090", + "address": { + "area": "Connaught Place", + "city": "New Delhi", + "state": "Delhi", + "country": "India", + "zip_code": "110001" + } + }, + "time": { + "timestamp": "2023-07-15T08:00:00Z" + } + }, + "end": { + "location": { + "gps": "19.0760, 72.8777", + "address": { + "area": "Colaba", + "city": "Mumbai", + "state": "Maharashtra", + "country": "India", + "zip_code": "400005" + } + } + } + }, + "quote": { + "value": "25000", + "currency": "INR", + "breakup": [ + { + "title": "Base Fare", + "price": { + "value": "20000", + "currency": "INR" + } + }, + { + "title": "Driver overnight charges", + "price": { + "value": "500", + "currency": "INR" + } + } + ] + }, + "payment": { + "type": "POST-FULFILLMENT", + "status": "NOT-PAID", + "params": { + "amount": "25000", + "currency": "INR" + }, + "time": { + "duration": "P1D" + } + } + } + } + +``` + +#### An example `confirm` request + +``` +{ + "context": { + "country": "IND", + "bpp_uri": "https://api.example-bpp.com/intercity/beckn/on_search", + "domain": "nic2004:60221", + "timestamp": "2023-07-13T10:30:00Z", + "bap_id": "example-bap.com", + "bpp_id": "example-bpp.com", + "transaction_id": "f4352982-9c82-4b06-a7f9-8ed44c1ae6e1", + "message_id": "1257d42f-1208-40d2-837f-1ef3c7d4173f", + "city": "std:011", + "core_version": "1.1.0", + "action": "confirm", + "bap_uri": "https://api.example-bap.com/pilot/bap/intercity/v1" + }, + "message": { + "description": "Intercity Transportation Request Confirmation", + "order": { + "id": "12345", + "provider": { + "id": "56789", + "descriptor": { + "name": "XYZ Intercity Transport Service" + } + }, + "items": [ + { + "id": "vehicle_1", + "descriptor": { + "name": "FastRide CAR" + }, + "price": { + "value": "25000", + "currency": "INR" + } + } + ], + "fulfillment": { + "id": "54321", + "start": { + "location": { + "gps": "28.6139, 77.2090", + "address": { + "area": "Connaught Place", + "city": "New Delhi", + "state": "Delhi", + "country": "India", + "zip_code": "110001" + } + }, + "time": { + "timestamp": "2023-07-15T08:00:00Z" + } + }, + "end": { + "location": { + "gps": "19.0760, 72.8777", + "address": { + "area": "Colaba", + "city": "Mumbai", + "state": "Maharashtra", + "country": "India", + "zip_code": "400005" + } + } + } + }, + "billing": { + "name": "John Doe", + "email": "john.doe@example.com", + "phone": "+91-9897867564" + }, + "quote": { + "price": { + "currency": "INR", + "value": "25000" + } + }, + "payment": { + "type": "POST-FULFILLMENT", + "status": "NOT-PAID", + "params": { + "amount": "25000", + "currency": "INR" + }, + "time": { + "duration": "P1D" + } + } + } + } + } + +``` + +#### An example `on_confirm` callback + +``` +{ + "context": { + "country": "IND", + "bpp_uri": "https://api.example-bpp.com/intercity/beckn/on_search", + "domain": "nic2004:60221", + "timestamp": "2023-07-13T10:30:00Z", + "bap_id": "example-bap.com", + "bpp_id": "example-bpp.com", + "transaction_id": "f4352982-9c82-4b06-a7f9-8ed44c1ae6e1", + "message_id": "1257d42f-1208-40d2-837f-1ef3c7d4173f", + "city": "std:011", + "core_version": "1.1.0", + "action": "on_confirm", + "bap_uri": "https://api.example-bap.com/pilot/bap/intercity/v1" + }, + "message": { + "order": { + "id": "12345", + "provider": { + "id": "56789", + "descriptor": { + "name": "XYZ Intercity Transport Service" + } + }, + "items": [ + { + "id": "vehicle_1", + "descriptor": { + "name": "FastRide CAR" + }, + "price": { + "value": "25000", + "currency": "INR" + } + } + ], + "fulfillment": { + "id": "54321", + "start": { + "location": { + "gps": "28.6139, 77.2090", + "address": { + "area": "Connaught Place", + "city": "New Delhi", + "state": "Delhi", + "country": "India", + "zip_code": "110001" + } + }, + "time": { + "timestamp": "2023-07-15T08:00:00Z" + } + }, + "end": { + "location": { + "gps": "19.0760, 72.8777", + "address": { + "area": "Colaba", + "city": "Mumbai", + "state": "Maharashtra", + "country": "India", + "zip_code": "400005" + } + } + } + }, + "billing": { + "name": "John Doe", + "email": "john.doe@example.com", + "phone": "+91-9897867564" + }, + "quote": { + "price": { + "currency": "INR", + "value": "25000" + } + }, + "payment": { + "type": "POST-FULFILLMENT", + "status": "NOT-PAID", + "params": { + "amount": "25000", + "currency": "INR" + }, + "time": { + "duration": "P1D" + } + } + } + } + } + +``` + +#### STATUS UPDATES + +#### An example `status` request +``` +{ + "context": { + "country": "IND", + "bpp_uri": "https://api.car-rental-provider.com/beckn/7f7896dd-787e-4a0b-8675-e9e6fe93bb8f", + "domain": "nic2004:60221", + "timestamp": "2023-03-23T04:48:53Z", + "bap_id": "example-bap.com", + "bpp_id": "example-bpp.com", + "transaction_id": "b580c989-f84d-4abe-af28-2c818aafce3b", + "message_id": "8926b747-0362-4fcc-b795-0994a6287700", + "city": "std:080", + "core_version": "1.1.0", + "action": "status", + "bap_uri": "https://mock_bap.com/beckn/" + }, + "message": { + "order_id": "7751bd26-3fdc-47ca-9b64-e998dc5abe68" + } + } +``` + +#### An example `on_status` callback + +- Case Ride started + +``` +{ + "context": { + "country": "IND", + "bpp_uri": "https://api.example-bpp.com/intercity/beckn/on_search", + "domain": "nic2004:60221", + "timestamp": "2023-07-13T10:35:00Z", + "bap_id": "example-bap.com", + "bpp_id": "example-bpp.com", + "transaction_id": "f4352982-9c82-4b06-a7f9-8ed44c1ae6e1", + "message_id": "1257d42f-1208-40d2-837f-1ef3c7d4173f", + "city": "std:011", + "core_version": "1.1.0", + "action": "on_status", + "bap_uri": "https://api.example-bap.com/pilot/bap/intercity/v1" + }, + "message": { + "description": "Intercity Transportation Ride Status", + "order": { + "id": "12345", + "provider": { + "id": "56789", + "descriptor": { + "name": "XYZ Intercity Transport Service" + } + }, + "items": [ + { + "id": "vehicle_1", + "descriptor": { + "name": "FastRide CAR" + }, + "price": { + "value": "25000", + "currency": "INR" + } + } + ], + "fulfillment": { + "id": "fulf_5cf064d5-4c0a-42d3-b73d-5f19a6f7468e", + "state": { + "descriptor": { + "code": "INTERCITY_STARTED", + "name": "Your intercity ride has started." + } + }, + "stops": [ + { + "authorization": { + "type": "OTP", + "token": "234234" + }, + "location": { + "gps": "28.6139, 77.2090", + "address": { + "area": "Connaught Place", + "city": "New Delhi", + "state": "Delhi", + "country": "India", + "zip_code": "110001" + } + } + }, + { + "location": { + "gps": "19.0760, 72.8777", + "address": { + "area": "Colaba", + "city": "Mumbai", + "state": "Maharashtra", + "country": "India", + "zip_code": "400005" + } + } + } + ], + "agent": { + "name": "John Smith", + "phone": "+9876543210", + "rateable": true, + "rating": "5" + }, + "vehicle": { + "category": "CAR", + "registration": "KA01JG1231" + }, + "customer": { + "person": { + "name": "John Doe", + "phone": "+91-9897867564", + "tags": [ + { + "descriptor": { + "name": "Localization" + }, + "list": [ + { + "descriptor": { + "name": "Language" + }, + "value": "en" + } + ], + "display": false + } + ] + } + } + }, + "quote": { + "price": { + "currency": "INR", + "value": "25000" + } + }, + "payment": { + "type": "POST-FULFILLMENT", + "status": "NOT-PAID", + "params": { + "amount": "25000", + "currency": "INR" + }, + "time": { + "duration": "P1D" + } + } + }, + "customer": { + "person": { + "name": "John Doe", + "email": "john.doe@example.com", + "phone": "+91-9897867564", + "tags": [ + { + "descriptor": { + "name": "Localization" + }, + "list": [ + { + "descriptor": { + "name": "Language" + }, + "value": "en" + } + ], + "display": false + } + ] + } + } + } + } +``` + +- Case Ride ended + +``` +{ + "context": { + "country": "IND", + "bpp_uri": "https://api.example-bpp.com/intercity/beckn/on_search", + "domain": "nic2004:60221", + "timestamp": "2023-07-13T10:35:00Z", + "bap_id": "example-bap.com", + "bpp_id": "example-bpp.com", + "transaction_id": "f4352982-9c82-4b06-a7f9-8ed44c1ae6e1", + "message_id": "1257d42f-1208-40d2-837f-1ef3c7d4173f", + "city": "std:011", + "core_version": "1.1.0", + "action": "on_status", + "bap_uri": "https://api.example-bap.com/pilot/bap/intercity/v1" + }, + "message": { + "description": "Intercity Transportation Ride Status", + "order": { + "id": "12345", + "provider": { + "id": "56789", + "descriptor": { + "name": "XYZ Intercity Transport Service" + } + }, + "items": [ + { + "id": "vehicle_1", + "descriptor": { + "name": "FastRide CAR" + }, + "price": { + "value": "25000", + "currency": "INR" + } + } + ], + "fulfillment": { + "id": "fulf_5cf064d5-4c0a-42d3-b73d-5f19a6f7468e", + "state": { + "descriptor": { + "code": "INTERCITY_ENDED", + "name": "Your intercity ride has ended." + } + }, + "stops": [ + { + "authorization": { + "type": "OTP", + "token": "234234" + }, + "location": { + "gps": "28.6139, 77.2090", + "address": { + "area": "Connaught Place", + "city": "New Delhi", + "state": "Delhi", + "country": "India", + "zip_code": "110001" + } + } + }, + { + "location": { + "gps": "19.0760, 72.8777", + "address": { + "area": "Colaba", + "city": "Mumbai", + "state": "Maharashtra", + "country": "India", + "zip_code": "400005" + } + } + } + ], + "agent": { + "name": "John Smith", + "phone": "+9876543210", + "rateable": true, + "rating": "5" + }, + "vehicle": { + "category": "CAR", + "registration": "KA01JG1231" + }, + "customer": { + "person": { + "name": "John Doe", + "phone": "+91-9897867564", + "tags": [ + { + "descriptor": { + "name": "Localization" + }, + "list": [ + { + "descriptor": { + "name": "Language" + }, + "value": "en" + } + ], + "display": false + } + ] + } + } + }, + "quote": { + "price": { + "currency": "INR", + "value": "25000" + } + }, + "payment": { + "type": "POST-FULFILLMENT", + "status": "NOT-PAID", + "params": { + "amount": "25000", + "currency": "INR" + }, + "time": { + "duration": "P1D" + } + } + }, + "customer": { + "person": { + "name": "John Doe", + "email": "john.doe@example.com", + "phone": "+91-9897867564", + "tags": [ + { + "descriptor": { + "name": "Localization" + }, + "list": [ + { + "descriptor": { + "name": "Language" + }, + "value": "en" + } + ], + "display": false + } + ] + } + } + } + } + +``` \ No newline at end of file From af21f9ac513fb79bef8922234bcc4056f85bbfa2 Mon Sep 17 00:00:00 2001 From: Shivansh Joshi <77457296+sniperzee2@users.noreply.github.com> Date: Wed, 23 Aug 2023 12:11:15 +0530 Subject: [PATCH 4/4] Fixed description --- docs/example implementation/Intercity.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/example implementation/Intercity.md b/docs/example implementation/Intercity.md index 5c1c143..f78e9ba 100644 --- a/docs/example implementation/Intercity.md +++ b/docs/example implementation/Intercity.md @@ -1,14 +1,14 @@ -## Parking Use Cases +## Intercity Use Cases ### Introduction -Parking is a service that offers individuals a designated area to safely and temporarily store their vehicles when they are not in use. It is an essential component of urban infrastructure, accommodating the transportation needs of people in densely populated areas. Parking facilities can vary widely in terms of size, location, features, and services offered. +Intercity travel refers to the movement of individuals or groups between cities, typically over longer distances. It involves journeying from one urban center to another, often across regions or states. Intercity travel serves various purposes, such as business trips, vacations, family visits, or any other travel needs that require crossing city or regional boundaries. Here's a comprehensive description of intercity travel: -Parking facilities can be found in various locations, including commercial areas, residential neighborhoods, entertainment venues, airports, and public transportation hubs. They play a crucial role in addressing the challenges of limited space and managing traffic congestion in urban environments. +Intercity travel forms an integral part of modern life, connecting distant places and facilitating mobility across geographical locations. It encompasses various modes of transportation, including buses, trains, airplanes, and private vehicles. This type of travel is characterized by its longer distances compared to intra-city commuting and often requires specialized services to cater to travelers' needs during extended journeys. ### Use Cases considered -- Parking +- Intercity Cabs ### Workflow