rnfse 0.0.1

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 (47) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +25 -0
  3. data/.rspec +1 -0
  4. data/.travis.yml +14 -0
  5. data/CHANGELOG.md +0 -0
  6. data/Gemfile +3 -0
  7. data/Guardfile +15 -0
  8. data/LICENSE.md +41 -0
  9. data/Procfile +1 -0
  10. data/README.md +59 -0
  11. data/Rakefile +12 -0
  12. data/lib/provedores.yml +11 -0
  13. data/lib/rnfse/api/abrasf_1_0/definitions.json +374 -0
  14. data/lib/rnfse/api/abrasf_1_0/recepcionar_lote_rps.json +46 -0
  15. data/lib/rnfse/api/abrasf_1_0.rb +55 -0
  16. data/lib/rnfse/api/iss_net_1_0.rb +6 -0
  17. data/lib/rnfse/api.rb +101 -0
  18. data/lib/rnfse/configuration.rb +18 -0
  19. data/lib/rnfse/core.rb +9 -0
  20. data/lib/rnfse/hash.rb +148 -0
  21. data/lib/rnfse/string.rb +36 -0
  22. data/lib/rnfse/version.rb +3 -0
  23. data/lib/rnfse/xml_builder/abrasf_1_0.rb +95 -0
  24. data/lib/rnfse/xml_builder/iss_net_1_0.rb +70 -0
  25. data/lib/rnfse/xml_builder.rb +10 -0
  26. data/lib/rnfse.rb +22 -0
  27. data/rnfse.gemspec +60 -0
  28. data/spec/api/abrasf_1_0/recepcionar_lote_rps_json_spec.rb +123 -0
  29. data/spec/api/abrasf_1_0_spec.rb +26 -0
  30. data/spec/api/iss_net_1_0_spec.rb +99 -0
  31. data/spec/api_spec.rb +65 -0
  32. data/spec/core_spec.rb +35 -0
  33. data/spec/fixtures/abrasf_1_0/enviar_lote_rps_envio.xml +47 -0
  34. data/spec/fixtures/abrasf_1_0/nfse.xsd +771 -0
  35. data/spec/fixtures/certificate.pem +18 -0
  36. data/spec/fixtures/iss_net_1_0/enviar_lote_rps_envio.xml +75 -0
  37. data/spec/fixtures/key.pem +15 -0
  38. data/spec/fixtures/vcr_cassettes/iss_net_1_0_recepcionar_lote_rps.yml +214 -0
  39. data/spec/hash_spec.rb +205 -0
  40. data/spec/spec_helper.rb +29 -0
  41. data/spec/string_spec.rb +38 -0
  42. data/spec/support/.keep +0 -0
  43. data/spec/version_spec.rb +5 -0
  44. data/spec/xml_builder/abrasf_1_0_spec.rb +63 -0
  45. data/spec/xml_builder/iss_net_1_0_spec.rb +86 -0
  46. data/spec/xml_builder_spec.rb +14 -0
  47. metadata +433 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 76d106a8b27e0d7d017eb9e661333ebe1c8c4735
4
+ data.tar.gz: 28d26e8e0c33bd7c9b6d6e54b20114bae13960ac
5
+ SHA512:
6
+ metadata.gz: 7f60b4ad9f17bbcf652d1e0f0b5420444d56627a9ddd77d1036fe6cfdcd4a00ff00dd965115ce8cab1d95e6dbfb70acc19615084fdb2a2a8aaeb8da813788114
7
+ data.tar.gz: 43e15ce520a0231e2e3a74c2097022d4dcbf00f190edd7456d4308afae1d4502077cdfcd223e73ba0b2f9d5413ba80c836bc995192411689a4c25127e1135eac
data/.gitignore ADDED
@@ -0,0 +1,25 @@
1
+ # Because this is a gem, ignore Gemfile.lock:
2
+
3
+ Gemfile.lock
4
+
5
+ # And because this is Ruby, ignore the following
6
+ # (source: https://github.com/github/gitignore/blob/master/Ruby.gitignore):
7
+
8
+ *.gem
9
+ *.rbc
10
+ .bundle
11
+ .config
12
+ coverage
13
+ InstalledFiles
14
+ lib/bundler/man
15
+ pkg
16
+ rdoc
17
+ spec/reports
18
+ test/tmp
19
+ test/version_tmp
20
+ tmp
21
+
22
+ # YARD artifacts
23
+ .yardoc
24
+ _yardoc
25
+ doc/
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --colour
data/.travis.yml ADDED
@@ -0,0 +1,14 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 2.0
5
+ - 2.1
6
+ - ruby-head
7
+ matrix:
8
+ fast_finish: true
9
+ allow_failures:
10
+ - rvm: ruby-head
11
+ addons:
12
+ code_climate:
13
+ repo_token:
14
+ secure: "vzzNVwWPm/BzVPjImSALhXSaaqExZRwZ1ePw8v9/lncbBSQoTGdthAjbirOO14rP2RTvupRnvoG3XK8FrY7Ct5+WCtEEuWNNB6f5u6gAI/+KKMQN69oIE5pLienB2yhTvcvghmNVf0aOVVh4H9RWeJD3Bv4GxnSkmNZNKNWfki0="
data/CHANGELOG.md ADDED
File without changes
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
data/Guardfile ADDED
@@ -0,0 +1,15 @@
1
+ guard :rspec do
2
+ watch(%r{^spec/.+_spec\.rb$})
3
+ watch(%r{^spec/support/(.+)\.rb$}) { 'spec' }
4
+ watch('spec/spec_helper.rb') { 'spec' }
5
+ watch(%r{^lib/rnfse/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
6
+ watch(%r{^lib/rnfse/api/(.+)\.rb$}) { |m| "spec/api/#{m[1]}_spec.rb" }
7
+ watch(%r{^lib/rnfse/api/(.+)/(.+)\.rb$}) { |m| "spec/api/#{m[1]}/#{m[2]}_spec.rb" }
8
+ watch(%r{^lib/rnfse/xml_builder/(.+)/(.+)\.rb$}) { |m| "spec/xml_builder/#{m[1]}/#{m[2]}_spec.rb" }
9
+ watch(%r{^lib/rnfse/api/(.+)/(.+)\.json$}) { |m| "spec/api/#{m[1]}/#{m[2]}_json_spec.rb" }
10
+ end
11
+
12
+ guard :bundler do
13
+ watch(/^.+\.gemspec/)
14
+ watch(/^Gemfile/)
15
+ end
data/LICENSE.md ADDED
@@ -0,0 +1,41 @@
1
+ DUAL LICENSED: GPL-3 and MIT
2
+ ====
3
+
4
+ ## The GNU Public License, Version 3 (GPL-3)
5
+
6
+ Copyright (c) Renan Mendes Carvalho <aitherios@gmail.com>
7
+
8
+ This program is free software: you can redistribute it and/or modify it under
9
+ the terms of the GNU General Public License as published by the
10
+ Free Software Foundation, either version 3 of the License, or (at your option)
11
+ any later version.
12
+
13
+ This program is distributed in the hope that it will be useful, but
14
+ WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15
+ FITNESS FOR A PARTICULAR PURPOSE.
16
+ See the GNU General Public License for more details.
17
+
18
+ You should have received a copy of the GNU General Public License along with
19
+ this program. If not, see <http://www.gnu.org/licenses/>.
20
+
21
+
22
+ ## The MIT License (MIT)
23
+
24
+ Copyright (c) Renan Mendes Carvalho <aitherios@gmail.com>
25
+
26
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
27
+ this software and associated documentation files (the "Software"), to deal in
28
+ the Software without restriction, including without limitation the rights to
29
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
30
+ the Software, and to permit persons to whom the Software is furnished to do so,
31
+ subject to the following conditions:
32
+
33
+ The above copyright notice and this permission notice shall be included in all
34
+ copies or substantial portions of the Software.
35
+
36
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
37
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
38
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
39
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
40
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
41
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Procfile ADDED
@@ -0,0 +1 @@
1
+ guard: bundle exec guard start
data/README.md ADDED
@@ -0,0 +1,59 @@
1
+ # rnfse
2
+ [![Gem Version](http://img.shields.io/gem/v/rnfse.svg?style=flat)](http://rubygems.org/gems/rnfse)
3
+ [![Dependency Status](https://img.shields.io/gemnasium/aitherios/rnfse.svg?style=flat)](https://gemnasium.com/aitherios/rnfse)
4
+ [![Build Status](https://img.shields.io/travis/aitherios/rnfse.svg?style=flat)](https://travis-ci.org/aitherios/rnfse)
5
+ [![Coverage](https://img.shields.io/codeclimate/coverage/github/aitherios/rnfse.svg?style=flat)](https://codeclimate.com/github/aitherios/rnfse)
6
+
7
+ Biblioteca para integração com as várias implementações
8
+ municipais de Nota Fiscal de Serviços eletrônica (NFS-e) que utilizam uma
9
+ das versões ou variações dos padrões
10
+ [ABRASF](http://www.abrasf.org.br/paginas_multiplas_detalhes.php?cod_pagina=1).
11
+
12
+ > O grande problema do nosso sistema democrático é que permite fazer coisas nada democráticas democraticamente.
13
+ > [José Saramago](http://pt.wikipedia.org/wiki/Jos%C3%A9_Saramago)
14
+
15
+ ## Instalação
16
+
17
+ Usando o rubygems.org rode:
18
+ ```
19
+ $ gem install rnfse
20
+ ```
21
+ **Ou** usando o repositório git rode:
22
+ ```
23
+ $ gem build rnfse.gemspec
24
+ $ gem install rnfse-X.X.X.gem
25
+ ```
26
+ **Ou** usando o bundler, adicione o Rnfse ao seu Gemfile:
27
+
28
+ ```ruby
29
+ gem 'rnfse'
30
+ ```
31
+
32
+ E rode `$ bundle install`
33
+
34
+ ## Uso
35
+
36
+ ## Limitações e problemas conhecidos
37
+
38
+ Esta é uma lista de limitações e problemas conhecidos. São questões que não tem
39
+ plano imediato de resolução. Talvez porque a funcionalidade nunca foi
40
+ necessária ou nenhum pull request tenha sido enviado. (dica!)
41
+
42
+ - Suporte para o JRuby e Rubinius (problema com a dependência nokogiri-xmlsec1).
43
+ - Só foi testada com municípios inscritos no [ISS.net](http://www.issnetonline.com.br/portaliss/) que utilizam o padrão [ABRASF v1](http://www.abrasf.org.br/paginas_multiplas_detalhes.php?cod_pagina=1).
44
+
45
+ ## Contribuindo
46
+
47
+ Antes do tudo, **obrigado** por querer ajudar!
48
+
49
+ 1. [Faça um fork do projeto](https://help.github.com/articles/fork-a-repo).
50
+ 2. Crie um branch para a funcionalidade - `git checkout -b mais_magia`
51
+ 3. Adicione testes e faça suas mudanças!
52
+ 4. Confira se os testes passam - `bundle exec rake`
53
+ 5. Faça um commit das suas mudanças - `git commit -am "Adicionei mais magia"`
54
+ 6. Faça um push do branch para o Github - `git push origin mais_magia`
55
+ 7. Envie um [pull request](https://help.github.com/articles/using-pull-requests)! :heart: :sparkling_heart: :heart:
56
+
57
+ ## Licença
58
+
59
+ Duplamente licenciado por GPL-3 e MIT. Veja [LICENSE.md](LICENSE.md) para mais detalhes.
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ require 'bundler'
2
+ require 'rake/clean'
3
+
4
+ require 'rspec/core/rake_task'
5
+
6
+ include Rake::DSL
7
+
8
+ Bundler::GemHelper.install_tasks
9
+
10
+ RSpec::Core::RakeTask.new(:spec)
11
+
12
+ task default: [:spec]
@@ -0,0 +1,11 @@
1
+ producao:
2
+ iss_net:
3
+ namespace: http://www.issnetonline.com.br/webservice/nfd
4
+ endpoint: http://www.issnetonline.com.br/webserviceabrasf/%{municipio}/servicos.asmx
5
+ api: abrasf_1_0
6
+
7
+ homologacao:
8
+ iss_net:
9
+ namespace: http://www.issnetonline.com.br/webservice/nfd
10
+ endpoint: http://www.issnetonline.com.br/webserviceabrasf/homologacao/servicos.asmx
11
+ api: abrasf_1_0
@@ -0,0 +1,374 @@
1
+ {
2
+ "numeroNfse": {
3
+ "description": "Número da Nota Fiscal de Serviço Eletrônica, formado pelo ano com 04 (quatro) dígitos e um número seqüencial com 11 posições – Formato AAAANNNNNNNNNNN.",
4
+ "type": "integer",
5
+ "minimum": 199000000000000,
6
+ "maximum": 220099999999999
7
+ },
8
+ "codigoVerificacao": {
9
+ "description": "Código de verificação do número da nota",
10
+ "type": "string",
11
+ "maxLength": 9
12
+ },
13
+ "statusRps": {
14
+ "description": "Código de status do RPS 1 – Normal ; 2 – Cancelado",
15
+ "type": "integer",
16
+ "minimum": 1,
17
+ "maximum": 2
18
+ },
19
+ "statusNfse": {
20
+ "description": "Código de status da NFS-e 1 – Normal ; 2 – Cancelado",
21
+ "type": "integer",
22
+ "minimum": 1,
23
+ "maximum": 2
24
+ },
25
+ "naturezaOperacao": {
26
+ "description": "Código de natureza da operação 1 – Tributação no município ; 2 - Tributação fora do município ; 3 - Isenção ; 4 - Imune ; 5 – Exigibilidade suspensa por decisão judicial ; 6 – Exigibilidade suspensa por procedimento administrativo ",
27
+ "type": "integer",
28
+ "minimum": 1,
29
+ "maximum": 6
30
+ },
31
+ "regimeEspecialTributacao": {
32
+ "description": "Código de natureza da operação 1 – Tributação no município ; 2 - Tributação fora do município ; 3 - Isenção ; 4 - Imune ; 5 – Exigibilidade suspensa por decisão judicial ; 6 – Exigibilidade suspensa por procedimento administrativo ",
33
+ "type": "integer",
34
+ "minimum": 1,
35
+ "maximum": 6
36
+ },
37
+ "simNao": {
38
+ "type": "boolean"
39
+ },
40
+ "quantidadeRps": {
41
+ "description": "Quantidade de RPS do Lote",
42
+ "type": "integer",
43
+ "minimum": 1,
44
+ "maximum": 9999
45
+ },
46
+ "numeroRps": {
47
+ "description": "Número do RPS",
48
+ "type": "integer",
49
+ "minimum": 1,
50
+ "maximum": 999999999999999
51
+ },
52
+ "serieRps": {
53
+ "description": "Número de série do RPS",
54
+ "type": "string",
55
+ "maxLength": 5
56
+ },
57
+ "tipoRps": {
58
+ "description": "Código de tipo de RPS 1 - RPS ; 2 – Nota Fiscal Conjugada (Mista) ; 3 – Cupom",
59
+ "type": "integer",
60
+ "minimum": 1,
61
+ "maximum": 3
62
+ },
63
+ "outrasInformacoes": {
64
+ "description": "Informações adicionais ao documento",
65
+ "type": "string",
66
+ "maxLength": 255
67
+ },
68
+ "valor": {
69
+ "description": "Valor monetário. Formato: 0.00 (ponto separando casa decimal) Ex: 1.234,56 = 1234.56 ; 1.000,00 = 1000.00 ; 1.000,00 = 1000",
70
+ "type": "number",
71
+ "minimum": 0,
72
+ "maximum": 9999999999999.99
73
+ },
74
+ "itemListaServico": {
75
+ "description": "Código de item da lista de serviço",
76
+ "type": "string",
77
+ "maxLength": 5
78
+ },
79
+ "codigoCnae": {
80
+ "description": "Código CNAE. Formato: 0000-0/00",
81
+ "type": "string",
82
+ "pattern": "^[0-9]{4}-[0-9]{1}/[0-9]{2}$"
83
+ },
84
+ "codigoTributacao": {
85
+ "description": "Código de Tributação",
86
+ "type": "string",
87
+ "maxLength": 20
88
+ },
89
+ "aliquota": {
90
+ "description": "Alíquota. Valor percentual. Formato: 0.0000 Ex: 1% = 0.01 ; 25,5% = 0.255 ; 100% = 1.0000 ou 1",
91
+ "type": "numeric",
92
+ "minimum": 0,
93
+ "maximum": 1
94
+ },
95
+ "discriminacao": {
96
+ "description": "Discriminação do conteúdo da NFS-e",
97
+ "type": "string",
98
+ "maxLength": 2000
99
+ },
100
+ "codigoMunicipioIbge": {
101
+ "description": "Código de identificação do município conforme tabela do IBGE",
102
+ "type": "integer",
103
+ "minimum": 1,
104
+ "maximum": 9999999
105
+ },
106
+ "inscricaoMunicipal": {
107
+ "description": "Número de inscrição municipal",
108
+ "type": "string",
109
+ "maxLength": 15
110
+ },
111
+ "razaoSocial": {
112
+ "description": "Razão Social do contribuinte",
113
+ "type": "string",
114
+ "maxLength": 115
115
+ },
116
+ "nomeFantasia": {
117
+ "description": "Nome fantasia",
118
+ "type": "string",
119
+ "maxLength": 60
120
+ },
121
+ "cnpj": {
122
+ "description": "Número CNPJ. Formato: 00.000.000/0000-00",
123
+ "type": "string",
124
+ "pattern": "^[0-9]{2}\.[0-9]{3}\.[0-9]{3}/[0-9]{4}-[0-9]{2}$"
125
+ },
126
+ "endereco": {
127
+ "description": "Endereço",
128
+ "type": "string",
129
+ "maxLength": 125
130
+ },
131
+ "numeroEndereco": {
132
+ "description": "Número do endereço",
133
+ "type": "string",
134
+ "maxLength": 10
135
+ },
136
+ "complementoEndereco": {
137
+ "description": "Número do endereço",
138
+ "type": "string",
139
+ "maxLength": 60
140
+ },
141
+ "bairro": {
142
+ "description": "Bairro",
143
+ "type": "string",
144
+ "maxLength": 60
145
+ },
146
+ "uf": {
147
+ "description": "Sigla da unidade federativa",
148
+ "type": "string",
149
+ "enum": ["AC", "AL", "AP", "AM", "BA", "CE", "DF", "ES", "GO", "MA", "MT", "MS", "MG", "PA", "PB", "PR", "PE", "PI", "RJ", "RN", "RS", "RO", "RR", "SC", "SP", "SE", "TO"]
150
+ },
151
+ "cep": {
152
+ "description": "Número do CEP. Formato: 00000-000",
153
+ "type": "string",
154
+ "pattern": "^[0-9]{5}-[0-9]{3}$"
155
+ },
156
+ "email": {
157
+ "description": "E-mail",
158
+ "type": "string",
159
+ "format": "email"
160
+ },
161
+ "telefone": {
162
+ "description": "Telefone",
163
+ "type": "string",
164
+ "maxLength": 11
165
+ },
166
+ "cpf": {
167
+ "description": "Número de CPF. Formato: 000.000.000-00",
168
+ "type": "string",
169
+ "pattern": "^[0-9]{3}\.[0-9]{3}\.[0-9]{3}-[0-9]{2}$"
170
+ },
171
+ "indicacaoCpfCnpj": {
172
+ "description": "Indicador de uso de CPF ou CNPJ 1 – CPF ; 2 – CNPJ ; 3 – Não Informado",
173
+ "type": "integer",
174
+ "minimum": 1,
175
+ "maximum": 3
176
+ },
177
+ "codigoObra": {
178
+ "description": "Código de Obra",
179
+ "type": "string",
180
+ "maxLength": 15
181
+ },
182
+ "art": {
183
+ "description": "Código ART",
184
+ "type": "string",
185
+ "maxLength": 15
186
+ },
187
+ "numeroLote": {
188
+ "description": "Número do Lote de RPS",
189
+ "type": "integer",
190
+ "minimum": 1,
191
+ "maximum": 999999999999999
192
+ },
193
+ "numeroProtocolo": {
194
+ "description": "Número do protocolo de recebimento do RPS",
195
+ "maxLength": 50
196
+ },
197
+ "situacaoLoteRps": {
198
+ "description": "Código de situação de lote de RPS 1 – Não Recebido ; 2 – Não Processado ; 3 – Processado com Erro ; 4 – Processado com Sucesso",
199
+ "type": "integer",
200
+ "minimum": 1,
201
+ "maximum": 4
202
+ },
203
+ "codigoMensagemAlerta": {
204
+ "description": "Código de mensagem de retorno de serviço",
205
+ "type": "string",
206
+ "maxLength": 4
207
+ },
208
+ "descricaoMensagemAlerta": {
209
+ "description": "Descrição da mensagem de retorno de serviço",
210
+ "type": "string",
211
+ "maxLength": 200
212
+ },
213
+ "codigoCancelamentoNfse": {
214
+ "description": "Código de cancelamento com base na tabela de Erros e alertas",
215
+ "type": "string",
216
+ "maxLength": 4
217
+ },
218
+ "idTag": {
219
+ "description": "Atributo de identificação da tag a ser assinada no documento XML",
220
+ "type": "string",
221
+ "maxLength": 255
222
+ },
223
+ "identificacaoRps": {
224
+ "description": "Dados de identificação do RPS",
225
+ "type": "object",
226
+ "properties": {
227
+ "numero": { "$ref": "#/numeroRps" },
228
+ "serie": { "$ref": "#/serieRps" },
229
+ "tipo": { "$ref": "#/tipoRps" }
230
+ },
231
+ "required": ["numero", "serie", "tipo"],
232
+ "additionalProperties": false
233
+ },
234
+ "dadosServico": {
235
+ "description": "Representa dados que compõe o serviço prestado",
236
+ "type": "object",
237
+ "properties": {
238
+ "valores": {
239
+ "type": "object",
240
+ "properties": {
241
+ "valorServicos": { "$ref": "#/valor" },
242
+ "valorDeducoes": { "$ref": "#/valor" },
243
+ "valorPis": { "$ref": "#/valor" },
244
+ "valorCofins": { "$ref": "#/valor" },
245
+ "valorInss": { "$ref": "#/valor" },
246
+ "valorIr": { "$ref": "#/valor" },
247
+ "valorCsll": { "$ref": "#/valor" },
248
+ "issRetido": { "type": "boolean" },
249
+ "valorIss": { "$ref": "#/valor" },
250
+ "outrasRetencoes": { "$ref": "#/valor" },
251
+ "baseCalculo": {
252
+ "description": "(Valor dos serviços - Valor das deduções - descontos incondicionados)",
253
+ "$ref": "#/valor"
254
+ },
255
+ "aliquota": { "$ref": "#/aliquota" },
256
+ "valorLiquidoNfse": {
257
+ "description": "(ValorServicos - ValorPIS - ValorCOFINS - ValorINSS - ValorIR - ValorCSLL - OutrasRetençoes - ValorISSRetido - DescontoIncondicionado - DescontoCondicionado)",
258
+ "$ref": "#/valor"
259
+ },
260
+ "valorIssRetido": { "$ref": "#/valor" },
261
+ "descontoCondicionado": { "$ref": "#/valor" },
262
+ "descontoIncondicionado": { "$ref": "#/valor" }
263
+ },
264
+ "required": ["valorServicos", "issRetido", "baseCalculo"],
265
+ "additionalProperties": false
266
+ },
267
+ "itemListaServico": { "$ref": "#/itemListaServico" },
268
+ "codigoCnae": { "$ref": "#/codigoCnae" },
269
+ "codigoTributacaoMunicipio": { "$ref": "#/codigoTributacao" },
270
+ "discriminacao": { "$ref": "#/discriminacao" },
271
+ "codigoMunicipio": { "$ref": "#/codigoMunicipioIbge" }
272
+ },
273
+ "required": ["valores", "itemListaServico", "discriminacao", "codigoMunicipio"],
274
+ "additionalProperties": false
275
+ },
276
+ "identificacaoPrestador": {
277
+ "description": "Representa dados para identificação do prestador de serviço",
278
+ "type": "object",
279
+ "properties": {
280
+ "cnpj": { "$ref": "#/cnpj" },
281
+ "inscricaoMunicipal": { "$ref": "#/inscricaoMunicipal" }
282
+ },
283
+ "required": ["cnpj"],
284
+ "additionalProperties": false
285
+ },
286
+ "dadosTomador": {
287
+ "description": "Representa dados do tomador de serviço",
288
+ "type": "object",
289
+ "properties": {
290
+ "identificacaoTomador": { "$ref": "#/identificacaoTomador" },
291
+ "razaoSocial": { "$ref": "#/razaoSocial" },
292
+ "endereco": { "$ref": "#/enderecoCompleto" },
293
+ "contato": { "$ref": "#/contato" }
294
+ },
295
+ "additionalProperties": false
296
+ },
297
+ "identificacaoTomador": {
298
+ "description": "Representa dados para identificação do tomador de serviço",
299
+ "oneOf": [
300
+ {
301
+ "type": "object",
302
+ "properties": {
303
+ "inscricaoMunicipal": { "$ref": "#/inscricaoMunicipal" },
304
+ "cnpj": { "$ref": "#/cnpj" }
305
+ },
306
+ "additionalProperties": false
307
+ },
308
+ {
309
+ "type": "object",
310
+ "properties": {
311
+ "cpf": { "$ref": "#/cpf" }
312
+ },
313
+ "additionalProperties": false
314
+ }
315
+ ]
316
+ },
317
+ "enderecoCompleto": {
318
+ "description": "Representação completa do endereço.",
319
+ "type": "object",
320
+ "properties": {
321
+ "endereco": { "$ref": "#/endereco" },
322
+ "numero": { "$ref": "#/numeroEndereco" },
323
+ "complemento": { "$ref": "#/complementoEndereco" },
324
+ "bairro": { "$ref": "#/bairro" },
325
+ "codigoMunicipio": { "$ref": "#/codigoMunicipioIbge" },
326
+ "uf": { "$ref": "#/uf" },
327
+ "cep": { "$ref": "#/cep" }
328
+ },
329
+ "required": [],
330
+ "additionalProperties": false
331
+ },
332
+ "contato": {
333
+ "description": "Representa forma de contato com a pessoa (física/jurídica)",
334
+ "type": "object",
335
+ "properties": {
336
+ "telefone": { "$ref": "#/telefone" },
337
+ "email": { "$ref": "#/email" }
338
+ },
339
+ "required": [],
340
+ "additionalProperties": false
341
+ },
342
+ "identificacaoIntermediarioServico": {
343
+ "description": "Representa dados para identificação de intermediário do serviço",
344
+ "oneOf": [
345
+ {
346
+ "type": "object",
347
+ "properties": {
348
+ "razaoSocial": { "$ref": "#/razaoSocial" },
349
+ "cnpj": { "$ref": "#/cnpj" },
350
+ "inscricaoMunicipal": { "$ref": "#/inscricaoMunicipal" }
351
+ },
352
+ "required": ["razaoSocial", "cnpj"],
353
+ "additionalProperties": false
354
+ },
355
+ {
356
+ "type": "object",
357
+ "properties": {
358
+ "cpf": { "$ref": "#/cpf" }
359
+ },
360
+ "required": ["cpf"],
361
+ "additionalProperties": false
362
+ }
363
+ ]
364
+ },
365
+ "dadosConstrucaoCivil": {
366
+ "description": "Representa dados para identificação de intermediário do serviço",
367
+ "properties": {
368
+ "codigoObra": { "$ref": "#/codigoObra" },
369
+ "art": { "$ref": "#/art" }
370
+ },
371
+ "required": [],
372
+ "additionalProperties": false
373
+ }
374
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+ "title": "Recepção de Lote de RPS",
4
+ "description": "Esse serviço compreende a recepção do Lote de RPS, a resposta com o número do protocolo gerado para esta transação e o processamento do lote. Quando efetuada a recepção, o Lote entrará na fila para processamento posterior onde serão feitas as validações necessárias e geração das NFS-e. ",
5
+
6
+ "type": "object",
7
+ "properties": {
8
+ "loteRps": {
9
+ "type": "object",
10
+ "properties": {
11
+ "numeroLote": { "$ref": "definitions.json#/numeroLote"},
12
+ "cnpj": { "$ref": "definitions.json#/cnpj"},
13
+ "inscricaoMunicipal": { "$ref": "definitions.json#/inscricaoMunicipal" },
14
+ "quantidadeRps": { "$ref": "definitions.json#/quantidadeRps" },
15
+ "listaRps": {
16
+ "type": "array",
17
+ "items": {
18
+ "type": "object",
19
+ "properties": {
20
+ "identificacaoRps": { "$ref": "definitions.json#/identificacaoRps" },
21
+ "dataEmissao": { "type": "string", "format": "date-time" },
22
+ "naturezaOperacao": { "$ref": "definitions.json#/naturezaOperacao" },
23
+ "regimeEspecialTributacao": { "$ref": "definitions.json#/regimeEspecialTributacao" },
24
+ "optanteSimplesNacional": { "type": "boolean" },
25
+ "incentivadorCultural": { "type": "boolean" },
26
+ "status": { "$ref": "definitions.json#/statusRps" },
27
+ "rpsSubstituido": { "$ref": "definitions.json#/identificacaoRps" },
28
+ "servico": { "$ref": "definitions.json#/dadosServico" },
29
+ "prestador": { "$ref": "definitions.json#/identificacaoPrestador" },
30
+ "tomador": { "$ref": "definitions.json#/dadosTomador" },
31
+ "intermediarioServico": { "$ref": "definitions.json#/identificacaoIntermediarioServico" },
32
+ "construcaoCivil": { "$ref": "definitions.json#/dadosConstrucaoCivil" }
33
+ },
34
+ "required": ["identificacaoRps", "dataEmissao", "naturezaOperacao", "optanteSimplesNacional", "incentivadorCultural", "status", "servico", "prestador", "tomador"],
35
+ "additionalProperties": false
36
+ },
37
+ "minItems": 1
38
+ }
39
+ },
40
+ "required": ["numeroLote", "cnpj", "inscricaoMunicipal", "quantidadeRps", "listaRps"],
41
+ "additionalProperties": false
42
+ }
43
+ },
44
+ "required": ["loteRps"],
45
+ "additionalProperties": false
46
+ }