From 4d3f8b2ad3d7e987c2b618875258065428aac5e0 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 29 Nov 2025 22:18:24 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D0=B8=D0=BB=20=D0=BF?= =?UTF-8?q?=D0=BE=D0=BF=D0=BE=D0=BB=D0=BD=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B1?= =?UTF-8?q?=D0=B0=D0=BB=D0=B0=D0=BD=D1=81=D0=B0,=20=D1=82=D0=B0=D0=BA=20?= =?UTF-8?q?=D0=BA=D0=B0=D0=BA=20=D0=B5=D0=B3=D0=BE=20=D1=82=D1=83=D1=82=20?= =?UTF-8?q?=D0=BD=D0=B5=20=D0=B4=D0=BE=D0=BB=D0=B6=D0=BD=D0=BE=20=D0=B1?= =?UTF-8?q?=D1=8B=D1=82=D1=8C,=20=D1=8D=D1=82=D0=BE=20=D0=BE=D1=82=D0=B2?= =?UTF-8?q?=D0=B5=D1=82=D1=81=D1=82=D0=B2=D0=B5=D0=BD=D0=BD=D0=BE=D1=81?= =?UTF-8?q?=D1=82=D1=8C=20billing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/routes/user_routes.py | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/app/routes/user_routes.py b/app/routes/user_routes.py index 060ac2d..c5ab3ae 100644 --- a/app/routes/user_routes.py +++ b/app/routes/user_routes.py @@ -98,37 +98,6 @@ async def get_user( logger.exception(f"Неожиданная ошибка при получении пользователя с telegram_id {telegram_id}: {e}") raise HTTPException(status_code=500, detail=str(e)) - - -@router.post("/user/{telegram_id}/balance/{amount}", summary="Обновить баланс") -async def update_balance( - telegram_id: int, - amount: float, - db_manager: DatabaseManager = Depends(get_database_manager) -): - """ - Обновляет баланс пользователя. - """ - logger.info(f"Получен запрос на обновление баланса: telegram_id={telegram_id}, amount={amount}") - try: - result = await db_manager.update_balance(telegram_id, amount) - if result == "ERROR": - logger.error(f"Ошибка обновления баланса для пользователя {telegram_id}") - raise HTTPException(status_code=500, detail="Failed to update balance") - - logger.info(f"Баланс пользователя {telegram_id} успешно обновлен на {amount}") - return {"message": "Balance updated successfully"} - except HTTPException as http_ex: - logger.warning(f"HTTP ошибка: {http_ex.detail}") - raise http_ex - except SQLAlchemyError as db_ex: - logger.error(f"Ошибка базы данных при обновлении баланса пользователя {telegram_id}: {db_ex}") - raise HTTPException(status_code=500, detail="Database error") - except Exception as e: - logger.exception(f"Неожиданная ошибка при обновлении баланса пользователя {telegram_id}: {e}") - raise HTTPException(status_code=500, detail=str(e)) - - @router.get("/user/{telegram_id}/transactions", summary="Последние транзакции пользователя") async def last_transactions( telegram_id: int,