diff --git a/fdk_client/platform/catalog/client.py b/fdk_client/platform/catalog/client.py index acd0acb0f..d6d6fb0b0 100644 --- a/fdk_client/platform/catalog/client.py +++ b/fdk_client/platform/catalog/client.py @@ -3468,8 +3468,8 @@ async def updateRealtimeInventory(self, item_id=None, seller_identifier=None, bo response = await AiohttpHelper().aiohttp_request("POST", url_with_params, headers=get_headers_with_signature(self._conf.domain, "post", await create_url_without_domain(f"/service/platform/catalog/v2.0/company/{self._conf.companyId}/products/{item_id}/inventory/{seller_identifier}", item_id=item_id, seller_identifier=seller_identifier), query_string, headers, body, exclude_headers=exclude_headers), data=body, debug=(self._conf.logLevel=="DEBUG")) if 200 <= int(response['status_code']) < 300: - from .models import InventoryUpdateResponse - schema = InventoryUpdateResponse() + from .models import InventoryUpdateResponseSchema + schema = InventoryUpdateResponseSchema() try: schema.load(response["json"]) except Exception as e: diff --git a/fdk_client/platform/catalog/models.py b/fdk_client/platform/catalog/models.py index 9de020e58..dc18c2a79 100644 --- a/fdk_client/platform/catalog/models.py +++ b/fdk_client/platform/catalog/models.py @@ -858,6 +858,14 @@ class InventoryUpdateResponse(BaseSchema): pass +class InventoryUpdateResponseSchema(BaseSchema): + pass + + +class InventoryTransaction(BaseSchema): + pass + + class InventoryValidationResponse(BaseSchema): pass @@ -4919,16 +4927,30 @@ class InventoryPayload(BaseSchema): price_marked = fields.Float(required=False) + price_cost = fields.Float(required=False) + seller_identifier = fields.Str(required=False) store_id = fields.Int(required=False) tags = fields.List(fields.Str(required=False), required=False) + mode = fields.Str(required=False) + total_quantity = fields.Int(required=False, allow_none=True) + damaged_quantity = fields.Int(required=False, allow_none=True) + + not_available_quantity = fields.Int(required=False, allow_none=True) + trace_id = fields.Str(required=False) + meta = fields.Dict(required=False) + + transaction_type = fields.Str(required=False, allow_none=True) + + transaction = fields.Nested(InventoryTransaction, required=False) + class InventoryRequest(BaseSchema): @@ -4953,6 +4975,10 @@ class InventoryRequestSchemaV2(BaseSchema): payload = fields.List(fields.Nested(InventoryPayload, required=False), required=False) + transaction_type = fields.Str(required=False, allow_none=True) + + transaction = fields.Nested(InventoryTransaction, required=False) + class InventoryResponse(BaseSchema): @@ -5127,6 +5153,34 @@ class InventoryUpdateResponse(BaseSchema): +class InventoryUpdateResponseSchema(BaseSchema): + # Catalog swagger.json + + + items = fields.List(fields.Nested(InventoryResponseItem, required=False), required=False) + + message = fields.Str(required=False) + + success = fields.Boolean(required=False) + + + +class InventoryTransaction(BaseSchema): + # Catalog swagger.json + + + type = fields.Str(required=False) + + reference_id = fields.Str(required=False) + + reason = fields.Str(required=False) + + source = fields.Str(required=False) + + user_ref = fields.Str(required=False) + + + class InventoryValidationResponse(BaseSchema): # Catalog swagger.json