feat: implement backend API clients for multi-marketplace integration and frontend service layer
This commit is contained in:
19
backend/ae_api/services/transactions.py
Normal file
19
backend/ae_api/services/transactions.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from typing import Dict, Any, Optional
|
||||
from ..client import AEClient
|
||||
|
||||
class TransactionsService:
|
||||
"""Service to handle AE Platform Transactions (Orders)."""
|
||||
|
||||
def __init__(self, client: AEClient):
|
||||
self.client = client
|
||||
|
||||
def get_list(self, user_id: Optional[str] = None, params: Optional[Dict[str, Any]] = None) -> Dict[str, Any]:
|
||||
"""
|
||||
Get list of transactions (orders) for a user.
|
||||
Endpoint: GET /users/{user_id}/transactions
|
||||
"""
|
||||
uid = user_id or self.client.user_id
|
||||
if not uid:
|
||||
raise ValueError("user_id must be provided either in the method call or client initialization.")
|
||||
|
||||
return self.client.get(f"/users/{uid}/transactions", params=params)
|
||||
Reference in New Issue
Block a user