# plugins/admin/models.py

from app import db
from datetime import datetime

class AnalyticsEvent(db.Model):
    __tablename__ = 'analytics_event'

    id              = db.Column(db.Integer, primary_key=True)
    timestamp       = db.Column(db.DateTime, default=datetime.utcnow, nullable=False)
    method          = db.Column(db.String(10), nullable=False)
    path            = db.Column(db.String(200), nullable=False)
    status_code     = db.Column(db.Integer, nullable=False)
    response_time   = db.Column(db.Float, nullable=False)
    user_agent      = db.Column(db.String(200))
    referer         = db.Column(db.String(200))
    accept_language = db.Column(db.String(200))
