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

31 statements  

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

1from decimal import Decimal 

2 

3from integrify.utils import UnsetOrNoneField 

4from pydantic import BaseModel 

5 

6 

7class PriceListPrice(BaseModel): 

8 id: int 

9 """Unique identifier of the price entry""" 

10 

11 list_id: int 

12 """ID of the price list this price belongs to""" 

13 

14 product_id: int 

15 """ID of the product this price applies to""" 

16 

17 price: Decimal 

18 """The price value for the product in this list""" 

19 

20 product: UnsetOrNoneField[dict] 

21 """The related product object (included with `with[]=product`)""" 

22 

23 list: UnsetOrNoneField[dict] 

24 """The related price list object (included with `with[]=list`)""" 

25 

26 

27class PriceList(BaseModel): 

28 id: int 

29 """Unique identifier of the price list""" 

30 

31 name: str 

32 """Name of the price list""" 

33 

34 description: UnsetOrNoneField[str] 

35 """Description of the price list""" 

36 

37 status: bool 

38 """Whether the price list is active""" 

39 

40 prices: UnsetOrNoneField[list[PriceListPrice]] 

41 """Prices contained in this list (included with `with[]=prices`)""" 

42 

43 created_at: UnsetOrNoneField[str] 

44 """The timestamp when the price list was created""" 

45 

46 updated_at: UnsetOrNoneField[str] 

47 """The timestamp when the price list was last updated"""