Coverage for packages/clopos/src/integrify/clopos/schemas/categories/object.py: 100%
45 statements
« prev ^ index » next coverage.py v7.16.0, created at 2026-10-19 02:39 +0000
« prev ^ index » next coverage.py v7.16.0, created at 2026-10-19 02:39 +0000
1from integrify.clopos.schemas.common.object import Image, Media, Timestamp
2from integrify.clopos.schemas.enums import CategoryType
3from integrify.utils import UnsetOrNoneField
4from pydantic import Field
7class Category(Timestamp):
8 id: int
9 """Unique identifier"""
11 name: str
12 """Name of the category"""
14 status: int
15 """1 = active, 0 = inactive"""
17 hidden: bool
18 """Whether the category is hidden or not"""
20 type: CategoryType
21 """product_category, ingredient_category, accounting_category"""
23 image: UnsetOrNoneField[Image]
24 """Image of the category"""
26 position: UnsetOrNoneField[int]
27 """The position of the category"""
29 emenu_position: UnsetOrNoneField[int]
30 """The position of the category in the eMenu"""
32 meta: UnsetOrNoneField[dict]
33 """Additional settings and visibility info"""
35 emenu_hidden: UnsetOrNoneField[bool]
36 """Whether the category is hidden in the eMenu or not"""
38 code: UnsetOrNoneField[str]
39 """The code of the category"""
41 lft: int = Field(alias='_lft')
42 """Nested set boundaries"""
44 rgt: int = Field(alias='_rgt')
45 """Nested set boundaries"""
47 depth: int
48 """Depth of the subcategory"""
50 parent_id: UnsetOrNoneField[int]
51 """Parent category ID, null for root"""
53 slug: UnsetOrNoneField[str]
54 """URL-friendly identifier"""
56 color: UnsetOrNoneField[str]
57 """HEX color"""
59 properties: UnsetOrNoneField[dict | list]
60 """Additional settings and visibility info"""
62 media: list[Media]
63 """Media of the category"""
65 children: UnsetOrNoneField[list['Category']]
66 """Subcategories"""