Add user delete process 2

This commit is contained in:
Urtzi Alfaro
2025-10-31 18:57:58 +01:00
parent 269d3b5032
commit f44d235c6d
15 changed files with 166 additions and 145 deletions

View File

@@ -50,7 +50,7 @@ class PurchaseOrderItemResponse(PurchaseOrderBase):
tenant_id: uuid.UUID
purchase_order_id: uuid.UUID
inventory_product_id: uuid.UUID # Changed from ingredient_id to match model
ingredient_name: Optional[str] = None
product_name: Optional[str] = None
ordered_quantity: Decimal
received_quantity: Decimal
unit_price: Decimal
@@ -109,6 +109,29 @@ class PurchaseOrderApproval(PurchaseOrderBase):
approved_by: Optional[uuid.UUID] = None
class SupplierSummary(PurchaseOrderBase):
"""Schema for supplier summary - matches the structure returned by suppliers service"""
id: str
name: str
supplier_code: Optional[str] = None
email: Optional[str] = None
phone: Optional[str] = None
contact_person: Optional[str] = None
address_line1: Optional[str] = None
city: Optional[str] = None
country: Optional[str] = None
supplier_type: Optional[str] = None
status: Optional[str] = None
mobile: Optional[str] = None
website: Optional[str] = None
payment_terms: Optional[str] = None
standard_lead_time: Optional[int] = None
quality_rating: Optional[float] = None
delivery_rating: Optional[float] = None
total_orders: Optional[int] = None
total_amount: Optional[float] = None
class PurchaseOrderResponse(PurchaseOrderBase):
"""Schema for purchase order responses"""
id: uuid.UUID
@@ -155,6 +178,11 @@ class PurchaseOrderResponse(PurchaseOrderBase):
items: List[PurchaseOrderItemResponse] = []
class PurchaseOrderWithSupplierResponse(PurchaseOrderResponse):
"""Schema for purchase order responses with supplier information"""
supplier: Optional[SupplierSummary] = None
class PurchaseOrderSummary(PurchaseOrderBase):
"""Schema for purchase order summary (list view)"""
id: uuid.UUID