feat: implement backend API clients for multi-marketplace integration and frontend service layer

This commit is contained in:
2026-05-12 13:16:14 +03:00
parent 6974af486a
commit ee39a3d83b
65 changed files with 2501 additions and 33 deletions

View File

@@ -0,0 +1,22 @@
from typing import Dict, Any, List
from ..client import LamodaClient
class OrdersService:
"""Service to handle Lamoda Orders (FBS)."""
def __init__(self, client: LamodaClient):
self.client = client
def get_new_orders(self, limit: int = 100) -> Dict[str, Any]:
"""
Get list of new orders (assembly tasks).
Endpoint: /v1/orders/new
"""
return self.client.get("/v1/orders/new", params={"limit": limit})
def confirm_packaging(self, order_ids: List[str]) -> Dict[str, Any]:
"""
Confirm that orders are packaged and ready for dispatch.
Endpoint: /v1/orders/pack
"""
return self.client.post("/v1/orders/pack", data={"order_ids": order_ids})

View File

@@ -0,0 +1,31 @@
from typing import Dict, Any, List
from ..client import LamodaClient
class ProductsService:
"""Service to handle Lamoda Products/Assortment."""
def __init__(self, client: LamodaClient):
self.client = client
def get_list(self, limit: int = 100, offset: int = 0, **filters) -> Dict[str, Any]:
"""
Get list of products in the seller's catalog.
Endpoint: /v1/products
"""
params = {"limit": limit, "offset": offset}
params.update(filters)
return self.client.get("/v1/products", params=params)
def update_stocks(self, items: List[Dict[str, Any]]) -> Dict[str, Any]:
"""
Update stock levels (FBS).
Endpoint: /v1/stocks
"""
return self.client.post("/v1/stocks", data={"stocks": items})
def update_prices(self, items: List[Dict[str, Any]]) -> Dict[str, Any]:
"""
Update prices for products.
Endpoint: /v1/prices
"""
return self.client.post("/v1/prices", data={"prices": items})