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,30 @@
from typing import Dict, Any
from ..client import MMClient
class ShipmentsService:
"""Service to handle Magnit Market Shipments."""
def __init__(self, client: MMClient):
self.client = client
def get_list(self, dir: str = "ASC", page_size: int = 100, page_token: str = None, **filters) -> Dict[str, Any]:
"""
Get list of shipments.
Endpoint: /api/seller/v1/shipments/list
"""
payload = {
"dir": dir,
"page_size": page_size
}
if page_token:
payload["page_token"] = page_token
payload.update(filters)
return self.client.post("/api/seller/v1/shipments/list", data=payload)
def confirm(self, shipment_id: str) -> Dict[str, Any]:
"""
Confirm a shipment.
Endpoint: /api/seller/v1/shipments/confirm
"""
return self.client.post("/api/seller/v1/shipments/confirm", data={"shipment_id": shipment_id})