enotas_api 4.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fec825b3ff2084de51ddee2c0667a5e195ee6cc9fdb9ebf699d8a558dd7af957
4
- data.tar.gz: 8a4b14268bb1b3dd5be1ab1092c33f1002ff3b4cfc447514829a07869905e1fa
3
+ metadata.gz: bbb7d612044138f73cdb09a5721e29bbcbe75341179adc70a8c056dfe62a865e
4
+ data.tar.gz: 8952d3b4bf2c0e01f47c00e04f887d4c56899751ac957a7170bf96234836ec81
5
5
  SHA512:
6
- metadata.gz: 84a2ed5edd202eaa63479591af50773d1dcf7da8f1905f7504fe1559e5b6be35d3187ee3cdfe7275fe3247a1eac4f65a25972b43e9adec1aaca98e47f563a046
7
- data.tar.gz: e3744c1133c4b529210e6be7d1ae222faca58659c68b83578238dbf2395b70601de360c672af0dd73b638d23ac44f8adfa5fce21ed294100dd5f1afcf22e3980
6
+ metadata.gz: 4febcfc953b37b9c59d024a76d18dbe206b96db9b2354fb0d9fa3aad0bb353265b4a94a4730ea8018114bc7a3a997ea549222e68a27580c89938221c9c1f60c1
7
+ data.tar.gz: b6e9ef30c83c4315a1d5077bf16d2134e5d5402a0b626868b915b315a8069f0a0401123d5ffcedd74cb81ee2c895e5a44d7102bb7809d531470623ab1cc3ca76
data/CHANGELOG.md CHANGED
@@ -1,3 +1,5 @@
1
+ # 4.2.0
2
+ - Add endpoints API V2 - NOTA FISCAL ELETRÔNICA DE PRODUTO (NF-E)
1
3
  # 4.1.0
2
4
  - Add support to ruby >= 3.1
3
5
  - Add endpoints API V2 - Empresa
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- enotas_api (4.1.0)
4
+ enotas_api (4.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -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
@@ -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,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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EnotasApi
4
- VERSION = '4.1.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.1.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-22 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,11 +75,29 @@ 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
78
79
  - lib/enotas_api/v2/consultar_empresa.rb
80
+ - lib/enotas_api/v2/consultar_nfs.rb
81
+ - lib/enotas_api/v2/emitir_nf.rb
79
82
  - lib/enotas_api/v2/entities/empresa.rb
80
83
  - lib/enotas_api/v2/entities/empresa_configuracoes.rb
81
84
  - lib/enotas_api/v2/entities/empresa_emissao_nfe_produto.rb
82
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
83
101
  - lib/enotas_api/v2/incluir_atualizar_empresa.rb
84
102
  - lib/enotas_api/v2/listar_empresas.rb
85
103
  - lib/enotas_api/v2/vincular_certificado.rb
@@ -109,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
127
  - !ruby/object:Gem::Version
110
128
  version: '0'
111
129
  requirements: []
112
- rubygems_version: 3.1.2
130
+ rubygems_version: 3.4.10
113
131
  signing_key:
114
132
  specification_version: 4
115
133
  summary: E-notas API client