from app.extensions import db

class Module(db.Model):
    __tablename__ = 'modules'

    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String(100), unique=True, nullable=False)
    titel = db.Column(db.String(200), nullable=False)
    kategorie = db.Column(db.String(100))
    icon = db.Column(db.String(20), default='📦')
    beschreibung = db.Column(db.Text)
    standard = db.Column(db.Boolean, default=False)  # immer verfügbar
    sortierung = db.Column(db.Integer, default=0)

    def __repr__(self):
        return f'<Module {self.name}>'
