narendrasinghd commited on
Commit
e0619c1
·
verified ·
1 Parent(s): c3ae38c

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +109 -2
app.py CHANGED
@@ -45,7 +45,7 @@ async def check_email(request: Request, token: str = Depends(verify_token)):
45
  detail=f"The email '{email}' is not found in the valid list."
46
  )
47
 
48
- valid_phones = ["+917389058485", "+12363269419", "+9173", "+917389"]
49
  @app.get('/phone')
50
  async def check_phone(request: Request, token: str = Depends(verify_token)):
51
  phone = request.query_params.get("phone")
@@ -89,10 +89,117 @@ async def book_ticket(request: Request):
89
 
90
  return {
91
  "status": "success",
92
- "message": f"Ticket booked for '{movie_name}'. Username: {username}, Time: {time}, Price: {price}"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  }
94
 
95
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
  class AgentAction(BaseModel):
97
  name: str
98
  email: str = None
 
45
  detail=f"The email '{email}' is not found in the valid list."
46
  )
47
 
48
+ valid_phones = ["+917389058485", "+12363269419", "+911234567890"]
49
  @app.get('/phone')
50
  async def check_phone(request: Request, token: str = Depends(verify_token)):
51
  phone = request.query_params.get("phone")
 
89
 
90
  return {
91
  "status": "success",
92
+ "data":[
93
+ {
94
+ "order_status": "Pending",
95
+ "dispatched_at": None,
96
+ "order_id": 12346,
97
+ "customer_name": "Alice Smith",
98
+ "email": "alice@example.com",
99
+ "phone": "+1-555-5678",
100
+ "address": "456 Oak St, Anytown, USA",
101
+ "payment_status": "Pending",
102
+ "payment_method": "PayPal",
103
+ "total_amount": 250.50,
104
+ "currency": "USD",
105
+ "items_purchased": 5,
106
+ "delivery_partner": "EcoDelivery",
107
+ "estimated_delivery": None,
108
+ "priority": "Normal",
109
+ "movie_name": movie_name,
110
+ "username": username,
111
+ "time": time,
112
+ "price": price,
113
+ "notes": "Contact upon arrival",
114
+ "created_at": "2024-12-30T09:00:00Z",
115
+ "last_updated": "2024-12-30T09:05:00Z"
116
+ },
117
+ {
118
+ "order_status": "Dispatched",
119
+ "dispatched_at": "2024-12-30T10:00:00Z",
120
+ "order_id": 12347,
121
+ "customer_name": "Bob Johnson",
122
+ "email": "bob@example.com",
123
+ "phone": "+1-555-8910",
124
+ "address": "789 Pine St, Anytown, USA",
125
+ "payment_status": "Paid",
126
+ "payment_method": "Debit Card",
127
+ "total_amount": 75.25,
128
+ "currency": "USD",
129
+ "items_purchased": 1,
130
+ "delivery_partner": "QuickShip",
131
+ "estimated_delivery": "2024-12-31T16:00:00Z",
132
+ "priority": "Normal",
133
+ "movie_name": movie_name,
134
+ "username": username,
135
+ "time": time,
136
+ "price": price,
137
+ "notes": "N/A",
138
+ "created_at": "2024-12-29T14:00:00Z",
139
+ "last_updated": "2024-12-30T10:00:00Z"
140
+ },
141
+ {
142
+ "order_status": "Delivered",
143
+ "dispatched_at": "2024-12-29T14:20:00Z",
144
+ "order_id": 12348,
145
+ "customer_name": "Charlie Brown",
146
+ "email": "charlie@example.com",
147
+ "phone": "+1-555-1122",
148
+ "address": "101 Birch St, Anytown, USA",
149
+ "payment_status": "Paid",
150
+ "payment_method": "Cash on Delivery",
151
+ "total_amount": 99.99,
152
+ "currency": "USD",
153
+ "movie_name": movie_name,
154
+ "username": username,
155
+ "time": time,
156
+ "price": price,
157
+ "items_purchased": 2,
158
+ "delivery_partner": "SwiftMove",
159
+ "estimated_delivery": "2024-12-30T12:00:00Z",
160
+ "priority": "High",
161
+ "notes": "Call before delivery",
162
+ "created_at": "2024-12-28T11:30:00Z",
163
+ "last_updated": "2024-12-30T12:00:00Z"
164
+ }
165
+ ]
166
  }
167
 
168
 
169
+ @app.post('/book_ticket2')
170
+ async def book_ticket(request: Request):
171
+ body = await request.json()
172
+ movie_name = request.query_params.get("movie_name")
173
+ username = body.get("username")
174
+ time = body.get("time")
175
+ price = body.get("price")
176
+
177
+ return {
178
+ "status": "success",
179
+ "order_status": "Pending",
180
+ "dispatched_at": None,
181
+ "order_id": 12346,
182
+ "customer_name": "Alice Smith",
183
+ "email": "alice@example.com",
184
+ "phone": "+1-555-5678",
185
+ "address": "456 Oak St, Anytown, USA",
186
+ "payment_status": "Pending",
187
+ "payment_method": "PayPal",
188
+ "total_amount": 250.50,
189
+ "currency": "USD",
190
+ "items_purchased": 5,
191
+ "delivery_partner": "EcoDelivery",
192
+ "estimated_delivery": None,
193
+ "priority": "Normal",
194
+ "movie_name": movie_name,
195
+ "username": username,
196
+ "time": time,
197
+ "price": price,
198
+ "notes": "Contact upon arrival",
199
+ "created_at": "2024-12-30T09:00:00Z",
200
+ "last_updated": "2024-12-30T09:05:00Z"
201
+ }
202
+
203
  class AgentAction(BaseModel):
204
  name: str
205
  email: str = None