vpsa 0.0.15 → 0.0.18

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 77f9e3068678cf07d5805cee0e6436a50221ef1e
4
- data.tar.gz: df3038a626e6709b26c762f810a2092a30577af8
3
+ metadata.gz: 8eec1315d01c5d12bcf6dc30b9ccd143fa057f93
4
+ data.tar.gz: fe9ee2c60a53f3123aa799f92f922b2d5eff06bb
5
5
  SHA512:
6
- metadata.gz: 75be767e94a6f8cb057c5cc9c7be217e1a0cd37270e7d67b5e2971235d366adc919d7e5acd4ee86eb771ec53825809e417ab8f6f24a4e48317b1993cc495d639
7
- data.tar.gz: 5c6ef579b27ab7d3bcef9949ed161ebe5ac4672c9f26726d897efb5e6deb6622040f8979223e6588d799e949e57b8f429ba756878276478687287fb88a98a664
6
+ metadata.gz: 67c881e6521434b03321f75bb67f31fdc9e0e701df6d8e76f739ce3b90988dfd0c20b86879c1094f381f0a02b0ce8bee9af1810bc4ad6b7a6f81ce69c0cec3a5
7
+ data.tar.gz: 04a810247fb540d11d78f0766b7f83b88de7bf7624eadca7ddb16ed3ac483aa757822d82818fc4a280c09ea6d15bbcb4199b6ad7cb8abea9b9aaa14a36d727e6
data/README.md CHANGED
@@ -36,6 +36,7 @@ With the client instance, you can access the following resources:
36
36
  * Provisões (client.provisions) **Only Creation**
37
37
  * Dados Login (client.user_data)
38
38
  * Classes de Clientes (client.client_classes) **Listing and finding**
39
+ * Contas a Receber (client.receipts) **Only listing**
39
40
 
40
41
  ## Using the resources
41
42
  ### Listing
@@ -48,6 +49,7 @@ Currently the following entities are implemented:
48
49
  * [Terceiros](lib/vpsa/searcher/administrative/third_party_searcher.rb)
49
50
  * [Entidades](lib/vpsa/searcher/administrative/entity_searcher.rb)
50
51
  * [Lançamentos Padrões](lib/vpsa/searcher/financial/default_entry_searcher.rb)
52
+ * [Contas a Receber](lib/vpsa/searcher/financial/receipt_searcher.rb)
51
53
  * [Classes de Clientes](lib/vpsa/searcher/operational/client_class_searcher.rb)
52
54
 
53
55
  ### Finding
data/lib/vpsa.rb CHANGED
@@ -4,7 +4,7 @@ module Vpsa
4
4
  LIBNAME = 'vpsa'
5
5
  LIBDIR = File.expand_path("../#{LIBNAME}", __FILE__)
6
6
 
7
- API_ADDRESS = "https://www.vpsa.com.br/apps/api"
7
+ API_ADDRESS = "http://www.vpsa.com.br/apps/api"
8
8
  #API_ADDRESS = "http://192.168.1.204:8080/vpsa/api"
9
9
 
10
10
  class << self
@@ -3,7 +3,7 @@ module Vpsa
3
3
  class CreditLimits < Client
4
4
  require_all 'vpsa/searcher/commercial', 'credit_limit_searcher'
5
5
 
6
- base_uri "#{Vpsa::API_ADDRESS}/limites_credito"
6
+ base_uri "#{Vpsa::API_ADDRESS}/limitescredito"
7
7
 
8
8
  def list(searcher = nil)
9
9
  raise ArgumentError unless searcher.nil? || searcher.is_a?(Vpsa::Searcher::Commercial::CreditLimitSearcher)
data/lib/vpsa/client.rb CHANGED
@@ -9,7 +9,7 @@ module Vpsa
9
9
  default_options.update(verify: false)
10
10
  parser Proc.new {|b| JSON.parse(b) rescue b}
11
11
 
12
- require_all 'vpsa/api', 'third_parties', 'entities', 'default_entries', 'provisions', 'user_data', 'installments', 'credit_limits', 'client_classes', 'receipts', 'sales'
12
+ require_all 'vpsa/api', 'third_parties', 'entities', 'default_entries', 'provisions', 'user_data', 'installments', 'credit_limits', 'client_classes', 'receipts'
13
13
 
14
14
  attr_accessor :access_token
15
15
 
@@ -54,10 +54,6 @@ module Vpsa
54
54
  Vpsa::Api::ClientClasses.new(@access_token)
55
55
  end
56
56
 
57
- def sales
58
- Vpsa::Api::Sales.new(@access_token)
59
- end
60
-
61
57
  protected
62
58
  def header
63
59
  {"Content-Type" => "application/json", "Accept" => "application/json"}
@@ -4,7 +4,7 @@ module Vpsa
4
4
  module Searcher
5
5
  module Commercial
6
6
  class CreditLimitSearcher < Base
7
- attr_accessor :idClassificacaoCliente, :"idTerceiro", :endereco, :uf, :cidade, :email
7
+ attr_accessor :classes, :"idTerceiro", :endereco, :uf, :cidade, :email, :"idClassificacaoCliente"
8
8
  end
9
9
  end
10
10
  end
data/lib/vpsa/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Vpsa
2
- VERSION = "0.0.15"
2
+ VERSION = "0.0.18"
3
3
  end
@@ -5,7 +5,7 @@ RSpec.describe Vpsa::Api::CreditLimits do
5
5
 
6
6
  describe "listing" do
7
7
  before(:each) do
8
- stub_request(:get, "#{Vpsa::API_ADDRESS}/limites_credito/").to_return(:status => 200)
8
+ stub_request(:get, "#{Vpsa::API_ADDRESS}/limitescredito/").to_return(:status => 200)
9
9
  end
10
10
 
11
11
  it "should issue a get to the credit_limits url" do
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.15
4
+ version: 0.0.18
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-05-27 00:00:00.000000000 Z
11
+ date: 2015-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -60,7 +60,6 @@ files:
60
60
  - lib/vpsa/api/installments.rb
61
61
  - lib/vpsa/api/provisions.rb
62
62
  - lib/vpsa/api/receipts.rb
63
- - lib/vpsa/api/sales.rb
64
63
  - lib/vpsa/api/third_parties.rb
65
64
  - lib/vpsa/api/user_data.rb
66
65
  - lib/vpsa/client.rb
@@ -87,7 +86,6 @@ files:
87
86
  - spec/vpsa/api/installments_spec.rb
88
87
  - spec/vpsa/api/provisions_spec.rb
89
88
  - spec/vpsa/api/receipts_spec.rb
90
- - spec/vpsa/api/sales_spec.rb
91
89
  - spec/vpsa/api/third_parties_spec.rb
92
90
  - spec/vpsa/api/user_data_spec.rb
93
91
  - spec/vpsa/client_spec.rb
@@ -131,7 +129,6 @@ test_files:
131
129
  - spec/vpsa/api/installments_spec.rb
132
130
  - spec/vpsa/api/provisions_spec.rb
133
131
  - spec/vpsa/api/receipts_spec.rb
134
- - spec/vpsa/api/sales_spec.rb
135
132
  - spec/vpsa/api/third_parties_spec.rb
136
133
  - spec/vpsa/api/user_data_spec.rb
137
134
  - spec/vpsa/client_spec.rb
@@ -1,12 +0,0 @@
1
- module Vpsa
2
- module Api
3
- class Sales < Client
4
-
5
- base_uri "#{Vpsa::API_ADDRESS}/externa/historico-vendas-terceiro"
6
-
7
- def sales_history(id)
8
- return parse_response(self.class.get("/buscar?terceiro=#{id}", :body => build_body, :headers => header))
9
- end
10
- end
11
- end
12
- end
@@ -1,23 +0,0 @@
1
- require 'spec_helper'
2
-
3
- RSpec.describe Vpsa::Api::Sales do
4
- let(:header) {{"Content-Type" => "application/json", "Accept" => "application/json"}}
5
-
6
- describe "information" do
7
-
8
- before(:each) do
9
- stub_request(:get, "https://www.vpsa.com.br/apps/api/externa/historico-vendas-terceiro/buscar?terceiro=1").
10
- with(:body => "{\"token\":\"abc\"}",
11
- :headers => {'Accept'=>'application/json', 'Content-Type'=>'application/json'}).
12
- to_return(:status => 200, :body => "", :headers => {})
13
-
14
- end
15
-
16
- it "should issue a get to the sales url" do
17
- expect(Vpsa::Api::Sales).to receive(:get).with("/buscar?terceiro=1", :body => {:token => "abc"}.to_json, :headers => header).and_call_original
18
-
19
- Vpsa.new("abc").sales.sales_history(1)
20
- end
21
- end
22
-
23
- end