
- Complete FastAPI application with JWT authentication
- SQLite database with SQLAlchemy ORM and Alembic migrations
- User registration/login with secure password hashing
- Multi-cryptocurrency wallet system with balance tracking
- Advertisement system for buy/sell listings with fund locking
- Order management with automatic payment integration
- Payment provider API integration with mock fallback
- Automatic crypto release after payment confirmation
- Health monitoring endpoint and CORS configuration
- Comprehensive API documentation with OpenAPI/Swagger
- Database models for users, wallets, ads, orders, and payments
- Complete CRUD operations for all entities
- Security features including fund locking and order expiration
- Detailed README with setup and usage instructions
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
44 lines
1.1 KiB
Python
44 lines
1.1 KiB
Python
from typing import Optional
|
|
from pydantic import BaseModel
|
|
from datetime import datetime
|
|
from app.models.advertisement import AdType, AdStatus
|
|
|
|
|
|
class AdvertisementBase(BaseModel):
|
|
cryptocurrency_id: int
|
|
ad_type: AdType
|
|
price: float
|
|
min_order_amount: float
|
|
max_order_amount: float
|
|
available_amount: float
|
|
payment_methods: str
|
|
terms_conditions: Optional[str] = None
|
|
|
|
|
|
class AdvertisementCreate(AdvertisementBase):
|
|
pass
|
|
|
|
|
|
class AdvertisementUpdate(BaseModel):
|
|
price: Optional[float] = None
|
|
min_order_amount: Optional[float] = None
|
|
max_order_amount: Optional[float] = None
|
|
available_amount: Optional[float] = None
|
|
payment_methods: Optional[str] = None
|
|
terms_conditions: Optional[str] = None
|
|
status: Optional[AdStatus] = None
|
|
|
|
|
|
class AdvertisementInDBBase(AdvertisementBase):
|
|
id: Optional[int] = None
|
|
user_id: Optional[int] = None
|
|
status: Optional[AdStatus] = None
|
|
created_at: Optional[datetime] = None
|
|
updated_at: Optional[datetime] = None
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
|
|
class Advertisement(AdvertisementInDBBase):
|
|
pass |