deliveries 0.1.1 → 0.2.0
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/CHANGELOG.md +6 -1
- data/Gemfile.lock +19 -19
- data/lib/deliveries/address.rb +2 -1
- data/lib/deliveries/couriers/correos_express/pickups/create/format_params.rb +2 -2
- data/lib/deliveries/couriers/correos_express/shipments/create/format_params.rb +2 -1
- data/lib/deliveries/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: ada488938a0775384a02f0f71ed87c472186e33c5eafd1dc9858dfda0f18a092
|
|
4
|
+
data.tar.gz: 257d9542096581e1b7b68fe69ef616f2554890caac0c6cd09d86caf208dbdb03
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6e47f2cd97e2badf2bc105bfb6784d43c0b33a0b6910fbee82b265bdfd81cd37ca1e1132f3292ef55c2419fd5b20f688245a8f60ee182cb3adb74983c9929ffd
|
|
7
|
+
data.tar.gz: 037fc742bf03560593b980e10b6b1c71967505324dc3ed716aa1136e019bb937efd5e00988b9b4d4ed401ec04a264494423ff644dc5b85d837ca29729bdcf1b2
|
data/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.2.0] - 2021-11-03
|
|
10
|
+
### Added
|
|
11
|
+
- `Address` can now include a custom id for couriers that support it (currently only Correos Express).
|
|
12
|
+
|
|
9
13
|
## [0.1.1] - 2021-10-11
|
|
10
14
|
### Fixed
|
|
11
15
|
- Fix keyword parameter passing to make it compatible with Ruby 3.0.
|
|
@@ -13,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
13
17
|
## [0.1.0] - 2021-09-27
|
|
14
18
|
🎉 First release!
|
|
15
19
|
|
|
16
|
-
[Unreleased]: https://github.com/ecommerce-ventures/deliveries/compare/v0.
|
|
20
|
+
[Unreleased]: https://github.com/ecommerce-ventures/deliveries/compare/v0.2.0...HEAD
|
|
21
|
+
[0.2.0]: https://github.com/ecommerce-ventures/deliveries/compare/v0.1.1...v0.2.0
|
|
17
22
|
[0.1.1]: https://github.com/ecommerce-ventures/deliveries/compare/v0.1.0...v0.1.1
|
|
18
23
|
[0.1.0]: https://github.com/ecommerce-ventures/deliveries/releases/tag/v0.1.0
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
deliveries (0.
|
|
4
|
+
deliveries (0.2.0)
|
|
5
5
|
activesupport (>= 5.2.0)
|
|
6
6
|
hexapdf
|
|
7
7
|
httparty
|
|
@@ -35,7 +35,7 @@ GEM
|
|
|
35
35
|
gyoku (1.3.1)
|
|
36
36
|
builder (>= 2.1.2)
|
|
37
37
|
hashdiff (1.0.1)
|
|
38
|
-
hexapdf (0.
|
|
38
|
+
hexapdf (0.17.3)
|
|
39
39
|
cmdparse (~> 3.0, >= 3.0.3)
|
|
40
40
|
geom2d (~> 0.3)
|
|
41
41
|
httparty (0.20.0)
|
|
@@ -44,7 +44,7 @@ GEM
|
|
|
44
44
|
httpi (2.5.0)
|
|
45
45
|
rack
|
|
46
46
|
socksify
|
|
47
|
-
i18n (1.8.
|
|
47
|
+
i18n (1.8.11)
|
|
48
48
|
concurrent-ruby (~> 1.0)
|
|
49
49
|
mime-types (3.3.1)
|
|
50
50
|
mime-types-data (~> 3.2015)
|
|
@@ -55,29 +55,29 @@ GEM
|
|
|
55
55
|
nokogiri (1.12.5-x86_64-linux)
|
|
56
56
|
racc (~> 1.4)
|
|
57
57
|
nori (2.6.0)
|
|
58
|
-
parallel (1.
|
|
58
|
+
parallel (1.21.0)
|
|
59
59
|
parser (3.0.2.0)
|
|
60
60
|
ast (~> 2.4.1)
|
|
61
61
|
public_suffix (4.0.6)
|
|
62
|
-
racc (1.
|
|
62
|
+
racc (1.6.0)
|
|
63
63
|
rack (2.2.3)
|
|
64
64
|
rainbow (3.0.0)
|
|
65
65
|
rake (13.0.6)
|
|
66
66
|
regexp_parser (2.1.1)
|
|
67
67
|
rexml (3.2.5)
|
|
68
|
-
rspec (3.
|
|
69
|
-
rspec-core (~> 3.
|
|
70
|
-
rspec-expectations (~> 3.
|
|
71
|
-
rspec-mocks (~> 3.
|
|
72
|
-
rspec-core (3.
|
|
73
|
-
rspec-support (~> 3.
|
|
74
|
-
rspec-expectations (3.
|
|
68
|
+
rspec (3.10.0)
|
|
69
|
+
rspec-core (~> 3.10.0)
|
|
70
|
+
rspec-expectations (~> 3.10.0)
|
|
71
|
+
rspec-mocks (~> 3.10.0)
|
|
72
|
+
rspec-core (3.10.1)
|
|
73
|
+
rspec-support (~> 3.10.0)
|
|
74
|
+
rspec-expectations (3.10.1)
|
|
75
75
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
76
|
-
rspec-support (~> 3.
|
|
77
|
-
rspec-mocks (3.
|
|
76
|
+
rspec-support (~> 3.10.0)
|
|
77
|
+
rspec-mocks (3.10.2)
|
|
78
78
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
79
|
-
rspec-support (~> 3.
|
|
80
|
-
rspec-support (3.
|
|
79
|
+
rspec-support (~> 3.10.0)
|
|
80
|
+
rspec-support (3.10.3)
|
|
81
81
|
rubocop (0.93.1)
|
|
82
82
|
parallel (~> 1.10)
|
|
83
83
|
parser (>= 2.7.1.5)
|
|
@@ -87,7 +87,7 @@ GEM
|
|
|
87
87
|
rubocop-ast (>= 0.6.0)
|
|
88
88
|
ruby-progressbar (~> 1.7)
|
|
89
89
|
unicode-display_width (>= 1.4.0, < 2.0)
|
|
90
|
-
rubocop-ast (1.
|
|
90
|
+
rubocop-ast (1.12.0)
|
|
91
91
|
parser (>= 3.0.1.1)
|
|
92
92
|
ruby-progressbar (1.11.0)
|
|
93
93
|
savon (2.12.1)
|
|
@@ -101,7 +101,7 @@ GEM
|
|
|
101
101
|
socksify (1.7.1)
|
|
102
102
|
tzinfo (2.0.4)
|
|
103
103
|
concurrent-ruby (~> 1.0)
|
|
104
|
-
unicode-display_width (1.
|
|
104
|
+
unicode-display_width (1.8.0)
|
|
105
105
|
wasabi (3.6.1)
|
|
106
106
|
addressable
|
|
107
107
|
httpi (~> 2.0)
|
|
@@ -110,7 +110,7 @@ GEM
|
|
|
110
110
|
addressable (>= 2.8.0)
|
|
111
111
|
crack (>= 0.3.2)
|
|
112
112
|
hashdiff (>= 0.4.0, < 2.0.0)
|
|
113
|
-
zeitwerk (2.
|
|
113
|
+
zeitwerk (2.5.1)
|
|
114
114
|
|
|
115
115
|
PLATFORMS
|
|
116
116
|
x86_64-linux
|
data/lib/deliveries/address.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
module Deliveries
|
|
2
2
|
class Address
|
|
3
|
-
attr_accessor :name, :email, :phone, :country, :state, :city, :street, :postcode
|
|
3
|
+
attr_accessor :name, :email, :phone, :country, :state, :city, :street, :postcode, :address_id
|
|
4
4
|
|
|
5
5
|
COUNTRY_PHONE_PREFIXES = {
|
|
6
6
|
be: 32,
|
|
@@ -30,6 +30,7 @@ module Deliveries
|
|
|
30
30
|
self.city = attributes[:city]
|
|
31
31
|
self.street = attributes[:street]
|
|
32
32
|
self.postcode = attributes[:postcode]
|
|
33
|
+
self.address_id = attributes[:address_id]
|
|
33
34
|
end
|
|
34
35
|
|
|
35
36
|
def courierize(courier_id)
|
|
@@ -25,7 +25,7 @@ module Deliveries
|
|
|
25
25
|
refRecogida: reference_code,
|
|
26
26
|
fechaRecogida: pickup_date&.strftime('%d%m%Y') || '',
|
|
27
27
|
clienteRecogida: CorreosExpress.config(:pickup_receiver_code),
|
|
28
|
-
codRemit: '',
|
|
28
|
+
codRemit: sender.address_id || '',
|
|
29
29
|
nomRemit: sender.name,
|
|
30
30
|
nifRemit: '',
|
|
31
31
|
dirRecog: sender.street,
|
|
@@ -34,7 +34,7 @@ module Deliveries
|
|
|
34
34
|
contRecog: sender.name,
|
|
35
35
|
tlfnoRecog: sender.phone,
|
|
36
36
|
emailRecog: sender.email,
|
|
37
|
-
codDest: CorreosExpress.config(:pickup_receiver_code),
|
|
37
|
+
codDest: receiver.address_id || CorreosExpress.config(:pickup_receiver_code),
|
|
38
38
|
nomDest: receiver.name,
|
|
39
39
|
dirDest: receiver.street,
|
|
40
40
|
pobDest: receiver.city,
|
|
@@ -23,7 +23,7 @@ module Deliveries
|
|
|
23
23
|
def execute
|
|
24
24
|
params = {
|
|
25
25
|
solicitante: CorreosExpress.config(:client_code),
|
|
26
|
-
codRte: CorreosExpress.config(:shipment_sender_code),
|
|
26
|
+
codRte: sender.address_id || CorreosExpress.config(:shipment_sender_code),
|
|
27
27
|
ref: reference_code,
|
|
28
28
|
fecha: format_date(shipment_date),
|
|
29
29
|
nomRte: sender.name,
|
|
@@ -33,6 +33,7 @@ module Deliveries
|
|
|
33
33
|
contacRte: sender.name,
|
|
34
34
|
telefRte: sender.phone,
|
|
35
35
|
emailRte: sender.email,
|
|
36
|
+
codDest: receiver.address_id || '',
|
|
36
37
|
nomDest: receiver.name,
|
|
37
38
|
dirDest: receiver.street,
|
|
38
39
|
pobDest: receiver.city,
|
data/lib/deliveries/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: deliveries
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Fran Vega
|
|
@@ -11,7 +11,7 @@ authors:
|
|
|
11
11
|
autorequire:
|
|
12
12
|
bindir: bin
|
|
13
13
|
cert_chain: []
|
|
14
|
-
date: 2021-
|
|
14
|
+
date: 2021-11-03 00:00:00.000000000 Z
|
|
15
15
|
dependencies:
|
|
16
16
|
- !ruby/object:Gem::Dependency
|
|
17
17
|
name: activesupport
|