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:
35
backend/app/models/withdrawal.py
Normal file
35
backend/app/models/withdrawal.py
Normal file
@@ -0,0 +1,35 @@
|
||||
from sqlalchemy import Column, Integer, String, Boolean, DateTime, ForeignKey, Float, Text
|
||||
from sqlalchemy.orm import relationship
|
||||
from sqlalchemy.sql import func
|
||||
from ..database import Base
|
||||
|
||||
|
||||
class WithdrawalRequest(Base):
|
||||
"""Track withdrawal requests from users"""
|
||||
__tablename__ = "withdrawal_requests"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
user_id = Column(Integer, ForeignKey("users.id"), nullable=False)
|
||||
|
||||
# Amount details
|
||||
amount = Column(Float, nullable=False) # Requested withdrawal amount
|
||||
tax_withheld = Column(Float, default=0) # Tax amount withheld (3.3%)
|
||||
net_amount = Column(Float, nullable=False) # Net amount after tax
|
||||
|
||||
# Bank info (snapshot at time of request)
|
||||
bank_name = Column(String(50), nullable=False)
|
||||
bank_account = Column(String(100), nullable=False)
|
||||
account_holder = Column(String(100), nullable=False)
|
||||
|
||||
# Status
|
||||
status = Column(String(20), default="pending") # pending, approved, completed, rejected
|
||||
|
||||
# Admin notes
|
||||
admin_note = Column(Text, nullable=True)
|
||||
|
||||
# Timestamps
|
||||
requested_at = Column(DateTime(timezone=True), server_default=func.now())
|
||||
processed_at = Column(DateTime(timezone=True), nullable=True)
|
||||
|
||||
# Relationships
|
||||
user = relationship("User", backref="withdrawal_requests")
|
||||
Reference in New Issue
Block a user