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