# This file was auto-generated by Fern from our API Definition.

from ..core.pydantic_utilities import UniversalBaseModel
import typing
import pydantic
from .category_type import CategoryType
import typing_extensions
from ..core.serialization import FieldMetadata
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class Category(UniversalBaseModel):
    id: typing.Optional[int] = pydantic.Field(default=None)
    """
    Unique identifier for the category
    """

    name: typing.Optional[str] = pydantic.Field(default=None)
    """
    Name of the category
    """

    type: typing.Optional[CategoryType] = pydantic.Field(default=None)
    """
    Type of the category
    """

    company_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="companyId")] = pydantic.Field(
        default=None
    )
    """
    ID of the company
    """

    account_code: typing.Optional[int] = pydantic.Field(default=None)
    """
    Account code
    """

    sub_type_code: typing.Optional[int] = pydantic.Field(default=None)
    """
    Sub-type code
    """

    tb_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    Trial balance ID
    """

    ledger_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    Ledger ID
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
