0.1.4 models update

This commit is contained in:
2026-07-22 16:12:10 +03:00
parent 588bff725b
commit 8e66161ddd
12 changed files with 386 additions and 18 deletions

View File

@@ -40,8 +40,7 @@ class UserUpdate(Base):
permissions:Annotated[list[str]|None, Field(None, description="permissions of the user")]
permission_groups:Annotated[list[str]|None, Field(None, description="permissions groups of the user")]
class Permissions(Base):
id:int
class PermissionsCreate(Base):
permission:Annotated[str, Field(..., max_length=30, description="permission name")]
@@ -49,8 +48,8 @@ class PermissionsOut(Base):
permission:Annotated[str, Field(..., max_length=30, description="permission name")]
class PermissionsGroups(Base):
id:int
class PermissionsGroupsCreate(Base):
group:Annotated[str, Field(..., max_length=255, description="group name for the permissions")]
@@ -59,21 +58,20 @@ class PermissionsGroupsOut(Base):
group:Annotated[str, Field(..., max_length=255, description="group name for the permissions")]
class RefreshTokens(Base):
class RefreshTokensCreate(Base):
user_id:Annotated[UUID, Field(..., description="foreign key for the user")]
token_hash:Annotated[str, Field(..., description="token hash")]
device_info:Annotated[str, Field(..., description="User device info")]
ip_address:Annotated[str, Field(..., description="ip v4/v6 of the user")]
token_hash:Annotated[str, Field(...,max_length=255, description="token hash")]
device_info:Annotated[str, Field(...,max_length=255, description="User device info")]
ip_address:Annotated[str, Field(...,max_length=45, description="ip v4/v6 of the user")]
is_revoked:Annotated[bool|None, Field(None, description="revoke token if logout was made")]
expires_at:Annotated[datetime, Field(..., description="when token is going to be expired")]
class RefreshTokensOut(Base):
id:int
user_id:Annotated[UUID, Field(..., description="foreign key for the user")]
token_hash:Annotated[str, Field(..., description="token hash")]
device_info:Annotated[str, Field(..., description="User device info")]
ip_address:Annotated[str, Field(..., description="ip v4/v6 of the user")]
token_hash:Annotated[str, Field(..., max_length=255,description="token hash")]
device_info:Annotated[str, Field(..., max_length=255, description="User device info")]
ip_address:Annotated[str, Field(...,max_length=45, description="ip v4/v6 of the user")]
is_revoked:Annotated[bool|None, Field(None, description="revoke token if logout was made")]
expires_at:Annotated[datetime, Field(..., description="when token is going to be expired")]