团队积分V1

This commit is contained in:
2026-08-14 15:23:46 +08:00
parent 516106c045
commit fac54b5667
70 changed files with 6670 additions and 4649 deletions
+9 -13
View File
@@ -1,4 +1,6 @@
from sqlalchemy import ForeignKey, Index, Integer, String
from datetime import datetime
from sqlalchemy import DateTime, ForeignKey, Index, Integer, String
from sqlalchemy.orm import Mapped, mapped_column
from app.enums.team import TeamStatus
@@ -17,21 +19,15 @@ class Team(Base, TimestampMixin, SoftDeleteMixin):
code: Mapped[str | None] = mapped_column(String(64), nullable=True, comment="团队编码")
description: Mapped[str | None] = mapped_column(String(512), nullable=True, comment="团队备注")
status: Mapped[str] = mapped_column(
String(16),
default=TeamStatus.ACTIVE.value,
server_default=TeamStatus.ACTIVE.value,
nullable=False,
index=True,
comment="团队状态:active启用,disabled禁用",
String(16), default=TeamStatus.ACTIVE.value, server_default=TeamStatus.ACTIVE.value,
nullable=False, index=True, comment="团队状态:active启用,disabled禁用",
)
sort_order: Mapped[int] = mapped_column(
Integer,
default=0,
server_default="0",
nullable=False,
index=True,
comment="排序值,越小越靠前",
Integer, default=0, server_default="0", nullable=False, index=True, comment="排序值,越小越靠前",
)
manager_id: Mapped[str | None] = mapped_column(
String(32), ForeignKey("users.id"), nullable=True, index=True, comment="团队管理人ID"
)
first_subscription_paid_at: Mapped[datetime | None] = mapped_column(
DateTime(timezone=True), nullable=True, index=True, comment="团队首次真实订阅成交时间"
)