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

43 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 Balance, Media, Timestamp 

4from integrify.utils import UnsetOrNoneField 

5 

6 

7class PaymentMethod(Timestamp): 

8 id: int 

9 """The unique identifier for the payment method""" 

10 

11 name: str 

12 """The name of the payment method (e.g., "Cash", "Card")""" 

13 

14 customer_required: int 

15 """Whether a customer must be attached to the transaction (1 for yes, 0 for no)""" 

16 

17 is_system: int 

18 """Indicates if it’s a system-default payment method""" 

19 

20 balance_id: UnsetOrNoneField[int] 

21 """The ID of the balance associated with the payment method""" 

22 

23 balance: UnsetOrNoneField[Balance] 

24 """An object containing details of the associated balance account""" 

25 

26 service: UnsetOrNoneField[dict] 

27 """Details of any external service integrated with this payment method""" 

28 

29 split: UnsetOrNoneField[int] 

30 """Indicates if this payment method can be used for split payments""" 

31 

32 status: dict[str, int] 

33 """Map of venue_id -> 0/1 availability for this method""" 

34 

35 

36class SaleType(Timestamp): 

37 id: int 

38 """The unique identifier for the sale type""" 

39 

40 name: str 

41 """The name of the sale type (e.g., "In-store", "Delivery")""" 

42 

43 system_type: UnsetOrNoneField[str] 

44 """A system-defined type identifier (e.g., "IN", "DELIVERY")""" 

45 

46 status: dict[str, int] 

47 """Map of venue_id -> 0/1 availability for this method""" 

48 

49 channel: UnsetOrNoneField[str] 

50 """The channel the sale type belongs to""" 

51 

52 service_charge_rate: UnsetOrNoneField[Decimal] 

53 """The service charge rate associated with this sale type""" 

54 

55 payment_method_id: UnsetOrNoneField[int] 

56 """The ID of the default payment method for this sale type, if any""" 

57 

58 position: UnsetOrNoneField[int] 

59 """The position of the sale type in the list of sale types""" 

60 

61 payment_method: UnsetOrNoneField[PaymentMethod] 

62 """An object containing details of the associated payment method""" 

63 

64 media: UnsetOrNoneField[list[Media]] 

65 """Media of the sale type"""