elemento-loyalty-processing 1.0.7__tar.gz → 1.0.9__tar.gz

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.
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: elemento-loyalty-processing
3
- Version: 1.0.7
3
+ Version: 1.0.9
4
4
  Summary: Elemento Loyalty Processing
5
5
  Requires-Python: >=3.11
6
- Requires-Dist: kaiju-tools<3,>=2.4.9
6
+ Requires-Dist: kaiju-tools<3,>=2.4.12
7
7
  Requires-Dist: elemento-customers>=1.0.0
8
8
  Requires-Dist: kaiju-models<2,>=1.0.4
9
9
  Provides-Extra: server
@@ -1,6 +1,6 @@
1
1
  """RPC client services for customer app."""
2
2
 
3
- import datetime
3
+ from datetime import datetime
4
4
  from typing import Any
5
5
 
6
6
  from kaiju_tools.http import RPCClientService
@@ -81,8 +81,8 @@ class ElementoLoyaltyProcessingClient(RPCClientService):
81
81
  return convert(data, Transaction)
82
82
 
83
83
  async def balance_confirm_transaction(
84
- self, transaction_id: TransactionId, _max_timeout: int = None, _nowait: bool = False
85
- ) -> Transaction:
84
+ self, transaction_id: TransactionExtId, _max_timeout: int = None, _nowait: bool = False
85
+ ) -> Transaction | None:
86
86
  """Call Balance.transaction.confirm."""
87
87
  data = await self.call(
88
88
  method="Balance.transaction.confirm",
@@ -90,10 +90,12 @@ class ElementoLoyaltyProcessingClient(RPCClientService):
90
90
  max_timeout=_max_timeout,
91
91
  nowait=_nowait,
92
92
  )
93
+ if not data:
94
+ return None
93
95
  return convert(data, Transaction)
94
96
 
95
97
  async def balance_revert_transaction(
96
- self, transaction_id: TransactionId, _max_timeout: int = None, _nowait: bool = False
98
+ self, transaction_id: TransactionExtId, _max_timeout: int = None, _nowait: bool = False
97
99
  ) -> None:
98
100
  """Call Balance.transaction.revert."""
99
101
  return await self.call(
@@ -104,8 +106,8 @@ class ElementoLoyaltyProcessingClient(RPCClientService):
104
106
  )
105
107
 
106
108
  async def balance_commit_transaction(
107
- self, transaction_id: TransactionId, _max_timeout: int = None, _nowait: bool = False
108
- ) -> Transaction:
109
+ self, transaction_id: TransactionExtId, _max_timeout: int = None, _nowait: bool = False
110
+ ) -> Transaction | None:
109
111
  """Call Balance.transaction.commit."""
110
112
  data = await self.call(
111
113
  method="Balance.transaction.commit",
@@ -131,6 +131,7 @@ class Item(Struct):
131
131
  quantity: int
132
132
  total: Decimal
133
133
  price: Decimal
134
+ initial_total: Decimal = None
134
135
  cashback: Points = 0
135
136
  discount: Decimal = Decimal("0.00")
136
137
  points_add: Points = 0
@@ -151,6 +152,7 @@ class Cart(Struct):
151
152
  points_available: Points = Points(0)
152
153
  cashier_message: str | None = None
153
154
  customer_message: str | None = None
155
+ offers_add: list[AppliedOffer] = []
154
156
 
155
157
 
156
158
  class StoredTransaction(Struct):
@@ -1,10 +1,10 @@
1
1
  [project]
2
2
  name = "elemento-loyalty-processing"
3
- version = "1.0.7"
3
+ version = "1.0.9"
4
4
  description = "Elemento Loyalty Processing"
5
5
  requires-python = ">=3.11"
6
6
  dependencies = [
7
- "kaiju-tools>=2.4.9,<3",
7
+ "kaiju-tools>=2.4.12,<3",
8
8
  "elemento-customers>=1.0.0",
9
9
  "kaiju-models>=1.0.4,<2"
10
10
  ]