Spaces:
Sleeping
Sleeping
Commit Β·
ff83914
1
Parent(s): 102d950
refactor(models): make customer_id and appointment_date optional fields
Browse filesChange customer_id and appointment_date from required to optional fields to accommodate cases where these values may not be available at creation time
app/models/appointment.py
CHANGED
|
@@ -51,8 +51,8 @@ class Appointment(BaseModel):
|
|
| 51 |
city: str = Field(..., description="City is required") # β
Mandatory
|
| 52 |
merchant_address: Dict[str, Any] = Field(..., description="Merchant address is required") # β
Mandatory
|
| 53 |
location_id: str
|
| 54 |
-
customer_id: str = Field(
|
| 55 |
-
appointment_date: date = Field(
|
| 56 |
appointment_time: str = Field(..., pattern=r"^\d{2}:\d{2}$", description="Appointment time in HH:MM format")
|
| 57 |
associates: List[AssociateDetails] # β
Using `AssociateDetails` model
|
| 58 |
status: AppointmentStatus # β
Using Enum
|
|
|
|
| 51 |
city: str = Field(..., description="City is required") # β
Mandatory
|
| 52 |
merchant_address: Dict[str, Any] = Field(..., description="Merchant address is required") # β
Mandatory
|
| 53 |
location_id: str
|
| 54 |
+
customer_id: Optional[str] = Field(None, description="Customer ID is optional") # β
Optional
|
| 55 |
+
appointment_date: Optional[date] = Field(None, description="Appointment date (YYYY-MM-DD)")
|
| 56 |
appointment_time: str = Field(..., pattern=r"^\d{2}:\d{2}$", description="Appointment time in HH:MM format")
|
| 57 |
associates: List[AssociateDetails] # β
Using `AssociateDetails` model
|
| 58 |
status: AppointmentStatus # β
Using Enum
|