Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions fdk_client/platform/catalog/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
54 changes: 54 additions & 0 deletions fdk_client/platform/catalog/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,14 @@ class InventoryUpdateResponse(BaseSchema):
pass


class InventoryUpdateResponseSchema(BaseSchema):
pass


class InventoryTransaction(BaseSchema):
pass


class InventoryValidationResponse(BaseSchema):
pass

Expand Down Expand Up @@ -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):
Expand All @@ -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):
Expand Down Expand Up @@ -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

Expand Down