varejonline 0.1.1 → 0.2.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
  SHA1:
3
- metadata.gz: ada899e3a884b6e05923ba87ab68a8b017955527
4
- data.tar.gz: 9698a8dff5f6272fdb86d373d75aaf88cdd90f65
3
+ metadata.gz: 3518f82973526d4ec3fbfaefaa9b7ccc668caea6
4
+ data.tar.gz: fda407e1e6738660e89202707e91507073fa1ed9
5
5
  SHA512:
6
- metadata.gz: b364eb20546c12e070bafba43443e8e8916f1473be42b7151680fc4b4a4104d8bdf8101a5c12dbd0b4328eee64a3b608ab09c0a265918537d8f76773f68ef665
7
- data.tar.gz: c1302047196ab2d3c01870ac9022e6983b79269900aafd7612c730805b9c1c9b6134b2aa73d728125f025703a5cc9513362748ff3257f527490f3bbd7346a9c0
6
+ metadata.gz: 9cd058460fb1262303239e9d327d71c19ff366364cf207647b4befecde90c7a84567e65cb839c190a98ba8c11c5928f64e841840b19f08d5d88fcf342598c879
7
+ data.tar.gz: 5e4041f283de03bbe9595006dfc51c42126b1e2b1ef2986777086c7471df328912530cee1b4ef77d47a3aff7fb0ef8e03f4ea0d5f5f1f11124f820f68a3b01d2
data/.travis.yml CHANGED
@@ -20,4 +20,4 @@ deploy:
20
20
  secure: KPJfKFZVnZQ6mVzvOAfDbnG36AYSMOh7Ac7e2UJwBDTmZuONbkpRtlOaA+6OajDrMT0dsuLAM0eoC3j4OTYdC5A6Y0J5ZbjqiiNQg/RLRry56pNjj7S75ylUDusZjRK102ZscWnfFJJqSA/lcFrhR4i7EPZ/dd6YCe1/CXQmDzxz2Bdqnay0wDBUZmz3h+Om59ChFytf0rH7cK9sK4eojRXYO3jXkMCDqS4A0SSmQ9+RP4NuheL0DLmQ2Ctrur+hv+/icT6u9DNUu/5B/loEO65jJ7UMHa/Z5oFRrHG7PJG9+HiEp5LrQX4upqtXe2DBzit6nPN6qegbFxtF5VmsbOjfswAu+Q2jCL9VV7NiROxoyPoyWzXTF856gMs55w3FIuLysSgqff5v24RbfJr0CNj2lrdhO3lWkw8S2lI50jsOlJ91c668KdntodypDSPDPRn8XxRny8QUHLeruWc3WVV7zKafb31ZB5Jxxh4nmC7woxeV1hzG6enPz1WPOhS/DTMdzufwPl+Vy7Y6gtboJTYfKICMzSrdzZ0Por19RBaAOlw9+UyqdK4XDTxkwddeL+11qWOdzG1zyCMZhtVN8AX7XGSgya5wb7jsFmNOy6lkTNCgymQEl5xGPXLEC/18GTNEW2OnRXPaZ3fHa+dadIs1Y40uT+0LVqQb2tWQ6LY=
21
21
  gem: varejonline
22
22
  on:
23
- repo: coyosoftware/varejonline
23
+ tags: true
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Varejonline
2
2
 
3
- [![Build Status](https://travis-ci.org/coyosoftware/varejonline.svg?branch=master)](https://travis-ci.org/coyosoftware/varejonline) [![Gem Version](https://badge.fury.io/rb/varejonline.svg)](http://badge.fury.io/rb/varejonline) [![Test Coverage](https://codeclimate.com/github/coyosoftware/varejonline/badges/coverage.svg)](https://codeclimate.com/github/coyosoftware/varejonline/coverage) [![Code Climate](https://codeclimate.com/github/coyosoftware/varejonline/badges/gpa.svg)](https://codeclimate.com/github/coyosoftware/varejonline)
3
+ [![Build Status](https://travis-ci.org/coyosoftware/varejonline.svg?branch=master)](https://travis-ci.org/coyosoftware/varejonline) [![Gem Version](https://badge.fury.io/rb/varejonline.svg)](https://badge.fury.io/rb/varejonline) [![Test Coverage](https://codeclimate.com/github/coyosoftware/varejonline/badges/coverage.svg)](https://codeclimate.com/github/coyosoftware/varejonline/coverage) [![Code Climate](https://codeclimate.com/github/coyosoftware/varejonline/badges/gpa.svg)](https://codeclimate.com/github/coyosoftware/varejonline)
4
4
 
5
5
  This gem simplifies the usage of [Varejonline](http://varejonline.com.br/) API
6
6
 
@@ -30,19 +30,23 @@ Create a new instance of Varejonline class passing your access token:
30
30
 
31
31
  With the client instance, you can access the following resources:
32
32
 
33
+ * Níveis de Categoria (client.category_levels) **Only listing**
33
34
  * Classes de Clientes (client.client_classes) **Listing and finding**
34
- * Configuração de crédito (client.installments) **Saving and information**
35
- * Contas a Receber (client.receipts) **Listing and finding**
36
- * Dados Login (client.user_data)
37
35
  * Empresas (client.companies) **Listing and finding**
36
+ * Limite de Créditos (client.credit_limits) **Listing and block history**
37
+ * Lançamentos Padrões (client.default_entries) **Listing and finding**
38
38
  * Entidades (client.entities) **Listing and finding**
39
+ * Configuração de crédito (client.installments) **Saving and information**
40
+ * Pedidos de venda (client.orders) **Listing, finding and creation**
41
+ * Planos de pagamento (client.payment_conditions) **Only listing**
42
+ * Categorias de produtos (client.product_categories) **Only listing**
43
+ * Produtos (client.products) **Listing, finding, updating and creation**
44
+ * Provisões (client.provisions) **Only creation**
45
+ * Contas a Receber (client.receipts) **Listing and finding**
39
46
  * Histórico de Vendas (client.sales_history) **Finding and more details **
40
- * Lançamentos Padrões (client.default_entries) **Listing and finding**
41
- * Limite de Créditos (client.credit_limits) **Listing and block history**
42
- * Pedidos de venda (client.orders) **Listing and finding**
43
- * Provisões (client.provisions) **Only Creation**
44
47
  * Representantes (client.sellers) **Listing and finding**
45
48
  * Terceiros (client.third_parties) **Listing, finding, creation, credit limit information, credit limit updating, blocking/unblocking credit**
49
+ * Dados Login (client.user_data)
46
50
 
47
51
  ## Using the resources
48
52
  ### Listing
@@ -52,15 +56,17 @@ It can accept an Entity object that reflects the searchable API fields.
52
56
 
53
57
  Currently the following entities are implemented:
54
58
 
55
- * [Classes de Clientes](lib/varejonline/searcher/operational/client_class_searcher.rb)
56
- * [Contas a Receber](lib/varejonline/searcher/financial/receipt_searcher.rb)
57
59
  * [Empresas](lib/varejonline/searcher/administrative/company_searcher.rb)
58
60
  * [Entidades](lib/varejonline/searcher/administrative/entity_searcher.rb)
59
- * [Lançamentos Padrões](lib/varejonline/searcher/financial/default_entry_searcher.rb)
61
+ * [Terceiros](lib/varejonline/searcher/administrative/third_party_searcher.rb)
60
62
  * [Limite de Crédito](lib/varejonline/searcher/commercial/credit_limit_searcher.rb)
63
+ * [Produtos](lib/varejonline/searcher/commercial/product_searcher.rb)
64
+ * [Lançamentos Padrões](lib/varejonline/searcher/financial/default_entry_searcher.rb)
65
+ * [Planos de pagamento](lib/varejonline/searcher/financial/payment_condition_searcher.rb)
66
+ * [Contas a Receber](lib/varejonline/searcher/financial/receipt_searcher.rb)
67
+ * [Classes de Clientes](lib/varejonline/searcher/operational/client_class_searcher.rb)
61
68
  * [Pedidos de Venda](lib/varejonline/searcher/operational/order_searcher.rb)
62
69
  * [Representantes](lib/varejonline/searcher/operational/seller_searcher.rb)
63
- * [Terceiros](lib/varejonline/searcher/administrative/third_party_searcher.rb)
64
70
 
65
71
  ### Finding
66
72
  All resources implement a **find** method.
@@ -1,10 +1,22 @@
1
1
  module Varejonline
2
2
  module API
3
3
  class Products < Client
4
+ require_all 'varejonline/searcher/commercial', 'product_searcher'
4
5
  require_all 'varejonline/entity/commercial', 'product'
5
6
 
6
7
  base_uri "#{Varejonline::API_ADDRESS}/produtos"
7
8
 
9
+ def list(searcher = nil)
10
+ raise ArgumentError unless searcher.nil? || searcher.is_a?(Varejonline::Searcher::Commercial::ProductSearcher)
11
+
12
+ return parse_response(self.class.get('/', body: build_body(searcher.as_parameter), headers: header)) if searcher
13
+ return parse_response(self.class.get('/', body: build_body, headers: header)) unless searcher
14
+ end
15
+
16
+ def find(id)
17
+ return parse_response(self.class.get("/#{id}", body: build_body, headers: header))
18
+ end
19
+
8
20
  def save(data)
9
21
  return parse_response(self.class.post('/', body: build_body(data.as_parameter), headers: header))
10
22
  end
@@ -0,0 +1,11 @@
1
+ require 'varejonline/searcher/base'
2
+
3
+ module Varejonline
4
+ module Searcher
5
+ module Commercial
6
+ class ProductSearcher < Base
7
+ attr_accessor :entidades, :categoria, :alteradoApos, :produtoBase, :descricao, :codigoBarras, :codigoInterno, :codigoSistema
8
+ end
9
+ end
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  module Varejonline
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
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.1.1
4
+ version: 0.2.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-20 00:00:00.000000000 Z
11
+ date: 2017-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -90,6 +90,7 @@ files:
90
90
  - lib/varejonline/searcher/administrative/third_party_searcher.rb
91
91
  - lib/varejonline/searcher/base.rb
92
92
  - lib/varejonline/searcher/commercial/credit_limit_searcher.rb
93
+ - lib/varejonline/searcher/commercial/product_searcher.rb
93
94
  - lib/varejonline/searcher/financial/default_entry_searcher.rb
94
95
  - lib/varejonline/searcher/financial/payment_condition_searcher.rb
95
96
  - lib/varejonline/searcher/financial/receipt_searcher.rb