init commit
This commit is contained in:
28
app/schemas/category.py
Normal file
28
app/schemas/category.py
Normal file
@@ -0,0 +1,28 @@
|
||||
"""Category schemas"""
|
||||
|
||||
from pydantic import BaseModel
|
||||
from datetime import datetime
|
||||
from typing import Optional
|
||||
|
||||
|
||||
class CategoryCreateSchema(BaseModel):
|
||||
"""Schema for creating category"""
|
||||
name: str
|
||||
category_type: str
|
||||
emoji: Optional[str] = None
|
||||
color: Optional[str] = None
|
||||
description: Optional[str] = None
|
||||
is_default: bool = False
|
||||
|
||||
|
||||
class CategorySchema(CategoryCreateSchema):
|
||||
"""Category response schema"""
|
||||
id: int
|
||||
family_id: int
|
||||
is_active: bool
|
||||
order: int
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
Reference in New Issue
Block a user