init commit
This commit is contained in:
28
app/schemas/account.py
Normal file
28
app/schemas/account.py
Normal file
@@ -0,0 +1,28 @@
|
||||
"""Account schemas"""
|
||||
|
||||
from pydantic import BaseModel
|
||||
from datetime import datetime
|
||||
from typing import Optional
|
||||
|
||||
|
||||
class AccountCreateSchema(BaseModel):
|
||||
"""Schema for creating account"""
|
||||
name: str
|
||||
account_type: str = "card"
|
||||
description: Optional[str] = None
|
||||
initial_balance: float = 0.0
|
||||
|
||||
|
||||
class AccountSchema(AccountCreateSchema):
|
||||
"""Account response schema"""
|
||||
id: int
|
||||
family_id: int
|
||||
owner_id: int
|
||||
balance: float
|
||||
is_active: bool
|
||||
is_archived: bool
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
Reference in New Issue
Block a user