-
-
Notifications
You must be signed in to change notification settings - Fork 19
add: provedor SimplISS #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| GravarArquivoEmDisco(strResponse, $"Enviar-{dps.Informacoes.NumeroDps:000000}-resp.json", documento); | ||
|
|
||
| // Reserializar com case insensitive para normalizar o JSON | ||
| object? obj = JsonSerializer.Deserialize<object>(strResponse, JsonOptions); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isso não está correto, sem falar que é redundante converter e converter de novo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
O Json retornado quebra acentuação, a função disso é basicamente corrigir com System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Não seria melhor então coloca a opção de passar o json options la no result, em vez de fazer 2 conversões
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tinha optado por não alterar NFSeResponse.
Feito.
| </PackageReference> | ||
| <PackageReference Include="OpenAC.Net.Core" Version="1.6.0" /> | ||
| <PackageReference Include="OpenAC.Net.DFe.Core" Version="1.6.0.2" /> | ||
| <PackageReference Include="System.Formats.Asn1" Version="8.0.2" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pq adicionou essa dependencia ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vou remover hoje a noite ao voltar para casa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feito
| public NFSeProvider Provedor { get; set; } | ||
|
|
||
| [DFeCollection("Ambiente")] | ||
| [DFeItem(typeof(NFSeEnvironment), "ambiente")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Não inicie o nome com letra minuscula.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Não era pra ter ido, foi no meio das tentativas de corrigir o serializer.
Ajusto hoje a noite ao voltar para casa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feito
| { | ||
| var serviceInfo = Services[config.WebServices.CodigoMunicipio]; | ||
| var serviceInfo = Services[config.WebServices.CodigoMunicipio] ?? | ||
| Services[-1]; //marcosgerene: na minha concepção, se não encontrou o município, deve-se entender que é o Nacional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Na minha concepção não, pois não sabes se o município está ativo no nacional.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Este projeto nasceu como nacional, diferente do outro que nasceu para atender X provedores.
Acredito que isso ajuda inclusive com quebras de quem já utiliza o projeto.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mas assim não vai retornar os endereços do nacional, pois não existe a cidade nacional
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No arquivo que enviei de configurações coloco nacional como cidade -1. No Fallback do meu código "coalesce" coloco o município -1 como a busca.
<Services>
<serviceInfo Id="-1">
<Tipo>Nacional</Tipo>
<Nome>NFSe Nacional</Nome>
<UF>EX</UF>
<Ambiente>
...
[+] Adiciona o provedor SimplISS
[-] Atualiza o pacote System.Formats.Asn1 com vulnerabilidades
[+] Adiciona arquivo de configuração de cidades e console para edição simples do arquivo original
[-] Aplica micro correções para serializar o arquivo de configuração
@rftd o SimplISS está problemático a alguns dias, não consegui realizar todos os testes. Mas e emissão em homologação está funcional.