add: endpoints for cancel and edit price item
All checks were successful
Build and Deploy / deploy (push) Successful in 22s

This commit is contained in:
2025-07-21 22:21:39 +05:00
parent 6e2742bc09
commit 1ae08de28b
2 changed files with 85 additions and 1 deletions

View File

@ -60,4 +60,23 @@ async def confirm_marketplace_operation(data: dict):
async def submit_item_details(data: dict):
"""Получить подробные данные о предмете"""
from app.services.marketplace import MarketplaceService
return await MarketplaceService().update_item_details(data["operation_id"], data["item_data"])
return await MarketplaceService().update_item_details(data["operation_id"], data["item_data"])
@router.delete("/items/{item_id}")
async def cancel_item_sale(
item_id: str,
username: str = Query(...)
):
"""Снять предмет с продажи"""
from app.services.marketplace import MarketplaceService
return await MarketplaceService().cancel_item_sale(username, item_id)
@router.put("/items/{item_id}/price")
async def update_item_price(
item_id: str,
new_price: int = Body(..., gt=0),
username: str = Body(...)
):
"""Обновить цену предмета на торговой площадке"""
from app.services.marketplace import MarketplaceService
return await MarketplaceService().update_item_price(username, item_id, new_price)