feat: backend core — models, auth, CRUD, tests
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import uuid
|
||||
from datetime import datetime
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
from app.models.category import CategoryType
|
||||
|
||||
|
||||
class CategoryCreate(BaseModel):
|
||||
name: str
|
||||
type: CategoryType
|
||||
color: str | None = None
|
||||
icon: str | None = None
|
||||
|
||||
|
||||
class CategoryUpdate(BaseModel):
|
||||
name: str | None = None
|
||||
color: str | None = None
|
||||
icon: str | None = None
|
||||
|
||||
|
||||
class CategoryResponse(BaseModel):
|
||||
id: uuid.UUID
|
||||
name: str
|
||||
type: CategoryType
|
||||
color: str | None
|
||||
icon: str | None
|
||||
is_default: bool
|
||||
created_at: datetime
|
||||
|
||||
model_config = {"from_attributes": True}
|
||||
Reference in New Issue
Block a user