feat: init activities

This commit is contained in:
swve 2023-11-14 22:30:39 +01:00
parent ee07f49139
commit 727f17ba7c
9 changed files with 358 additions and 370 deletions

View file

@ -5,21 +5,21 @@ from sqlmodel import Field, SQLModel
class RoleTypeEnum(str, Enum):
ORGANIZATION = "ORGANIZATION"
ORGANIZATION_API_TOKEN = "ORGANIZATION_API_TOKEN"
GLOBAL = "GLOBAL"
TYPE_ORGANIZATION = "TYPE_ORGANIZATION"
TYPE_ORGANIZATION_API_TOKEN = "TYPE_ORGANIZATION_API_TOKEN"
TYPE_GLOBAL = "TYPE_GLOBAL"
class RoleBase(SQLModel):
name: str
description: Optional[str]
name: str
description: Optional[str]
rights: dict = Field(default={}, sa_column=Column(JSON))
class Role(RoleBase, table=True):
id: Optional[int] = Field(default=None, primary_key=True)
org_id: int = Field(default=None, foreign_key="organization.id")
role_type: RoleTypeEnum = RoleTypeEnum.ORGANIZATION
role_type: RoleTypeEnum = RoleTypeEnum.TYPE_GLOBAL
role_uuid: str = ""
creation_date: str = ""
update_date: str = ""
@ -31,6 +31,6 @@ class RoleCreate(RoleBase):
class RoleUpdate(SQLModel):
role_id: int = Field(default=None, foreign_key="role.id")
name: Optional[str]
description: Optional[str]
name: Optional[str]
description: Optional[str]
rights: Optional[dict] = Field(default={}, sa_column=Column(JSON))