solidus_me 3.0.2 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/solidus_me/melhor_envio.rb +7 -3
- data/lib/solidus_me/version.rb +1 -1
- data/lib/solidus_me.rb +1 -0
- data/solidus_me.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9db290c638a2d01484e2fa15aab8c66e9aa5aa9d655360b2aa59a290654c9131
|
4
|
+
data.tar.gz: c6f27dc5ad820d3b778805e138b566de84733caa75a1ec0f49d0bbcb21580ecd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69fbcd15348fe78ff501e5245558da1be4156a298889a4afb347f70350d99cd4d857f5ae3445de1d5d02e4e4bbfd3f945b56cd62bb328776fd344cd98d3f1569
|
7
|
+
data.tar.gz: 229e6ce800fb87c1330033303358ac7ae6f5ca41eb934e5da7dbdeb60c6a913d968dcc2047696da70a6b094f47c9870c0b69f6d9f936ac6dd299b4bc0d0d267e
|
@@ -44,7 +44,7 @@ module SolidusMe
|
|
44
44
|
melhor_envio_rates = get_rates_from_melhor_envio(package)
|
45
45
|
shipping_rates = melhor_envio_rates.map do |melhor_envio_rate|
|
46
46
|
build_shipping_rate(melhor_envio_rate, package)
|
47
|
-
end
|
47
|
+
end.compact
|
48
48
|
|
49
49
|
shipping_rates
|
50
50
|
end
|
@@ -70,14 +70,18 @@ module SolidusMe
|
|
70
70
|
end
|
71
71
|
|
72
72
|
def build_shipping_rate(melhor_envio_rate, package)
|
73
|
+
return unless melhor_envio_rate.max_delivery_time
|
73
74
|
shipping_method = Spree::ShippingMethod.find_by(code: self.class.generate_code(melhor_envio_rate.id))
|
75
|
+
estimate_prose = "Chegará em até #{ActionController::Base.helpers.pluralize(melhor_envio_rate.max_delivery_time, "dia", plural: "dias")} úteis"
|
74
76
|
|
75
77
|
Spree::ShippingRate.new(
|
76
78
|
shipment: package.shipment,
|
77
79
|
shipping_method: shipping_method,
|
78
80
|
cost: melhor_envio_rate.price,
|
79
|
-
min_delivery_time:
|
80
|
-
max_delivery_time:
|
81
|
+
min_delivery_time: melhor_envio_rate.min_delivery_time.business_days.from_now,
|
82
|
+
max_delivery_time: melhor_envio_rate.max_delivery_time.business_days.from_now,
|
83
|
+
estimate_prose: estimate_prose,
|
84
|
+
expires_in: Time.now + 2.hours
|
81
85
|
)
|
82
86
|
end
|
83
87
|
|
data/lib/solidus_me/version.rb
CHANGED
data/lib/solidus_me.rb
CHANGED
data/solidus_me.gemspec
CHANGED
@@ -32,6 +32,7 @@ Gem::Specification.new do |spec|
|
|
32
32
|
spec.add_dependency "solidus_support", "~> 0.5"
|
33
33
|
spec.add_dependency "me_api"
|
34
34
|
spec.add_dependency "solidus_brazilian_adaptations"
|
35
|
+
spec.add_dependency "business_time"
|
35
36
|
|
36
37
|
spec.add_development_dependency "solidus_dev_support", "~> 2.7"
|
37
38
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solidus_me
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hamilton Tumenas Borges
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-10-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: solidus_core
|
@@ -72,6 +72,20 @@ dependencies:
|
|
72
72
|
- - ">="
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: '0'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: business_time
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0'
|
82
|
+
type: :runtime
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
75
89
|
- !ruby/object:Gem::Dependency
|
76
90
|
name: solidus_dev_support
|
77
91
|
requirement: !ruby/object:Gem::Requirement
|