feat: implement backend API clients for multi-marketplace integration and frontend service layer
This commit is contained in:
22
backend/lamoda_api/services/orders.py
Normal file
22
backend/lamoda_api/services/orders.py
Normal 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})
|
||||
Reference in New Issue
Block a user