Files
xpack-mcp/services/common/models/submission.py
T
jinghui d18adf035b
release / release (release) Canceled after 0s
feat(billing): per-service and platform-wide free call limits
- mcp_service.free_daily_limit: per service, per user per day (NULL/0 = unlimited)
- sys_config free_global_daily_limit: applies to every free service
- effective limit = smaller of the two, so a service without its own value
  still inherits the global one
- admin: Pricing tab input, System Settings > Business > Free Call Limits
- submission review pages and endpoints (scaffolding, not yet published end to end)
- allow LAN IPs in http_utils, add docker-compose.yml
2026-11-13 10:20:25 +08:00

23 lines
1.0 KiB
Python

"""User submission model for MCP/Skill/Plugin marketplace."""
from sqlalchemy import Column, String, Text, DateTime, JSON, Enum
from sqlalchemy.sql import func
from services.common.models.base import Base
import uuid
class Submission(Base):
__tablename__ = "submission"
id = Column(String(36), primary_key=True, default=lambda: str(uuid.uuid4()))
user_id = Column(String(36), nullable=False, index=True)
type = Column(Enum("mcp", "skill", "plugin", name="submission_type"), nullable=False)
name = Column(String(255), nullable=False)
description = Column(Text, nullable=True)
file_path = Column(String(512), nullable=True)
metadata_json = Column(JSON, nullable=True)
status = Column(Enum("pending", "approved", "rejected", name="submission_status"), default="pending", nullable=False)
reviewer_id = Column(String(36), nullable=True)
review_note = Column(Text, nullable=True)
created_at = Column(DateTime, server_default=func.now())
reviewed_at = Column(DateTime, nullable=True)