2020-06-14 13:13:10 +00:00
|
|
|
import uuid
|
2020-10-11 05:26:29 +00:00
|
|
|
|
2023-07-26 07:30:01 +00:00
|
|
|
from pydantic import BaseModel, ConfigDict, Field
|
2020-10-11 15:23:43 +00:00
|
|
|
|
|
|
|
from . import to_camel
|
2020-06-14 13:13:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
class AccountBase(BaseModel):
|
|
|
|
name: str = Field(..., min_length=1)
|
|
|
|
is_starred: bool
|
|
|
|
is_active: bool
|
2023-07-22 09:27:50 +00:00
|
|
|
model_config = ConfigDict(str_strip_whitespace=True, alias_generator=to_camel, populate_by_name=True)
|
2020-06-14 13:13:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
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
|
2023-07-22 09:27:50 +00:00
|
|
|
model_config = ConfigDict(alias_generator=to_camel, populate_by_name=True)
|