ifixkart-admin/Backend/app/models/BrandModel.py
Adithiyan bbd3a3e959 feat: initial commit — full platform snapshot
- Backend: FastAPI app with all models, services, schemas, routes
- Admin Panel: Next.js dashboard with all modules
  (CRM, POS, repairs, warranties, billing, notifications, etc.)
- Ecommerce: storefront (submodule) + product catalog
- AI Agents: .agents/ skill library for Antigravity IDE
- Docs: architecture, billing, notification gateway markdown
- Submodules: Backend/OpenWA, Ecommerce/File 2/storefront
2026-10-13 12:59:47 +05:30

22 lines
913 B
Python

from sqlalchemy import Column, String, Boolean, DateTime
from sqlalchemy.sql import func
from sqlalchemy.orm import relationship
from app.core.database.db_session import Base
from app.models.BrandDeviceTypeModel import BrandDeviceType
class Brand(Base):
__tablename__ = "brands"
brand_id = Column(String(26), primary_key=True)
name = Column(String(100), unique=True, nullable=False)
slug = Column(String(100), unique=True, nullable=False)
logo_url = Column(String(500), nullable=True)
is_active = Column(Boolean, default=True)
created_at = Column(DateTime, server_default=func.now())
updated_at = Column(DateTime, server_default=func.now(), onupdate=func.now())
device_types_rel = relationship("BrandDeviceType", back_populates="brand", cascade="all, delete-orphan")
@property
def device_types(self):
return [dt.device_type for dt in self.device_types_rel]