- Backend: FastAPI app with all models, services, schemas, routes - Admin Panel: Next.js dashboard with all modules (CRM, POS, repairs, warranties, billing, notifications, etc.) - Ecommerce: storefront (submodule) + product catalog - AI Agents: .agents/ skill library for Antigravity IDE - Docs: architecture, billing, notification gateway markdown - Submodules: Backend/OpenWA, Ecommerce/File 2/storefront
34 lines
1.1 KiB
Python
34 lines
1.1 KiB
Python
from pydantic import BaseModel, Field
|
|
from typing import Optional
|
|
from datetime import datetime
|
|
|
|
class WarrantyBase(BaseModel):
|
|
reference_type: str = Field(..., description="ORDER or SERVICE")
|
|
reference_id: str = Field(..., description="Order ID or Service Job ID")
|
|
product_id: Optional[str] = None
|
|
order_item_id: Optional[str] = None
|
|
service_job_id: Optional[str] = None
|
|
serial_no_imei: Optional[str] = None
|
|
start_date: datetime
|
|
end_date: datetime
|
|
status: str = Field(default="ACTIVE", description="ACTIVE, EXPIRED, VOID")
|
|
warranty_type: str = Field(..., description="PRODUCT, SERVICE, EXTENDED")
|
|
terms: Optional[str] = None
|
|
void_reason: Optional[str] = None
|
|
|
|
class WarrantyCreate(WarrantyBase):
|
|
customer_id: str
|
|
|
|
class WarrantyResponse(WarrantyBase):
|
|
warranty_id: str
|
|
tenant_id: str
|
|
customer_id: str
|
|
expiry_notification_sent: bool
|
|
created_at: datetime
|
|
updated_at: datetime
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
class WarrantyVoidRequest(BaseModel):
|
|
void_reason: str = Field(..., description="Reason for voiding the warranty")
|