| 12345678910111213141516 |
- from uuid import uuid4
- from core_db import AuditMixin, Base, VersionMixin
- from sqlalchemy import JSON, String, Text
- from sqlalchemy.orm import Mapped, mapped_column
- class Role(Base, AuditMixin, VersionMixin):
- __tablename__ = "auth_role"
- id: Mapped[str] = mapped_column(String(36), primary_key=True, default=lambda: str(uuid4()))
- code: Mapped[str] = mapped_column(String(128), index=True)
- name: Mapped[str] = mapped_column(String(128))
- description: Mapped[str | None] = mapped_column(Text, nullable=True)
- status: Mapped[str] = mapped_column(String(32), default="active", index=True)
- permissions_json: Mapped[list[str]] = mapped_column(JSON, default=list)
|