make some fields optional
This commit is contained in:
parent
d7f21cdd81
commit
79fdfac78b
1 changed files with 10 additions and 3 deletions
|
|
@ -12,7 +12,7 @@ class Price(BaseModel):
|
|||
class Badge(BaseModel):
|
||||
type: str
|
||||
title: str
|
||||
subtitle: str
|
||||
subtitle: Optional[str]
|
||||
tooltip: Optional[str]
|
||||
|
||||
|
||||
|
|
@ -45,6 +45,13 @@ class SaleStock(BaseModel):
|
|||
shelf_life: Optional[str] = Field(..., alias='shelfLife')
|
||||
|
||||
|
||||
class ShelfLife(BaseModel):
|
||||
average: int
|
||||
minimal: int
|
||||
type: str
|
||||
bestBefore: Optional[str]
|
||||
|
||||
|
||||
class Stock(BaseModel):
|
||||
warehouse_id: int = Field(..., alias='warehouseId')
|
||||
unavailability_reason: Optional[str] = Field(..., alias='unavailabilityReason')
|
||||
|
|
@ -54,7 +61,7 @@ class Stock(BaseModel):
|
|||
delivery_restriction: Optional[str] = Field(..., alias='deliveryRestriction')
|
||||
expected_replenishment: Optional[datetime] = Field(..., alias='expectedReplenishment')
|
||||
availability_dimension: int = Field(..., alias='availabilityDimension')
|
||||
shelf_life: Optional[str] = Field(..., alias='shelfLife')
|
||||
shelf_life: Optional[ShelfLife] = Field(..., alias='shelfLife')
|
||||
billable_packaging: Optional[str] = Field(..., alias='billablePackaging')
|
||||
sales: List[SaleStock]
|
||||
in_stock: bool = Field(..., alias='inStock')
|
||||
|
|
@ -74,7 +81,7 @@ class Allergens(BaseModel):
|
|||
|
||||
|
||||
class AmountUnit(BaseModel):
|
||||
amount: Decimal
|
||||
amount: Optional[Decimal]
|
||||
unit: str
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue