fix: address ask-user findings from review
- Move unit loading to use real /api/tickets/units endpoint - Match unit code format to backend seed (0101E style) - Send unit_id in create ticket payload - Fix tech IDs to match seed order (9-15 for Prosper-Afful) - Add customer_name and phone fields to TicketCreate schema - Map form customer_name/phone into API payload
This commit is contained in:
@@ -8,6 +8,17 @@ from decimal import Decimal
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
# ── Unit ─────────────────────────────────────────────────────────────
|
||||
class UnitOut(BaseModel):
|
||||
id: int
|
||||
property: str
|
||||
apartment_code: str
|
||||
building: str | None = None
|
||||
floor: int | None = None
|
||||
|
||||
model_config = {"from_attributes": True}
|
||||
|
||||
|
||||
# ── Category ─────────────────────────────────────────────────────────
|
||||
class CategoryOut(BaseModel):
|
||||
id: int
|
||||
@@ -32,6 +43,8 @@ class TicketCreate(BaseModel):
|
||||
reported_via: str | None = None # whatsapp, phone, walk-in, qr, agent
|
||||
description: str | None = None
|
||||
assigned_to: int | None = None
|
||||
customer_name: str | None = None
|
||||
phone: str | None = None
|
||||
|
||||
|
||||
class TicketUpdate(BaseModel):
|
||||
|
||||
Reference in New Issue
Block a user