20 lines
980 B
Python
20 lines
980 B
Python
"""
|
|
@model SettingModel (Backend/app/models/SettingModel.py)
|
|
@purpose Robust key-value setting model for system configuration across Core, Storefront, Shipping, and Repair domains.
|
|
"""
|
|
from sqlalchemy import Column, String, Boolean, JSON
|
|
from app.models.db_base import Base
|
|
from app.models.audit_base import AuditBaseMixin
|
|
|
|
class Setting(Base, AuditBaseMixin):
|
|
__tablename__ = "settings"
|
|
|
|
setting_id = Column(String(36), primary_key=True, index=True)
|
|
setting_key = Column(String(128), unique=True, index=True, nullable=False)
|
|
group = Column(String(64), nullable=False, default="storefront", index=True)
|
|
type = Column(String(32), nullable=False, default="string")
|
|
setting_value = Column(JSON, nullable=False)
|
|
description = Column(String(500), nullable=True)
|
|
is_public = Column(Boolean, default=True, nullable=False, index=True)
|
|
is_editable = Column(Boolean, default=True, nullable=False)
|
|
validation_rule = Column(String(255), nullable=True)
|