MukeshKapoor25 commited on
Commit
73a629a
·
1 Parent(s): ff83914

refactor(appointment): update merchant details and payment example values

Browse files

Update merchant address structure to include detailed address fields and modify example payment values to be more realistic. Remove commented-out created_at/modified_at fields as they're no longer needed.

Files changed (1) hide show
  1. app/models/appointment.py +13 -9
app/models/appointment.py CHANGED
@@ -64,8 +64,6 @@ class Appointment(BaseModel):
64
  payment_status: PaymentStatus = PaymentStatus.PENDING # ✅ Default to "pending"
65
  payment_id: Optional[str] = None
66
  cleared_amount: float = Field(default=0.0, ge=0, description="Cleared amount must be non-negative")
67
- #created_at: datetime = Field(default_factory=lambda: datetime.now(timezone.utc))
68
- #modified_at: datetime = Field(default_factory=lambda: datetime.now(timezone.utc))
69
  order_id: Optional[str] = Field(None, description="Order ID is required if payment mode is ONLINE")
70
 
71
  class Config:
@@ -76,8 +74,15 @@ class Appointment(BaseModel):
76
  json_schema_extra = {
77
  "example": {
78
  "merchant_id": "MERCHANT123",
79
- "merchant_name": "Merchant Name",
80
- "merchant_address": "Merchant Address",
 
 
 
 
 
 
 
81
  "location_id": "LOC001",
82
  "customer_id": "CUST567",
83
  "appointment_date": "2025-02-25",
@@ -102,12 +107,11 @@ class Appointment(BaseModel):
102
  "total_amount": 50.0,
103
  "discount": 5.0,
104
  "payment_mode": "online",
105
- "payment_status": "PAID",
106
- "payment_id": "ORDER789",
107
  "cleared_amount": 45.0,
108
- "order_id": "ORDER789",
109
- #"created_at": "2025-02-20 10:15:00",
110
- #"modified_at": "2025-02-21 12:00:00"
111
  }
112
  }
113
 
 
64
  payment_status: PaymentStatus = PaymentStatus.PENDING # ✅ Default to "pending"
65
  payment_id: Optional[str] = None
66
  cleared_amount: float = Field(default=0.0, ge=0, description="Cleared amount must be non-negative")
 
 
67
  order_id: Optional[str] = Field(None, description="Order ID is required if payment mode is ONLINE")
68
 
69
  class Config:
 
74
  json_schema_extra = {
75
  "example": {
76
  "merchant_id": "MERCHANT123",
77
+ "merchant_name": "Elegant Salon",
78
+ "city": "Mumbai",
79
+ "merchant_address": {
80
+ "line1": "12 High Street",
81
+ "area": "Andheri East",
82
+ "city": "Mumbai",
83
+ "state": "MH",
84
+ "zip_code": "400093"
85
+ },
86
  "location_id": "LOC001",
87
  "customer_id": "CUST567",
88
  "appointment_date": "2025-02-25",
 
107
  "total_amount": 50.0,
108
  "discount": 5.0,
109
  "payment_mode": "online",
110
+ "payment_status": "paid",
111
+ "payment_id": "pay_789xyz",
112
  "cleared_amount": 45.0,
113
+ "order_id": "order_789xyz",
114
+
 
115
  }
116
  }
117