solidus_tec_estimator 1.0.6 → 2.0.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_tec_estimator/providers/local_delivery.rb +7 -5
- data/lib/solidus_tec_estimator/version.rb +1 -1
- data/lib/solidus_tec_estimator.rb +2 -0
- data/solidus_tec_estimator.gemspec +1 -0
- metadata +20 -7
- data/db/migrate/20240806202950_recreate_min_and_max_delivery_time.rb +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5e4dc99244ea1042793e9040e0e9e7e21aba0e95299c20c0723a2795cc2298a
|
4
|
+
data.tar.gz: 39eee3390a6e1536306f79fb3a6a4882b9c4de073a64cf8ba9fc5f3cfa0e892f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e2b9ce9dffb0e046b438a060b92133a278e7e32d36ec56dc189b7a1acbbe0602b5cefbb15daf073302dd3d3710909f4bd7817dfd96ec3603a322c5cff19ca8c3
|
7
|
+
data.tar.gz: e51d4827b3e2e57344ea1eaa7941bb582754946355d60c4097f9b53bf4a17a5a9ad387102c69b8de10cd692b99dcd7a52c47783dec6cfde63560ebbdb8cb0bc2
|
@@ -58,7 +58,9 @@ module SolidusTecEstimator
|
|
58
58
|
shipping_method: shipping_method,
|
59
59
|
cost: shipping_method.calculator.compute(package),
|
60
60
|
min_delivery_time: min_delivery_time,
|
61
|
-
max_delivery_time: max_delivery_time
|
61
|
+
max_delivery_time: max_delivery_time,
|
62
|
+
estimate_prose: create_estimate_prose(max_delivery_time),
|
63
|
+
expires_in: Time.now + 2.hours
|
62
64
|
)
|
63
65
|
end
|
64
66
|
|
@@ -69,13 +71,13 @@ module SolidusTecEstimator
|
|
69
71
|
zipcode >= sjbv_ceps.min && zipcode <= sjbv_ceps.max
|
70
72
|
end
|
71
73
|
|
72
|
-
def
|
73
|
-
if
|
74
|
+
def create_estimate_prose delivery_time
|
75
|
+
if delivery_time.today?
|
74
76
|
"Chegará em até 2 horas"
|
75
|
-
elsif
|
77
|
+
elsif delivery_time.tomorrow?
|
76
78
|
"Chegará amanhã até às 10h"
|
77
79
|
else
|
78
|
-
"Chegará em #{ActionController::Base.helpers.pluralize((
|
80
|
+
"Chegará em #{ActionController::Base.helpers.pluralize((delivery_time.to_datetime.end_of_day - DateTime.now).to_i, "dia", plural: "dias")}"
|
79
81
|
end
|
80
82
|
end
|
81
83
|
|
@@ -31,6 +31,7 @@ Gem::Specification.new do |spec|
|
|
31
31
|
|
32
32
|
spec.add_dependency 'solidus_core', ['>= 2.0.0', '< 5']
|
33
33
|
spec.add_dependency 'solidus_support', '~> 0.5'
|
34
|
+
spec.add_dependency "solidus_brazilian_adaptations"
|
34
35
|
|
35
36
|
spec.add_development_dependency 'solidus_dev_support', '~> 2.9'
|
36
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solidus_tec_estimator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ulysses
|
8
|
-
autorequire:
|
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
|
@@ -44,6 +44,20 @@ dependencies:
|
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '0.5'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: solidus_brazilian_adaptations
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
47
61
|
- !ruby/object:Gem::Dependency
|
48
62
|
name: solidus_dev_support
|
49
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -93,7 +107,6 @@ files:
|
|
93
107
|
- config/routes.rb
|
94
108
|
- db/migrate/20240806142636_create_solidus_tec_estimator_providers.rb
|
95
109
|
- db/migrate/20240806165855_add_provider_id_to_shipping_method.rb
|
96
|
-
- db/migrate/20240806202950_recreate_min_and_max_delivery_time.rb
|
97
110
|
- lib/generators/solidus_tec_estimator/install/install_generator.rb
|
98
111
|
- lib/generators/solidus_tec_estimator/install/templates/initializer.rb
|
99
112
|
- lib/solidus_tec_estimator.rb
|
@@ -110,7 +123,7 @@ metadata:
|
|
110
123
|
homepage_uri: https://github.com/todasessascoisas/solidus_tec_estimator#readme
|
111
124
|
source_code_uri: https://github.com/todasessascoisas/solidus_tec_estimator
|
112
125
|
changelog_uri: https://github.com/todasessascoisas/solidus_tec_estimator/blob/main/CHANGELOG.md
|
113
|
-
post_install_message:
|
126
|
+
post_install_message:
|
114
127
|
rdoc_options: []
|
115
128
|
require_paths:
|
116
129
|
- lib
|
@@ -128,8 +141,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
128
141
|
- !ruby/object:Gem::Version
|
129
142
|
version: '0'
|
130
143
|
requirements: []
|
131
|
-
rubygems_version: 3.5.
|
132
|
-
signing_key:
|
144
|
+
rubygems_version: 3.5.11
|
145
|
+
signing_key:
|
133
146
|
specification_version: 4
|
134
147
|
summary: ''
|
135
148
|
test_files:
|
@@ -1,9 +0,0 @@
|
|
1
|
-
class RecreateMinAndMaxDeliveryTime < ActiveRecord::Migration[7.1]
|
2
|
-
def change
|
3
|
-
remove_column :spree_shipping_rates, :min_delivery_time, if_exists: true
|
4
|
-
remove_column :spree_shipping_rates, :max_delivery_time, if_exists: true
|
5
|
-
|
6
|
-
add_column :spree_shipping_rates, :min_delivery_time, :datetime
|
7
|
-
add_column :spree_shipping_rates, :max_delivery_time, :datetime
|
8
|
-
end
|
9
|
-
end
|