46 lines
933 B
Python
46 lines
933 B
Python
|
|
"""Schemas for Workspace API endpoints."""
|
||
|
|
|
||
|
|
from __future__ import annotations
|
||
|
|
|
||
|
|
from pydantic import BaseModel
|
||
|
|
|
||
|
|
|
||
|
|
class WorkspaceBase(BaseModel):
|
||
|
|
name: str
|
||
|
|
icon: str = "LayoutGrid"
|
||
|
|
description: str | None = None
|
||
|
|
is_default: bool = False
|
||
|
|
is_active: bool = True
|
||
|
|
|
||
|
|
|
||
|
|
class WorkspaceCreate(WorkspaceBase):
|
||
|
|
pass
|
||
|
|
|
||
|
|
|
||
|
|
class WorkspaceUpdate(BaseModel):
|
||
|
|
name: str | None = None
|
||
|
|
icon: str | None = None
|
||
|
|
description: str | None = None
|
||
|
|
is_default: bool | None = None
|
||
|
|
is_active: bool | None = None
|
||
|
|
|
||
|
|
|
||
|
|
class WorkspaceResponse(WorkspaceBase):
|
||
|
|
id: str
|
||
|
|
created_by: str | None = None
|
||
|
|
created_at: str | None = None
|
||
|
|
updated_at: str | None = None
|
||
|
|
|
||
|
|
model_config = {"from_attributes": True}
|
||
|
|
|
||
|
|
|
||
|
|
class WorkspaceModuleResponse(BaseModel):
|
||
|
|
id: str
|
||
|
|
workspace_id: str
|
||
|
|
module_key: str
|
||
|
|
is_visible: bool
|
||
|
|
menu_order: int
|
||
|
|
config: dict = {}
|
||
|
|
|
||
|
|
model_config = {"from_attributes": True}
|