elemento-loyalty-processing 1.0.3__py3-none-any.whl → 1.0.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,4 +2,4 @@
2
2
 
3
3
  __author__ = "Anton Taraskin"
4
4
  __email__ = "hel.nidhoggr@gmail.com"
5
- __version__ = "1.0.3"
5
+ __version__ = "1.0.4"
@@ -44,15 +44,15 @@ class ElementoLoyaltyProcessingClient(RPCClientService):
44
44
 
45
45
  async def balance_calculate(
46
46
  self,
47
- customer: dict[str, Any],
48
- store_id: int,
49
- items: list[Item],
50
- custom_attributes: dict[str, Any] = None,
51
- points_sub: int = 0,
52
- transaction_id: TransactionId = None,
47
+ customer: Customer.Fields | dict[str, Any],
48
+ store_id: StoreId,
49
+ payment_type: str,
50
+ items: list[Item] | list[dict[str, Any]],
51
+ transaction_id: TransactionId,
52
+ action: str = BalanceAction.CALC.value,
53
+ points_sub: Points = 0,
53
54
  order_id: str = None,
54
- timestamp: datetime.datetime = None,
55
- actions: list[BalanceAction | str] = None,
55
+ timestamp: datetime = None,
56
56
  meta: dict[str, Any] = None,
57
57
  _max_timeout: int = None,
58
58
  _nowait: bool = False,
@@ -64,12 +64,12 @@ class ElementoLoyaltyProcessingClient(RPCClientService):
64
64
  customer=customer,
65
65
  store_id=store_id,
66
66
  items=items,
67
- custom_attributes=custom_attributes,
67
+ payment_type=payment_type,
68
68
  points_sub=points_sub,
69
69
  transaction_id=transaction_id,
70
70
  order_id=order_id,
71
71
  timestamp=timestamp,
72
- actions=actions,
72
+ action=action,
73
73
  meta=meta,
74
74
  ),
75
75
  max_timeout=_max_timeout,
@@ -3,6 +3,7 @@ from decimal import Decimal
3
3
  from enum import Enum
4
4
  from typing import Any, NewType, TypedDict
5
5
 
6
+ from elemento_customers.types import Customer, CustomerId
6
7
  from msgspec import Struct
7
8
 
8
9
 
@@ -34,14 +35,14 @@ __all__ = [
34
35
  "ActionId",
35
36
  "Points",
36
37
  "StoreId",
38
+ "AppliedOffer",
37
39
  ]
38
40
 
39
41
  DATE_MAXVALUE = date.fromisoformat("3000-01-01")
40
42
 
41
43
  TransactionId = NewType("TransactionId", str)
42
44
  EventTypeId = NewType("EventTypeId", str)
43
- ListId = NewType("ListId", str)
44
- CustomerId = NewType("CustomerId", int)
45
+ ListId = NewType("ListId", int)
45
46
  StoreId = NewType("StoreId", int)
46
47
  OfferId = NewType("OfferId", int)
47
48
  LifetimeId = NewType("LifetimeId", int)
@@ -60,11 +61,6 @@ class OfferEventTypes(Enum):
60
61
  RegistrationDone = "RegistrationDone"
61
62
 
62
63
 
63
- class Customer(TypedDict):
64
- id: CustomerId
65
- profile: dict[str, Any]
66
-
67
-
68
64
  class ItemListType(Enum):
69
65
  STORE = "STORE"
70
66
  PRODUCT = "PRODUCT"
@@ -114,7 +110,6 @@ class StoredTransaction(Struct):
114
110
  active: bool = True
115
111
  meta: dict[str, Any] | None = None
116
112
  items: list[OrderItem] | None = None
117
- id: int = None
118
113
 
119
114
 
120
115
  class BalanceAction(Enum):
@@ -123,6 +118,16 @@ class BalanceAction(Enum):
123
118
  ADD = "ADD"
124
119
 
125
120
 
121
+ class AppliedOffer(Struct):
122
+ offer_id: int | None
123
+ offer_name: str
124
+ points_sub: Points
125
+ points_sub_max: Points
126
+ points_add: Points
127
+ active_from: date
128
+ active_to: date
129
+
130
+
126
131
  class Item(Struct):
127
132
  pos: int
128
133
  product_id: str
@@ -134,14 +139,18 @@ class Item(Struct):
134
139
  points_add: Points = 0
135
140
  points_sub: Points = 0
136
141
  points_sub_max: Points = 0
137
- params: dict[str, Any] | None = None
142
+ params: dict[str, Any] = {}
143
+ offers: list[AppliedOffer] = []
138
144
 
139
145
 
140
146
  class Cart(Struct):
141
- points_add: Points
142
- points_sub: Points
143
- points_sub_max: Points
144
147
  items: list[Item]
148
+ total: Decimal = Decimal(0)
149
+ discount: Decimal = Decimal(0)
150
+ points_add: Points = Points(0)
151
+ points_sub: Points = Points(0)
152
+ points_sub_max: Points = Points(0)
153
+ points_available: Points = Points(0)
145
154
  cashier_message: str | None = None
146
155
  customer_message: str | None = None
147
156
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: elemento-loyalty-processing
3
- Version: 1.0.3
3
+ Version: 1.0.4
4
4
  Summary: Elemento Loyalty Processing
5
5
  Requires-Python: >=3.11
6
6
  Requires-Dist: kaiju-tools<3,>=2.4.9
@@ -0,0 +1,7 @@
1
+ elemento_loyalty_processing/__init__.py,sha256=8xRRN_yvBcEDEbrYXNdDI_xuIm73EKEdgZKNO1sBXq0,117
2
+ elemento_loyalty_processing/client.py,sha256=tCq7WdT7aX5Rba9W7fZLTt-Jk0BlqK6O339TKV_nPrc,4751
3
+ elemento_loyalty_processing/types.py,sha256=aPnOLFSGbXWCwZ8yiz4HmOrgOHIiID9VjvK5bepP-tU,3441
4
+ elemento_loyalty_processing-1.0.4.dist-info/METADATA,sha256=QvsJk-TJ_AwA1lpgnotW8oRIS1PfDcvUJLZVL0iJfx0,407
5
+ elemento_loyalty_processing-1.0.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
6
+ elemento_loyalty_processing-1.0.4.dist-info/top_level.txt,sha256=N_AtPyYKvkr1NkoPAUrVl_4VCTP-kJIehtsLhkdacAc,28
7
+ elemento_loyalty_processing-1.0.4.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- elemento_loyalty_processing/__init__.py,sha256=B9q7Xuz-G7-a-us-RjJyMq7EcUaMJOMZ5bgDNu78p5w,117
2
- elemento_loyalty_processing/client.py,sha256=ChtOHtbCDcbSCsSV292XJDa372U-MvR8W6-DZR79fEA,4757
3
- elemento_loyalty_processing/types.py,sha256=5weGZa4wfotbKKIyR0Gy6G3kqaBhFO1g6czT02FfgQY,3137
4
- elemento_loyalty_processing-1.0.3.dist-info/METADATA,sha256=OH8RWA5hsjswuNGw6O-bp4crPBvnBccDP7GtpWUqJxQ,407
5
- elemento_loyalty_processing-1.0.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
6
- elemento_loyalty_processing-1.0.3.dist-info/top_level.txt,sha256=N_AtPyYKvkr1NkoPAUrVl_4VCTP-kJIehtsLhkdacAc,28
7
- elemento_loyalty_processing-1.0.3.dist-info/RECORD,,