Initial commit: AutonetSellCar platform with deployment system
- 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>
This commit is contained in:
69
backend/app/schemas/vehicle_share.py
Normal file
69
backend/app/schemas/vehicle_share.py
Normal file
@@ -0,0 +1,69 @@
|
||||
from pydantic import BaseModel
|
||||
from typing import Optional
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
class VehicleShareCreate(BaseModel):
|
||||
"""Schema for creating a vehicle share"""
|
||||
request_vehicle_id: int
|
||||
markup_amount_krw: float = 0
|
||||
|
||||
|
||||
class VehicleShareResponse(BaseModel):
|
||||
"""Schema for vehicle share response"""
|
||||
id: int
|
||||
user_id: int
|
||||
request_vehicle_id: int
|
||||
share_code: str
|
||||
original_price_krw: float
|
||||
markup_amount_krw: float
|
||||
shared_price_krw: float
|
||||
view_count: int
|
||||
is_purchased: bool
|
||||
purchased_by_user_id: Optional[int] = None
|
||||
created_at: datetime
|
||||
expires_at: Optional[datetime] = None
|
||||
purchased_at: Optional[datetime] = None
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class VehicleSharePublic(BaseModel):
|
||||
"""Public schema for shared vehicle (for viewing shared link)"""
|
||||
id: int
|
||||
share_code: str
|
||||
shared_price_krw: float
|
||||
view_count: int
|
||||
is_purchased: bool
|
||||
created_at: datetime
|
||||
# Vehicle info will be added separately
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class ShareRewardResponse(BaseModel):
|
||||
"""Schema for share reward response"""
|
||||
id: int
|
||||
user_id: int
|
||||
vehicle_share_id: int
|
||||
markup_amount: float
|
||||
reward_amount: float
|
||||
tax_amount: float
|
||||
net_amount: float
|
||||
status: str
|
||||
withdrawn_at: Optional[datetime] = None
|
||||
created_at: datetime
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class ShareRewardSummary(BaseModel):
|
||||
"""Summary of user's share rewards"""
|
||||
total_rewards: float
|
||||
total_withdrawn: float
|
||||
pending_amount: float
|
||||
available_for_withdrawal: float
|
||||
reward_count: int
|
||||
Reference in New Issue
Block a user