separated clients handlers, cart->checkout ppline

This commit is contained in:
2026-02-11 20:53:47 +07:00
parent 6409d66dfd
commit a3aaafd7ac
20 changed files with 658 additions and 369 deletions

View File

@@ -1,4 +1,5 @@
from db.models import Product
from dto.cart import CartDTO
def get_product_description(product: Product) -> str:
@@ -7,3 +8,18 @@ def get_product_description(product: Product) -> str:
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}. <b>{product.name}</b>\n\t<i>{product.quantity} × {product.price} = {product.total}₽</i>\n"
text += f"\n━━━━━━━━━━━━━━\n💰 Итого: {cart.total}"
return text
# def get_order_notification(cart: CartDTO):
# text
# FIXME