init commit
This commit is contained in:
29
app/schemas/budget.py
Normal file
29
app/schemas/budget.py
Normal file
@@ -0,0 +1,29 @@
|
||||
"""Budget schemas"""
|
||||
|
||||
from pydantic import BaseModel
|
||||
from datetime import datetime
|
||||
from typing import Optional
|
||||
|
||||
|
||||
class BudgetCreateSchema(BaseModel):
|
||||
"""Schema for creating budget"""
|
||||
name: str
|
||||
limit_amount: float
|
||||
period: str = "monthly"
|
||||
alert_threshold: float = 80.0
|
||||
category_id: Optional[int] = None
|
||||
start_date: datetime
|
||||
|
||||
|
||||
class BudgetSchema(BudgetCreateSchema):
|
||||
"""Budget response schema"""
|
||||
id: int
|
||||
family_id: int
|
||||
spent_amount: float
|
||||
is_active: bool
|
||||
end_date: Optional[datetime] = None
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
Reference in New Issue
Block a user