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

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 

5 

6 

7class Category(Timestamp): 

8 id: int 

9 """Unique identifier""" 

10 

11 name: str 

12 """Name of the category""" 

13 

14 status: int 

15 """1 = active, 0 = inactive""" 

16 

17 hidden: bool 

18 """Whether the category is hidden or not""" 

19 

20 type: CategoryType 

21 """product_category, ingredient_category, accounting_category""" 

22 

23 image: UnsetOrNoneField[Image] 

24 """Image of the category""" 

25 

26 position: UnsetOrNoneField[int] 

27 """The position of the category""" 

28 

29 emenu_position: UnsetOrNoneField[int] 

30 """The position of the category in the eMenu""" 

31 

32 meta: UnsetOrNoneField[dict] 

33 """Additional settings and visibility info""" 

34 

35 emenu_hidden: UnsetOrNoneField[bool] 

36 """Whether the category is hidden in the eMenu or not""" 

37 

38 code: UnsetOrNoneField[str] 

39 """The code of the category""" 

40 

41 lft: int = Field(alias='_lft') 

42 """Nested set boundaries""" 

43 

44 rgt: int = Field(alias='_rgt') 

45 """Nested set boundaries""" 

46 

47 depth: int 

48 """Depth of the subcategory""" 

49 

50 parent_id: UnsetOrNoneField[int] 

51 """Parent category ID, null for root""" 

52 

53 slug: UnsetOrNoneField[str] 

54 """URL-friendly identifier""" 

55 

56 color: UnsetOrNoneField[str] 

57 """HEX color""" 

58 

59 properties: UnsetOrNoneField[dict | list] 

60 """Additional settings and visibility info""" 

61 

62 media: list[Media] 

63 """Media of the category""" 

64 

65 children: UnsetOrNoneField[list['Category']] 

66 """Subcategories"""