Coverage for packages/clopos/src/integrify/clopos/schemas/products/object.py: 100%

134 statements  

« prev     ^ index     » next       coverage.py v7.16.0, created at 2026-10-19 02:39 +0000

1from decimal import Decimal 

2 

3from integrify.clopos.schemas.common.object import ( 

4 Image, 

5 Media, 

6 ModifierGroup, 

7 Package, 

8 Price, 

9 Tax, 

10 TimerSetting, 

11 Timestamp, 

12 Variant, 

13) 

14from integrify.clopos.schemas.enums import ProductType 

15from integrify.clopos.schemas.venues.object import Venue 

16from integrify.utils import UnsetOrNoneField 

17from pydantic import BaseModel 

18 

19 

20class Product(Timestamp): 

21 id: int 

22 """Unique identifier""" 

23 

24 cid: UnsetOrNoneField[str] 

25 """Unique identifier""" 

26 

27 parent_id: UnsetOrNoneField[int] 

28 """Parent product ID, null for root""" 

29 

30 station_id: UnsetOrNoneField[int] 

31 """The ID of the station the product belongs to""" 

32 

33 category_id: UnsetOrNoneField[int] 

34 """The ID of the category the product belongs to""" 

35 

36 unit_id: UnsetOrNoneField[int] 

37 """The ID of the unit the product belongs to""" 

38 

39 net_output: UnsetOrNoneField[int] 

40 """Net output of the product""" 

41 

42 type: UnsetOrNoneField[ProductType] 

43 """product, ingredient, accounting""" 

44 

45 name: str 

46 """The main name of the product""" 

47 

48 parent_name: UnsetOrNoneField[str] 

49 """The name of the parent product""" 

50 

51 image: UnsetOrNoneField[Image] 

52 """Image of the product""" 

53 

54 position: UnsetOrNoneField[int] 

55 """The position of the product in the menu""" 

56 

57 description: UnsetOrNoneField[str] 

58 """Description of the product""" 

59 

60 barcode: UnsetOrNoneField[str] 

61 """The barcode of the product""" 

62 

63 gov_code: UnsetOrNoneField[str] 

64 """The government code of the product""" 

65 

66 cost: UnsetOrNoneField[Decimal] 

67 """The cost of the product""" 

68 

69 status: UnsetOrNoneField[int] 

70 """1 = active, 0 = inactive""" 

71 

72 hidden: UnsetOrNoneField[bool] 

73 """Whether the product is hidden or not""" 

74 

75 sold_by_weight: UnsetOrNoneField[bool] 

76 """Whether the product is sold by weight or not""" 

77 

78 max_age: UnsetOrNoneField[int] 

79 """The maximum age of the product""" 

80 

81 discountable: UnsetOrNoneField[bool] 

82 """Whether the product is discountable or not""" 

83 

84 giftable: UnsetOrNoneField[bool] 

85 """Whether the product is giftable or not""" 

86 

87 has_modifications: UnsetOrNoneField[bool] 

88 """If true, the product has variants in the modifications array""" 

89 

90 meta: UnsetOrNoneField[dict] 

91 """Additional settings and visibility info""" 

92 

93 setting: UnsetOrNoneField[TimerSetting] 

94 """Pricing rules for TIMER type products. See Timer Settings""" 

95 

96 modifications: UnsetOrNoneField[list[Variant]] 

97 """List of variants for GOODS type products. See Variant Object""" 

98 

99 modificator_groups: UnsetOrNoneField[list[ModifierGroup]] 

100 """List of modificator groups for GOODS type products. See Modificator Group Object""" 

101 

102 recipe: UnsetOrNoneField[list['Product']] 

103 """Recipe for DISH or PREPARATION type products. See Recipe Item.""" 

104 

105 packages: UnsetOrNoneField[list[Package]] 

106 """Packages for INGREDIENT type products. See Package Object.""" 

107 

108 variants: list['Product'] = [] 

109 """Variants of the product""" 

110 

111 e_menu_id: UnsetOrNoneField[int] 

112 """The ID of the eMenu the product belongs to""" 

113 

114 emenu_category_id: UnsetOrNoneField[int] 

115 """The ID of the category the product belongs to in eMenu""" 

116 

117 emenu_position: UnsetOrNoneField[int] 

118 """The position of the product in eMenu""" 

119 

120 emenu_hidden: UnsetOrNoneField[bool] 

121 """Whether the product is hidden in eMenu or not""" 

122 

123 accounting_category_id: UnsetOrNoneField[int] 

124 """The ID of the category the product belongs to in accounting""" 

125 

126 price: Decimal 

127 """The base price of the product (variants may have their own prices)""" 

128 

129 prices: UnsetOrNoneField[list[Price]] 

130 """The prices of the product""" 

131 

132 cost_price: UnsetOrNoneField[Decimal] 

133 """The cost price of the product""" 

134 

135 markup_rate: UnsetOrNoneField[Decimal] 

136 """The markup rate of the product""" 

137 

138 taxes: UnsetOrNoneField[list[Tax]] 

139 """Taxes applied to the product""" 

140 

141 cooking_time: UnsetOrNoneField[int] 

142 """The cooking time of the product""" 

143 

144 ignore_service_charge: UnsetOrNoneField[bool] 

145 """Whether the product should ignore the service charge or not""" 

146 

147 inventory_behavior: UnsetOrNoneField[int] 

148 """The inventory behavior of the product""" 

149 

150 low_stock: UnsetOrNoneField[int] 

151 """Low stock count""" 

152 

153 unit_weight: UnsetOrNoneField[int] 

154 """The weight of the product in grams""" 

155 

156 name_slug: UnsetOrNoneField[str] 

157 """The slug of the product name""" 

158 

159 full_name: UnsetOrNoneField[str] 

160 """The full product name, including variant information""" 

161 

162 gross_margin: UnsetOrNoneField[Decimal] 

163 """The gross margin of the product""" 

164 

165 slug: UnsetOrNoneField[str] 

166 """The slug of the product""" 

167 

168 color: UnsetOrNoneField[str] 

169 """The color of the product""" 

170 

171 venues: UnsetOrNoneField[list[Venue]] 

172 """The venues the product is available in""" 

173 

174 properties: UnsetOrNoneField[dict | list] 

175 """The properties of the product""" 

176 

177 media: UnsetOrNoneField[list[Media]] 

178 """Media of the product""" 

179 

180 tags: UnsetOrNoneField[list[dict]] 

181 """Tags of the product""" 

182 

183 total_quantity: UnsetOrNoneField[int] 

184 """The total quantity of the product""" 

185 

186 total_cost: UnsetOrNoneField[Decimal] 

187 """The total cost of the product""" 

188 

189 average_cost: UnsetOrNoneField[Decimal] 

190 """The average cost of the product""" 

191 

192 open_receipts_count: UnsetOrNoneField[int] 

193 """The number of open receipts for the product""" 

194 

195 created_at: UnsetOrNoneField[str] # type: ignore[assignment] 

196 """The timestamp when the object was created""" 

197 

198 updated_at: UnsetOrNoneField[str] # type: ignore[assignment] 

199 """The timestamp when the object was last updated""" 

200 

201 

202class StopList(BaseModel): 

203 id: int 

204 """The ID of the stop list""" 

205 

206 limit: int 

207 """The stock limit of the product""" 

208 

209 timestamp: int 

210 """Last updated timestamp"""