separated clients handlers, cart->checkout ppline
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user