varejonline 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -5
- data/lib/varejonline/api/payables.rb +20 -0
- data/lib/varejonline/api/{receipts.rb → receivables.rb} +3 -3
- data/lib/varejonline/client.rb +7 -3
- data/lib/varejonline/searcher/financial/{receipt_searcher.rb → payable_searcher.rb} +1 -1
- data/lib/varejonline/searcher/financial/receivable_searcher.rb +11 -0
- data/lib/varejonline/version.rb +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b039759125e05be0d9db12c636411860748cb456
|
4
|
+
data.tar.gz: 550acd64c440105e3b5b52b74415e12105619172
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8887b6f7276cd91b0b61a4fb78c1b2e7050ba7bbb85f313050357200612a851b1a3965d9a6a86356ca52625bd3262cbcb9faa538ef6417b433ec873750d2f5ab
|
7
|
+
data.tar.gz: 4e89dfe7b8191c12808a2b998e649a76def6e04465a4440f7872566530b1b463afb63eec66e19e0aa8335a428231464584e49c35995f21eb8b209020185b8d38
|
data/README.md
CHANGED
@@ -42,15 +42,16 @@ With the client instance, you can access the following resources:
|
|
42
42
|
* Categorias de produtos (client.product_categories) **Only listing**
|
43
43
|
* Produtos (client.products) **Listing, finding, updating and creation**
|
44
44
|
* Provisões (client.provisions) **Only creation**
|
45
|
-
* Contas a Receber (client.
|
46
|
-
*
|
45
|
+
* Contas a Receber (client.receivables) **Listing and finding**
|
46
|
+
* Contas a Pagar (client.payables) **Listing and finding**
|
47
|
+
* Histórico de Vendas (client.sales_history) **Finding and more details**
|
47
48
|
* Representantes (client.sellers) **Listing and finding**
|
48
49
|
* Terceiros (client.third_parties) **Listing, finding, creation, credit limit information, credit limit updating, blocking/unblocking credit**
|
49
50
|
* Dados Login (client.user_data)
|
50
51
|
|
51
52
|
## Using the resources
|
52
53
|
### Listing
|
53
|
-
|
54
|
+
Some resources implement a **list** method.
|
54
55
|
|
55
56
|
It can accept an Entity object that reflects the searchable API fields.
|
56
57
|
|
@@ -63,13 +64,14 @@ Currently the following entities are implemented:
|
|
63
64
|
* [Produtos](lib/varejonline/searcher/commercial/product_searcher.rb)
|
64
65
|
* [Lançamentos Padrões](lib/varejonline/searcher/financial/default_entry_searcher.rb)
|
65
66
|
* [Planos de pagamento](lib/varejonline/searcher/financial/payment_condition_searcher.rb)
|
66
|
-
* [Contas a Receber](lib/varejonline/searcher/financial/
|
67
|
+
* [Contas a Receber](lib/varejonline/searcher/financial/receivable_searcher.rb)
|
68
|
+
* [Contas a Pagar](lib/varejonline/searcher/financial/payable_searcher.rb)
|
67
69
|
* [Classes de Clientes](lib/varejonline/searcher/operational/client_class_searcher.rb)
|
68
70
|
* [Pedidos de Venda](lib/varejonline/searcher/operational/order_searcher.rb)
|
69
71
|
* [Representantes](lib/varejonline/searcher/operational/seller_searcher.rb)
|
70
72
|
|
71
73
|
### Finding
|
72
|
-
|
74
|
+
Some resources implement a **find** method.
|
73
75
|
|
74
76
|
It finds the resource with the passed ID.
|
75
77
|
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Varejonline
|
2
|
+
module API
|
3
|
+
class Payables < Client
|
4
|
+
require_all 'varejonline/searcher/financial', 'payable_searcher'
|
5
|
+
|
6
|
+
base_uri "#{Varejonline::API_ADDRESS}/contas-pagar"
|
7
|
+
|
8
|
+
def list(searcher = nil)
|
9
|
+
raise ArgumentError unless searcher.nil? || searcher.is_a?(Varejonline::Searcher::Financial::PayableSearcher)
|
10
|
+
|
11
|
+
return parse_response(self.class.get('/', body: build_body(searcher.as_parameter), headers: header)) if searcher
|
12
|
+
return parse_response(self.class.get('/', body: build_body, headers: header)) unless searcher
|
13
|
+
end
|
14
|
+
|
15
|
+
def find(id)
|
16
|
+
return parse_response(self.class.get("/#{id}", body: build_body, headers: header))
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -1,12 +1,12 @@
|
|
1
1
|
module Varejonline
|
2
2
|
module API
|
3
|
-
class
|
4
|
-
require_all 'varejonline/searcher/financial', '
|
3
|
+
class Receivables < Client
|
4
|
+
require_all 'varejonline/searcher/financial', 'receivable_searcher'
|
5
5
|
|
6
6
|
base_uri "#{Varejonline::API_ADDRESS}/contas-receber"
|
7
7
|
|
8
8
|
def list(searcher = nil)
|
9
|
-
raise ArgumentError unless searcher.nil? || searcher.is_a?(Varejonline::Searcher::Financial::
|
9
|
+
raise ArgumentError unless searcher.nil? || searcher.is_a?(Varejonline::Searcher::Financial::ReceivableSearcher)
|
10
10
|
|
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
|
data/lib/varejonline/client.rb
CHANGED
@@ -11,7 +11,7 @@ module Varejonline
|
|
11
11
|
parser Proc.new {|b| JSON.parse(b) rescue b}
|
12
12
|
|
13
13
|
require_all 'varejonline/api', 'third_parties', 'entities', 'default_entries', 'provisions', 'user_data', 'installments', 'credit_limits',
|
14
|
-
'client_classes', '
|
14
|
+
'client_classes', 'receivables', 'payables', 'sales_history', 'orders', 'companies', 'sellers', 'products', 'category_levels', 'product_categories',
|
15
15
|
'payment_conditions'
|
16
16
|
|
17
17
|
attr_accessor :access_token
|
@@ -49,8 +49,12 @@ module Varejonline
|
|
49
49
|
Varejonline::API::CreditLimits.new(@access_token)
|
50
50
|
end
|
51
51
|
|
52
|
-
def
|
53
|
-
Varejonline::API::
|
52
|
+
def receivables
|
53
|
+
Varejonline::API::Receivables.new(@access_token)
|
54
|
+
end
|
55
|
+
|
56
|
+
def payables
|
57
|
+
Varejonline::API::Payables.new(@access_token)
|
54
58
|
end
|
55
59
|
|
56
60
|
def client_classes
|
data/lib/varejonline/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: varejonline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Coyô
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -63,11 +63,12 @@ files:
|
|
63
63
|
- lib/varejonline/api/entities.rb
|
64
64
|
- lib/varejonline/api/installments.rb
|
65
65
|
- lib/varejonline/api/orders.rb
|
66
|
+
- lib/varejonline/api/payables.rb
|
66
67
|
- lib/varejonline/api/payment_conditions.rb
|
67
68
|
- lib/varejonline/api/product_categories.rb
|
68
69
|
- lib/varejonline/api/products.rb
|
69
70
|
- lib/varejonline/api/provisions.rb
|
70
|
-
- lib/varejonline/api/
|
71
|
+
- lib/varejonline/api/receivables.rb
|
71
72
|
- lib/varejonline/api/sales_history.rb
|
72
73
|
- lib/varejonline/api/sellers.rb
|
73
74
|
- lib/varejonline/api/third_parties.rb
|
@@ -92,8 +93,9 @@ files:
|
|
92
93
|
- lib/varejonline/searcher/commercial/credit_limit_searcher.rb
|
93
94
|
- lib/varejonline/searcher/commercial/product_searcher.rb
|
94
95
|
- lib/varejonline/searcher/financial/default_entry_searcher.rb
|
96
|
+
- lib/varejonline/searcher/financial/payable_searcher.rb
|
95
97
|
- lib/varejonline/searcher/financial/payment_condition_searcher.rb
|
96
|
-
- lib/varejonline/searcher/financial/
|
98
|
+
- lib/varejonline/searcher/financial/receivable_searcher.rb
|
97
99
|
- lib/varejonline/searcher/operational/client_class_searcher.rb
|
98
100
|
- lib/varejonline/searcher/operational/order_searcher.rb
|
99
101
|
- lib/varejonline/searcher/operational/seller_searcher.rb
|