"""Vendor model."""

from shopdb.extensions import db
from .base import BaseModel


class Vendor(BaseModel):
    """Vendor/Manufacturer model."""
    __tablename__ = 'vendors'

    vendorid = db.Column(db.Integer, primary_key=True)
    vendor = db.Column(db.String(100), unique=True, nullable=False)
    description = db.Column(db.Text)
    website = db.Column(db.String(255))
    supportphone = db.Column(db.String(50))
    supportemail = db.Column(db.String(100))
    notes = db.Column(db.Text)

    def __repr__(self):
        return f"<Vendor {self.vendor}>"
