Spaces:
Sleeping
Sleeping
Commit ·
0c31b33
1
Parent(s): 36c0ef3
Make pet and guest field as optional
Browse files- app/models/appointment.py +2 -2
- app/models/cart.py +3 -3
app/models/appointment.py
CHANGED
|
@@ -65,8 +65,8 @@ class Appointment(BaseModel):
|
|
| 65 |
appointment_date: Optional[date] = Field(None, description="Appointment date (YYYY-MM-DD)")
|
| 66 |
appointment_time: str = Field(..., pattern=r"^\d{2}:\d{2}$", description="Appointment time in HH:MM format")
|
| 67 |
associates: List[AssociateDetails] # ✅ Using `AssociateDetails` model
|
| 68 |
-
guest: List[Guestdetails]
|
| 69 |
-
pet: List[Petdetails]
|
| 70 |
status: AppointmentStatus # ✅ Using Enum
|
| 71 |
services: List[ServiceDetails] # ✅ Using `ServiceDetails` model
|
| 72 |
notes: Optional[str] = None
|
|
|
|
| 65 |
appointment_date: Optional[date] = Field(None, description="Appointment date (YYYY-MM-DD)")
|
| 66 |
appointment_time: str = Field(..., pattern=r"^\d{2}:\d{2}$", description="Appointment time in HH:MM format")
|
| 67 |
associates: List[AssociateDetails] # ✅ Using `AssociateDetails` model
|
| 68 |
+
guest: Optional[List[Guestdetails]] = Field(None, description="Guest details")
|
| 69 |
+
pet: Optional[List[Petdetails]] = Field(None, description="Pet details")
|
| 70 |
status: AppointmentStatus # ✅ Using Enum
|
| 71 |
services: List[ServiceDetails] # ✅ Using `ServiceDetails` model
|
| 72 |
notes: Optional[str] = None
|
app/models/cart.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
from pydantic import BaseModel, Field, validator
|
| 2 |
-
from typing import List, Union
|
| 3 |
from datetime import timedelta
|
| 4 |
|
| 5 |
class Service(BaseModel):
|
|
@@ -35,8 +35,8 @@ class AppointmentCart(BaseModel):
|
|
| 35 |
appointment_time: str
|
| 36 |
services: List[Service]
|
| 37 |
associate: List[Associate]
|
| 38 |
-
guest: List[Guest]
|
| 39 |
-
pet: List[Pet]
|
| 40 |
ttl: Union[int, str] = Field(default="forever") # Allow integer or "forever"
|
| 41 |
business_url:str
|
| 42 |
merchant_category:str
|
|
|
|
| 1 |
from pydantic import BaseModel, Field, validator
|
| 2 |
+
from typing import List, Union,Optional
|
| 3 |
from datetime import timedelta
|
| 4 |
|
| 5 |
class Service(BaseModel):
|
|
|
|
| 35 |
appointment_time: str
|
| 36 |
services: List[Service]
|
| 37 |
associate: List[Associate]
|
| 38 |
+
guest: Optional[List[Guest]]=None
|
| 39 |
+
pet: Optional[List[Pet]]=None
|
| 40 |
ttl: Union[int, str] = Field(default="forever") # Allow integer or "forever"
|
| 41 |
business_url:str
|
| 42 |
merchant_category:str
|