Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Remove qu_factor_purchase_to_stock to maintain compatibility with API v4 #265

Merged
merged 4 commits into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions pygrocy/data_models/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ def _init_empty(self):
self._best_before_date = None

self._default_quantity_unit_purchase = None
self._qu_factor_purchase_to_stock = None

self._barcodes = []
self._product_group_id = None
Expand Down Expand Up @@ -115,7 +114,6 @@ def _init_from_ProductData(self, product: ProductData):
self._id = product.id
self._product_group_id = product.product_group_id
self._name = product.name
self._qu_factor_purchase_to_stock = product.qu_factor_purchase_to_stock

def _init_from_StockLogResponse(self, response: StockLogResponse):
self._id = response.product_id
Expand Down Expand Up @@ -184,10 +182,6 @@ def is_partly_in_stock(self) -> int:
def default_quantity_unit_purchase(self) -> QuantityUnit:
return self._default_quantity_unit_purchase

@property
def qu_factor_purchase_to_stock(self) -> float:
return self._qu_factor_purchase_to_stock


class Group(DataModel):
def __init__(self, raw_product_group: LocationData):
Expand Down
1 change: 0 additions & 1 deletion pygrocy/data_models/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ def row_created_timestamp(self) -> datetime:

class Task(DataModel):
def __init__(self, response: TaskResponse):

self._id = response.id
self._name = response.name
self._description = response.description
Expand Down
4 changes: 0 additions & 4 deletions pygrocy/grocy_api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ class ProductData(BaseModel):
product_group_id: Optional[int] = None
qu_id_stock: int
qu_id_purchase: int
qu_factor_purchase_to_stock: Optional[float] = None
picture_file_name: Optional[str] = None
allow_partial_units_in_stock: Optional[bool] = False
row_created_timestamp: datetime
Expand All @@ -100,9 +99,6 @@ class ProductData(BaseModel):

location_id_validator = _field_not_empty_validator("location_id")
product_group_id_validator = _field_not_empty_validator("product_group_id")
qu_factor_purchase_to_stock_validator = _field_not_empty_validator(
"qu_factor_purchase_to_stock"
)


class ChoreData(BaseModel):
Expand Down
Loading