From f8e9a568fcc252300f9efc63af62be37290cbd8d Mon Sep 17 00:00:00 2001 From: Maxim Date: Thu, 19 Dec 2024 02:10:59 +0300 Subject: [PATCH] fix paginated orders --- backend/src/core/entities/order/order.py | 7 ++----- backend/src/core/services/order_service/order_service.py | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/backend/src/core/entities/order/order.py b/backend/src/core/entities/order/order.py index c318a0c..c4ada6b 100644 --- a/backend/src/core/entities/order/order.py +++ b/backend/src/core/entities/order/order.py @@ -123,11 +123,8 @@ class OrderCreated(BaseModel): ) class OrderSummary(BaseModel): - id: Optional[ObjectIdStr] = Field( - ..., - default_factory=ObjectIdStr, - alias="_id", - description="Unique identifier of order" + id: str = Field( + ... ) price: float = Field( default=None, diff --git a/backend/src/core/services/order_service/order_service.py b/backend/src/core/services/order_service/order_service.py index b101282..1dc813f 100644 --- a/backend/src/core/services/order_service/order_service.py +++ b/backend/src/core/services/order_service/order_service.py @@ -86,7 +86,7 @@ async def get_paginated_orders_for_client( [objectId_to_str(tool) for tool in order.tools]) orders.append(OrderSummary( - id=order.id, + id=str(order.id), price=order.price, tools=tool_summaries, start_leasing=order.start_leasing,