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,29 @@
from typing import Dict, Any
from ..client import FlowwowClient
class OrdersService:
"""Service to handle Flowwow Orders."""
def __init__(self, client: FlowwowClient):
self.client = client
def get_new_orders(self, limit: int = 50) -> Dict[str, Any]:
"""
Get list of new, unprocessed orders.
Endpoint: /orders/new
"""
return self.client.get("/orders/new", params={"limit": limit})
def accept_order(self, order_id: str) -> Dict[str, Any]:
"""
Accept an order for processing.
Endpoint: /orders/{order_id}/accept
"""
return self.client.post(f"/orders/{order_id}/accept")
def upload_photo(self, order_id: str, image_url: str) -> Dict[str, Any]:
"""
Upload a photo of the completed order before shipping.
Endpoint: /orders/{order_id}/photo
"""
return self.client.post(f"/orders/{order_id}/photo", data={"image_url": image_url})