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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c28036d5ed36a833efc6236adc4f6967c365643108de215570f47b8f8956308e
4
- data.tar.gz: f432013f0bbbcae40151b2460053c145dfc4802d06a5ee6a076714a5bb860c9f
3
+ metadata.gz: b5e4dc99244ea1042793e9040e0e9e7e21aba0e95299c20c0723a2795cc2298a
4
+ data.tar.gz: 39eee3390a6e1536306f79fb3a6a4882b9c4de073a64cf8ba9fc5f3cfa0e892f
5
5
  SHA512:
6
- metadata.gz: 7aeeccbf3a3de41cfa2e47ac1eeb60bb0eaffb8172b91ec04fbdf8a42fa830268647f693d73e441f62102b92e3c6ea40aad15b46baafb7a9272e9fd439e856e2
7
- data.tar.gz: e4ab018f35f80f41f201f401cb98f778a6fe00abf44105201b8829c87d384c56fd52621aad9834ad405c46d3ea4de30e1c6c5683370ccfc58bc8d8fb2df20e96
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 self.calculate_delivery_time rate
73
- if rate.max_delivery_time.today?
74
+ def create_estimate_prose delivery_time
75
+ if delivery_time.today?
74
76
  "Chegará em até 2 horas"
75
- elsif rate.max_delivery_time.tomorrow?
77
+ elsif delivery_time.tomorrow?
76
78
  "Chegará amanhã até às 10h"
77
79
  else
78
- "Chegará em #{ActionController::Base.helpers.pluralize((rate.max_delivery_time.to_datetime.end_of_day - DateTime.now).to_i, "dia", plural: "dias")}"
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
 
@@ -1,3 +1,3 @@
1
1
  module SolidusTecEstimator
2
- VERSION = '1.0.6'
2
+ VERSION = '2.0.0'
3
3
  end
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "solidus_brazilian_adaptations"
4
+
3
5
  require 'solidus_tec_estimator/configuration'
4
6
  require 'solidus_tec_estimator/version'
5
7
  require 'solidus_tec_estimator/engine'
@@ -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: 1.0.6
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-09-23 00:00:00.000000000 Z
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.10
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