item_builder_mwh 0.1.33 → 0.1.37

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c282ebc9226e7ecefba32a5b1b090497d55d2ae0348e4bce59fd85778f5b86bd
4
- data.tar.gz: 39e5261db0a0b8db5d273e6c51e00263a6653784c040ee8535c68a19d7212d1e
3
+ metadata.gz: b5f5b09777469d722c4c2612e4e5c230d30a63e0d7c743ca02f53f65b8e2b285
4
+ data.tar.gz: d6a784c648540481cb300e25c80beb3fa40ad1858e47f753919fe1980489c8fd
5
5
  SHA512:
6
- metadata.gz: bc90d9146267c005d720d6b3fc5e17253d3fa0021577476ece017baed78105c68173167859a30722b2bec3137dbc150bb2abfdf53ef822dda3807259e728dda6
7
- data.tar.gz: a1b92a340806454c47d766c8008861cd5d53fb0d58ac46f0cd39d20a7d29745d4890f116c1c8397117923083a486023a5a998f0b79df5a5f94980680dafff2bc
6
+ metadata.gz: b67c521b8560ad10a07dc8e1d896c76e6be37ddcbc363c6ab645c789995c460f65ee96581975ef9f2db1afc34deaddf5b940bfe82714cce14e32daef139af17d
7
+ data.tar.gz: 2bca78cdf0c938e51e543a4d5a0f343c6863d42364bacd93c09d279bc7d6773f1cfff7a6a115817682e6d7cc89438293a85aca98b193714566dddb0f983a6a26
@@ -6,7 +6,7 @@ class ItemBuilderMwh
6
6
  module Quantity
7
7
  class LazadaService < Base
8
8
  def perform
9
- available_quantity + local_qty
9
+ available_quantity
10
10
  end
11
11
  end
12
12
  end
@@ -101,7 +101,7 @@ class ItemBuilderMwh
101
101
  .joins('JOIN warehouses ON
102
102
  warehouse_spaces.warehouse_id = warehouses.id')
103
103
  .where("warehouse_mappings.profile_channel_association_id=#{pca}")
104
- .where("warehouse_spaces.item_variant_id=#{listing.variant_id}")
104
+ .where("warehouse_spaces.item_variant_id=#{variant_id}")
105
105
  .where('warehouses.consignment = 0')
106
106
  end
107
107
 
@@ -109,6 +109,10 @@ class ItemBuilderMwh
109
109
  listing.profile_channel_association_id.to_s
110
110
  end
111
111
 
112
+ def variant_id
113
+ bundle_variants&.first&.variant_id || listing.variant_id
114
+ end
115
+
112
116
  def warehouse_mapping(warehouse_id)
113
117
  WarehouseMapping
114
118
  .where(profile_channel_association_id:
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class ItemBuilderMwh
4
- VERSION = '0.1.33'
4
+ VERSION = '0.1.37'
5
5
  end
@@ -89,7 +89,7 @@ class ItemBuilderMwh
89
89
  def existing_alloc_stocks
90
90
  @existing_alloc_stocks ||= VariantListingStockAllocation.where(
91
91
  variant_association_id: vl_ids
92
- ).where('ADDTIME(end_at, "07:00") >= NOW()')
92
+ ).where('end_at >= NOW()')
93
93
  end
94
94
 
95
95
  def vl_ids
@@ -121,7 +121,7 @@ class ItemBuilderMwh
121
121
  end
122
122
 
123
123
  def wh_spaces
124
- @wh_spaces ||= WarehouseSpace.where(item_variant_id: variant_ids)
124
+ @wh_spaces ||= WarehouseSpace.where(item_variant_id: variant_ids).where.not(warehouse_id: nil)
125
125
  end
126
126
 
127
127
  def variants
@@ -155,9 +155,7 @@ class ItemBuilderMwh
155
155
  end
156
156
 
157
157
  def lazada_quantity
158
- @lazada_quantity ||= ItemBuilderMwh::LazadaQuantityService.new(
159
- listings: listings, skus: skus
160
- ).perform
158
+ @lazada_quantity ||= nil
161
159
  end
162
160
 
163
161
  def order_host
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: item_builder_mwh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.33
4
+ version: 0.1.37
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Ivander
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-11-10 00:00:00.000000000 Z
11
+ date: 2022-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler