MukeshKapoor25 commited on
Commit
ff83914
Β·
1 Parent(s): 102d950

refactor(models): make customer_id and appointment_date optional fields

Browse files

Change customer_id and appointment_date from required to optional fields to accommodate cases where these values may not be available at creation time

Files changed (1) hide show
  1. app/models/appointment.py +2 -2
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(..., description="Customer ID is required") # βœ… Mandatory
55
- appointment_date: date = Field(..., 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
 
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