
- Implemented user authentication with JWT tokens - Created product management endpoints - Added shopping cart functionality - Implemented order management system - Setup database models with SQLAlchemy - Created alembic migrations - Added health check endpoint generated with BackendIM... (backend.im)
17 lines
619 B
Python
17 lines
619 B
Python
from sqlalchemy import Boolean, Column, String
|
|
from sqlalchemy.orm import relationship
|
|
|
|
from app.models.base import BaseModel
|
|
|
|
|
|
class User(BaseModel):
|
|
__tablename__ = "users"
|
|
|
|
email = Column(String, unique=True, index=True, nullable=False)
|
|
password = Column(String, nullable=False)
|
|
full_name = Column(String, nullable=True)
|
|
is_active = Column(Boolean, default=True)
|
|
is_admin = Column(Boolean, default=False)
|
|
|
|
orders = relationship("Order", back_populates="user", cascade="all, delete-orphan")
|
|
cart_items = relationship("CartItem", back_populates="user", cascade="all, delete-orphan") |