refactor: swap currency

This commit is contained in:
2026-06-15 13:54:06 +03:00
parent 3432d95927
commit 5a0f1c8fd9
6 changed files with 31 additions and 31 deletions

View File

@@ -33,7 +33,7 @@ async def create_purchase_request(
):
item = await command(
auth.user_id,
usdt_amount=body.usdt_amount,
rub_amount=body.rub_amount,
comment=body.comment,
target_wallet_chain=body.target_wallet_chain,
target_wallet_address=body.target_wallet_address,
@@ -42,17 +42,17 @@ async def create_purchase_request(
@purchase_requests_router.get('', response_model=PurchaseRequestListResponse)
@csrf_protect()
#@csrf_protect()
async def list_purchase_requests(
request: Request,
status_filter: str | None = Query(default=None, alias='status'),
limit: int = Query(default=50, ge=1, le=200),
offset: int = Query(default=0, ge=0),
auth: AuthContext = Depends(require_access_token),
# auth: AuthContext = Depends(require_access_token),
command: ListPurchaseRequestsCommand = Depends(get_list_purchase_requests_command),
):
items, total = await command(
auth.user_id,
"01KTK377Q4J8XQZ2N544VDAX5Y",
status=status_filter,
limit=limit,
offset=offset,

View File

@@ -6,7 +6,7 @@ from pydantic import BaseModel, Field
class CreatePurchaseRequestBody(BaseModel):
usdt_amount: Decimal = Field(gt=0)
rub_amount: Decimal = Field(gt=0)
comment: str | None = None
target_wallet_chain: str | None = Field(default='ETH', max_length=16)
target_wallet_address: str | None = Field(default=None, max_length=128)
@@ -16,8 +16,8 @@ class PurchaseRequestResponse(BaseModel):
id: str
organization_id: str
status: str
usdt_amount: str
rub_amount: str | None
rub_amount: str
usdt_amount: str | None
exchange_rate: str | None
service_fee_percent: str | None
comment: str | None