Skip to content

Commit

Permalink
Merge pull request #1 from SSD-Smart-Software-Development-SRL/feat/ad…
Browse files Browse the repository at this point in the history
…d-dgii-sdk

feat: add dgii sdk
  • Loading branch information
dluciano authored Mar 13, 2024
2 parents 99f06b4 + a25752e commit eba0b73
Show file tree
Hide file tree
Showing 73 changed files with 1,086 additions and 16,656 deletions.
37 changes: 15 additions & 22 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ on:
push:
branches:
- 'main' # Run the workflow when pushing to the main branch
pull_request:
branches:
- '*' # Run the workflow for all pull requests
release:
types:
- published # Run the workflow when a new GitHub release is published
Expand All @@ -23,21 +20,27 @@ defaults:
shell: pwsh

jobs:
create_nuget:
build_and_pack:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Get all history to allow automatic versioning using MinVer

# Install the .NET SDK indicated in the global.json file
- name: Setup .NET
uses: actions/setup-dotnet@v4

# Create the NuGet package in the folder from the environment variable NuGetDirectory
- run: dotnet pack --configuration Release --output ${{ env.NuGetDirectory }}
- name: Restore
run: dotnet restore

- name: Build
run: dotnet build --no-restore --configuration Release

- name: Test
run: dotnet test --filter Type!=Integration --no-restore --no-build --configuration Release

- name: Pack
run: dotnet pack --no-restore --no-build --configuration Release -p:RepositoryBranch="${{ github.ref_name }}" -p:RepositoryCommit="${{ github.sha }}" --output ${{ env.NuGetDirectory }}

# Publish the NuGet package as an artifact, so they can be used in the following jobs
- uses: actions/upload-artifact@v3
with:
name: nuget
Expand All @@ -47,9 +50,8 @@ jobs:

validate_nuget:
runs-on: ubuntu-latest
needs: [ create_nuget ]
needs: [ build_and_pack ]
steps:
# Install the .NET SDK indicated in the global.json file
- name: Setup .NET
uses: actions/setup-dotnet@v4

Expand All @@ -67,23 +69,14 @@ jobs:
# If some rules are not applicable, you can disable them
# using the --excluded-rules or --excluded-rule-ids option
- name: Validate package
run: meziantou.validate-nuget-package (Get-ChildItem "${{ env.NuGetDirectory }}/*.nupkg")

run_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v4
- name: Run tests
run: dotnet test --configuration Release
run: meziantou.validate-nuget-package (Get-ChildItem "${{ env.NuGetDirectory }}/*.nupkg")

deploy:
# Publish only when creating a GitHub Release
# https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository
if: github.event_name == 'release'
runs-on: ubuntu-latest
needs: [ validate_nuget, run_test ]
needs: [ validate_nuget ]
steps:
# Download the NuGet package created in the previous job
- uses: actions/download-artifact@v3
Expand Down
42 changes: 40 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,46 @@
<PropertyGroup>
<ArtifactsPath>$(MSBuildThisFileDirectory)artifacts</ArtifactsPath>
</PropertyGroup>
<PropertyGroup>
<Version>1.1.0</Version>
<Authors>SSD Smart Software Development SRL</Authors>
<Company>SSD Smart Software Development SRL</Company>
<Copyright>© SSD Smart Software Development SRL</Copyright>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<ContinuousIntegrationBuild
Condition="'$(ContinuousIntegrationBuild)' == '' And '$(GITHUB_ACTIONS)' == 'true'">true</ContinuousIntegrationBuild>
<RepositoryType>git</RepositoryType>
<PackageRequireLicenseAcceptance>False</PackageRequireLicenseAcceptance>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/SSD-Smart-Software-Development-SRL/ecf_dgii</PackageProjectUrl>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<RepositoryUrl>https://github.com/SSD-Smart-Software-Development-SRL/ecf_dgii</RepositoryUrl>
<AllowedOutputExtensionsInPackageBuildOutputFolder>
$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<PackageReadmeFile>README.md</PackageReadmeFile>
<EnablePackageValidation>true</EnablePackageValidation>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<DebugType>embedded</DebugType>
<PackageTags>dgii;republica dominicana;do;dominican republic;ecf;rnc;ncf;encf;direccion
general de impuestos internos</PackageTags>
<PackageIcon>logo.png</PackageIcon>
</PropertyGroup>
<ItemGroup>
<None Include="..\logo.png">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>
<ItemGroup>
<None Include="README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>
<Sdk Name="DotNet.ReproducibleBuilds.Isolated" Version="1.1.1" />
<ItemGroup>
<PackageReference Include="DotNet.ReproducibleBuilds" Version="1.1.1" PrivateAssets="All"/>
<PackageReference Include="DotNet.ReproducibleBuilds" Version="1.1.1" PrivateAssets="All" />
</ItemGroup>
</Project>
</Project>
8 changes: 8 additions & 0 deletions ECF_DGII.Models/Anulacion/RespuestaAnulacionRango.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace ECF_DGII.Models.Anulacion;

public record RespuestaAnulacionRango(
string? Rnc,
string? Codigo,
string? Nombre,
string[]? Mensajes
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace ECF_DGII.Models.RespuestaAprobacionComercial;

public record RespuestaAprobacionComercial(
string? Codigo,
string? Estado,
string[]? Mensaje
);
9 changes: 9 additions & 0 deletions ECF_DGII.Models/ConsultaDirectorio/Directorio.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace ECF_DGII.Models.ConsultaDirectorio;

public record Directorio(
string? Nombre,
string? Rnc,
string? UrlRecepcion,
string? UrlAceptacion,
string? UrlOpcional
);
9 changes: 9 additions & 0 deletions ECF_DGII.Models/ConsultaDirectorio/DirectorioModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace ECF_DGII.Models.ConsultaDirectorio;

public record DirectorioModel(
string? Nombre,
string? Rnc,
string? UrlRecepcion,
string? UrlAceptacion,
string? UrlOpcional
);
15 changes: 15 additions & 0 deletions ECF_DGII.Models/ConsultaEstado/RespuestaConsultaEstado.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
namespace ECF_DGII.Models.ConsultaEstado;

public record RespuestaConsultaEstado(
int Codigo,
string? Estado,
string? RncEmisor,
string? NcfElectronico,
double? MontoTotal,
double? TotalITBIS,
string? FechaEmision,
string? FechaFirma,
string? RncComprador,
string? CodigoSeguridad,
string? IdExtranjero
);
3 changes: 3 additions & 0 deletions ECF_DGII.Models/ConsultaRFCE/Mensaje.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace ECF_DGII.Models.ConsultaRFCE;

public record Mensaje(string? Valor, int Codigo);
10 changes: 10 additions & 0 deletions ECF_DGII.Models/ConsultaRFCE/RespuestaConsultaRFCE.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace ECF_DGII.Models.ConsultaRFCE;

public record RespuestaConsultaRFCE(
string? Rnc,
string Encf,
bool SecuenciaUtilizada,
string? Codigo,
string? Estado,
Mensaje[]? Mensajes
);
3 changes: 3 additions & 0 deletions ECF_DGII.Models/ConsultaResultado/Mensaje.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace ECF_DGII.Models.ConsultaResultado;

public record Mensaje(string? Valor, int Codigo);
12 changes: 12 additions & 0 deletions ECF_DGII.Models/ConsultaResultado/RespuestaConsultaRFCE.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace ECF_DGII.Models.ConsultaResultado;

public record RespuestaConsultaTrackId(
string? TrackId,
string? Codigo,
string? Estado,
string? Rnc,
string? Encf,
bool SecuenciaUtilizada,
string? FechaRecepcion,
Mensaje[]? Mensajes
);
7 changes: 7 additions & 0 deletions ECF_DGII.Models/ConsultaTrackId/TrackingDetalle.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace ECF_DGII.Models.ConsultaTrackId;

public record TrackingDetalle(
string? TrackId,
string? Estado,
string? FechaRecepcion
);
78 changes: 8 additions & 70 deletions ECF_DGII.Models/ECF_DGII.Models.csproj
Original file line number Diff line number Diff line change
@@ -1,77 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>12.0</LangVersion>
</PropertyGroup>

<PropertyGroup>
<PackageId>SSDDO.ECF_DGII.Models</PackageId>
<Authors>SSD Smart Software Development SRL</Authors>
<Company>SSD Smart Software Development SRL</Company>
<Copyright>© SSD Smart Software Development SRL</Copyright>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<ContinuousIntegrationBuild Condition="'$(ContinuousIntegrationBuild)' == '' And '$(GITHUB_ACTIONS)' == 'true'">true</ContinuousIntegrationBuild>
<Title>ECF_DGII Models</Title>
<Description>Modelos POCO generados a partir de los XSD definidos por la DGII, para la facturación electrónica en República Dominicana.</Description>
<RepositoryType>git</RepositoryType>
<PackageRequireLicenseAcceptance>False</PackageRequireLicenseAcceptance>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/SSD-Smart-Software-Development-SRL/ecf_dgii</PackageProjectUrl>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<RepositoryUrl>https://github.com/SSD-Smart-Software-Development-SRL/ecf_dgii</RepositoryUrl>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<PackageReadmeFile>README.md</PackageReadmeFile>
<EnablePackageValidation>true</EnablePackageValidation>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<DebugType>embedded</DebugType>
<PackageTags>dgii;republica dominicana;do;dominican republic;ecf;rnc;ncf;encf;direccion general de impuestos internos</PackageTags>
<PackageIcon>logo.png</PackageIcon>
<Description>Modelos POCO generados a partir de los XSD y de los responses del API definido
por la DGII para la facturación electrónica en República Dominicana.</Description>
</PropertyGroup>

<ItemGroup>
<Content Remove="XSD/ARECF v1.0.xsd" />
<Content Remove="XSD/Semilla v.1.0.xsd" />
<Content Remove="XSD/e-CF 31 v.1.0.xsd" />
<Content Remove="XSD/e-CF 32 v.1.0.xsd" />
<Content Remove="XSD/e-CF 33 v.1.0.xsd" />
<Content Remove="XSD/e-CF 34 v.1.0.xsd" />
<Content Remove="XSD/e-CF 41 v.1.0.xsd" />
<Content Remove="XSD/e-CF 43 v.1.0.xsd" />
<Content Remove="XSD/e-CF 44 v.1.0.xsd" />
<Content Remove="XSD/e-CF 45 v.1.0.xsd" />
<Content Remove="XSD/e-CF 46 v.1.0.xsd" />
<Content Remove="XSD/e-CF 47 v.1.0.xsd" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="XSD/ARECF v1.0.xsd" />
<EmbeddedResource Include="XSD/Semilla v.1.0.xsd" />
<EmbeddedResource Include="XSD/e-CF 31 v.1.0.xsd" />
<EmbeddedResource Include="XSD/e-CF 32 v.1.0.xsd" />
<EmbeddedResource Include="XSD/e-CF 33 v.1.0.xsd" />
<EmbeddedResource Include="XSD/e-CF 34 v.1.0.xsd" />
<EmbeddedResource Include="XSD/e-CF 41 v.1.0.xsd" />
<EmbeddedResource Include="XSD/e-CF 43 v.1.0.xsd" />
<EmbeddedResource Include="XSD/e-CF 44 v.1.0.xsd" />
<EmbeddedResource Include="XSD/e-CF 45 v.1.0.xsd" />
<EmbeddedResource Include="XSD/e-CF 46 v.1.0.xsd" />
<EmbeddedResource Include="XSD/e-CF 47 v.1.0.xsd" />
</ItemGroup>

<ItemGroup>
<None Include="..\logo.png">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>
<ItemGroup>
<None Update="ECF-DGII.png">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Update="README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>
</Project>
</Project>
8 changes: 8 additions & 0 deletions ECF_DGII.Models/EstatusServicios/Ambiente.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace ECF_DGII.Models.EstatusServicios;

public enum Ambiente
{
PreCertificacion = 1,
Certificacion = 2,
Producion = 3
}
3 changes: 3 additions & 0 deletions ECF_DGII.Models/EstatusServicios/RespuestaEstado.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace ECF_DGII.Models.EstatusServicios;

public record RespuestaEstado(string? Estado);
3 changes: 3 additions & 0 deletions ECF_DGII.Models/EstatusServicios/RespuestaEstatusServicio.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace ECF_DGII.Models.EstatusServicios;

public record RespuestaEstatusServicio(string? Servicio, string? Status, string? Ambiente);
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace ECF_DGII.Models.EstatusServicios;

public record RespuestaVentanaDeMantenimiento(VentanaDeMantenimiento[] VentanaMantenimientos);
8 changes: 8 additions & 0 deletions ECF_DGII.Models/EstatusServicios/VentanaDeMantenimiento.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace ECF_DGII.Models.EstatusServicios;

public record VentanaDeMantenimiento(
string? Ambiente,
string? HoraInicio,
string? HoraFin,
string[]? Dias
);
2 changes: 1 addition & 1 deletion ECF_DGII.Models/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# ECF DGII Models

Modelos POCO generados a partir de los XSD definidos por la DGII, para la facturación electrónica en República Dominicana.
Modelos POCO generados a partir de los XSD definidos por la DGII y de los parametros de entrada y salida de los diferentes servicios de la DGII, para la facturación electrónica en República Dominicana.
3 changes: 3 additions & 0 deletions ECF_DGII.Models/Recepcion/RespuestaRecepcion.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace ECF_DGII.Models.Recepcion;

public record RespuestaRecepcion(string? TrackId, string? Error, string? Mensaje);
6 changes: 6 additions & 0 deletions ECF_DGII.Models/RecepcionFC/EstadoCF.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace ECF_DGII.Models.RecepcionFC;

public enum EstadoCF
{
One = 1, Two = 2, Three = 3, Four = 4, Five = 5
}
3 changes: 3 additions & 0 deletions ECF_DGII.Models/RecepcionFC/MensajeRespuesta.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace ECF_DGII.Models.RecepcionFC;

public record MensajeRespuesta(string? Codigo, string? Valor);
9 changes: 9 additions & 0 deletions ECF_DGII.Models/RecepcionFC/Respuesta.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace ECF_DGII.Models.RecepcionFC;

public record Respuesta(
EstadoCF Codigo,
string? Estado,
MensajeRespuesta[]? Mensajes,
string? Enfc,
bool SecuenciaUtilizada
);
Loading

0 comments on commit eba0b73

Please sign in to comment.