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
« prev ^ index » next coverage.py v7.16.0, created at 2026-10-19 02:39 +0000
1from decimal import Decimal
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
20class Product(Timestamp):
21 id: int
22 """Unique identifier"""
24 cid: UnsetOrNoneField[str]
25 """Unique identifier"""
27 parent_id: UnsetOrNoneField[int]
28 """Parent product ID, null for root"""
30 station_id: UnsetOrNoneField[int]
31 """The ID of the station the product belongs to"""
33 category_id: UnsetOrNoneField[int]
34 """The ID of the category the product belongs to"""
36 unit_id: UnsetOrNoneField[int]
37 """The ID of the unit the product belongs to"""
39 net_output: UnsetOrNoneField[int]
40 """Net output of the product"""
42 type: UnsetOrNoneField[ProductType]
43 """product, ingredient, accounting"""
45 name: str
46 """The main name of the product"""
48 parent_name: UnsetOrNoneField[str]
49 """The name of the parent product"""
51 image: UnsetOrNoneField[Image]
52 """Image of the product"""
54 position: UnsetOrNoneField[int]
55 """The position of the product in the menu"""
57 description: UnsetOrNoneField[str]
58 """Description of the product"""
60 barcode: UnsetOrNoneField[str]
61 """The barcode of the product"""
63 gov_code: UnsetOrNoneField[str]
64 """The government code of the product"""
66 cost: UnsetOrNoneField[Decimal]
67 """The cost of the product"""
69 status: UnsetOrNoneField[int]
70 """1 = active, 0 = inactive"""
72 hidden: UnsetOrNoneField[bool]
73 """Whether the product is hidden or not"""
75 sold_by_weight: UnsetOrNoneField[bool]
76 """Whether the product is sold by weight or not"""
78 max_age: UnsetOrNoneField[int]
79 """The maximum age of the product"""
81 discountable: UnsetOrNoneField[bool]
82 """Whether the product is discountable or not"""
84 giftable: UnsetOrNoneField[bool]
85 """Whether the product is giftable or not"""
87 has_modifications: UnsetOrNoneField[bool]
88 """If true, the product has variants in the modifications array"""
90 meta: UnsetOrNoneField[dict]
91 """Additional settings and visibility info"""
93 setting: UnsetOrNoneField[TimerSetting]
94 """Pricing rules for TIMER type products. See Timer Settings"""
96 modifications: UnsetOrNoneField[list[Variant]]
97 """List of variants for GOODS type products. See Variant Object"""
99 modificator_groups: UnsetOrNoneField[list[ModifierGroup]]
100 """List of modificator groups for GOODS type products. See Modificator Group Object"""
102 recipe: UnsetOrNoneField[list['Product']]
103 """Recipe for DISH or PREPARATION type products. See Recipe Item."""
105 packages: UnsetOrNoneField[list[Package]]
106 """Packages for INGREDIENT type products. See Package Object."""
108 variants: list['Product'] = []
109 """Variants of the product"""
111 e_menu_id: UnsetOrNoneField[int]
112 """The ID of the eMenu the product belongs to"""
114 emenu_category_id: UnsetOrNoneField[int]
115 """The ID of the category the product belongs to in eMenu"""
117 emenu_position: UnsetOrNoneField[int]
118 """The position of the product in eMenu"""
120 emenu_hidden: UnsetOrNoneField[bool]
121 """Whether the product is hidden in eMenu or not"""
123 accounting_category_id: UnsetOrNoneField[int]
124 """The ID of the category the product belongs to in accounting"""
126 price: Decimal
127 """The base price of the product (variants may have their own prices)"""
129 prices: UnsetOrNoneField[list[Price]]
130 """The prices of the product"""
132 cost_price: UnsetOrNoneField[Decimal]
133 """The cost price of the product"""
135 markup_rate: UnsetOrNoneField[Decimal]
136 """The markup rate of the product"""
138 taxes: UnsetOrNoneField[list[Tax]]
139 """Taxes applied to the product"""
141 cooking_time: UnsetOrNoneField[int]
142 """The cooking time of the product"""
144 ignore_service_charge: UnsetOrNoneField[bool]
145 """Whether the product should ignore the service charge or not"""
147 inventory_behavior: UnsetOrNoneField[int]
148 """The inventory behavior of the product"""
150 low_stock: UnsetOrNoneField[int]
151 """Low stock count"""
153 unit_weight: UnsetOrNoneField[int]
154 """The weight of the product in grams"""
156 name_slug: UnsetOrNoneField[str]
157 """The slug of the product name"""
159 full_name: UnsetOrNoneField[str]
160 """The full product name, including variant information"""
162 gross_margin: UnsetOrNoneField[Decimal]
163 """The gross margin of the product"""
165 slug: UnsetOrNoneField[str]
166 """The slug of the product"""
168 color: UnsetOrNoneField[str]
169 """The color of the product"""
171 venues: UnsetOrNoneField[list[Venue]]
172 """The venues the product is available in"""
174 properties: UnsetOrNoneField[dict | list]
175 """The properties of the product"""
177 media: UnsetOrNoneField[list[Media]]
178 """Media of the product"""
180 tags: UnsetOrNoneField[list[dict]]
181 """Tags of the product"""
183 total_quantity: UnsetOrNoneField[int]
184 """The total quantity of the product"""
186 total_cost: UnsetOrNoneField[Decimal]
187 """The total cost of the product"""
189 average_cost: UnsetOrNoneField[Decimal]
190 """The average cost of the product"""
192 open_receipts_count: UnsetOrNoneField[int]
193 """The number of open receipts for the product"""
195 created_at: UnsetOrNoneField[str] # type: ignore[assignment]
196 """The timestamp when the object was created"""
198 updated_at: UnsetOrNoneField[str] # type: ignore[assignment]
199 """The timestamp when the object was last updated"""
202class StopList(BaseModel):
203 id: int
204 """The ID of the stop list"""
206 limit: int
207 """The stock limit of the product"""
209 timestamp: int
210 """Last updated timestamp"""