- Frontend: Next.js 14 with TypeScript - Backend: FastAPI with SQLAlchemy - Agent: Carmodoo sync agent - Deployment: Docker Compose based staging/production setup - Scripts: Automated deployment with rollback support 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
81 lines
1.9 KiB
Python
81 lines
1.9 KiB
Python
from pydantic import BaseModel
|
|
from typing import Optional
|
|
from datetime import datetime
|
|
|
|
|
|
class DealerApplicationCreate(BaseModel):
|
|
"""Schema for creating a dealer application"""
|
|
business_name: str
|
|
business_number: Optional[str] = None
|
|
real_name: str
|
|
id_number: Optional[str] = None # Will be encrypted before storage
|
|
phone: str
|
|
bank_name: str
|
|
bank_account: str
|
|
account_holder: str
|
|
photo_url: Optional[str] = None
|
|
|
|
|
|
class DealerApplicationResponse(BaseModel):
|
|
"""Schema for dealer application response"""
|
|
id: int
|
|
user_id: int
|
|
business_name: str
|
|
business_number: Optional[str] = None
|
|
real_name: str
|
|
phone: str
|
|
bank_name: str
|
|
bank_account: str
|
|
account_holder: str
|
|
photo_url: Optional[str] = None
|
|
status: str
|
|
rejected_reason: Optional[str] = None
|
|
applied_at: datetime
|
|
approved_at: Optional[datetime] = None
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
|
|
class DealerApplicationApprove(BaseModel):
|
|
"""Schema for approving a dealer application"""
|
|
pass # No additional fields needed
|
|
|
|
|
|
class DealerApplicationReject(BaseModel):
|
|
"""Schema for rejecting a dealer application"""
|
|
reason: str
|
|
|
|
|
|
class DealerInfoResponse(BaseModel):
|
|
"""Schema for dealer info response"""
|
|
id: int
|
|
user_id: int
|
|
dealer_code: str
|
|
dealer_card_url: Optional[str] = None
|
|
business_name: str
|
|
real_name: str
|
|
phone: str
|
|
photo_url: Optional[str] = None
|
|
total_commission_earned: float
|
|
total_withdrawn: float
|
|
pending_withdrawal: float
|
|
is_active: bool
|
|
created_at: datetime
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
|
|
class DealerPublicInfo(BaseModel):
|
|
"""Public dealer info for displaying in lists"""
|
|
id: int
|
|
dealer_code: str
|
|
business_name: str
|
|
real_name: str
|
|
photo_url: Optional[str] = None
|
|
is_active: bool
|
|
|
|
class Config:
|
|
from_attributes = True
|