barker/barker/barker/schemas/master.py

36 lines
678 B
Python

import uuid
from pydantic import BaseModel, ConfigDict, Field
from . import to_camel
class AccountBase(BaseModel):
name: str = Field(..., min_length=1)
is_starred: bool
is_active: bool
model_config = ConfigDict(str_strip_whitespace=True, alias_generator=to_camel, populate_by_name=True)
class AccountIn(AccountBase):
type: int
is_reconcilable: bool
class Account(AccountIn):
id_: uuid.UUID
code: int
is_fixture: bool
class DbSetting(BaseModel):
id_: uuid.UUID
name: str
data: bytes
class AccountType(BaseModel):
id_: int
name: str
model_config = ConfigDict(alias_generator=to_camel, populate_by_name=True)