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.
- checksums.yaml +4 -4
- data/.github/workflows/check.yml +4 -5
- data/.rubocop.yml +1 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +3 -3
- data/README.md +9 -9
- data/Rakefile +1 -1
- data/enotas_api.gemspec +1 -1
- data/lib/enotas_api/support/type_handler.rb +1 -0
- data/lib/enotas_api/v2/cancelar_nf.rb +13 -0
- data/lib/enotas_api/v2/consultar_empresa.rb +13 -0
- data/lib/enotas_api/v2/consultar_nfs.rb +13 -0
- data/lib/enotas_api/v2/emitir_nf.rb +13 -0
- data/lib/enotas_api/v2/entities/empresa.rb +23 -0
- data/lib/enotas_api/v2/entities/empresa_configuracoes.rb +13 -0
- data/lib/enotas_api/v2/entities/empresa_emissao_nfe_produto.rb +13 -0
- data/lib/enotas_api/v2/entities/empresa_endereco.rb +17 -0
- data/lib/enotas_api/v2/entities/nfe.rb +24 -0
- data/lib/enotas_api/v2/entities/nfe_cliente.rb +20 -0
- data/lib/enotas_api/v2/entities/nfe_cliente_endereco.rb +18 -0
- data/lib/enotas_api/v2/entities/nfe_imposto_cofins.rb +15 -0
- data/lib/enotas_api/v2/entities/nfe_imposto_icms.rb +22 -0
- data/lib/enotas_api/v2/entities/nfe_imposto_ipi.rb +15 -0
- data/lib/enotas_api/v2/entities/nfe_imposto_percentual_aproximado_tributos.rb +15 -0
- data/lib/enotas_api/v2/entities/nfe_imposto_pis.rb +15 -0
- data/lib/enotas_api/v2/entities/nfe_imposto_por_aliquota.rb +11 -0
- data/lib/enotas_api/v2/entities/nfe_imposto_por_valor.rb +11 -0
- data/lib/enotas_api/v2/entities/nfe_imposto_tributos_detalhado.rb +13 -0
- data/lib/enotas_api/v2/entities/nfe_imposto_tributos_simplificado.rb +11 -0
- data/lib/enotas_api/v2/entities/nfe_item.rb +23 -0
- data/lib/enotas_api/v2/entities/nfe_item_impostos.rb +20 -0
- data/lib/enotas_api/v2/entities/nfe_referenciada.rb +13 -0
- data/lib/enotas_api/v2/incluir_atualizar_empresa.rb +13 -0
- data/lib/enotas_api/v2/listar_empresas.rb +17 -0
- data/lib/enotas_api/v2/vincular_certificado.rb +14 -0
- data/lib/enotas_api/v2/vincular_logotipo.rb +14 -0
- data/lib/enotas_api/version.rb +1 -1
- metadata +31 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bbb7d612044138f73cdb09a5721e29bbcbe75341179adc70a8c056dfe62a865e
|
4
|
+
data.tar.gz: 8952d3b4bf2c0e01f47c00e04f887d4c56899751ac957a7170bf96234836ec81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4febcfc953b37b9c59d024a76d18dbe206b96db9b2354fb0d9fa3aad0bb353265b4a94a4730ea8018114bc7a3a997ea549222e68a27580c89938221c9c1f60c1
|
7
|
+
data.tar.gz: b6e9ef30c83c4315a1d5077bf16d2134e5d5402a0b626868b915b315a8069f0a0401123d5ffcedd74cb81ee2c895e5a44d7102bb7809d531470623ab1cc3ca76
|
data/.github/workflows/check.yml
CHANGED
@@ -19,12 +19,11 @@ jobs:
|
|
19
19
|
|
20
20
|
steps:
|
21
21
|
- uses: actions/checkout@v3
|
22
|
-
- name: Set up Ruby
|
23
|
-
|
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.
|
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
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
enotas_api (4.
|
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.
|
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.
|
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
|
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
|
-
- [
|
107
|
-
- [
|
108
|
-
- [
|
109
|
-
- [
|
110
|
-
- [
|
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
|
-
- [
|
123
|
-
- [
|
124
|
-
- [
|
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
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.
|
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 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,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,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
|
data/lib/enotas_api/version.rb
CHANGED
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.
|
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-
|
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.
|
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.
|
130
|
+
rubygems_version: 3.4.10
|
104
131
|
signing_key:
|
105
132
|
specification_version: 4
|
106
133
|
summary: E-notas API client
|