enotas_api 4.0.0 → 4.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.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/check.yml +4 -5
  3. data/.rubocop.yml +1 -0
  4. data/CHANGELOG.md +5 -0
  5. data/Gemfile.lock +3 -3
  6. data/README.md +9 -9
  7. data/Rakefile +1 -1
  8. data/enotas_api.gemspec +1 -1
  9. data/lib/enotas_api/support/type_handler.rb +1 -0
  10. data/lib/enotas_api/v2/cancelar_nf.rb +13 -0
  11. data/lib/enotas_api/v2/consultar_empresa.rb +13 -0
  12. data/lib/enotas_api/v2/consultar_nfs.rb +13 -0
  13. data/lib/enotas_api/v2/emitir_nf.rb +13 -0
  14. data/lib/enotas_api/v2/entities/empresa.rb +23 -0
  15. data/lib/enotas_api/v2/entities/empresa_configuracoes.rb +13 -0
  16. data/lib/enotas_api/v2/entities/empresa_emissao_nfe_produto.rb +13 -0
  17. data/lib/enotas_api/v2/entities/empresa_endereco.rb +17 -0
  18. data/lib/enotas_api/v2/entities/nfe.rb +24 -0
  19. data/lib/enotas_api/v2/entities/nfe_cliente.rb +20 -0
  20. data/lib/enotas_api/v2/entities/nfe_cliente_endereco.rb +18 -0
  21. data/lib/enotas_api/v2/entities/nfe_imposto_cofins.rb +15 -0
  22. data/lib/enotas_api/v2/entities/nfe_imposto_icms.rb +22 -0
  23. data/lib/enotas_api/v2/entities/nfe_imposto_ipi.rb +15 -0
  24. data/lib/enotas_api/v2/entities/nfe_imposto_percentual_aproximado_tributos.rb +15 -0
  25. data/lib/enotas_api/v2/entities/nfe_imposto_pis.rb +15 -0
  26. data/lib/enotas_api/v2/entities/nfe_imposto_por_aliquota.rb +11 -0
  27. data/lib/enotas_api/v2/entities/nfe_imposto_por_valor.rb +11 -0
  28. data/lib/enotas_api/v2/entities/nfe_imposto_tributos_detalhado.rb +13 -0
  29. data/lib/enotas_api/v2/entities/nfe_imposto_tributos_simplificado.rb +11 -0
  30. data/lib/enotas_api/v2/entities/nfe_item.rb +23 -0
  31. data/lib/enotas_api/v2/entities/nfe_item_impostos.rb +20 -0
  32. data/lib/enotas_api/v2/entities/nfe_referenciada.rb +13 -0
  33. data/lib/enotas_api/v2/incluir_atualizar_empresa.rb +13 -0
  34. data/lib/enotas_api/v2/listar_empresas.rb +17 -0
  35. data/lib/enotas_api/v2/vincular_certificado.rb +14 -0
  36. data/lib/enotas_api/v2/vincular_logotipo.rb +14 -0
  37. data/lib/enotas_api/version.rb +1 -1
  38. metadata +31 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 71850347c5ef565b749e81d9bd89787f0d3f313709a55c4b7ba67df060c28339
4
- data.tar.gz: f3fceeeb982cd826099bd86d70af5977d335d31a3d671e1822f123538c969846
3
+ metadata.gz: bbb7d612044138f73cdb09a5721e29bbcbe75341179adc70a8c056dfe62a865e
4
+ data.tar.gz: 8952d3b4bf2c0e01f47c00e04f887d4c56899751ac957a7170bf96234836ec81
5
5
  SHA512:
6
- metadata.gz: f20fa56cb1cbe25ee49df5b8d4fc645dbe173f83d1cce68601c97ce7bab979d00970c308c6afe36f581030295bc737050770e185317587ad59fe4d97577bb8a1
7
- data.tar.gz: 3e38119a6d8238dbc0c9a0d9ee119085911177158e5d0110b8d5f186e1cfa37db9a631a7a5db2da3594e4f7f6ccfe07d968fced6ff6e961395234a10d8a2335d
6
+ metadata.gz: 4febcfc953b37b9c59d024a76d18dbe206b96db9b2354fb0d9fa3aad0bb353265b4a94a4730ea8018114bc7a3a997ea549222e68a27580c89938221c9c1f60c1
7
+ data.tar.gz: b6e9ef30c83c4315a1d5077bf16d2134e5d5402a0b626868b915b315a8069f0a0401123d5ffcedd74cb81ee2c895e5a44d7102bb7809d531470623ab1cc3ca76
@@ -19,12 +19,11 @@ jobs:
19
19
 
20
20
  steps:
21
21
  - uses: actions/checkout@v3
22
- - name: Set up Ruby
23
- # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
24
- # change this to (see https://github.com/ruby/setup-ruby#versioning):
25
- uses: ruby/setup-ruby@v1.110.0
22
+ - name: Set up Ruby 3.2
23
+ uses: ruby/setup-ruby@v1
26
24
  with:
27
- ruby-version: 2.7.6
25
+ ruby-version: 3.2.2
26
+ bundler-cache: true
28
27
  - name: Install dependencies
29
28
  run: bundle install
30
29
  - name: Run tests
data/.rubocop.yml CHANGED
@@ -3,6 +3,7 @@ require: rubocop-rspec
3
3
  AllCops:
4
4
  NewCops: enable
5
5
  UseCache: true
6
+ TargetRubyVersion: 3.1
6
7
  Layout/LineLength:
7
8
  Max: 150
8
9
  Metrics/AbcSize:
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ # 4.2.0
2
+ - Add endpoints API V2 - NOTA FISCAL ELETRÔNICA DE PRODUTO (NF-E)
3
+ # 4.1.0
4
+ - Add support to ruby >= 3.1
5
+ - Add endpoints API V2 - Empresa
1
6
  # 4.0.0
2
7
  - Add support to ruby >= 3.2.2
3
8
  - [BREAKING_CHANGE] Drop support for ruby 2.7
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- enotas_api (4.0.0)
4
+ enotas_api (4.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -49,7 +49,7 @@ GEM
49
49
  parser (>= 3.2.1.0)
50
50
  rubocop-capybara (2.18.0)
51
51
  rubocop (~> 1.41)
52
- rubocop-factory_bot (2.23.0)
52
+ rubocop-factory_bot (2.23.1)
53
53
  rubocop (~> 1.33)
54
54
  rubocop-rspec (2.22.0)
55
55
  rubocop (~> 1.33)
@@ -74,4 +74,4 @@ DEPENDENCIES
74
74
  webmock (~> 3.18, >= 3.18.1)
75
75
 
76
76
  BUNDLED WITH
77
- 2.3.16
77
+ 2.4.10
data/README.md CHANGED
@@ -16,7 +16,7 @@ PS: Because e-notas api is entire in portuguese, the code and documentation from
16
16
 
17
17
  ## Dependencias
18
18
  EnotasApi não depende de nenhuma Gem externa para executar, (aloha dependency hell).
19
- Porém implementamos utilizamos a versão que ruby que temos em produção atualmente que é `~> ruby 3.2.2`.
19
+ Porém implementamos com a versão de ruby `>= ruby 3.1` que é compatível com a versão que temos em produção, `~> ruby 3.2.2`.
20
20
  Se tiver interesse em fazer backport para versões anteriores, não deixe de fazer seu comentário ou abrir um PR.
21
21
 
22
22
  ## Instalação
@@ -103,11 +103,11 @@ O suporte as novas APIs (V2) com suporte a NFC-e e NF-e estarão disponíveis em
103
103
  - [x] Cidades com Serviço Municipal Unificado - `EnotasApi::V1::ConsultarCidadesServicoMunicipalUnificado`
104
104
  - [NF-e & NFC-e (v2)](https://docs.enotasgw.com.br/v2/reference)
105
105
  - Empresa
106
- - [ ] Incluir/Alterar Empresa
107
- - [ ] Vincular Certificado
108
- - [ ] Vincular Logotipo
109
- - [ ] Consultar Empresa
110
- - [ ] Listar Empresas
106
+ - [x] Incluir/Alterar Empresa
107
+ - [x] Vincular Certificado
108
+ - [x] Vincular Logotipo
109
+ - [x] Consultar Empresa
110
+ - [x] Listar Empresas
111
111
  - Nota Fiscal eletrônica de consumidor (NFC-e)
112
112
  - [ ] Emitir Nota Fiscal
113
113
  - [ ] Consultar Nota Fiscal
@@ -119,9 +119,9 @@ O suporte as novas APIs (V2) com suporte a NFC-e e NF-e estarão disponíveis em
119
119
  - [ ] Consultar Inutilização de Número da Nota Fiscal
120
120
  - [ ] Consultar XML de Inutilização
121
121
  - Nota fiscal eletrônica de produto (NF-e)
122
- - [ ] Emitir Nota Fiscal
123
- - [ ] Consultar Nota Fiscal
124
- - [ ] Cancelar Nota Fiscal
122
+ - [x] Emitir Nota Fiscal
123
+ - [x] Consultar Nota Fiscal
124
+ - [x] Cancelar Nota Fiscal
125
125
  - [ ] Consultar XML de Cancelamento
126
126
  - [ ] Emitir Carta de Correção pela Chave da NF-e
127
127
  - [ ] Consultar Carta de Correção
data/Rakefile CHANGED
@@ -9,7 +9,7 @@ RuboCop::RakeTask.new
9
9
 
10
10
  desc 'Run All Resources Check'
11
11
  task :check do
12
- %w[rubocop:auto_correct spec].each do |task|
12
+ %w[rubocop:autocorrect spec].each do |task|
13
13
  Rake::Task[task].execute
14
14
  end
15
15
  end
data/enotas_api.gemspec CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
12
12
  spec.description = 'Non oficial, well supported, e-notas ruby api client'
13
13
  spec.homepage = 'https://github.com/bempapp/enotas_api'
14
14
  spec.license = 'MIT'
15
- spec.required_ruby_version = Gem::Requirement.new('>= 3.2.2')
15
+ spec.required_ruby_version = Gem::Requirement.new('>= 3.1')
16
16
 
17
17
  spec.metadata['allowed_push_host'] = 'https://rubygems.org'
18
18
 
@@ -11,6 +11,7 @@ module EnotasApi
11
11
  integer: ->(value, _type) { value.is_a?(Integer) },
12
12
  string: ->(value, _type) { value.is_a?(String) },
13
13
  datetime: ->(value, _type) { value.is_a?(DateTime) || value.is_a?(Date) },
14
+ array: ->(value, _type) { value.is_a?(Array) },
14
15
  entity: ->(value, type) { value.is_a?(type) || value.is_a?(Hash) }
15
16
  }.freeze
16
17
 
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../common/request'
4
+
5
+ module EnotasApi
6
+ module V2
7
+ class CancelarNf < EnotasApi::Request
8
+ def initialize(empresa_id, nf_id)
9
+ super(method: :DELETE, uri: "/v2/empresas/#{url_encode(empresa_id)}/nf-e/#{url_encode(nf_id)}")
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../common/request'
4
+
5
+ module EnotasApi
6
+ module V2
7
+ class ConsultarEmpresa < EnotasApi::Request
8
+ def initialize(id)
9
+ super(uri: "/v2/empresas/#{url_encode(id)}")
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../common/request'
4
+
5
+ module EnotasApi
6
+ module V2
7
+ class ConsultarNf < EnotasApi::Request
8
+ def initialize(empresa_id, nf_id)
9
+ super(uri: "/v2/empresas/#{url_encode(empresa_id)}/nf-e/#{url_encode(nf_id)}")
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../common/request'
4
+
5
+ module EnotasApi
6
+ module V2
7
+ class EmitirNf < EnotasApi::Request
8
+ def initialize(empresa_id, nf)
9
+ super(method: :POST, uri: "/v2/empresas/#{url_encode(empresa_id)}/nf-e", content: nf.to_json)
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../common/entity'
4
+ require_relative 'empresa_endereco'
5
+ require_relative 'empresa_emissao_nfe_produto'
6
+
7
+ module EnotasApi
8
+ module V2
9
+ class Empresa < EnotasApi::Entity
10
+ attributes id: :string,
11
+ cnpj: :string,
12
+ inscricaoMunicipal: :string,
13
+ inscricaoEstadual: :string,
14
+ razaoSocial: :string,
15
+ nomeFantasia: :string,
16
+ optanteSimplesNacional: :boolean,
17
+ email: :string,
18
+ telefoneComercial: :string,
19
+ endereco: EmpresaEndereco,
20
+ emissaoNFeProduto: EmpresaEmissaoNfeProduto
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../common/entity'
4
+
5
+ module EnotasApi
6
+ module V2
7
+ class EmpresaConfiguracoes < EnotasApi::Entity
8
+ attributes sequencialNFe: :integer,
9
+ serieNFe: :string,
10
+ sequencialLoteNFe: :integer
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../common/entity'
4
+ require_relative 'empresa_configuracoes'
5
+
6
+ module EnotasApi
7
+ module V2
8
+ class EmpresaEmissaoNfeProduto < EnotasApi::Entity
9
+ attributes ambienteProducao: EmpresaConfiguracoes,
10
+ ambienteHomologacao: EmpresaConfiguracoes
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../common/entity'
4
+
5
+ module EnotasApi
6
+ module V2
7
+ class EmpresaEndereco < EnotasApi::Entity
8
+ attributes uf: :string,
9
+ cidade: :string,
10
+ logradouro: :string,
11
+ numero: :string,
12
+ complemento: :string,
13
+ bairro: :string,
14
+ cep: :string
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../common/entity'
4
+ require_relative 'nfe_referenciada'
5
+ require_relative 'nfe_cliente'
6
+
7
+ module EnotasApi
8
+ module V2
9
+ class Nfe < EnotasApi::Entity
10
+ attributes id: :string,
11
+ ambienteEmissao: :string,
12
+ naturezaOperacao: :string,
13
+ tipoOperacao: :string,
14
+ finalidade: :string,
15
+ consumidorFinal: :boolean,
16
+ enviarPorEmail: :boolean,
17
+ nfeReferenciada: NfeReferenciada,
18
+ dataEmissao: :string,
19
+ cliente: NfeCliente,
20
+ itens: :array,
21
+ informacoesAdicionais: :string
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../common/entity'
4
+ require_relative 'nfe_cliente_endereco'
5
+
6
+ module EnotasApi
7
+ module V2
8
+ class NfeCliente < EnotasApi::Entity
9
+ attributes endereco: NfeClienteEndereco,
10
+ tipoPessoa: :string,
11
+ nome: :string,
12
+ email: :string,
13
+ cpfCnpj: :string,
14
+ inscricaoMunicipal: :string,
15
+ inscricaoEstadual: :string,
16
+ indicadorContribuinteICMS: :string,
17
+ telefone: :string
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../common/entity'
4
+
5
+ module EnotasApi
6
+ module V2
7
+ class NfeClienteEndereco < EnotasApi::Entity
8
+ attributes pais: :string,
9
+ uf: :string,
10
+ cidade: :string,
11
+ logradouro: :string,
12
+ numero: :string,
13
+ complemento: :string,
14
+ bairro: :string,
15
+ cep: :string
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../common/entity'
4
+ require_relative 'nfe_imposto_por_aliquota'
5
+ require_relative 'nfe_imposto_por_valor'
6
+
7
+ module EnotasApi
8
+ module V2
9
+ class NfeImpostoCofins < EnotasApi::Entity
10
+ attributes situacaoTributaria: :string,
11
+ porAliquota: NfeImpostoPorAliquota,
12
+ porValor: NfeImpostoPorValor
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../common/entity'
4
+ require_relative 'nfe_imposto_ipi'
5
+
6
+ module EnotasApi
7
+ module V2
8
+ class NfeImpostoIcms < EnotasApi::Entity
9
+ attributes situacaoTributaria: :string,
10
+ origem: :integer,
11
+ aliquota: :decimal,
12
+ baseCalculo: :decimal,
13
+ modalidadeBaseCalculo: :integer,
14
+ percentualReducaoBaseCalculo: :decimal,
15
+ baseCalculoST: :decimal,
16
+ aliquotaST: :decimal,
17
+ modalidadeBaseCalculoST: :decimal,
18
+ percentualReducaoBaseCalculoST: :decimal,
19
+ percentualMargemValorAdicionadoST: :decimal
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../common/entity'
4
+ require_relative 'nfe_imposto_por_aliquota'
5
+ require_relative 'nfe_imposto_por_valor'
6
+
7
+ module EnotasApi
8
+ module V2
9
+ class NfeImpostoIpi < EnotasApi::Entity
10
+ attributes situacaoTributaria: :string,
11
+ porAliquota: NfeImpostoPorAliquota,
12
+ porValor: NfeImpostoPorValor
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../common/entity'
4
+ require_relative 'nfe_imposto_tributos_simplificado'
5
+ require_relative 'nfe_imposto_tributos_detalhado'
6
+
7
+ module EnotasApi
8
+ module V2
9
+ class NfeImpostoPercentualAproximadoTributos < EnotasApi::Entity
10
+ attributes simplificado: NfeImpostoTributosSimplificado,
11
+ detalhado: NfeImpostoTributosDetalhado,
12
+ fonte: :string
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../common/entity'
4
+ require_relative 'nfe_imposto_por_aliquota'
5
+ require_relative 'nfe_imposto_por_valor'
6
+
7
+ module EnotasApi
8
+ module V2
9
+ class NfeImpostoPis < EnotasApi::Entity
10
+ attributes situacaoTributaria: :string,
11
+ porAliquota: NfeImpostoPorAliquota,
12
+ porValor: NfeImpostoPorValor
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../common/entity'
4
+
5
+ module EnotasApi
6
+ module V2
7
+ class NfeImpostoPorAliquota < EnotasApi::Entity
8
+ attributes aliquota: :decimal
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../common/entity'
4
+
5
+ module EnotasApi
6
+ module V2
7
+ class NfeImpostoPorValor < EnotasApi::Entity
8
+ attributes valorPorUnidade: :decimal
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../common/entity'
4
+
5
+ module EnotasApi
6
+ module V2
7
+ class NfeImpostoTributosDetalhado < EnotasApi::Entity
8
+ attributes percentualFederal: :decimal,
9
+ percentualEstadual: :decimal,
10
+ percentualMunicipal: :decimal
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../common/entity'
4
+
5
+ module EnotasApi
6
+ module V2
7
+ class NfeImpostoTributosSimplificado < EnotasApi::Entity
8
+ attributes percentual: :decimal
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../common/entity'
4
+ require_relative 'nfe_item_impostos'
5
+
6
+ module EnotasApi
7
+ module V2
8
+ class NfeItem < EnotasApi::Entity
9
+ attributes cfop: :string,
10
+ codigo: :string,
11
+ descricao: :string,
12
+ sku: :string,
13
+ ncm: :string,
14
+ cest: :string,
15
+ quantidade: :integer,
16
+ unidadeMedida: :string,
17
+ valorUnitario: :decimal,
18
+ frete: :decimal,
19
+ impostos: NfeItemImpostos,
20
+ informacoesAdicionais: :string
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../common/entity'
4
+ require_relative 'nfe_imposto_percentual_aproximado_tributos'
5
+ require_relative 'nfe_imposto_icms'
6
+ require_relative 'nfe_imposto_pis'
7
+ require_relative 'nfe_imposto_cofins'
8
+ require_relative 'nfe_imposto_ipi'
9
+
10
+ module EnotasApi
11
+ module V2
12
+ class NfeItemImpostos < EnotasApi::Entity
13
+ attributes percentualAproximadoTributos: NfeImpostoPercentualAproximadoTributos,
14
+ icms: NfeImpostoIcms,
15
+ pis: NfeImpostoPis,
16
+ cofins: NfeImpostoCofins,
17
+ ipi: NfeImpostoIpi
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../common/entity'
4
+ require_relative 'empresa_endereco'
5
+ require_relative 'empresa_emissao_nfe_produto'
6
+
7
+ module EnotasApi
8
+ module V2
9
+ class NfeReferenciada < EnotasApi::Entity
10
+ attributes chaveAcesso: :string
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../common/request'
4
+
5
+ module EnotasApi
6
+ module V2
7
+ class IncluirAtualizarEmpresa < EnotasApi::Request
8
+ def initialize(empresa)
9
+ super(method: :POST, uri: '/v2/empresas', content: empresa.to_json)
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../common/request'
4
+
5
+ module EnotasApi
6
+ module V2
7
+ class ListarEmpresas < EnotasApi::Request
8
+ paginable
9
+ searchable %i[nome_fantasia razao_social]
10
+ sortable %i[nome_fantasia razao_social cidade data_criacao data_ultima_modificacao]
11
+
12
+ def initialize
13
+ super(uri: '/v2/empresas')
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../common/request'
4
+
5
+ module EnotasApi
6
+ module V2
7
+ class VincularCertificado < EnotasApi::Request
8
+ def initialize(empresa_id, nome_arquivo, arquivo, senha)
9
+ form_data = { 'FileName' => nome_arquivo, 'arquivo' => arquivo, 'senha' => senha }
10
+ super(method: :POST_FORM, uri: "/v2/empresas/#{url_encode(empresa_id)}/certificadoDigital", content: form_data)
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../common/request'
4
+
5
+ module EnotasApi
6
+ module V2
7
+ class VincularLogotipo < EnotasApi::Request
8
+ def initialize(empresa_id, nome_arquivo, arquivo)
9
+ form_data = { 'FileName' => nome_arquivo, 'logotipo' => arquivo }
10
+ super(method: :POST_FORM, uri: "/v2/empresas/#{url_encode(empresa_id)}/logo", content: form_data)
11
+ end
12
+ end
13
+ end
14
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EnotasApi
4
- VERSION = '4.0.0'
4
+ VERSION = '4.2.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enotas_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eduardo Bohrer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-16 00:00:00.000000000 Z
11
+ date: 2023-06-27 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Non oficial, well supported, e-notas ruby api client
14
14
  email:
@@ -75,6 +75,33 @@ files:
75
75
  - lib/enotas_api/v1/listar_notas_fiscais.rb
76
76
  - lib/enotas_api/v1/vincular_certificado.rb
77
77
  - lib/enotas_api/v1/vincular_logotipo.rb
78
+ - lib/enotas_api/v2/cancelar_nf.rb
79
+ - lib/enotas_api/v2/consultar_empresa.rb
80
+ - lib/enotas_api/v2/consultar_nfs.rb
81
+ - lib/enotas_api/v2/emitir_nf.rb
82
+ - lib/enotas_api/v2/entities/empresa.rb
83
+ - lib/enotas_api/v2/entities/empresa_configuracoes.rb
84
+ - lib/enotas_api/v2/entities/empresa_emissao_nfe_produto.rb
85
+ - lib/enotas_api/v2/entities/empresa_endereco.rb
86
+ - lib/enotas_api/v2/entities/nfe.rb
87
+ - lib/enotas_api/v2/entities/nfe_cliente.rb
88
+ - lib/enotas_api/v2/entities/nfe_cliente_endereco.rb
89
+ - lib/enotas_api/v2/entities/nfe_imposto_cofins.rb
90
+ - lib/enotas_api/v2/entities/nfe_imposto_icms.rb
91
+ - lib/enotas_api/v2/entities/nfe_imposto_ipi.rb
92
+ - lib/enotas_api/v2/entities/nfe_imposto_percentual_aproximado_tributos.rb
93
+ - lib/enotas_api/v2/entities/nfe_imposto_pis.rb
94
+ - lib/enotas_api/v2/entities/nfe_imposto_por_aliquota.rb
95
+ - lib/enotas_api/v2/entities/nfe_imposto_por_valor.rb
96
+ - lib/enotas_api/v2/entities/nfe_imposto_tributos_detalhado.rb
97
+ - lib/enotas_api/v2/entities/nfe_imposto_tributos_simplificado.rb
98
+ - lib/enotas_api/v2/entities/nfe_item.rb
99
+ - lib/enotas_api/v2/entities/nfe_item_impostos.rb
100
+ - lib/enotas_api/v2/entities/nfe_referenciada.rb
101
+ - lib/enotas_api/v2/incluir_atualizar_empresa.rb
102
+ - lib/enotas_api/v2/listar_empresas.rb
103
+ - lib/enotas_api/v2/vincular_certificado.rb
104
+ - lib/enotas_api/v2/vincular_logotipo.rb
78
105
  - lib/enotas_api/version.rb
79
106
  homepage: https://github.com/bempapp/enotas_api
80
107
  licenses:
@@ -93,14 +120,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
93
120
  requirements:
94
121
  - - ">="
95
122
  - !ruby/object:Gem::Version
96
- version: 3.2.2
123
+ version: '3.1'
97
124
  required_rubygems_version: !ruby/object:Gem::Requirement
98
125
  requirements:
99
126
  - - ">="
100
127
  - !ruby/object:Gem::Version
101
128
  version: '0'
102
129
  requirements: []
103
- rubygems_version: 3.1.2
130
+ rubygems_version: 3.4.10
104
131
  signing_key:
105
132
  specification_version: 4
106
133
  summary: E-notas API client