From dff3f116ee2d8ef3a67bb4f027e59813571645b0 Mon Sep 17 00:00:00 2001 From: enrique Date: Tue, 16 Apr 2024 23:10:39 -0600 Subject: [PATCH] ScheduleOrder: Adding driver field to DynamoDB record update --- .../delivery/delivery_modules/data_access/dynamo_handler.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/orders/delivery/delivery_modules/data_access/dynamo_handler.py b/src/orders/delivery/delivery_modules/data_access/dynamo_handler.py index 730fa09..8ab4c7c 100644 --- a/src/orders/delivery/delivery_modules/data_access/dynamo_handler.py +++ b/src/orders/delivery/delivery_modules/data_access/dynamo_handler.py @@ -44,13 +44,13 @@ def update_records(self, records: List[Dict[str, Any]]) -> Dict[str, Any]: """ try: for record in records: - update_expression = "SET delivery_sequence = :val, #status = :statusVal" + update_expression = "SET delivery_sequence = :val, #status = :statusVal, #driver = :driverVal" expression_attribute_values = { ":val": record["delivery_sequence"], ":statusVal": "Programada", + ":driverVal": record["driver"], } - expression_attribute_names = {"#status": "status"} - + expression_attribute_names = {"#status": "status", "#driver": "driver"} self.table.update_item( Key={'delivery_date': record['delivery_date'], 'id': record['id']}, UpdateExpression=update_expression,