From a6ad63357086a05c16a1f5a81991810e877ebe06 Mon Sep 17 00:00:00 2001 From: Jadowyne Ulve Date: Sun, 7 Sep 2025 16:34:05 -0500 Subject: [PATCH] set up take out correctly --- .../meal_planner_processes.cpython-313.pyc | Bin 3646 -> 3687 bytes .../meal_planner/meal_planner_processes.py | 6 +++--- logs/database.log | 14 +++++++++++++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/application/meal_planner/__pycache__/meal_planner_processes.cpython-313.pyc b/application/meal_planner/__pycache__/meal_planner_processes.cpython-313.pyc index e7d07d1e3b377a51e21b0df900d3b17566c8b89e..96178943df67e8ab41ff4038cb9f419d41fc4bcf 100644 GIT binary patch delta 411 zcmdld^IV4aGcPX}0}wcF-Ua`Oede?loB-qG0j1Q zCWv4M5}IO@|8m}9VJce;Tbu4a=Tc=9oXpEzGkFrX2#X+4V)ANk4XzL%Ljs74uWr7} z&BVwkKKUt+pX?nL&JLX`EaG=WRIiJeT@o?7AtZJ~Lgs?3-bD%h$q~GElV|WYGKNf+ N;*(_zpKQUW4*-;oR89Z@ diff --git a/application/meal_planner/meal_planner_processes.py b/application/meal_planner/meal_planner_processes.py index 5249e63..5b37385 100644 --- a/application/meal_planner/meal_planner_processes.py +++ b/application/meal_planner/meal_planner_processes.py @@ -51,7 +51,7 @@ def addTakeOutEvent(site, data, user_id, conn=None): cost = float(data['cost'])/int(attendees) receipt_item = database_payloads.ReceiptItemPayload( - type = 'custom', + type = data['event_type'], receipt_id=receipt['id'], barcode="", item_uuid=None, @@ -62,10 +62,10 @@ def addTakeOutEvent(site, data, user_id, conn=None): ) receipt_item = meal_planner_database.insertReceiptItemsTuple(site, receipt_item.payload(), conn=conn) - print(receipt_item) + trimmed = data['event_shortname'][:32] # TODO: this shortens the name but i should use a a large character limit event_payload = database_payloads.PlanEventPayload( plan_uuid=None, - event_shortname=data['event_shortname'], + event_shortname=str(trimmed), event_description=data['event_description'], event_date_start=event_date_start, event_date_end=event_date_end, diff --git a/logs/database.log b/logs/database.log index 32b5f60..dafd5b0 100644 --- a/logs/database.log +++ b/logs/database.log @@ -913,4 +913,16 @@ FOREIGN KEY(vendor_id) REFERENCES test2_vendors(id) );, - sql='receipts') \ No newline at end of file + sql='receipts') +2025-09-07 11:23:19.621345 --- ERROR --- DatabaseError(message='value too long for type character varying(32)', + payload=(None, "Take Out: Richie's Brickhouse BBQ Grill", "Take out dining at Take Out: Richie's Brickhouse BBQ Grill", datetime.datetime(2025, 9, 4, 0, 0), datetime.datetime(2025, 9, 4, 0, 0), 1, None, '99c30119-9f01-4199-9e99-63fc692d30eb', 'take out'), + sql='INSERT INTO main_plan_events(plan_uuid, event_shortname, event_description, event_date_start, event_date_end, created_by, recipe_uuid, receipt_uuid, event_type) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s) RETURNING *;') +2025-09-07 11:28:43.503622 --- ERROR --- DatabaseError(message='value too long for type character varying(32)', + payload=(None, "Take Out: Richie's Brickhouse BBQ Grill", "Take out dining at Take Out: Richie's Brickhouse BBQ Grill", datetime.datetime(2025, 9, 4, 0, 0), datetime.datetime(2025, 9, 4, 0, 0), 1, None, '688cee70-1ecf-4a9f-b606-0f7b1b3b433d', 'take out'), + sql='INSERT INTO main_plan_events(plan_uuid, event_shortname, event_description, event_date_start, event_date_end, created_by, recipe_uuid, receipt_uuid, event_type) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s) RETURNING *;') +2025-09-07 11:30:19.938172 --- ERROR --- DatabaseError(message='value too long for type character varying(32)', + payload=(None, "Take Out: Richie's Brickhouse BBQ Grill", "Take out dining at Take Out: Richie's Brickhouse BBQ Grill", datetime.datetime(2025, 9, 4, 0, 0), datetime.datetime(2025, 9, 4, 0, 0), 1, None, '55f2ee72-9f99-40e4-b2bc-ca98e031dd77', 'take out'), + sql='INSERT INTO main_plan_events(plan_uuid, event_shortname, event_description, event_date_start, event_date_end, created_by, recipe_uuid, receipt_uuid, event_type) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s) RETURNING *;') +2025-09-07 11:31:37.389493 --- ERROR --- DatabaseError(message='value too long for type character varying(32)', + payload=(None, "Take Out: Richie's Brickhouse BBQ Grill", "Take out dining at Take Out: Richie's Brickhouse BBQ Grill", datetime.datetime(2025, 9, 4, 0, 0), datetime.datetime(2025, 9, 4, 0, 0), 1, None, '08671808-a664-4dbc-8147-8634500364f7', 'take out'), + sql='INSERT INTO main_plan_events(plan_uuid, event_shortname, event_description, event_date_start, event_date_end, created_by, recipe_uuid, receipt_uuid, event_type) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s) RETURNING *;') \ No newline at end of file