15 lines
563 B
Python
15 lines
563 B
Python
from sqlalchemy import Column, String, Text
|
|
from sqlalchemy.orm import relationship
|
|
from app.models.base import BaseModel
|
|
|
|
class Supplier(BaseModel):
|
|
"""Model for suppliers."""
|
|
name = Column(String, unique=True, index=True, nullable=False)
|
|
contact_name = Column(String, nullable=True)
|
|
contact_email = Column(String, nullable=True)
|
|
contact_phone = Column(String, nullable=True)
|
|
address = Column(Text, nullable=True)
|
|
notes = Column(Text, nullable=True)
|
|
|
|
# Relationships
|
|
items = relationship("Item", back_populates="supplier") |