from db.models import Product from dto.cart import CartDTO product_editing_mapping = { "name": "новое название", "description": "новое описание", "price": "новую цену", } def get_product_description(product: Product) -> str: output = f"📦 {product.name}\n\n🏷️ {product.price}₽" if product.description: output += f"\n\n📜 {product.description}" return output def get_order_item_list(cart: CartDTO): text = "🛍 Состав заказа:\n" for i, product in enumerate(cart.items): text += f"\n{i+1}. {product.name}\n•\t{product.quantity} × {product.price} = {product.total}₽\n" text += f"\n━━━━━━━━━━━━━━\n💰 Итого: {cart.total}₽" return text