init commit
This commit is contained in:
30
.history/app/schemas/goal_20251210201618.py
Normal file
30
.history/app/schemas/goal_20251210201618.py
Normal file
@@ -0,0 +1,30 @@
|
||||
"""Goal schemas"""
|
||||
|
||||
from pydantic import BaseModel
|
||||
from datetime import datetime
|
||||
from typing import Optional
|
||||
|
||||
|
||||
class GoalCreateSchema(BaseModel):
|
||||
"""Schema for creating goal"""
|
||||
name: str
|
||||
description: Optional[str] = None
|
||||
target_amount: float
|
||||
priority: int = 0
|
||||
target_date: Optional[datetime] = None
|
||||
account_id: Optional[int] = None
|
||||
|
||||
|
||||
class GoalSchema(GoalCreateSchema):
|
||||
"""Goal response schema"""
|
||||
id: int
|
||||
family_id: int
|
||||
current_amount: float
|
||||
is_active: bool
|
||||
is_completed: bool
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
completed_at: Optional[datetime] = None
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
Reference in New Issue
Block a user