elemento-loyalty-processing 1.0.13__py3-none-any.whl → 1.0.15__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.11"
5
+ __version__ = "1.0.15"
@@ -1,6 +1,6 @@
1
1
  """RPC client services for customer app."""
2
2
 
3
- from datetime import date, datetime
3
+ from datetime import datetime
4
4
  from typing import Any
5
5
 
6
6
  from kaiju_tools.http import RPCClientService
@@ -79,6 +79,14 @@ class ElementoLoyaltyProcessingClient(RPCClientService):
79
79
  method="Balance.get", params=dict(customer_id=customer_id), max_timeout=_max_timeout, nowait=_nowait
80
80
  )
81
81
 
82
+ async def balance_clear_balance(
83
+ self, customer_id: CustomerId, _max_timeout: int = None, _nowait: bool = False
84
+ ) -> None:
85
+ """Call Balance.clear."""
86
+ return await self.call(
87
+ method="Balance.clear", params=dict(customer_id=customer_id), max_timeout=_max_timeout, nowait=_nowait
88
+ )
89
+
82
90
  async def balance_calculate(
83
91
  self,
84
92
  customer: Customer.Fields | dict[str, Any],
@@ -176,14 +184,14 @@ class ElementoLoyaltyProcessingClient(RPCClientService):
176
184
  customer_id: CustomerId,
177
185
  source: str,
178
186
  transaction_id: TransactionExtId,
179
- positions: list[int],
187
+ items: list[RefundItem],
180
188
  _max_timeout: int = None,
181
189
  _nowait: bool = False,
182
190
  ) -> Points:
183
191
  """Call Balance.refund."""
184
192
  data = await self.call(
185
193
  method="Balance.refund",
186
- params=dict(customer_id=customer_id, source=source, transaction_id=transaction_id, positions=positions),
194
+ params=dict(customer_id=customer_id, source=source, transaction_id=transaction_id, items=items),
187
195
  max_timeout=_max_timeout,
188
196
  nowait=_nowait,
189
197
  )
@@ -205,32 +213,5 @@ class ElementoLoyaltyProcessingClient(RPCClientService):
205
213
  nowait=_nowait,
206
214
  )
207
215
 
208
- async def balance_history(
209
- self,
210
- customer_id: int,
211
- next_transaction_id: int | None = None,
212
- limit: int = 10,
213
- _max_timeout: int = None,
214
- _nowait: bool = False,
215
- ):
216
- """Call Balance.history."""
217
- return await self.call(
218
- method="Balance.history",
219
- params={"customer_id": customer_id, "limit": limit, "next_transaction_id": next_transaction_id},
220
- max_timeout=_max_timeout,
221
- nowait=_nowait,
222
- )
223
-
224
- async def balance_history_expiring(
225
- self, customer_id: int, active_to: date, _max_timeout: int = None, _nowait: bool = False
226
- ):
227
- """Call alance.history.expiring."""
228
- return await self.call(
229
- method="Balance.history.expiring",
230
- params={"customer_id": customer_id, "active_to": active_to},
231
- max_timeout=_max_timeout,
232
- nowait=_nowait,
233
- )
234
-
235
216
 
236
217
  SERVICE_CLASS_REGISTRY.register(ElementoLoyaltyProcessingClient)
@@ -22,6 +22,7 @@ __all__ = [
22
22
  "Transaction",
23
23
  "EventTypeId",
24
24
  "Item",
25
+ "RefundItem",
25
26
  "Cart",
26
27
  "BalanceAction",
27
28
  "Customer",
@@ -73,7 +74,7 @@ class ItemListType(Enum):
73
74
  class ItemList(Struct):
74
75
  type: ItemListType
75
76
  id: ListId
76
- items: frozenset[str]
77
+ items: list[str]
77
78
 
78
79
 
79
80
  class BalanceStatus(Enum):
@@ -143,6 +144,11 @@ class Item(Struct):
143
144
  offers_sub: list[AppliedOffer] = []
144
145
 
145
146
 
147
+ class RefundItem(TypedDict):
148
+ pos: int
149
+ quantity: int
150
+
151
+
146
152
  class Cart(Struct):
147
153
  items: list[Item]
148
154
  total: Decimal = Decimal(0)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: elemento-loyalty-processing
3
- Version: 1.0.13
3
+ Version: 1.0.15
4
4
  Summary: Elemento Loyalty Processing
5
5
  Requires-Python: >=3.11
6
6
  Requires-Dist: kaiju-tools<3,>=2.4.12
@@ -0,0 +1,7 @@
1
+ elemento_loyalty_processing/__init__.py,sha256=--nGNG2CZ1Oaa4Utp7tEhkS1jcijW9NWl9e4W8z3KEw,118
2
+ elemento_loyalty_processing/client.py,sha256=chlgOADY3z4Iy_ollecHB7ttIse3G1jG2ygF6JdOsW4,7362
3
+ elemento_loyalty_processing/types.py,sha256=totsptNjI7hMZw6qJS4ZJcZ2s9plG0kZO50v_BowhOM,4094
4
+ elemento_loyalty_processing-1.0.15.dist-info/METADATA,sha256=E2HTL44dkQhrRJRl14UXFtEPnQu-n11u6f6XbT0mazE,450
5
+ elemento_loyalty_processing-1.0.15.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
6
+ elemento_loyalty_processing-1.0.15.dist-info/top_level.txt,sha256=N_AtPyYKvkr1NkoPAUrVl_4VCTP-kJIehtsLhkdacAc,28
7
+ elemento_loyalty_processing-1.0.15.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- elemento_loyalty_processing/__init__.py,sha256=32qjgePFNecQb5PvKkcoMCOEoSSl-OkQ2BEWgQ069bE,118
2
- elemento_loyalty_processing/client.py,sha256=_u2ObL9p1-bMqFHD4okzpNT-6IyaUKIVaHlLw8vK8dg,7967
3
- elemento_loyalty_processing/types.py,sha256=u0iVCo9xXjOugZ8oMSq-V8bRqaac706Lh1wRELpvi-g,4019
4
- elemento_loyalty_processing-1.0.13.dist-info/METADATA,sha256=UbZS_L9hK_7o8md5BM9vpGYjLeBWCDl_GYotDjV94A4,450
5
- elemento_loyalty_processing-1.0.13.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
6
- elemento_loyalty_processing-1.0.13.dist-info/top_level.txt,sha256=N_AtPyYKvkr1NkoPAUrVl_4VCTP-kJIehtsLhkdacAc,28
7
- elemento_loyalty_processing-1.0.13.dist-info/RECORD,,