Skip to content

Commit

Permalink
refactor: remove unused method
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigosfelix committed Oct 15, 2024
1 parent e128b9c commit fb89b8b
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/cart/use_cases/cart.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,6 @@ def get_order_by_id(order_id: str, gateway: ICartGateway):
def delete_order(order_id: str, gateway: ICartGateway):
gateway.delete_order(order_id=order_id)

@staticmethod
def add_new_product_to_order(original_order_products, product_gateway, updated_order_products_sku):
product_entity = product_gateway.get_product_by_sku(updated_order_products_sku['sku'])
quantity = updated_order_products_sku['quantity']
new_order_product = OrderProduct(product=product_entity,
quantity=quantity,
observation=updated_order_products_sku.get('observation'))
original_order_products.append(new_order_product)
product_entity.stock -= quantity if product_entity.stock - quantity > 0 else 0
product_gateway.create_update_product(product=product_entity)

@staticmethod
def update_order_status(order_id: str, new_status: str, gateway: ICartGateway):
order = CartUseCase.get_order_by_id(order_id, gateway)
Expand Down

0 comments on commit fb89b8b

Please sign in to comment.