enotas_api 4.2.3 → 4.3.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 (29) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/check.yml +4 -0
  3. data/CHANGELOG.md +2 -0
  4. data/Gemfile +5 -0
  5. data/Gemfile.lock +10 -1
  6. data/README.md +7 -3
  7. data/lib/enotas_api/v2/cancelar_nfc.rb +13 -0
  8. data/lib/enotas_api/v2/consultar_nfc.rb +13 -0
  9. data/lib/enotas_api/v2/emitir_nfc.rb +13 -0
  10. data/lib/enotas_api/v2/entities/nfce.rb +20 -0
  11. data/lib/enotas_api/v2/entities/nfce_cliente.rb +20 -0
  12. data/lib/enotas_api/v2/entities/nfce_cliente_endereco.rb +18 -0
  13. data/lib/enotas_api/v2/entities/nfce_imposto_cofins.rb +15 -0
  14. data/lib/enotas_api/v2/entities/nfce_imposto_icms.rb +22 -0
  15. data/lib/enotas_api/v2/entities/nfce_imposto_ipi.rb +15 -0
  16. data/lib/enotas_api/v2/entities/nfce_imposto_percentual_aproximado_tributos.rb +15 -0
  17. data/lib/enotas_api/v2/entities/nfce_imposto_pis.rb +15 -0
  18. data/lib/enotas_api/v2/entities/nfce_imposto_por_aliquota.rb +11 -0
  19. data/lib/enotas_api/v2/entities/nfce_imposto_por_valor.rb +11 -0
  20. data/lib/enotas_api/v2/entities/nfce_imposto_tributos_detalhado.rb +13 -0
  21. data/lib/enotas_api/v2/entities/nfce_imposto_tributos_simplificado.rb +11 -0
  22. data/lib/enotas_api/v2/entities/nfce_item.rb +22 -0
  23. data/lib/enotas_api/v2/entities/nfce_item_impostos.rb +20 -0
  24. data/lib/enotas_api/v2/entities/nfce_pedido.rb +13 -0
  25. data/lib/enotas_api/v2/entities/nfce_pedido_pagamento.rb +12 -0
  26. data/lib/enotas_api/v2/entities/nfce_pedido_pagamento_forma.rb +14 -0
  27. data/lib/enotas_api/v2/entities/nfce_pedido_pagamento_forma_credenciadora.rb +14 -0
  28. data/lib/enotas_api/version.rb +1 -1
  29. metadata +27 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ba2f1a8c3997f7213753c78dd3826e503070ed0fa470d0763a908ef08055ec4b
4
- data.tar.gz: e792da884f4ca624e40627fc76e2e0cbf67e7440c93fbaaf251ee13237420361
3
+ metadata.gz: 7cb9ac01b2ff11fb35cbdb73431c2c7b569dbaa1c23e0f5c28fbd01ead301c8d
4
+ data.tar.gz: f9fee42d0f9cdeae5afeeda5309c36ce7e17ce8270b16ba3cfd6c320e7d94759
5
5
  SHA512:
6
- metadata.gz: 46084be371fd736374088961a88051a2e1c8932e87268a94feeadaca48fc5205a02bb9981f3da3482db65b625973fb65f13018a7633116e9bd9bdcfd8eafdae1
7
- data.tar.gz: af7cd769c35738070c3083abf441c775f535c38bba0ea880e5ba6f3983e1ed9d3f0225e7186b3c599ef05ade92aa29e7a3689afa4c2ef4db5852638fed726589
6
+ metadata.gz: 188f6e8b5f40224bcc0703045b6a5356c9d6c9f3c2d0a5e1e3603730828d2a2da91ab7019830c9ca9cf7ae47a37a171458197c847d917ee8c609536abf186fbc
7
+ data.tar.gz: 1c8d3e346850aa7303fd4a35aef24ed2f8bba7a71c3feeb66c8974c09b8cad24fe512fd9801eac2c89fb05be023f15706a27ca4f9071a502a1968f68800448a6
@@ -28,3 +28,7 @@ jobs:
28
28
  run: bundle install
29
29
  - name: Run tests
30
30
  run: bundle exec rake
31
+ - name: Publish Coverage
32
+ uses: paambaati/codeclimate-action@v5.0.0
33
+ env:
34
+ CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
data/CHANGELOG.md CHANGED
@@ -1,3 +1,5 @@
1
+ # 4.3.0
2
+ - Add endpoints API V2 - NOTA FISCAL ELETRÔNICA DE CONSUMIDOR (NFC-E)
1
3
  # 4.2.3
2
4
  - Fix test nfe
3
5
  - Rename v2/consultar_nfs to v2/consultar_nf
data/Gemfile CHANGED
@@ -12,3 +12,8 @@ group :development do
12
12
  gem 'rubocop-rspec', '~> 2.22'
13
13
  gem 'webmock', '~> 3.18', '>= 3.18.1'
14
14
  end
15
+
16
+ group :test do
17
+ gem 'simplecov', '~> 0.22.0'
18
+ gem 'simplecov_json_formatter', '~> 0.1.2'
19
+ end
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- enotas_api (4.2.3)
4
+ enotas_api (4.3.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -12,6 +12,7 @@ GEM
12
12
  crack (0.4.5)
13
13
  rexml
14
14
  diff-lcs (1.5.0)
15
+ docile (1.4.0)
15
16
  hashdiff (1.0.1)
16
17
  json (2.6.3)
17
18
  parallel (1.23.0)
@@ -56,6 +57,12 @@ GEM
56
57
  rubocop-capybara (~> 2.17)
57
58
  rubocop-factory_bot (~> 2.22)
58
59
  ruby-progressbar (1.13.0)
60
+ simplecov (0.22.0)
61
+ docile (~> 1.1)
62
+ simplecov-html (~> 0.11)
63
+ simplecov_json_formatter (~> 0.1)
64
+ simplecov-html (0.12.3)
65
+ simplecov_json_formatter (0.1.4)
59
66
  unicode-display_width (2.4.2)
60
67
  webmock (3.18.1)
61
68
  addressable (>= 2.8.0)
@@ -71,6 +78,8 @@ DEPENDENCIES
71
78
  rspec (~> 3.12)
72
79
  rubocop (~> 1.51)
73
80
  rubocop-rspec (~> 2.22)
81
+ simplecov (~> 0.22.0)
82
+ simplecov_json_formatter (~> 0.1.2)
74
83
  webmock (~> 3.18, >= 3.18.1)
75
84
 
76
85
  BUNDLED WITH
data/README.md CHANGED
@@ -1,3 +1,7 @@
1
+ [![Gem Version](https://badge.fury.io/rb/enotas_api.svg)](https://badge.fury.io/rb/enotas_api)
2
+ [![Maintainability](https://api.codeclimate.com/v1/badges/41c671eb551e1c6c7cf1/maintainability)](https://codeclimate.com/github/bempapp/enotas_api/maintainability)
3
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/41c671eb551e1c6c7cf1/test_coverage)](https://codeclimate.com/github/bempapp/enotas_api/test_coverage)
4
+
1
5
  # EnotasApi
2
6
  *enotas_api* é um cliente ruby para a [API](https://docs.enotasgw.com.br/reference) do [e-notas](https://enotas.com.br/).
3
7
 
@@ -109,10 +113,10 @@ O suporte as novas APIs (V2) com suporte a NFC-e e NF-e estarão disponíveis em
109
113
  - [x] Consultar Empresa
110
114
  - [x] Listar Empresas
111
115
  - Nota Fiscal eletrônica de consumidor (NFC-e)
112
- - [ ] Emitir Nota Fiscal
113
- - [ ] Consultar Nota Fiscal
116
+ - [x] Emitir Nota Fiscal
117
+ - [x] Consultar Nota Fiscal
118
+ - [x] Cancelar Nota Fiscal
114
119
  - [ ] Consultar XML
115
- - [ ] Cancelar Nota Fiscal
116
120
  - [ ] Consultar XML de Envio do Cancelamento
117
121
  - [ ] Consultar XML de Retorno do Cancelamento
118
122
  - [ ] Inutilizar Numeração
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../common/request'
4
+
5
+ module EnotasApi
6
+ module V2
7
+ class CancelarNfc < EnotasApi::Request
8
+ def initialize(empresa_id, nf_id)
9
+ super(method: :DELETE, uri: "/v2/empresas/#{url_encode(empresa_id)}/nfc-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 ConsultarNfc < EnotasApi::Request
8
+ def initialize(empresa_id, nf_id)
9
+ super(uri: "/v2/empresas/#{url_encode(empresa_id)}/nfc-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 EmitirNfc < EnotasApi::Request
8
+ def initialize(empresa_id, nf)
9
+ super(method: :POST, uri: "/v2/empresas/#{url_encode(empresa_id)}/nfc-e", content: nf.to_json)
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../common/entity'
4
+ require_relative 'nfce_cliente'
5
+ require_relative 'nfce_pedido'
6
+
7
+ module EnotasApi
8
+ module V2
9
+ class Nfce < EnotasApi::Entity
10
+ attributes id: :string,
11
+ ambienteEmissao: :string,
12
+ naturezaOperacao: :string,
13
+ enviarPorEmail: :boolean,
14
+ pedido: NfcePedido,
15
+ cliente: NfceCliente,
16
+ itens: :array,
17
+ informacoesAdicionais: :string
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../common/entity'
4
+ require_relative 'nfce_cliente_endereco'
5
+
6
+ module EnotasApi
7
+ module V2
8
+ class NfceCliente < EnotasApi::Entity
9
+ attributes endereco: NfceClienteEndereco,
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 NfceClienteEndereco < 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 'nfce_imposto_por_aliquota'
5
+ require_relative 'nfce_imposto_por_valor'
6
+
7
+ module EnotasApi
8
+ module V2
9
+ class NfceImpostoCofins < EnotasApi::Entity
10
+ attributes situacaoTributaria: :string,
11
+ porAliquota: NfceImpostoPorAliquota,
12
+ porValor: NfceImpostoPorValor
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../common/entity'
4
+ require_relative 'nfce_imposto_ipi'
5
+
6
+ module EnotasApi
7
+ module V2
8
+ class NfceImpostoIcms < 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 'nfce_imposto_por_aliquota'
5
+ require_relative 'nfce_imposto_por_valor'
6
+
7
+ module EnotasApi
8
+ module V2
9
+ class NfceImpostoIpi < EnotasApi::Entity
10
+ attributes situacaoTributaria: :string,
11
+ porAliquota: NfceImpostoPorAliquota,
12
+ porValor: NfceImpostoPorValor
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../common/entity'
4
+ require_relative 'nfce_imposto_tributos_simplificado'
5
+ require_relative 'nfce_imposto_tributos_detalhado'
6
+
7
+ module EnotasApi
8
+ module V2
9
+ class NfceImpostoPercentualAproximadoTributos < EnotasApi::Entity
10
+ attributes simplificado: NfceImpostoTributosSimplificado,
11
+ detalhado: NfceImpostoTributosDetalhado,
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 'nfce_imposto_por_aliquota'
5
+ require_relative 'nfce_imposto_por_valor'
6
+
7
+ module EnotasApi
8
+ module V2
9
+ class NfceImpostoPis < EnotasApi::Entity
10
+ attributes situacaoTributaria: :string,
11
+ porAliquota: NfceImpostoPorAliquota,
12
+ porValor: NfceImpostoPorValor
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 NfceImpostoPorAliquota < 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 NfceImpostoPorValor < 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 NfceImpostoTributosDetalhado < 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 NfceImpostoTributosSimplificado < EnotasApi::Entity
8
+ attributes percentual: :decimal
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../common/entity'
4
+ require_relative 'nfce_item_impostos'
5
+
6
+ module EnotasApi
7
+ module V2
8
+ class NfceItem < 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
+ impostos: NfceItemImpostos,
19
+ informacoesAdicionais: :string
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../common/entity'
4
+ require_relative 'nfce_imposto_percentual_aproximado_tributos'
5
+ require_relative 'nfce_imposto_icms'
6
+ require_relative 'nfce_imposto_pis'
7
+ require_relative 'nfce_imposto_cofins'
8
+ require_relative 'nfce_imposto_ipi'
9
+
10
+ module EnotasApi
11
+ module V2
12
+ class NfceItemImpostos < EnotasApi::Entity
13
+ attributes percentualAproximadoTributos: NfceImpostoPercentualAproximadoTributos,
14
+ icms: NfceImpostoIcms,
15
+ pis: NfceImpostoPis,
16
+ cofins: NfceImpostoCofins,
17
+ ipi: NfceImpostoIpi
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../common/entity'
4
+ require_relative 'nfce_pedido_pagamento'
5
+
6
+ module EnotasApi
7
+ module V2
8
+ class NfcePedido < EnotasApi::Entity
9
+ attributes presencaConsumidor: :string,
10
+ pagamento: NfcePedidoPagamento
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../common/entity'
4
+
5
+ module EnotasApi
6
+ module V2
7
+ class NfcePedidoPagamento < EnotasApi::Entity
8
+ attributes tipo: :string,
9
+ formas: :array
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../common/entity'
4
+ require_relative 'nfce_pedido_pagamento_forma_credenciadora'
5
+
6
+ module EnotasApi
7
+ module V2
8
+ class NfcePedidoPagamentoForma < EnotasApi::Entity
9
+ attributes tipo: :string,
10
+ valor: :decimal,
11
+ credenciadoraCartao: NfcePedidoPagamentoFormaCredenciadora
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../common/entity'
4
+
5
+ module EnotasApi
6
+ module V2
7
+ class NfcePedidoPagamentoFormaCredenciadora < EnotasApi::Entity
8
+ attributes tipoIntegracaoPagamento: :string,
9
+ cnpjCredenciadoraCartao: :string,
10
+ bandeira: :string,
11
+ autorizacao: :string
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.2.3'
4
+ VERSION = '4.3.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.2.3
4
+ version: 4.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eduardo Bohrer
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-06 00:00:00.000000000 Z
11
+ date: 2023-10-21 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Non oficial, well supported, e-notas ruby api client
14
14
  email:
@@ -76,13 +76,34 @@ files:
76
76
  - lib/enotas_api/v1/vincular_certificado.rb
77
77
  - lib/enotas_api/v1/vincular_logotipo.rb
78
78
  - lib/enotas_api/v2/cancelar_nf.rb
79
+ - lib/enotas_api/v2/cancelar_nfc.rb
79
80
  - lib/enotas_api/v2/consultar_empresa.rb
80
81
  - lib/enotas_api/v2/consultar_nf.rb
82
+ - lib/enotas_api/v2/consultar_nfc.rb
81
83
  - lib/enotas_api/v2/emitir_nf.rb
84
+ - lib/enotas_api/v2/emitir_nfc.rb
82
85
  - lib/enotas_api/v2/entities/empresa.rb
83
86
  - lib/enotas_api/v2/entities/empresa_configuracoes.rb
84
87
  - lib/enotas_api/v2/entities/empresa_emissao_nfe_produto.rb
85
88
  - lib/enotas_api/v2/entities/empresa_endereco.rb
89
+ - lib/enotas_api/v2/entities/nfce.rb
90
+ - lib/enotas_api/v2/entities/nfce_cliente.rb
91
+ - lib/enotas_api/v2/entities/nfce_cliente_endereco.rb
92
+ - lib/enotas_api/v2/entities/nfce_imposto_cofins.rb
93
+ - lib/enotas_api/v2/entities/nfce_imposto_icms.rb
94
+ - lib/enotas_api/v2/entities/nfce_imposto_ipi.rb
95
+ - lib/enotas_api/v2/entities/nfce_imposto_percentual_aproximado_tributos.rb
96
+ - lib/enotas_api/v2/entities/nfce_imposto_pis.rb
97
+ - lib/enotas_api/v2/entities/nfce_imposto_por_aliquota.rb
98
+ - lib/enotas_api/v2/entities/nfce_imposto_por_valor.rb
99
+ - lib/enotas_api/v2/entities/nfce_imposto_tributos_detalhado.rb
100
+ - lib/enotas_api/v2/entities/nfce_imposto_tributos_simplificado.rb
101
+ - lib/enotas_api/v2/entities/nfce_item.rb
102
+ - lib/enotas_api/v2/entities/nfce_item_impostos.rb
103
+ - lib/enotas_api/v2/entities/nfce_pedido.rb
104
+ - lib/enotas_api/v2/entities/nfce_pedido_pagamento.rb
105
+ - lib/enotas_api/v2/entities/nfce_pedido_pagamento_forma.rb
106
+ - lib/enotas_api/v2/entities/nfce_pedido_pagamento_forma_credenciadora.rb
86
107
  - lib/enotas_api/v2/entities/nfe.rb
87
108
  - lib/enotas_api/v2/entities/nfe_cliente.rb
88
109
  - lib/enotas_api/v2/entities/nfe_cliente_endereco.rb
@@ -112,7 +133,7 @@ metadata:
112
133
  source_code_uri: https://github.com/bempapp/enotas_api
113
134
  changelog_uri: https://github.com/bempapp/enotas_api/blob/main/CHANGELOG.md
114
135
  rubygems_mfa_required: 'true'
115
- post_install_message:
136
+ post_install_message:
116
137
  rdoc_options: []
117
138
  require_paths:
118
139
  - lib
@@ -127,8 +148,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
148
  - !ruby/object:Gem::Version
128
149
  version: '0'
129
150
  requirements: []
130
- rubygems_version: 3.4.10
131
- signing_key:
151
+ rubygems_version: 3.3.26
152
+ signing_key:
132
153
  specification_version: 4
133
154
  summary: E-notas API client
134
155
  test_files: []