first commit

This commit is contained in:
javad committed 2026-06-15 10:57:28 +03:30
commit 3e4574dcdd
163 files changed
+3559

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
from apps.order.models import Order as OrderModel
from rest_framework.exceptions import ValidationError
def retrieve_order(order_id: int) -> OrderModel:
try:
order = OrderModel.objects.get(id=order_id)
return order
except OrderModel.DoesNotExist:
raise ValidationError(f"Order with id {order_id} does not exist")
except Exception as e:
raise ValidationError(f"Error retrieving order: {e}")