Fix: Loaded voucher was not showing H H name in Happy Hour products
This commit is contained in:
parent
02e208cd4e
commit
28952402aa
@ -97,7 +97,7 @@ def from_table(
|
|||||||
return voucher_blank(table, guest)
|
return voucher_blank(table, guest)
|
||||||
|
|
||||||
|
|
||||||
def voucher_product(product_id: uuid.UUID, date_: date, db: Session):
|
def voucher_product(product_id: uuid.UUID, date_: date, is_happy_hour: bool, db: Session):
|
||||||
product: ProductVersion = (
|
product: ProductVersion = (
|
||||||
db.query(ProductVersion)
|
db.query(ProductVersion)
|
||||||
.filter(
|
.filter(
|
||||||
@ -118,7 +118,7 @@ def voucher_product(product_id: uuid.UUID, date_: date, db: Session):
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
"id": product_id,
|
"id": product_id,
|
||||||
"name": product.full_name,
|
"name": ("H H " if is_happy_hour else "") + product.full_name,
|
||||||
"menuCategory": {
|
"menuCategory": {
|
||||||
"id": product.menu_category_id,
|
"id": product.menu_category_id,
|
||||||
"name": product.menu_category.name,
|
"name": product.menu_category.name,
|
||||||
@ -160,7 +160,7 @@ def voucher_info(item: Voucher, db: Session):
|
|||||||
{
|
{
|
||||||
"id": i.id,
|
"id": i.id,
|
||||||
"sortOrder": i.sort_order,
|
"sortOrder": i.sort_order,
|
||||||
"product": voucher_product(i.product_id, item.date.date(), db),
|
"product": voucher_product(i.product_id, item.date.date(), i.is_happy_hour, db),
|
||||||
"quantity": i.quantity,
|
"quantity": i.quantity,
|
||||||
"price": i.price,
|
"price": i.price,
|
||||||
"isHappyHour": i.is_happy_hour,
|
"isHappyHour": i.is_happy_hour,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user