
- 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>
21 lines
996 B
Python
21 lines
996 B
Python
from sqlalchemy import Column, Integer, String, Boolean, Float, DateTime
|
|
from sqlalchemy.orm import relationship
|
|
from sqlalchemy.sql import func
|
|
from app.db.base import Base
|
|
|
|
class Cryptocurrency(Base):
|
|
__tablename__ = "cryptocurrencies"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
symbol = Column(String, unique=True, index=True, nullable=False) # e.g., BTC, ETH, USDT
|
|
name = Column(String, nullable=False) # e.g., Bitcoin, Ethereum, Tether
|
|
is_active = Column(Boolean, default=True)
|
|
min_trade_amount = Column(Float, default=0.00001)
|
|
max_trade_amount = Column(Float, default=1000000.0)
|
|
precision = Column(Integer, default=8) # decimal places
|
|
created_at = Column(DateTime, server_default=func.now())
|
|
|
|
# Relationships
|
|
wallets = relationship("Wallet", back_populates="cryptocurrency")
|
|
advertisements = relationship("Advertisement", back_populates="cryptocurrency")
|
|
orders = relationship("Order", back_populates="cryptocurrency") |