item_builder_mwh 0.1.28 → 0.1.29
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.
- checksums.yaml +4 -4
- data/lib/item_builder_mwh/modes/active_service.rb +3 -3
- data/lib/item_builder_mwh/modes/price_service.rb +2 -2
- data/lib/item_builder_mwh/modes/quantity_service.rb +12 -13
- data/lib/item_builder_mwh/modes/simple_service.rb +5 -5
- data/lib/item_builder_mwh/modes.rb +8 -0
- data/lib/item_builder_mwh/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b78cf06c6468a43cb0276bce86475e9e26225998a51a07ebc0f5abcccbb275a
|
4
|
+
data.tar.gz: 26f16ef4c2b1e4c0d27ba8f1da2817b1c185713c0fa64af76f440ce9ec218eec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5db1144fc273bb1861c8477a72dfc9d119c98e6c0fddb9befc07d13b431bfe116075ec0c70b315de618b2d7ddc35f9c8d8e4b241f8e26421d15b8a3ec502ac55
|
7
|
+
data.tar.gz: 0a02b711a5dd12ebd751ffa106f786949456c25b555638962a102fbee3ef57c9ee5bb34e34e37d9af6ba673c357b8be82f88b88d21895293a4bbed43ef79bff4
|
@@ -15,10 +15,10 @@ class ItemBuilderMwh
|
|
15
15
|
def to_h(warehouse_space)
|
16
16
|
{
|
17
17
|
active: listing.active,
|
18
|
-
quantity: warehouse_space
|
19
|
-
warehouse_id: wh_mapping(
|
18
|
+
quantity: warehouse_space&.quantity || 0,
|
19
|
+
warehouse_id: warehouse_space.present? ? wh_mapping(
|
20
20
|
warehouse_space.warehouse_id
|
21
|
-
)
|
21
|
+
) : ''
|
22
22
|
}
|
23
23
|
end
|
24
24
|
end
|
@@ -33,20 +33,19 @@ class ItemBuilderMwh
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def to_h(warehouse_space)
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
warehouse_id
|
40
|
-
|
41
|
-
|
42
|
-
|
36
|
+
{
|
37
|
+
quantity: warehouse_space.present? ? real_quantity(warehouse_space) : 0,
|
38
|
+
warehouse_id: warehouse_space.present? ? wh_mapping(
|
39
|
+
warehouse_space.warehouse_id
|
40
|
+
) : ''
|
41
|
+
}
|
42
|
+
end
|
43
|
+
|
44
|
+
def real_quantity(warehouse_space)
|
45
|
+
if channel_name == 'Zilingo'
|
46
|
+
qty(warehouse_space.quantity)
|
43
47
|
else
|
44
|
-
|
45
|
-
quantity: [qty(warehouse_space.quantity), 0].sort[1],
|
46
|
-
warehouse_id: wh_mapping(
|
47
|
-
warehouse_space.warehouse_id
|
48
|
-
)
|
49
|
-
}
|
48
|
+
[qty(warehouse_space.quantity), 0].sort[1]
|
50
49
|
end
|
51
50
|
end
|
52
51
|
|
@@ -41,14 +41,14 @@ class ItemBuilderMwh
|
|
41
41
|
|
42
42
|
def warehouse_ids(warehouse_space)
|
43
43
|
{
|
44
|
-
warehouse_id: wh_mapping(
|
44
|
+
warehouse_id: warehouse_space.present? ? wh_mapping(
|
45
45
|
warehouse_space.warehouse_id
|
46
|
-
)
|
46
|
+
) : ''
|
47
47
|
}
|
48
48
|
end
|
49
49
|
|
50
50
|
def simple(warehouse_space)
|
51
|
-
qty = warehouse_space
|
51
|
+
qty = warehouse_space&.quantity || 0
|
52
52
|
qty(qty).merge(
|
53
53
|
price
|
54
54
|
)
|
@@ -92,11 +92,11 @@ class ItemBuilderMwh
|
|
92
92
|
end
|
93
93
|
|
94
94
|
def local_qty
|
95
|
-
if
|
95
|
+
if quantity_name == 'Zilingo'
|
96
96
|
return 0 if zilingo_quantity.blank?
|
97
97
|
|
98
98
|
zilingo_quantity[listing.local_id].to_i
|
99
|
-
elsif
|
99
|
+
elsif quantity_name == 'Zalora'
|
100
100
|
return 0 if zalora_reserved_stock.blank?
|
101
101
|
|
102
102
|
zalora_reserved_stock[listing.local_id].to_i
|
@@ -80,9 +80,17 @@ class ItemBuilderMwh
|
|
80
80
|
if multiwarehouse && wh_routing == 1
|
81
81
|
warehouses << to_h(warehouse_spaces.first)
|
82
82
|
else
|
83
|
+
warehouse_list
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
def warehouse_list
|
88
|
+
if warehouse_spaces.present?
|
83
89
|
warehouse_spaces.each do |warehouse_space|
|
84
90
|
warehouses << to_h(warehouse_space)
|
85
91
|
end
|
92
|
+
else
|
93
|
+
warehouses << to_h(nil)
|
86
94
|
end
|
87
95
|
end
|
88
96
|
|
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.
|
4
|
+
version: 0.1.29
|
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-09-
|
11
|
+
date: 2021-09-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|