PalmeaGroup.DGII.Client
1.0.4
dotnet add package PalmeaGroup.DGII.Client --version 1.0.4
NuGet\Install-Package PalmeaGroup.DGII.Client -Version 1.0.4
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PalmeaGroup.DGII.Client" Version="1.0.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PalmeaGroup.DGII.Client" Version="1.0.4" />
<PackageReference Include="PalmeaGroup.DGII.Client" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add PalmeaGroup.DGII.Client --version 1.0.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: PalmeaGroup.DGII.Client, 1.0.4"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package PalmeaGroup.DGII.Client@1.0.4
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=PalmeaGroup.DGII.Client&version=1.0.4
#tool nuget:?package=PalmeaGroup.DGII.Client&version=1.0.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
PalmeaGroup.Dgii.Client
Cliente para consultas web a la DGII (Republica Dominicana).
Caracteristicas
- Realiza consultas RNC, NCF y e-NCF contra la pagina de consultas publicas de la DGII.
- Implementado como cliente HTTP con
IHttpClientFactoryy politicas de reintento (Polly). - Parsing tolerante de HTML a XML con helpers seguros (evita NullReference/ParseException).
- Logging estructurado para diagnosticos cuando el parseo falla.
Instalaci�n
- Anade el proyecto al
Solutiono compilalo como paquete NuGet. El ensamblado/namespace raiz esPalmeaGroup.Dgii.Client.
Registro en DI (ejemplo)
En Program.cs / startup:
using PalmeaGroup.Dgii.Client.Extensions;
using PalmeaGroup.Dgii.Client;
var builder = WebApplication.CreateBuilder(args);
// Registra named HttpClient con Polly y soporte de cookies
builder.Services.AddDgiiWrapper();
// Registra servicio
builder.Services.AddTransient<IServicioConsultasDgii, ServicioConsultasWebDgii>();
var app = builder.Build();
Uso (ejemplo)
public class Example
{
private readonly IServicioConsultasDgii _dgii;
public Example(IServicioConsultasDgii dgii) => _dgii = dgii;
public async Task Run(CancellationToken ct)
{
var result = await _dgii.ConsultarENcf("123456789", "E0000000001", "", "", ct);
if (result.Success)
{
Console.WriteLine($"Estado: {result.Estado}");
}
else
{
Console.WriteLine($"Mensaje: {result.Message}");
}
}
}
Notas sobre modelos (DTOs)
- Los DTOs estan en
PalmeaGroup.Dgii.Client.Dtos. - Propiedades importantes son anulables (
string?,decimal?,DateTime?) porque la pagina puede devolver valores ausentes o con formato distinto. - Se eliminaron acentos en nombres de propiedades publicas para interoperabilidad. Ejemplos:
ValidoHasta(antesValidoHasta)NombreORazonSocial(antesNombreORazonSocial)Categoria(antesCategoria)
Logging y seguridad
- El servicio acepta
ILogger<ServicioConsultasWebDgii>para registrar advertencias cuando el parseo falla. - Evita loggear datos sensibles en produccion; se recomienda configurar un sink separado para diagnosticos y/o aplicar redaccion sobre RNC y codigos de seguridad.
Tests
- Hay un proyecto de tests de ejemplo en
tests/PalmeaGroup.Dgii.Client.Tests. - Ejecutar:
dotnet test ./tests/PalmeaGroup.Dgii.Client.Tests
Sugerencias futuras
- A�adir m�s pol�ticas Polly (circuit-breaker, jitter), configuraci�n desde
IConfiguration. - Mayor cobertura de tests con HTML de ejemplo (fixtures) y tests de integraci�n con handler mock.
- Empaquetar como NuGet y publicar con metadata adecuada.
Licencia
- C�digo del repositorio: revisa la licencia del proyecto (no incluida por defecto en este repo).
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- HtmlAgilityPack (>= 1.12.3)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.2)
- Microsoft.Extensions.Http.Polly (>= 8.0.21)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.3)
- Polly (>= 8.6.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.