
- 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>
38 lines
838 B
Python
38 lines
838 B
Python
from typing import Optional
|
|
from pydantic import BaseModel
|
|
from datetime import datetime
|
|
from app.models.payment import PaymentStatus
|
|
|
|
|
|
class PaymentBase(BaseModel):
|
|
order_id: int
|
|
account_number: str
|
|
account_name: str
|
|
bank_name: str
|
|
amount: float
|
|
reference: str
|
|
|
|
|
|
class PaymentCreate(PaymentBase):
|
|
pass
|
|
|
|
|
|
class PaymentUpdate(BaseModel):
|
|
status: Optional[PaymentStatus] = None
|
|
provider_transaction_id: Optional[str] = None
|
|
|
|
|
|
class PaymentInDBBase(PaymentBase):
|
|
id: Optional[int] = None
|
|
status: Optional[PaymentStatus] = None
|
|
provider_transaction_id: Optional[str] = None
|
|
confirmed_at: Optional[datetime] = None
|
|
created_at: Optional[datetime] = None
|
|
updated_at: Optional[datetime] = None
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
|
|
class Payment(PaymentInDBBase):
|
|
pass |