elemento-loyalty-processing 1.0.14__py3-none-any.whl → 1.0.16__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.
- elemento_loyalty_processing/__init__.py +1 -1
- elemento_loyalty_processing/client.py +9 -28
- elemento_loyalty_processing/types.py +10 -1
- {elemento_loyalty_processing-1.0.14.dist-info → elemento_loyalty_processing-1.0.16.dist-info}/METADATA +1 -1
- elemento_loyalty_processing-1.0.16.dist-info/RECORD +7 -0
- {elemento_loyalty_processing-1.0.14.dist-info → elemento_loyalty_processing-1.0.16.dist-info}/WHEEL +1 -1
- elemento_loyalty_processing-1.0.14.dist-info/RECORD +0 -7
- {elemento_loyalty_processing-1.0.14.dist-info → elemento_loyalty_processing-1.0.16.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""RPC client services for customer app."""
|
|
2
2
|
|
|
3
|
-
from datetime import
|
|
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],
|
|
@@ -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 balance.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)
|
|
@@ -39,6 +39,7 @@ __all__ = [
|
|
|
39
39
|
"PointType",
|
|
40
40
|
"TransactionExtId",
|
|
41
41
|
"PurchaseStats",
|
|
42
|
+
"PersonalOffer",
|
|
42
43
|
]
|
|
43
44
|
|
|
44
45
|
DATE_MAXVALUE = date.fromisoformat("3000-01-01")
|
|
@@ -74,7 +75,7 @@ class ItemListType(Enum):
|
|
|
74
75
|
class ItemList(Struct):
|
|
75
76
|
type: ItemListType
|
|
76
77
|
id: ListId
|
|
77
|
-
items:
|
|
78
|
+
items: list[str]
|
|
78
79
|
|
|
79
80
|
|
|
80
81
|
class BalanceStatus(Enum):
|
|
@@ -127,6 +128,12 @@ class AppliedOffer(Struct):
|
|
|
127
128
|
active_to: date
|
|
128
129
|
|
|
129
130
|
|
|
131
|
+
class PersonalOffer(Struct):
|
|
132
|
+
type: str
|
|
133
|
+
discount_percent: int = 0
|
|
134
|
+
cashback_percent: int = 0
|
|
135
|
+
|
|
136
|
+
|
|
130
137
|
class Item(Struct):
|
|
131
138
|
pos: int
|
|
132
139
|
product_id: str
|
|
@@ -142,6 +149,7 @@ class Item(Struct):
|
|
|
142
149
|
params: dict[str, Any] = {}
|
|
143
150
|
offers_add: list[AppliedOffer] = []
|
|
144
151
|
offers_sub: list[AppliedOffer] = []
|
|
152
|
+
personal: list[PersonalOffer] = []
|
|
145
153
|
|
|
146
154
|
|
|
147
155
|
class RefundItem(TypedDict):
|
|
@@ -161,6 +169,7 @@ class Cart(Struct):
|
|
|
161
169
|
cashier_message: str | None = None
|
|
162
170
|
customer_message: str | None = None
|
|
163
171
|
offers_add: list[AppliedOffer] = []
|
|
172
|
+
personal: list[PersonalOffer] = []
|
|
164
173
|
|
|
165
174
|
|
|
166
175
|
class StoredTransaction(Struct):
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
elemento_loyalty_processing/__init__.py,sha256=j1XYJhob0Z8VK2C4GTWWwqWnSN87D3sD4CrqbPxKRF8,118
|
|
2
|
+
elemento_loyalty_processing/client.py,sha256=chlgOADY3z4Iy_ollecHB7ttIse3G1jG2ygF6JdOsW4,7362
|
|
3
|
+
elemento_loyalty_processing/types.py,sha256=CS1Jg8r7UtfsqJ0uFWtJz6jgEXF9fbAhqxMRYCd3bfA,4298
|
|
4
|
+
elemento_loyalty_processing-1.0.16.dist-info/METADATA,sha256=IzdqBK2xgbM-uWLBJv_34HPNFymVbJFLpint-et8BmI,450
|
|
5
|
+
elemento_loyalty_processing-1.0.16.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
6
|
+
elemento_loyalty_processing-1.0.16.dist-info/top_level.txt,sha256=N_AtPyYKvkr1NkoPAUrVl_4VCTP-kJIehtsLhkdacAc,28
|
|
7
|
+
elemento_loyalty_processing-1.0.16.dist-info/RECORD,,
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
elemento_loyalty_processing/__init__.py,sha256=32qjgePFNecQb5PvKkcoMCOEoSSl-OkQ2BEWgQ069bE,118
|
|
2
|
-
elemento_loyalty_processing/client.py,sha256=F33_41ND_AFc1Jo253oEa7Dm_LBx4t-FmGk70sJEwkQ,7963
|
|
3
|
-
elemento_loyalty_processing/types.py,sha256=Mm9XiB0BogpPSChM7AQ4v0SFzLjOT9O6WfvKm6DZhN8,4099
|
|
4
|
-
elemento_loyalty_processing-1.0.14.dist-info/METADATA,sha256=Wk_2sxPJ5yGD8otJS-Z3e-FWLk4GpBBTaqKerw8n0jQ,450
|
|
5
|
-
elemento_loyalty_processing-1.0.14.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
6
|
-
elemento_loyalty_processing-1.0.14.dist-info/top_level.txt,sha256=N_AtPyYKvkr1NkoPAUrVl_4VCTP-kJIehtsLhkdacAc,28
|
|
7
|
-
elemento_loyalty_processing-1.0.14.dist-info/RECORD,,
|
|
File without changes
|