channel-app 0.0.134__tar.gz → 0.0.137__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.
Files changed (90) hide show
  1. {channel_app-0.0.134 → channel_app-0.0.137}/PKG-INFO +1 -1
  2. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/omnitron/commands/orders/addresses.py +19 -5
  3. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/omnitron/commands/product_stocks.py +6 -0
  4. channel_app-0.0.137/channel_app/omnitron/commands/tests/test_products.py +871 -0
  5. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app.egg-info/PKG-INFO +1 -1
  6. {channel_app-0.0.134 → channel_app-0.0.137}/setup.py +1 -1
  7. channel_app-0.0.134/channel_app/omnitron/commands/tests/test_products.py +0 -247
  8. {channel_app-0.0.134 → channel_app-0.0.137}/.gitignore +0 -0
  9. {channel_app-0.0.134 → channel_app-0.0.137}/.vscode/settings.json +0 -0
  10. {channel_app-0.0.134 → channel_app-0.0.137}/Makefile +0 -0
  11. {channel_app-0.0.134 → channel_app-0.0.137}/Procfile-dist +0 -0
  12. {channel_app-0.0.134 → channel_app-0.0.137}/README.md +0 -0
  13. {channel_app-0.0.134 → channel_app-0.0.137}/akinon.json-dist +0 -0
  14. {channel_app-0.0.134 → channel_app-0.0.137}/bitbucket-pipelines.yml +0 -0
  15. {channel_app-0.0.134 → channel_app-0.0.137}/build.sh-dist +0 -0
  16. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/__init__.py +0 -0
  17. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/app/__init__.py +0 -0
  18. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/app/order/__init__.py +0 -0
  19. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/app/order/service.py +0 -0
  20. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/app/product/__init__.py +0 -0
  21. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/app/product/service.py +0 -0
  22. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/app/product_image/__init__.py +0 -0
  23. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/app/product_image/service.py +0 -0
  24. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/app/product_price/__init__.py +0 -0
  25. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/app/product_price/service.py +0 -0
  26. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/app/product_stock/__init__.py +0 -0
  27. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/app/product_stock/service.py +0 -0
  28. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/app/setup/__init__.py +0 -0
  29. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/app/setup/service.py +0 -0
  30. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/channel/__init__.py +0 -0
  31. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/channel/commands/__init__.py +0 -0
  32. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/channel/commands/orders/__init__.py +0 -0
  33. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/channel/commands/orders/orders.py +0 -0
  34. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/channel/commands/product_categories.py +0 -0
  35. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/channel/commands/product_images.py +0 -0
  36. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/channel/commands/product_prices.py +0 -0
  37. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/channel/commands/product_stocks.py +0 -0
  38. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/channel/commands/products.py +0 -0
  39. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/channel/commands/setup.py +0 -0
  40. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/channel/integration.py +0 -0
  41. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/core/__init__.py +0 -0
  42. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/core/clients.py +0 -0
  43. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/core/commands.py +0 -0
  44. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/core/data.py +0 -0
  45. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/core/integration.py +0 -0
  46. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/core/products.py +0 -0
  47. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/core/settings.py +0 -0
  48. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/core/tests/test_clients.py +0 -0
  49. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/core/tests.py +0 -0
  50. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/core/utilities.py +0 -0
  51. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/omnitron/__init__.py +0 -0
  52. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/omnitron/batch_request.py +0 -0
  53. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/omnitron/commands/__init__.py +0 -0
  54. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/omnitron/commands/batch_requests.py +0 -0
  55. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/omnitron/commands/error_reports.py +0 -0
  56. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/omnitron/commands/integration_actions.py +0 -0
  57. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/omnitron/commands/orders/__init__.py +0 -0
  58. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/omnitron/commands/orders/cargo_companies.py +0 -0
  59. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/omnitron/commands/orders/customers.py +0 -0
  60. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/omnitron/commands/orders/orders.py +0 -0
  61. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/omnitron/commands/product_categories.py +0 -0
  62. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/omnitron/commands/product_images.py +0 -0
  63. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/omnitron/commands/product_prices.py +0 -0
  64. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/omnitron/commands/products.py +0 -0
  65. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/omnitron/commands/setup.py +0 -0
  66. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/omnitron/commands/tests/__init__.py +0 -0
  67. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/omnitron/constants.py +0 -0
  68. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/omnitron/exceptions.py +0 -0
  69. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app/omnitron/integration.py +0 -0
  70. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app.egg-info/SOURCES.txt +0 -0
  71. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app.egg-info/dependency_links.txt +0 -0
  72. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app.egg-info/requires.txt +0 -0
  73. {channel_app-0.0.134 → channel_app-0.0.137}/channel_app.egg-info/top_level.txt +0 -0
  74. {channel_app-0.0.134 → channel_app-0.0.137}/docs/Makefile +0 -0
  75. {channel_app-0.0.134 → channel_app-0.0.137}/docs/make.bat +0 -0
  76. {channel_app-0.0.134 → channel_app-0.0.137}/docs/requirements.txt +0 -0
  77. {channel_app-0.0.134 → channel_app-0.0.137}/docs/source/architecture.rst +0 -0
  78. {channel_app-0.0.134 → channel_app-0.0.137}/docs/source/command_reference.rst +0 -0
  79. {channel_app-0.0.134 → channel_app-0.0.137}/docs/source/conf.py +0 -0
  80. {channel_app-0.0.134 → channel_app-0.0.137}/docs/source/flows.rst +0 -0
  81. {channel_app-0.0.134 → channel_app-0.0.137}/docs/source/images/async.png +0 -0
  82. {channel_app-0.0.134 → channel_app-0.0.137}/docs/source/images/batch_request_state_machine.png +0 -0
  83. {channel_app-0.0.134 → channel_app-0.0.137}/docs/source/images/sync.png +0 -0
  84. {channel_app-0.0.134 → channel_app-0.0.137}/docs/source/index.rst +0 -0
  85. {channel_app-0.0.134 → channel_app-0.0.137}/docs/source/installation_and_usage.rst +0 -0
  86. {channel_app-0.0.134 → channel_app-0.0.137}/docs/source/terminology.rst +0 -0
  87. {channel_app-0.0.134 → channel_app-0.0.137}/requirements-dev.txt +0 -0
  88. {channel_app-0.0.134 → channel_app-0.0.137}/requirements.txt +0 -0
  89. {channel_app-0.0.134 → channel_app-0.0.137}/setup.cfg +0 -0
  90. {channel_app-0.0.134 → channel_app-0.0.137}/tox.ini +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: channel_app
3
- Version: 0.0.134
3
+ Version: 0.0.137
4
4
  Summary: Channel app for Sales Channels
5
5
  Home-page: https://github.com/akinon/channel_app
6
6
  Author: akinonteam
@@ -180,7 +180,7 @@ class GetOrCreateAddress(OmnitronCommandInterface):
180
180
  def get_country(self, country_code: str) -> Country:
181
181
  endpoint = ChannelCountryEndpoint(channel_id=self.integration.channel_id)
182
182
 
183
- params = {"code__exact": country_code}
183
+ params = {"code__exact": country_code, "is_active": True}
184
184
  countries = endpoint.list(params=params)
185
185
  if len(countries) == 1:
186
186
  return countries[0]
@@ -200,7 +200,11 @@ class GetOrCreateAddress(OmnitronCommandInterface):
200
200
  def get_city(self, country: Country, city_name: str) -> City:
201
201
  endpoint = ChannelCityEndpoint(channel_id=self.integration.channel_id)
202
202
 
203
- params = {"name__exact": city_name, "country": country.pk}
203
+ params = {
204
+ "name__iexact": city_name,
205
+ "country": country.pk,
206
+ "is_active": True
207
+ }
204
208
  cities = endpoint.list(params=params)
205
209
  if len(cities) == 1:
206
210
  return cities[0]
@@ -221,7 +225,12 @@ class GetOrCreateAddress(OmnitronCommandInterface):
221
225
  def get_township(self, country: Country, city: City, township_name: str) -> Township:
222
226
  endpoint = ChannelTownshipEndpoint(channel_id=self.integration.channel_id)
223
227
 
224
- params = {"name__exact": township_name, "country": country.pk, "city": city.pk}
228
+ params = {
229
+ "name__iexact": township_name,
230
+ "country": country.pk,
231
+ "city": city.pk,
232
+ "is_active": True
233
+ }
225
234
  townships = endpoint.list(params=params)
226
235
  if len(townships) == 1:
227
236
  return townships[0]
@@ -244,8 +253,13 @@ class GetOrCreateAddress(OmnitronCommandInterface):
244
253
  district_name: str) -> District:
245
254
  endpoint = ChannelDistrictEndpoint(channel_id=self.integration.channel_id)
246
255
 
247
- params = {"name__exact": district_name, "country": country.pk, "city": city.pk,
248
- "township": township.pk}
256
+ params = {
257
+ "name__exact": district_name,
258
+ "country": country.pk,
259
+ "city": city.pk,
260
+ "township": township.pk,
261
+ "is_active": True
262
+ }
249
263
  districts = endpoint.list(params=params)
250
264
  if len(districts) == 1:
251
265
  return districts[0]
@@ -47,6 +47,9 @@ class GetUpdatedProductStocks(OmnitronCommandInterface):
47
47
  return stocks
48
48
 
49
49
  def get_stocks_with_available(self, stocks: List[ProductStock]):
50
+ if not stocks:
51
+ return []
52
+
50
53
  endpoint = ChannelIntegrationActionEndpoint(
51
54
  channel_id=self.integration.channel_id)
52
55
  stock_integration_actions = endpoint.list(
@@ -167,6 +170,9 @@ class GetInsertedProductStocks(GetUpdatedProductStocks):
167
170
  path = "inserts"
168
171
 
169
172
  def get_stocks_with_available(self, stocks: List[ProductStock]):
173
+ if not stocks:
174
+ return []
175
+
170
176
  endpoint = ChannelIntegrationActionEndpoint(
171
177
  channel_id=self.integration.channel_id)
172
178
  product_ids = [str(stock.product) for stock in stocks]