Darshan03's picture
docs: finalize production-grade documentation and technical comments across core files
0bbc2af
Raw History Blame Contribute Delete
26 kB
"""
Mock E-Commerce Database — OpenEnv CSA
=====================================
This file acts as the 'Source of Truth' for the environment. It contains
simulated records for Users, Orders, Payments, and Logistics.
The 53KB of data provided here ensures that the agent encounters realistic
scenarios (e.g. missing orders, failed payments, and specific delivery locations).
"""
# Consolidated Global Databases
USERS_DB = {
"u5": {
"user_id": "u5",
"name": "Priya Sharma",
"phone": "+91-9876543210",
"email": "priya.sharma@example.com",
"address": "Andheri West, Mumbai, Maharashtra 400053",
"prime_member": True,
"language_preference": "English"
},
"u6": {
"user_id": "u6",
"name": "Rahul Verma",
"phone": "+91-9123456789",
"email": "rahul.v@example.com",
"address": "Indiranagar, Bangalore, Karnataka 560038",
"prime_member": False,
"language_preference": "English"
},
"u7": {
"user_id": "u7",
"name": "Sneha Iyer",
"phone": "+91-9988112233",
"email": "sneha.iyer@example.com",
"address": "T Nagar, Chennai, Tamil Nadu 600017",
"prime_member": True,
"language_preference": "English"
},
"u8": {
"user_id": "u8",
"name": "Amit Patel",
"phone": "+91-9877665544",
"email": "apatel88@example.com",
"address": "Navrangpura, Ahmedabad, Gujarat 380009",
"prime_member": False,
"language_preference": "English"
},
"u9": {
"user_id": "u9",
"name": "Vikram Singh",
"phone": "+91-9888777666",
"email": "vikram.s@example.com",
"address": "Bandra Kurla Complex, Mumbai, Maharashtra 400051",
"prime_member": True,
"language_preference": "English"
},
"u10": {
"user_id": "u10",
"name": "Anita Desai",
"phone": "+91-9777666555",
"email": "anita.desai@example.com",
"address": "Koregaon Park, Pune, Maharashtra 411001",
"prime_member": False,
"language_preference": "English"
},
"u11": {
"user_id": "u11",
"name": "Rohan Kapoor",
"phone": "+91-9666555444",
"email": "rohan.k@example.com",
"address": "Vasant Kunj, New Delhi, Delhi 110070",
"prime_member": True,
"language_preference": "English"
},
"u12": {
"user_id": "u12",
"name": "Meera Reddy",
"phone": "+91-9555444333",
"email": "meera.reddy@example.com",
"address": "Banjara Hills, Hyderabad, Telangana 500034",
"prime_member": False,
"language_preference": "English"
},
"u13": {
"user_id": "u13",
"name": "Kabir Khan",
"phone": "+91-9811223344",
"email": "kabir.k@example.com",
"address": "DLF Phase 3, Gurgaon, Haryana 122002",
"prime_member": True,
"language_preference": "English"
},
"u14": {
"user_id": "u14",
"name": "Sofia Rossi",
"phone": "+91-9722334455",
"email": "s.rossi@example.com",
"address": "Colaba, Mumbai, Maharashtra 400005",
"prime_member": False,
"language_preference": "English"
},
"u15": {
"user_id": "u15",
"name": "Neha Gupta",
"phone": "+91-9633445566",
"email": "neha.g@example.com",
"address": "Salt Lake City, Kolkata, West Bengal 700091",
"prime_member": True,
"language_preference": "English"
},
"u16": {
"user_id": "u16",
"name": "Tariq Ali",
"phone": "+91-9544556677",
"email": "tariq.ali@example.com",
"address": "Gomti Nagar, Lucknow, UP 226010",
"prime_member": True,
"language_preference": "English"
},
"u17": {
"user_id": "u17",
"name": "Aarav Menon",
"phone": "+91-9455667788",
"email": "aarav.m@example.com",
"address": "Kochi, Kerala 682001",
"prime_member": False,
"language_preference": "English"
},
"u18": {
"user_id": "u18",
"name": "Zara Sheikh",
"phone": "+91-9366778899",
"email": "zara.s@example.com",
"address": "Sector 17, Chandigarh 160017",
"prime_member": True,
"language_preference": "English"
},
"u19": {
"user_id": "u19",
"name": "Arjun Desai",
"phone": "+91-9811112222",
"email": "arjun.d@example.com",
"address": "Cyber City, Phase 2, Gurgaon, Haryana 122002",
"prime_member": True,
"language_preference": "English"
},
"u20": {
"user_id": "u20",
"name": "Fatima Saeed",
"phone": "+91-9722223333",
"email": "fatima.s@example.com",
"address": "Jubilee Hills, Hyderabad, Telangana 500033",
"prime_member": False,
"language_preference": "English"
},
"u21": {
"user_id": "u21",
"name": "Chris Evans",
"phone": "+91-9633334444",
"email": "chris.expat@example.com",
"address": "Whitefield, Bangalore, Karnataka 560066",
"prime_member": True,
"language_preference": "English"
},
"u22": {
"user_id": "u22",
"name": "Pooja Hegde",
"phone": "+91-9544445555",
"email": "pooja.h@example.com",
"address": "Juhu, Mumbai, Maharashtra 400049",
"prime_member": True,
"language_preference": "English"
},
"u23": {
"user_id": "u23",
"name": "Rajesh Kumar",
"phone": "+91-9455556666",
"email": "rajesh.k@example.com",
"address": "Connaught Place, New Delhi, Delhi 110001",
"prime_member": False,
"language_preference": "English"
},
"u24": {
"user_id": "u24",
"name": "Simran Kaur",
"phone": "+91-9366667777",
"email": "simran.k@example.com",
"address": "Model Town, Ludhiana, Punjab 141002",
"prime_member": True,
"language_preference": "English"
},
"u1": {
"user_id": "u1",
"name": "Darshan Sharma",
"phone": "+91-9876543210",
"email": "darshan.sharma@gmail.com",
"address": "Flat 302, Green View Apartments, HSR Layout, Bengaluru, Karnataka 560102",
"prime_member": True,
"language_preference": "English"
},
"u2": {
"user_id": "u2",
"name": "Priya Patel",
"phone": "+91-8765432109",
"email": "priya.p@yahoo.in",
"address": "House No 45, Sector 15, Near Metro Station, Noida, UP 201301",
"prime_member": False,
"language_preference": "Hindi"
},
"u3": {
"user_id": "u3",
"name": "Rahul Verma",
"phone": "+91-7654321098",
"email": "rahul.verma@outlook.com",
"address": "B-Wing, Seawoods Estate, Navi Mumbai, Maharashtra 400706",
"prime_member": True,
"language_preference": "English"
}
}
ORDERS_DB = {
"ORD-505": {
"order_id": "ORD-505",
"user_id": "u5",
"status": "shipped",
"items": [
{
"item_id": "p5",
"name": "Dyson V12 Vacuum",
"price": 44900
}
],
"delivery_date": "2026-04-12",
"payment_id": "txn-05"
},
"ORD-606": {
"order_id": "ORD-606",
"user_id": "u6",
"status": "delivered",
"items": [
{
"item_id": "p6",
"name": "Samsung Galaxy S24 Ultra",
"price": 129999
}
],
"delivery_date": "2026-04-05",
"payment_id": "txn-06"
},
"ORD-707": {
"order_id": "ORD-707",
"user_id": "u7",
"status": "shipped",
"items": [
{
"item_id": "p7",
"name": "Apple iPad Pro 11-inch",
"price": 81900
}
],
"delivery_date": "2026-04-15",
"payment_id": "txn-07"
},
"ORD-808": {
"order_id": "ORD-808",
"user_id": "u8",
"status": "cancelled",
"items": [
{
"item_id": "p8",
"name": "Nike Air Force 1",
"price": 7495
}
],
"delivery_date": "2026-04-08",
"payment_id": "txn-08"
},
"ORD-909": {
"order_id": "ORD-909",
"user_id": "u9",
"status": "shipped",
"items": [
{
"item_id": "p9",
"name": "Apple MacBook Air M3",
"price": 114900
}
],
"delivery_date": "2026-03-01",
"payment_id": "txn-09"
},
"ORD-1010": {
"order_id": "ORD-1010",
"user_id": "u10",
"status": "delivered",
"items": [
{
"item_id": "p10a",
"name": "Nespresso Coffee Machine",
"price": 15500
},
{
"item_id": "p10b",
"name": "Arabica Coffee Pods (Pack of 50)",
"price": 3000
}
],
"delivery_date": "2026-04-09",
"payment_id": "txn-10"
},
"ORD-1111": {
"order_id": "ORD-1111",
"user_id": "u11",
"status": "shipped",
"items": [
{
"item_id": "p11",
"name": "PlayStation 5 Console",
"price": 49990
}
],
"delivery_date": "2026-04-14",
"payment_id": "txn-11"
},
"ORD-1212": {
"order_id": "ORD-1212",
"user_id": "u12",
"status": "cancelled",
"items": [
{
"item_id": "p12",
"name": "Lululemon Yoga Mat",
"price": 5500
}
],
"delivery_date": "2026-04-01",
"payment_id": "txn-12"
},
"ORD-1313": {
"order_id": "ORD-1313",
"user_id": "u13",
"status": "delivered",
"items": [
{
"item_id": "p13",
"name": "Bose SoundLink Revolve+",
"price": 24900
}
],
"delivery_date": "2026-04-09",
"payment_id": "txn-13"
},
"ORD-1414": {
"order_id": "ORD-1414",
"user_id": "u14",
"status": "cancelled",
"items": [
{
"item_id": "p14",
"name": "Ray-Ban Aviator Sunglasses",
"price": 8500
}
],
"delivery_date": "2026-04-18",
"payment_id": "txn-14"
},
"ORD-1515": {
"order_id": "ORD-1515",
"user_id": "u15",
"status": "delivered",
"items": [
{
"item_id": "p15a",
"name": "MAC Ruby Woo Lipstick",
"price": 1950
},
{
"item_id": "p15b",
"name": "Estee Lauder Foundation",
"price": 4300
}
],
"delivery_date": "2026-04-08",
"payment_id": "txn-15"
},
"ORD-1616": {
"order_id": "ORD-1616",
"user_id": "u16",
"status": "shipped",
"items": [
{
"item_id": "p16",
"name": "GoPro HERO 12 Black",
"price": 38990
}
],
"delivery_date": "2026-04-12",
"payment_id": "txn-16"
},
"ORD-1717": {
"order_id": "ORD-1717",
"user_id": "u17",
"status": "delivered",
"items": [
{
"item_id": "p17",
"name": "Garmin Forerunner 265",
"price": 44990
}
],
"delivery_date": "2026-04-05",
"payment_id": "txn-17"
},
"ORD-1818": {
"order_id": "ORD-1818",
"user_id": "u18",
"status": "shipped",
"items": [
{
"item_id": "p18",
"name": "Kindle Paperwhite 16GB",
"price": 13999
}
],
"delivery_date": "2026-04-15",
"payment_id": "txn-18"
},
"ORD-1919": {
"order_id": "ORD-1919",
"user_id": "u19",
"status": "shipped",
"items": [
{
"item_id": "p19",
"name": "Dell UltraSharp 27 Monitor",
"price": 32000
}
],
"delivery_date": "2026-04-12",
"payment_id": "txn-19"
},
"ORD-2020": {
"order_id": "ORD-2020",
"user_id": "u20",
"status": "delivered",
"items": [
{
"item_id": "p20",
"name": "Michael Kors Handbag",
"price": 18500
}
],
"delivery_date": "2026-04-06",
"payment_id": "txn-20"
},
"ORD-2121": {
"order_id": "ORD-2121",
"user_id": "u21",
"status": "cancelled",
"items": [
{
"item_id": "p21",
"name": "LG OLED 65-inch TV",
"price": 150000
}
],
"delivery_date": "2026-04-01",
"payment_id": "txn-21"
},
"ORD-2222": {
"order_id": "ORD-2222",
"user_id": "u22",
"status": "delivered",
"items": [
{
"item_id": "p22",
"name": "iPhone 15 Pro Max 512GB",
"price": 159900
}
],
"delivery_date": "2026-04-10",
"payment_id": "txn-22"
},
"ORD-2323": {
"order_id": "ORD-2323",
"user_id": "u23",
"status": "shipped",
"items": [
{
"item_id": "p23",
"name": "LEGO Star Wars Millennium Falcon",
"price": 7500
}
],
"delivery_date": "2026-04-14",
"payment_id": "txn-23"
},
"ORD-2424": {
"order_id": "ORD-2424",
"user_id": "u24",
"status": "delivered",
"items": [
{
"item_id": "p24a",
"name": "Amul Taza Milk 1L",
"price": 70
},
{
"item_id": "p24b",
"name": "Whole Wheat Bread",
"price": 50
},
{
"item_id": "p24c",
"name": "Organic Avocados (Pack of 2)",
"price": 450
}
],
"delivery_date": "2026-04-10",
"payment_id": "txn-24"
},
"ORD-101": {
"order_id": "ORD-101",
"user_id": "u1",
"status": "shipped",
"items": [
{
"item_id": "p1",
"name": "Boat Rockerz 450",
"price": 1499
}
],
"delivery_date": "2026-04-02",
"payment_id": "txn-01"
},
"ORD-202": {
"order_id": "ORD-202",
"user_id": "u2",
"status": "delivered",
"items": [
{
"item_id": "p2",
"name": "Milton Thermosteel Flask",
"price": 899
}
],
"delivery_date": "2026-03-29",
"payment_id": "txn-02"
},
"ORD-303": {
"order_id": "ORD-303",
"user_id": "u3",
"status": "cancelled",
"items": [
{
"item_id": "p3",
"name": "Puma Running Shoes",
"price": 2499
}
],
"delivery_date": None,
"payment_id": "txn-03"
}
}
PAYMENTS_DB = {
"txn-05": {
"transaction_id": "txn-05",
"status": "success",
"method": "UPI",
"amount": 44900,
"refunded": False
},
"txn-06": {
"transaction_id": "txn-06",
"status": "success",
"method": "CreditCard_HDFC",
"amount": 129999,
"refunded": False
},
"txn-07": {
"transaction_id": "txn-07",
"status": "success",
"method": "DebitCard_SBI",
"amount": 81900,
"refunded": False
},
"txn-08": {
"transaction_id": "txn-08",
"status": "success",
"method": "CreditCard_Axis",
"amount": 7495,
"refunded": False
},
"txn-09": {
"transaction_id": "txn-09",
"status": "success",
"method": "CreditCard_SBI",
"amount": 114900,
"refunded": False
},
"txn-10": {
"transaction_id": "txn-10",
"status": "success",
"method": "UPI",
"amount": 18500,
"refunded": False
},
"txn-11": {
"transaction_id": "txn-11",
"status": "success",
"method": "DebitCard_HDFC",
"amount": 49990,
"refunded": False
},
"txn-12": {
"transaction_id": "txn-12",
"status": "success",
"method": "CreditCard_Amex",
"amount": 5500,
"refunded": False
},
"txn-13": {
"transaction_id": "txn-13",
"status": "success",
"method": "CreditCard_ICICI",
"amount": 24900,
"refunded": False
},
"txn-14": {
"transaction_id": "txn-14",
"status": "failed",
"method": "DebitCard_HDFC",
"amount": 8500,
"refunded": False
},
"txn-15": {
"transaction_id": "txn-15",
"status": "success",
"method": "UPI",
"amount": 6250,
"refunded": False
},
"txn-16": {
"transaction_id": "txn-16",
"status": "success",
"method": "CreditCard_SBI",
"amount": 38990,
"refunded": False
},
"txn-17": {
"transaction_id": "txn-17",
"status": "success",
"method": "UPI",
"amount": 44990,
"refunded": False
},
"txn-18": {
"transaction_id": "txn-18",
"status": "success",
"method": "CreditCard_Axis",
"amount": 13999,
"refunded": False
},
"txn-19": {
"transaction_id": "txn-19",
"status": "success",
"method": "CreditCard_HDFC",
"amount": 32000,
"refunded": False
},
"txn-20": {
"transaction_id": "txn-20",
"status": "success",
"method": "DebitCard_SBI",
"amount": 18500,
"refunded": False
},
"txn-21": {
"transaction_id": "txn-21",
"status": "success",
"method": "CreditCard_Amex",
"amount": 150000,
"refunded": False
},
"txn-22": {
"transaction_id": "txn-22",
"status": "success",
"method": "UPI",
"amount": 159900,
"refunded": False
},
"txn-23": {
"transaction_id": "txn-23",
"status": "success",
"method": "CreditCard_Axis",
"amount": 7500,
"refunded": False
},
"txn-24": {
"transaction_id": "txn-24",
"status": "success",
"method": "UPI",
"amount": 570,
"refunded": False
},
"txn-01": {
"transaction_id": "txn-01",
"status": "success",
"method": "UPI_PhonePe",
"amount": 1499,
"refunded": False
},
"txn-02": {
"transaction_id": "txn-02",
"status": "success",
"method": "CreditCard_HDFC",
"amount": 899,
"refunded": False
},
"txn-03": {
"transaction_id": "txn-03",
"status": "success",
"method": "NetBanking_SBI",
"amount": 2499,
"refund_status": "pending_bank_clearance"
}
}
LOGISTICS_DB = {
"ORD-505": {
"order_id": "ORD-505",
"shipment_id": "Awb-Delhivery-505",
"location": "Mumbai Sorting Hub",
"status": "in_transit",
"courier": "Delhivery",
"estimated_arrival": "2026-04-12"
},
"ORD-606": {
"order_id": "ORD-606",
"shipment_id": "Awb-EcomExpress-606",
"location": "Bangalore Central",
"status": "delivered",
"courier": "Ecom Express",
"estimated_arrival": "2026-04-05"
},
"ORD-707": {
"order_id": "ORD-707",
"shipment_id": "Awb-BlueDart-707",
"location": "Chennai Facility",
"status": "in_transit",
"courier": "Blue Dart",
"estimated_arrival": "2026-04-15"
},
"ORD-808": {
"order_id": "ORD-808",
"shipment_id": "Awb-XpressBees-808",
"location": "Ahmedabad Hub",
"status": "cancelled",
"courier": "XpressBees",
"estimated_arrival": "2026-04-08"
},
"ORD-909": {
"order_id": "ORD-909",
"shipment_id": "Awb-BlueDart-909",
"location": "Stuck at Mumbai Hub",
"status": "in_transit",
"courier": "Blue Dart",
"estimated_arrival": "2026-03-01"
},
"ORD-1010": {
"order_id": "ORD-1010",
"shipment_id": "Awb-Delhivery-1010",
"location": "Pune Local Delivery Center",
"status": "delivered",
"courier": "Delhivery",
"estimated_arrival": "2026-04-09"
},
"ORD-1111": {
"order_id": "ORD-1111",
"shipment_id": "Awb-EcomExpress-1111",
"location": "Delhi Sorting Hub",
"status": "in_transit",
"courier": "Ecom Express",
"estimated_arrival": "2026-04-14"
},
"ORD-1212": {
"order_id": "ORD-1212",
"shipment_id": "Awb-XpressBees-1212",
"location": "Hyderabad Facility",
"status": "cancelled",
"courier": "XpressBees",
"estimated_arrival": "2026-04-01"
},
"ORD-1313": {
"order_id": "ORD-1313",
"shipment_id": "Awb-BlueDart-1313",
"location": "Front Desk / Reception",
"status": "delivered",
"courier": "Blue Dart",
"estimated_arrival": "2026-04-09"
},
"ORD-1414": {
"order_id": "ORD-1414",
"shipment_id": "N/A",
"location": "Warehouse",
"status": "cancelled",
"courier": "None",
"estimated_arrival": "N/A"
},
"ORD-1515": {
"order_id": "ORD-1515",
"shipment_id": "Awb-Delhivery-1515",
"location": "Customer Mailroom",
"status": "delivered",
"courier": "Delhivery",
"estimated_arrival": "2026-04-08"
},
"ORD-1616": {
"order_id": "ORD-1616",
"shipment_id": "Awb-Ecom-1616",
"location": "Lucknow Sorting Center",
"status": "in_transit",
"courier": "Ecom Express",
"estimated_arrival": "2026-04-12"
},
"ORD-1717": {
"order_id": "ORD-1717",
"shipment_id": "Awb-Amazon-1717",
"location": "Kochi Hub",
"status": "delivered",
"courier": "Amazon Logistics",
"estimated_arrival": "2026-04-05"
},
"ORD-1818": {
"order_id": "ORD-1818",
"shipment_id": "Awb-Xpress-1818",
"location": "Chandigarh Terminal",
"status": "in_transit",
"courier": "XpressBees",
"estimated_arrival": "2026-04-15"
},
"ORD-1919": {
"order_id": "ORD-1919",
"shipment_id": "Awb-Delhivery-1919",
"location": "Gurgaon Out for Delivery",
"status": "in_transit",
"courier": "Delhivery",
"estimated_arrival": "2026-04-12"
},
"ORD-2020": {
"order_id": "ORD-2020",
"shipment_id": "Awb-BlueDart-2020",
"location": "Delivered to Security",
"status": "delivered",
"courier": "Blue Dart",
"estimated_arrival": "2026-04-06"
},
"ORD-2121": {
"order_id": "ORD-2121",
"shipment_id": "N/A",
"location": "Warehouse",
"status": "cancelled",
"courier": "None",
"estimated_arrival": "N/A"
},
"ORD-2222": {
"order_id": "ORD-2222",
"shipment_id": "Awb-Amazon-2222",
"location": "Handed directly to resident",
"status": "delivered",
"courier": "Amazon Logistics",
"estimated_arrival": "2026-04-10"
},
"ORD-2323": {
"order_id": "ORD-2323",
"shipment_id": "Awb-Ecom-2323",
"location": "Delhi Sorting Hub",
"status": "in_transit",
"courier": "Ecom Express",
"estimated_arrival": "2026-04-14"
},
"ORD-2424": {
"order_id": "ORD-2424",
"shipment_id": "Awb-Blinkit-2424",
"location": "Delivered at Doorstep",
"status": "delivered",
"courier": "Hyperlocal",
"estimated_arrival": "2026-04-10"
},
"ORD-101": {
"order_id": "ORD-101",
"user_id": "u1",
"status": "shipped",
"items": [{"item_id": "p1", "name": "Boat Rockerz 450", "price": 1499}],
"delivery_date": "2026-04-02",
"payment_id": "txn-01"
},
"ORD-202": {
"order_id": "ORD-202",
"user_id": "u2",
"status": "delivered",
"items": [{"item_id": "p2", "name": "Milton Flask", "price": 899}],
"delivery_date": "2026-03-29",
"payment_id": "txn-02"
}
}
COUPONS_DB = {
"SAVE10": {"valid": True, "discount_percent": 10},
"EXPIRED20": {"valid": False, "discount_percent": 20},
"OPENENV50": {"valid": True, "discount_percent": 50}
}
SLOTS_DB = {
"ORD-1919": ["2026-04-13 Morning", "2026-04-13 Evening", "2026-04-14 Morning"],
"ORD-2323": ["2026-04-15 Evening", "2026-04-16 Morning"]
}
# Add dynamic fields to all orders
if 'ORDERS_DB' in locals() or 'ORDERS_DB' in globals():
for oid in ORDERS_DB:
ORDERS_DB[oid].setdefault("damage_proof_received", False)
ORDERS_DB[oid].setdefault("rescheduled_to", None)
ORDERS_DB[oid].setdefault("new_address", None)
SUPPORT_TICKETS_DB = {}
# LOGISTICS_DB is already defined above, DO NOT OVERWRITE