vpsa 0.0.19 → 0.0.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vpsa/api/credit_limits.rb +6 -0
- data/lib/vpsa/api/installments.rb +2 -2
- data/lib/vpsa/api/third_parties.rb +2 -5
- data/lib/vpsa/entity/commercial/installment.rb +0 -30
- data/lib/vpsa/version.rb +1 -1
- data/spec/vpsa/api/credit_limits_spec.rb +18 -0
- data/spec/vpsa/api/installments_spec.rb +3 -3
- data/spec/vpsa/api/third_parties_spec.rb +3 -16
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6aafd10b28f34f33ec0e79174b0d2a536985f0c
|
4
|
+
data.tar.gz: 1b09acff663446760c6886e54deb6023ed9b31cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 128b261ae5c82dbc1803015bbb426fcac7e47288698d7d86e34acb3a4d77b5b3d584d03efda1989acd82193dacda241a6f5163c22e9b73bde894d1ff42856337
|
7
|
+
data.tar.gz: 477fbbae7f32287fb40d0f296c2f3548d1cf43ed33f570497f43982417a8f3d1c43e013a543f4469704d00de7149a5d636e1ddf3f33c544570245d4d3bcd2c87
|
@@ -11,6 +11,12 @@ module Vpsa
|
|
11
11
|
return parse_response(self.class.get("/", :body => build_body(searcher.as_parameter), :headers => header)) if searcher
|
12
12
|
return parse_response(self.class.get("/", :body => build_body, :headers => header)) unless searcher
|
13
13
|
end
|
14
|
+
|
15
|
+
|
16
|
+
def block_history(idTerceiro, start_date, end_date)
|
17
|
+
return parse_response(self.class.get("/historico_bloqueio", :body => build_body({"desde" => start_date, "ate" => end_date, "idTerceiro" => idTerceiro}), :headers => header))
|
18
|
+
end
|
19
|
+
|
14
20
|
end
|
15
21
|
end
|
16
22
|
end
|
@@ -5,8 +5,8 @@ module Vpsa
|
|
5
5
|
|
6
6
|
base_uri "#{Vpsa::API_ADDRESS}/configuracao-credito"
|
7
7
|
|
8
|
-
def configure(data)
|
9
|
-
return parse_response(self.class.put("
|
8
|
+
def configure(id, data)
|
9
|
+
return parse_response(self.class.put("/#{id}", :body => build_body(data), :headers => header))
|
10
10
|
end
|
11
11
|
|
12
12
|
def information
|
@@ -36,16 +36,13 @@ module Vpsa
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def block_credit_limit(id, justification)
|
39
|
-
return parse_response(self.class.put("/#{id}/limites_credito/bloquear", :body => build_body({"
|
39
|
+
return parse_response(self.class.put("/#{id}/limites_credito/bloquear", :body => build_body({"motivo" => justification}), :headers => header))
|
40
40
|
end
|
41
41
|
|
42
42
|
def unlock_credit_limit(id, justification)
|
43
|
-
return parse_response(self.class.put("/#{id}/limites_credito/desbloquear", :body => build_body({"
|
43
|
+
return parse_response(self.class.put("/#{id}/limites_credito/desbloquear", :body => build_body({"motivo" => justification}), :headers => header))
|
44
44
|
end
|
45
45
|
|
46
|
-
def credit_limit_history(id, start_date, end_date)
|
47
|
-
return parse_response(self.class.get("/#{id}/limites_credito/historico", :body => build_body({"desde" => start_date, "ate" => end_date}), :headers => header))
|
48
|
-
end
|
49
46
|
end
|
50
47
|
end
|
51
48
|
end
|
@@ -13,33 +13,3 @@ module Vpsa
|
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
-
|
17
|
-
# private boolean bloquearClienteSemAnalise;//
|
18
|
-
# private boolean bloqueioAutomatico;//
|
19
|
-
# private String mensagemBloqueio;//
|
20
|
-
# private boolean permissaoValorExcedente;//
|
21
|
-
#
|
22
|
-
# private boolean permiteLiberarBloqueioManual;//
|
23
|
-
# private boolean permiteVenderSemAnalise;//
|
24
|
-
#
|
25
|
-
# private BigDecimal creditoMaximoCliente;//
|
26
|
-
# private boolean valorCredMaximoCliente;//
|
27
|
-
#
|
28
|
-
#
|
29
|
-
# private String limiteMensal;//
|
30
|
-
#
|
31
|
-
# private boolean limiteCreditoSobreRenda;
|
32
|
-
# private BigDecimal limiteSobreRenda;
|
33
|
-
|
34
|
-
# private BigDecimal totalCredito;
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
# private boolean bloquearPorChequeDevolvido;
|
44
|
-
#
|
45
|
-
//
|
data/lib/vpsa/version.rb
CHANGED
@@ -26,4 +26,22 @@ RSpec.describe Vpsa::Api::CreditLimits do
|
|
26
26
|
expect{Vpsa.new("abc").credit_limits.list(Array.new)}.to raise_error(ArgumentError)
|
27
27
|
end
|
28
28
|
end
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
context "history" do
|
33
|
+
let(:history_params) {{"desde" => Date.parse("01/01/2015"), "ate" => Date.parse("11/01/2015"), idTerceiro: 5, :token => "abc"}}
|
34
|
+
|
35
|
+
before(:each) do
|
36
|
+
stub_request(:get, "#{Vpsa::API_ADDRESS}/limites_credito/historico_bloqueio").to_return(:status => 200)
|
37
|
+
end
|
38
|
+
|
39
|
+
it "should issue a get to the third party credit history url" do
|
40
|
+
expect(Vpsa::Api::CreditLimits).to receive(:get).with("/historico_bloqueio", :body => history_params.to_json, :headers => header).and_call_original
|
41
|
+
|
42
|
+
Vpsa.new("abc").credit_limits.block_history(5, Date.parse("01/01/2015"), Date.parse("11/01/2015"))
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
|
29
47
|
end
|
@@ -17,15 +17,15 @@ RSpec.describe Vpsa::Api::Installments do
|
|
17
17
|
|
18
18
|
describe "configuration" do
|
19
19
|
before(:each) do
|
20
|
-
stub_request(:put, "#{Vpsa::API_ADDRESS}/configuracao-credito/").to_return(:status => 201)
|
20
|
+
stub_request(:put, "#{Vpsa::API_ADDRESS}/configuracao-credito/1").to_return(:status => 201)
|
21
21
|
end
|
22
22
|
|
23
23
|
let(:installment_param) {{}}
|
24
24
|
|
25
25
|
it "should issue a post to the installments url" do
|
26
|
-
expect(Vpsa::Api::Installments).to receive(:put).with("/", :body => installment_param.merge!({:token => "abc"}).to_json, :headers => header).and_call_original
|
26
|
+
expect(Vpsa::Api::Installments).to receive(:put).with("/1", :body => installment_param.merge!({:token => "abc"}).to_json, :headers => header).and_call_original
|
27
27
|
|
28
|
-
Vpsa.new("abc").installments.configure( installment_param)
|
28
|
+
Vpsa.new("abc").installments.configure(1, installment_param)
|
29
29
|
end
|
30
30
|
end
|
31
31
|
end
|
@@ -130,7 +130,7 @@ RSpec.describe Vpsa::Api::ThirdParties do
|
|
130
130
|
end
|
131
131
|
|
132
132
|
context "blocking" do
|
133
|
-
let(:credit_limit_block_params) {{"
|
133
|
+
let(:credit_limit_block_params) {{"motivo" => "Cliente caloteiro", :token => "abc"}}
|
134
134
|
|
135
135
|
before(:each) do
|
136
136
|
stub_request(:put, "#{Vpsa::API_ADDRESS}/terceiros/5/limites_credito/bloquear").to_return(:status => 200)
|
@@ -144,7 +144,7 @@ RSpec.describe Vpsa::Api::ThirdParties do
|
|
144
144
|
end
|
145
145
|
|
146
146
|
context "unlocking" do
|
147
|
-
let(:credit_limit_unlock_params) {{"
|
147
|
+
let(:credit_limit_unlock_params) {{"motivo" => "Cliente pagou", :token => "abc"}}
|
148
148
|
|
149
149
|
before(:each) do
|
150
150
|
stub_request(:put, "#{Vpsa::API_ADDRESS}/terceiros/5/limites_credito/desbloquear").to_return(:status => 200)
|
@@ -156,19 +156,6 @@ RSpec.describe Vpsa::Api::ThirdParties do
|
|
156
156
|
Vpsa.new("abc").third_parties.unlock_credit_limit(5, "Cliente pagou")
|
157
157
|
end
|
158
158
|
end
|
159
|
-
|
160
|
-
context "history" do
|
161
|
-
let(:history_params) {{"desde" => Date.parse("01/01/2015"), "ate" => Date.parse("11/01/2015"), :token => "abc"}}
|
162
|
-
|
163
|
-
before(:each) do
|
164
|
-
stub_request(:get, "#{Vpsa::API_ADDRESS}/terceiros/5/limites_credito/historico").to_return(:status => 200)
|
165
|
-
end
|
166
|
-
|
167
|
-
it "should issue a get to the third party credit history url" do
|
168
|
-
expect(Vpsa::Api::ThirdParties).to receive(:get).with("/5/limites_credito/historico", :body => history_params.to_json, :headers => header).and_call_original
|
169
|
-
|
170
|
-
Vpsa.new("abc").third_parties.credit_limit_history(5, Date.parse("01/01/2015"), Date.parse("11/01/2015"))
|
171
|
-
end
|
172
|
-
end
|
159
|
+
|
173
160
|
end
|
174
161
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vpsa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gustavo Berdugo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|