first commit

develop
unknown 1 year ago
commit 39808dca34
  1. 12
      .config/dotnet-tools.json
  2. 31
      .vscode/launch.json
  3. 15
      .vscode/settings.json
  4. 103
      .vscode/tasks.json
  5. 18
      CORRESPONSALBackend.csproj
  6. 18
      Context/DapperContext.cs
  7. 12
      Contracts/Catalogos/ICorresponsalesRepository.cs
  8. 11
      Contracts/Catalogos/IProveedoresRepository.cs
  9. 13
      Contracts/Catalogos/ITabuladorDetalleRepository.cs
  10. 10
      Contracts/Catalogos/ITabuladorRepository.cs
  11. 16
      Contracts/Clientes/CasaCuervo/ICasaCuervoRepository.cs
  12. 10
      Contracts/Contabilidad/Corresponsalias/IContabilidadCorresponsaliasRepository.cs
  13. 15
      Contracts/Corresponsalias/ICorresponsaliasAnticiposRepository.cs
  14. 9
      Contracts/Corresponsalias/ICorresponsaliasCatAduanasRepository.cs
  15. 9
      Contracts/Corresponsalias/ICorresponsaliasCatDestinosRepository.cs
  16. 9
      Contracts/Corresponsalias/ICorresponsaliasCatMediosEmbarqueRepository.cs
  17. 9
      Contracts/Corresponsalias/ICorresponsaliasCatTipoEmbarqueRepository.cs
  18. 11
      Contracts/Corresponsalias/ICorresponsaliasCatTiposDocumentosRepository.cs
  19. 12
      Contracts/Corresponsalias/ICorresponsaliasContenedoresRepository.cs
  20. 17
      Contracts/Corresponsalias/ICorresponsaliasCuentasComplementarias.cs
  21. 12
      Contracts/Corresponsalias/ICorresponsaliasFacturasRepository.cs
  22. 10
      Contracts/Corresponsalias/ICorresponsaliasFacturasTercerosRepository.cs
  23. 10
      Contracts/Corresponsalias/ICorresponsaliasGuiasRepository.cs
  24. 11
      Contracts/Corresponsalias/ICorresponsaliasPedimentoPartidasRepository.cs
  25. 11
      Contracts/Corresponsalias/ICorresponsaliasPedimentoRepository.cs
  26. 11
      Contracts/Corresponsalias/ICorresponsaliasPrecuentaRepository.cs
  27. 20
      Contracts/Corresponsalias/ICorresponsaliasTraficosRepository.cs
  28. 10
      Contracts/Dashboard/IDashboardCorresponsalesRepository.cs
  29. 14
      Contracts/IBatteryRepository.cs
  30. 16
      Contracts/IClientesRepository.cs
  31. 9
      Contracts/IMenuRepository.cs
  32. 20
      Contracts/IPerfilesRepository.cs
  33. 24
      Contracts/IUsuariosRepository.cs
  34. 14
      Contracts/Utils/IFileManagerRepository.cs
  35. 10
      Contracts/Utils/IFilePaths4ProcessRepository.cs
  36. 9
      Contracts/Utils/IPDFGenerator.cs
  37. 11
      Contracts/Utils/IReportesRepository.cs
  38. 7
      Contracts/Utils/IValidaFraccion.cs
  39. 206
      Controllers/AuthController.cs
  40. 56
      Controllers/Catalogos/CorresponsalesController.cs
  41. 47
      Controllers/Catalogos/ProveedoresController.cs
  42. 52
      Controllers/Catalogos/TabuladorController.cs
  43. 58
      Controllers/Catalogos/TabuladorDetalleController.cs
  44. 99
      Controllers/ClientesController.cs
  45. 38
      Controllers/Contabilidad/Corresponsales/ContabilidadTraficoController.cs
  46. 66
      Controllers/Corresponsalias/AnticiposController.cs
  47. 31
      Controllers/Corresponsalias/CatAduanasController.cs
  48. 30
      Controllers/Corresponsalias/CatDestinosController.cs
  49. 29
      Controllers/Corresponsalias/CatMediosEmbarquesController.cs
  50. 33
      Controllers/Corresponsalias/CatTiposDocumento.cs
  51. 30
      Controllers/Corresponsalias/CatTiposEmbarqueController.cs
  52. 47
      Controllers/Corresponsalias/ContenedoresController.cs
  53. 91
      Controllers/Corresponsalias/CuentasComplementariasController.cs
  54. 57
      Controllers/Corresponsalias/FacturasController.cs
  55. 53
      Controllers/Corresponsalias/FacturasTercerosController.cs
  56. 46
      Controllers/Corresponsalias/GuiasController.cs
  57. 47
      Controllers/Corresponsalias/PedimentoController.cs
  58. 55
      Controllers/Corresponsalias/PedimentoPartidaController.cs
  59. 44
      Controllers/Corresponsalias/PrecuentaController.cs
  60. 131
      Controllers/Corresponsalias/TraficosController.cs
  61. 39
      Controllers/Dashboard/CorresponsalesController.cs
  62. 204
      Controllers/FileManagerController.cs
  63. 165
      Controllers/PerfilesController.cs
  64. 189
      Controllers/UsuariosController.cs
  65. 62
      Controllers/Utils/MFileManagerController.cs
  66. 33
      Controllers/Utils/ReportesController.cs
  67. 55
      Crypto/Crypto.cs
  68. 11
      DTO/AnexoFacturacion/DTOAnexoFacturacionAlen.cs
  69. 12
      DTO/AnexoFacturacion/DTOAnexoFacturacionMission.cs
  70. 10
      DTO/ArchivoElectronico/DTOAEPeriodo.cs
  71. 12
      DTO/ArchivoElectronico/DTOAEPeriodoSeleccion.cs
  72. 10
      DTO/ArchivoElectronico/DTOArchivoOficial.cs
  73. 20
      DTO/Battery/DTOBatteryEntry.cs
  74. 8
      DTO/Battery/DTOBatteryInfo.cs
  75. 12
      DTO/Battery/DTOLogFotosBodega.cs
  76. 12
      DTO/Cliente/ClienteProveedor.cs
  77. 9
      DTO/Cliente/ClienteUsuario.cs
  78. 8
      DTO/Clientes/CasaCuervo/DTO325AduanasPedidos.cs
  79. 16
      DTO/Clientes/CasaCuervo/DTO325ComplementaPedido.cs
  80. 10
      DTO/Clientes/CasaCuervo/DTO325RptPedidos.cs
  81. 18
      DTO/Clientes/CasaCuervo/DTO325UpdateFromWeb.cs
  82. 9
      DTO/Corresponsales/DTOCorresponsalCuentaComplementaria.cs
  83. 8
      DTO/Corresponsales/DTOCorresponsalCuentaComplementariaEstatus.cs
  84. 52
      DTO/Corresponsales/DTOCorresponsalTrafico.cs
  85. 8
      DTO/Corresponsales/DTOCorresponsalesAnticipo.cs
  86. 9
      DTO/Corresponsales/DTOLogCorresposalCuentaComplementaria.cs
  87. 9
      DTO/Corresponsales/DTORectificacionHistorico.cs
  88. 10
      DTO/Corresponsales/DTOTraficoCompleto.cs
  89. 8
      DTO/DTOConceptos.cs
  90. 10
      DTO/DTOItemMenuPerfil.cs
  91. 8
      DTO/DTOLogin.cs
  92. 8
      DTO/DTOPINData.cs
  93. 8
      DTO/DTOPINUsuario.cs
  94. 12
      DTO/DTOPedimentosSeleccion.cs
  95. 8
      DTO/DTORespuesta.cs
  96. 11
      DTO/DTORolesAsignados.cs
  97. 11
      DTO/DTOSendEmail.cs
  98. 12
      DTO/Reportes/DTOReporte.cs
  99. 18
      DTO/Reportes/DTOReporteCorresponsales.cs
  100. 8
      DTO/Usuario/DTOClonarUsuario.cs
  101. Some files were not shown because too many files have changed in this diff Show More

@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"csharpier": {
"version": "0.21.0",
"commands": [
"dotnet-csharpier"
]
}
}
}

@ -0,0 +1,31 @@
{
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/bin/Debug/net7.0/CORRESPONSALBackend.dll",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+https?://\\S+",
"uriFormat": "https://localhost:5051/swagger/index.html"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
}
]
}

@ -0,0 +1,15 @@
{
"workbench.colorCustomizations": {
"titleBar.border": "#ff0000",
/* "titleBar.activeForeground": "#fbfcff",
"titleBar.inactiveForeground": "#b4c0e8cc",
"titleBar.activeBackground": "#06660e",
"titleBar.inactiveBackground": "#25eb77cc", */
/* "activityBar.activeBackground": "#25eb77cc",
"activityBar.background": "#06660e",
"activityBar.foreground": "#86b0da",
"activityBar.inactiveForeground": "#7ea9d3", */
"sideBar.background": "#011105",
"list.hoverBackground": "#3c5866"
}
}

103
.vscode/tasks.json vendored

@ -0,0 +1,103 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/CORRESPONSALBackend.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/CORRESPONSALBackend.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"--project",
"${workspaceFolder}/CORRESPONSALBackend.csproj"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish for PRODUCTION",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"/property:Configuration=Release",
"/property:EnvironmentName=Production",
"${workspaceFolder}/CORRESPONSALBackend.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": false,
"close": true
},
"problemMatcher": "$msCompile"
},
{
"label": "publish for QA",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"/property:Configuration=Release",
"/property:EnvironmentName=Staging",
"${workspaceFolder}/CORRESPONSALBackend.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": false,
"close": true
},
"problemMatcher": "$msCompile"
},
{
"label": "Clean & Build",
"command": "dotnet clean; dotnet build",
"type": "shell",
"args": [ ],
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": false,
"close": true
},
"problemMatcher": "$msCompile"
}
]
}

@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.5" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
<PackageReference Include="Dapper" Version="2.0.123" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.5" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="7.0.5" />
</ItemGroup>
</Project>

@ -0,0 +1,18 @@
using Microsoft.Data.SqlClient;
using System.Data;
namespace CORRESPONSALBackend.Context
{
public class DapperContext
{
private readonly IConfiguration _configuration;
private readonly string _connectionString;
public DapperContext(IConfiguration configuration)
{
_configuration = configuration;
_connectionString = _configuration.GetConnectionString("SqlConnection");
}
public IDbConnection CreateConnection()
=> new SqlConnection(_connectionString);
}
}

@ -0,0 +1,12 @@
using CORRESPONSALBackend.Models.Catalogos;
namespace CORRESPONSALBackend.Contracts.Catalogos
{
public interface ICorresponsalesRepository
{
public Task<IEnumerable<CatCorresponsales>> GetAll();
public Task<IEnumerable<CatCorresponsales>> GetAllFormated();
public Task<CatCorresponsales> Append(CatCorresponsales data);
public Task<CatCorresponsales> Delete(int id);
}
}

@ -0,0 +1,11 @@
using CORRESPONSALBackend.Models;
namespace CORRESPONSALBackend.Contracts.Catalogos
{
public interface IProveedoresRepository
{
public Task<IEnumerable<CatProveedores>> GetAll(int Clasificacion);
public Task<CatProveedores> Append(CatProveedores data);
public Task Delete(int id);
}
}

@ -0,0 +1,13 @@
using CORRESPONSALBackend.DTO;
using CORRESPONSALBackend.Models.Catalogos;
namespace CORRESPONSALBackend.Contracts.Catalogos
{
public interface ITabuladorDetalleRepository
{
public Task<IEnumerable<TabuladorDetalle>> Append(TabuladorDetalle data);
public Task<IEnumerable<TabuladorDetalle>> GetDetailByIdTab(int id);
public Task<IEnumerable<TabuladorDetalle>> GetAll(int id, int IdCliente);
public Task Delete(int id);
public Task<IEnumerable<DTOConceptos>> GetAllConcepts();
}
}

@ -0,0 +1,10 @@
using CORRESPONSALBackend.Models.Catalogos;
namespace CORRESPONSALBackend.Contracts.Catalogos
{
public interface ITabuladorRepository
{
public Task<IEnumerable<Tabulador>> GetAll(int id, int IdCliente);
public Task<Tabulador> Append(Tabulador data);
public Task Delete(int id);
}
}

@ -0,0 +1,16 @@
using CORRESPONSALBackend.Models.Clientes.CasaCuervo;
using CORRESPONSALBackend.DTO.Clientes.CasaCuervo;
namespace CORRESPONSALBackend.Contracts.Clientes.CasaCuervo
{
public interface ICasaCuervoRepository
{
public Task<Boolean> Append(List<I325Pedidos> data);
public Task<Boolean> UpdateInfoFromCorresponsal(List<DTO325ComplementaPedido> data);
public Task<IEnumerable<I325Pedidos>> getAll(string Inicio, string Fin, string Aduana);
public Task<I325Pedidos> GetById(int Id);
public Task<I325Pedidos> UpdateInfoFromWeb(DTO325UpdateFromWeb data);
public Task<IEnumerable<DTO325AduanasPedidos>> getAduanas(int Usuario, int TipoUsuario);
public Task<IEnumerable<I325RptCOVE>> GetRptCOVE(string Inicio, string Fin);
}
}

@ -0,0 +1,10 @@
using CORRESPONSALBackend.Models.Corresponsales;
namespace CORRESPONSALBackend.Contracts.Contabilidad.Corresponsalias
{
public interface IContabilidadCorresponsaliasRepository
{
public Task<CorresponsalTraficoContabilidad> Append(CorresponsalTraficoContabilidad data);
public Task<IEnumerable<string>> Get(int IdTrafico, int tipo);
}
}

@ -0,0 +1,15 @@
using CORRESPONSALBackend.DTO.Corresponsales;
using CORRESPONSALBackend.Models;
using CORRESPONSALBackend.Models.Corresponsales;
namespace CORRESPONSALBackend.Contracts.Corresponsalias
{
public interface ICorresponsaliasAnticiposRepository
{
public Task<CorresponsalAnticipos> Append(CorresponsalAnticipos data);
public Task<IEnumerable<CorresponsalAnticipos>> getAll(int IdTrafico);
public Task Delete(int id);
public Task<DashboardTotal> GetTotalAnticiposPendientes();
public Task<CorresponsalAnticipos> Autoriza(DTOCorresponsalesAnticipo data);
}
}

@ -0,0 +1,9 @@
using CORRESPONSALBackend.Models.Corresponsales;
namespace CORRESPONSALBackend.Contracts.Corresponsalias
{
public interface ICorresponsaliasCatAduanasRepository
{
public Task<IEnumerable<CorresponsalCatAduanas>> getAll(int IdCliente);
}
}

@ -0,0 +1,9 @@
using CORRESPONSALBackend.Models.Corresponsales;
namespace CORRESPONSALBackend.Contracts.Corresponsalias
{
public interface ICorresponsaliasCatDestinosRepository
{
public Task<IEnumerable<CorresponsalCatDestinos>> getAll(int IdCliente);
}
}

@ -0,0 +1,9 @@
using CORRESPONSALBackend.Models.Corresponsales;
namespace CORRESPONSALBackend.Contracts.Corresponsalias
{
public interface ICorresponsaliasCatMediosEmbarqueRepository
{
public Task<IEnumerable<CorresponsalCatMediosEmbarque>> getAll();
}
}

@ -0,0 +1,9 @@
using CORRESPONSALBackend.Models.Corresponsales;
namespace CORRESPONSALBackend.Contracts.Corresponsalias
{
public interface ICorresponsaliasCatTipoEmbarqueRepository
{
public Task<IEnumerable<CorresponsalCatTipoEmbarque>> getAll();
}
}

@ -0,0 +1,11 @@
using CORRESPONSALBackend.DTO.Corresponsales;
using CORRESPONSALBackend.Models;
using CORRESPONSALBackend.Models.Corresponsales;
namespace CORRESPONSALBackend.Contracts.Corresponsalias
{
public interface ICorresponsaliasCatTiposDocumentosRepository
{
public Task<IEnumerable<CorresponsalCatTiposDocumento>> getAll(int Cliente, int Clasificacion);
}
}

@ -0,0 +1,12 @@
using CORRESPONSALBackend.Models.Corresponsales;
namespace CORRESPONSALBackend.Contracts.Corresponsalias
{
public interface ICorresponsaliasContenedoresRepository
{
public Task<IEnumerable<CorresponsalesContenedores>> GetAll(int IdTrafico);
public Task<CorresponsalesContenedores> Append(CorresponsalesContenedores data);
public Task Delete(int id);
public Task<CorresponsalesContenedores> Appendc1896(CorresponsalesContenedores data);
}
}

@ -0,0 +1,17 @@
using CORRESPONSALBackend.Models.Corresponsales;
using CORRESPONSALBackend.DTO.Corresponsales;
using CORRESPONSALBackend.Models;
namespace CORRESPONSALBackend.Contracts.Corresponsalias
{
public interface ICorresponsaliasCuentasComplementarias
{
public Task<CorresponsalCuentasComplementarias> Append(DTOCorresponsalCuentaComplementaria data);
public Task<IEnumerable<CorresponsalCuentasComplementarias>> Get(int IdTrafico);
public Task<DashboardTotal> GetPendientes();
public Task<IEnumerable<CorresponsalCuentasComplementariasEstatus>> GetEstatus();
public Task<CorresponsalCuentasComplementariasEstatus> AppendEstatus(CorresponsalCuentasComplementariasEstatus data);
public Task<Boolean> ChangeEstatus(DTOCorresponsalCuentaComplementariaEstatus data);
public Task<IEnumerable<DTOLogCorresposalCuentaComplementaria>> GetLogEstatus(int id);
public Task<Boolean> ClearFile(int id, byte witchFile);
}
}

@ -0,0 +1,12 @@
using CORRESPONSALBackend.Models.Corresponsales;
namespace CORRESPONSALBackend.Contracts.Corresponsalias
{
public interface ICorresponsaliasFacturasRepository
{
public Task<IEnumerable<CorresponsalFacturas>> GetAll(int idTrafico);
public Task<CorresponsalFacturas> Append(CorresponsalFacturas data);
public Task Delete(int id);
public Task<CorresponsalFacturas> Appendc1896(CorresponsalFacturas data, string UUID);
}
}

@ -0,0 +1,10 @@
using CORRESPONSALBackend.Models.Corresponsales;
namespace CORRESPONSALBackend.Contracts.Corresponsalias
{
public interface ICorresponsaliasFacturasTercerosRepository
{
public Task<IEnumerable<CorresponsalFacturasTerceros>> GetAll(int IdTrafico);
public Task<CorresponsalFacturasTerceros> Append(CorresponsalFacturasTerceros data);
public Task Delete(int id);
}
}

@ -0,0 +1,10 @@
using CORRESPONSALBackend.Models.Corresponsales;
namespace CORRESPONSALBackend.Contracts.Corresponsalias
{
public interface ICorresponsaliasGuiasRepository
{
public Task<IEnumerable<CorresponsalesGuias>> GetAll(int IdTrafico);
public Task<CorresponsalesGuias> Append(CorresponsalesGuias data);
public Task Delete(int id);
}
}

@ -0,0 +1,11 @@
using CORRESPONSALBackend.Models.Corresponsales;
namespace CORRESPONSALBackend.Contracts.Corresponsalias
{
public interface ICorresponsaliasPedimentoPartidasRepository
{
public Task<CorresponsalPedimentoPartida> Append(CorresponsalPedimentoPartida data);
public Task<IEnumerable<CorresponsalPedimentoPartida>> getAll(int IdTrafico);
public Task Delete(int id);
}
}

@ -0,0 +1,11 @@
using CORRESPONSALBackend.Models.Corresponsales;
namespace CORRESPONSALBackend.Contracts.Corresponsalias
{
public interface ICorresponsaliasPedimentoRepository
{
public Task<CorresponsalPedimento> Append(CorresponsalPedimento data);
public Task<CorresponsalPedimento> Get(int IdTrafico);
public Task Delete(int id);
}
}

@ -0,0 +1,11 @@
using CORRESPONSALBackend.Models.Corresponsales;
namespace CORRESPONSALBackend.Contracts.Corresponsalias
{
public interface ICorresponsaliasPrecuentaRepository
{
public Task<IEnumerable<IPrecuenta>> GetAll(int id, int IdTrafico);
public Task ChangeStatus(int id);
public Task<IEnumerable<IPrecuenta>> Append(int IdTabulador, int IdTrafico);
}
}

@ -0,0 +1,20 @@
using CORRESPONSALBackend.Models;
using CORRESPONSALBackend.DTO.Corresponsales;
using CORRESPONSALBackend.Models.Corresponsales;
using CORRESPONSALBackend.Repository.Corresponsalias;
namespace CORRESPONSALBackend.Contracts.Corresponsalias
{
public interface ICorresponsaliasTraficosRepository
{
public Task<ITrafico> Get(int id);
public Task<DashboardTotal> GetAll(int Mode);
public Task<IEnumerable<ICorRectificaciones>> GetRectificaciones(int id);
public Task<ICorRectificaciones> AddRectificacion(int id);
public Task<ITrafico> Append(ITrafico data);
public Task<IEnumerable<CorresponsalesTraficoEstatus>> GetTraficoEstatus();
public Task<Boolean> ValidaTraficoCompleto(DTOTraficoCompleto data);
public Task<Boolean> RectificacionHistoricoAppend(DTORectificacionHistorico data);
public Task<CorresponsaliasTraficoRectificacionHistorico> RectificacionHistoricoGet(int IdTrafico);
}
}

@ -0,0 +1,10 @@
using CORRESPONSALBackend.Models;
namespace CORRESPONSALBackend.Contracts.Dashboard
{
public interface IDashboardCorresponsalesRepository
{
public Task<IEnumerable<DashboardCorresponsales>> Get();
public Task<Decimal> GetTipoCambio(string Fecha);
}
}

@ -0,0 +1,14 @@
using CORRESPONSALBackend.DTO.Battery;
using CORRESPONSALBackend.DTO.Reportes;
using CORRESPONSALBackend.Models;
namespace CORRESPONSALBackend.Contracts
{
public interface IBatteryRepository
{
public Task<BatteryEntry> updatePallete2Warehouse(DTOBatteryEntry data);
public Task<IEnumerable<BatteryEntry>> getBatteryInfo(DTOBatteryInfo data);
public Task<IEnumerable<BatteryEntry>> getReportFromWarehouse(DTOReporte data);
public Task<double> getPalletWeight(string data);
}
}

@ -0,0 +1,16 @@
using CORRESPONSALBackend.DTO.Cliente;
using CORRESPONSALBackend.DTO.Usuario;
using CORRESPONSALBackend.Models;
namespace CORRESPONSALBackend.Contracts
{
public interface IClientesRepository
{
public Task<IEnumerable<IClientes>> getAllClientes(int id);
public Task<IEnumerable<IClientes>> getClientesAsignados(int id);
public Task<string> GetCustomerName(int sClave);
public Task<IEnumerable<IClientes>> addCliente(DTOClienteUsuario CU);
public Task<IEnumerable<DTOClienteProveedor>> asignaClienteProveedor(DTOClienteProveedor cp);
public Task<IEnumerable<Transportistas>> asignaUsuarioTransportista(DTOUsuarioTransportista t);
}
}

@ -0,0 +1,9 @@
using CORRESPONSALBackend.Models;
namespace CORRESPONSALBackend.Contracts
{
public interface IMenuRepository
{
public Task<IEnumerable<Menu>> GetItemsMenu(Usuarios user);
}
}

@ -0,0 +1,20 @@
using CORRESPONSALBackend.DTO;
using CORRESPONSALBackend.DTO.Usuario;
using CORRESPONSALBackend.Models;
namespace CORRESPONSALBackend.Contracts
{
public interface IPerfilesRepository
{
public Task<IEnumerable<Perfiles>> getPerfiles();
public Task<Perfiles> PerfilGetById(int id);
public Task<IEnumerable<Menu>> getMenu();
public Task<IEnumerable<PerfilesMenu>> getPerfilMenuById(int id);
public Task<IEnumerable<PerfilesMenu>> getAllPerfilesMenu();
public Task<IEnumerable<DTOPerfilCreate>> createPerfil(DTOPerfilCreate data);
public Task<IEnumerable<Menu>> createItemMenu(Menu data);
public Task<IEnumerable<DTOItemMenuPerfil>> asignaItemMenuPerfil(DTOItemMenuPerfil data);
public Task<IEnumerable<Transportistas>> getAllTransportistas(int id);
public Task<IEnumerable<Proveedores>> getAllProveedores(int id);
}
}

@ -0,0 +1,24 @@
using CORRESPONSALBackend.DTO;
using CORRESPONSALBackend.DTO.Usuario;
using CORRESPONSALBackend.Models;
namespace CORRESPONSALBackend.Contracts
{
public interface IUsuariosRepository
{
public Task<IEnumerable<DTOUsuariosShort>> getAllUsuariosShort();
public Task<IEnumerable<Usuarios>> getAllUsuarios();
public Task<Usuarios> GetUsuario(DTOLogin user);
public Task<int> searchUsuario(string user);
public Task<Usuarios> GetUsuarioById(int id);
public Task<Usuarios> createUsuario(DTOUsuario user);
public Task<DTOLogin> resetPassword(DTOResetPassword user);
public Task<DTOPINData> CreatePIN(int Id);
public Task<Boolean> ValidatePIN(DTOPINUsuario data);
public Task<IEnumerable<DTOClonarUsuario>> clonarUsuario(DTOClonarUsuario user);
public Task<IEnumerable<CatRoles>> CatalogoRolesGET();
public Task<IEnumerable<DTORolesAsignados>> RolesAsignadosGET(int id);
public Task<IEnumerable<DTOUsuariosPerfilParecido>> GETPerfilesParecidos(string Perfil);
public Task<Boolean> DisableUser(int id);
}
}

@ -0,0 +1,14 @@
using CORRESPONSALBackend.Models.Utils;
namespace CORRESPONSALBackend.Contracts.Utils
{
public interface IFileManagerRepository
{
public Task<FileManager> FileManager(FileManager data);
public Task<FileManager> getFileByProcess(long id, int Proceso);
public Task<List<FileManager>> getAllFilesByProcess(long Tags, int Proceso);
public Task<FileManager> getFileById(long id);
public Task deleteFileByProcess(long id, int Proceso);
}
}

@ -0,0 +1,10 @@
using System.Numerics;
using CORRESPONSALBackend.Models.Utils;
namespace CORRESPONSALBackend.Contracts.Utils
{
public interface IFilePaths4ProcessRepository
{
public Task<FilePaths4Process> getPaths4ProcessById(long id);
}
}

@ -0,0 +1,9 @@
using CORRESPONSALBackend.Models.Clientes.CasaCuervo;
namespace CORRESPONSALBackend.Contracts.Utils
{
public interface IPDFGenerator
{
public Task<byte[]> GeneratePdfFromString(string htmlContent);
}
}

@ -0,0 +1,11 @@
using CORRESPONSALBackend.DTO.Reportes;
using CORRESPONSALBackend.DTO.Corresponsales;
namespace CORRESPONSALBackend.Contracts
{
public interface IReportesRepository
{
public Task<IEnumerable<DTOCorresponsalTrafico>> GetRptCorresponsalesTraficos(DTOReporteCorresponsales data);
}
}

@ -0,0 +1,7 @@
namespace CORRESPONSALBackend.Contracts.Utils
{
public interface IValidaFraccion
{
public Boolean ValidaFraccion(string Fraccion);
}
}

@ -0,0 +1,206 @@
using CORRESPONSALBackend.Models;
using Microsoft.IdentityModel.Tokens;
using System.IdentityModel.Tokens.Jwt;
using System.Security.Claims;
using System.Text;
using Microsoft.AspNetCore.Mvc;
using CORRESPONSALBackend.Contracts;
using CORRESPONSALBackend.DTO;
using Microsoft.AspNetCore.Authorization;
using CORRESPONSALBackend.DTO.Usuario;
using CORRESPONSALBackend.Services.Utilerias;
using CORRESPONSALBackend.Clientes.ZincInternacional.DTO;
namespace CORRESPONSALBackend.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class AuthController : ControllerBase
{
public IConfiguration _config;
private readonly IUsuariosRepository _usuariosRepo;
private readonly IPerfilesRepository _perfilesRepo;
private readonly IMenuRepository _menuRepo;
public AuthController(IConfiguration config, IUsuariosRepository usuariosRepo, IMenuRepository menuRepo, IPerfilesRepository perfilesRepo)
{
_config = config;
_usuariosRepo = usuariosRepo;
_perfilesRepo = perfilesRepo;
_menuRepo = menuRepo;
}
[HttpPost]
public async Task<IActionResult> Post(DTOLogin _userData)
{
if (_userData.Contrasena == _config.GetValue<string>("DefaultUser:Password"))
{
return StatusCode(401, "La primera vez que accese debera cambiar su contraseña!");
}
if (_userData != null && _userData.Usuario != null && _userData.Contrasena != null)
{
var user = await _usuariosRepo.GetUsuario(_userData);
if (user == null) return BadRequest("Invalid credentials");
if (user != null)
{
var menu = await _menuRepo.GetItemsMenu(user);
var claims = new List<Claim>();
var ProfileData = await _perfilesRepo.PerfilGetById(user.Id);
claims.Add(new Claim(JwtRegisteredClaimNames.Sub, _config["Jwt:Subject"]));
claims.Add(new Claim(JwtRegisteredClaimNames.Jti, Guid.NewGuid().ToString()));
claims.Add(new Claim(JwtRegisteredClaimNames.Iat, DateTime.UtcNow.ToString()));
claims.Add(new Claim("UserId", user.Id.ToString()));
claims.Add(new Claim("Usuario", user.Usuario));
claims.Add(new Claim("Departamento", (user.sDept ?? user.sDept ?? "No asignado")));
claims.Add(new Claim("UserType", (user != null) ? user.TipoUsuario.ToString() : "0"));
claims.Add(new Claim("Perfil", ProfileData.Perfil));
foreach (Menu item in menu) { claims.Add(new Claim(ClaimTypes.Role, item.Url)); }
var key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(_config["Jwt:Key"]));
var signIn = new SigningCredentials(key, SecurityAlgorithms.HmacSha256);
var token = new JwtSecurityToken(
_config["Jwt:Issuer"],
_config["Jwt:Audience"],
claims,
expires: DateTime.UtcNow.AddHours(Int32.Parse(_config["Jwt:ExpirationHours"])),
//expires: DateTime.UtcNow.AddMinutes(5),
signingCredentials: signIn);
var _token = new JwtSecurityTokenHandler().WriteToken(token);
return new OkObjectResult(new { menu = menu, token = _token });
}
else
{
return BadRequest("Invalid credentials");
}
}
else
{
return BadRequest();
}
}
[HttpGet]
[Route("GetPermissions")]
public async Task<IActionResult> GetPermissions(string Usuario, string Contrasena)
{
DTOLogin _userData = new DTOLogin();
_userData.Usuario = Usuario;
_userData.Contrasena = Contrasena;
if (_userData.Contrasena == _config.GetValue<string>("DefaultUser:Password"))
{
return StatusCode(401, "La primera vez que accese debera cambiar su contraseña!");
}
if (_userData != null && _userData.Usuario != null && _userData.Contrasena != null)
{
var user = await _usuariosRepo.GetUsuario(_userData);
if (user == null) return BadRequest("Invalid credentials");
if (user != null)
{
var menu = await _menuRepo.GetItemsMenu(user);
var claims = new List<Claim>();
foreach (Menu item in menu) { claims.Add(new Claim(ClaimTypes.Role, item.Url)); }
var key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(_config["Jwt:Key"]));
var signIn = new SigningCredentials(key, SecurityAlgorithms.HmacSha256);
var token = new JwtSecurityToken(
_config["Jwt:Issuer"],
_config["Jwt:Audience"],
claims,
expires: DateTime.UtcNow.AddHours(Int32.Parse(_config["Jwt:ExpirationHours"])),
//expires: DateTime.UtcNow.AddMinutes(5),
signingCredentials: signIn);
var _token = new JwtSecurityTokenHandler().WriteToken(token);
return new OkObjectResult(new { menu = menu, token = _token });
}
else
{
return BadRequest("Invalid credentials");
}
}
else
{
return BadRequest();
}
}
[HttpPost]
[Route("forgotPassword")]
public async Task<IActionResult> forgotPassword(DTOLogin userData)
{
if (userData == null) return BadRequest(new { respuesta = "Usuario invalido" });
int IdUser = await _usuariosRepo.searchUsuario(userData.Usuario);
if (IdUser > 0) // Es un usuario del ZINC
{
DTOPINData PINData = await _usuariosRepo.CreatePIN(IdUser);
string htmlContent = $@"<table>
<tr><td>Estimado usuario, mediante este correo se le notifica que esta en proceso de cambiar su contraseña</td></tr>
<tr><td>Se ha generado un PIN para poder cambiar su contraseña. PIN : <b>{PINData.PIN}</b> </td></tr>
<tr><td>El PIN tiene un tiempo de vida de 10 minutos, a partir de su generacion, despues de ese tiempo caduca</td></tr>
<tr><td>Si usted <b>no</b> es quien ha activando este mecanismo, favor de ponerse en contacto con personal de ZINC</td></tr>
</table>";
if (PINData.PIN > 0)
{
Utilerias email = new Utilerias(_config);
var dataEmail = new DTOSendEmail()
{
To = PINData.Correo,
Subject = "Corresponsal: Se le generado un PIN para el cambio de su contraseña, expira en 10 minutos",
Text = "Corresponsal: Se le generado un PIN para el cambio de su contraseña, expira en 10 minutos",
Html = htmlContent
};
await email.SendEmail(dataEmail);
return new OkObjectResult(new { respuesta = "Continua con el proceso" });
}
}
return BadRequest(new { respuesta = "Invalid Request" });
}
[HttpPost]
[Route("validatePIN")]
public async Task<IActionResult> validatePIN(DTOPINUsuario userData)
{
var PINUsuario = await _usuariosRepo.ValidatePIN(userData);
if (!PINUsuario)
{
return StatusCode(403, "Acceso denegado");
}
return new OkObjectResult(new { respuesta = "Continua con el proceso" });
}
[Route("resetPassword")]
[HttpPost]
public async Task<IActionResult> resetPassword(DTOResetPassword data)
{
try
{
var result = await _usuariosRepo.resetPassword(data);
if (result.Usuario == null)
{
return StatusCode(400, "Cuenta de usuario no existe");
}
return Ok(result);
}
catch (Exception ex)
{
return StatusCode(500, ex);
}
}
[HttpGet]
[Route("GetEnvironment")]
public IActionResult GetEnvironment()
{
return StatusCode(200, Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") + ' ' + _config.GetValue<string>("AmazonPyAPI"));
}
[Authorize]
[Route("Validate")]
[HttpGet]
public IActionResult GetValidation()
{
return StatusCode(200, "Its Ok");
}
}
}

@ -0,0 +1,56 @@
using CORRESPONSALBackend.Models.Catalogos;
using CORRESPONSALBackend.Contracts.Catalogos;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authorization;
namespace CORRESPONSALBackend.Controllers.Catalogos
{
[Authorize]
[Route("api/Catalogos/[controller]")]
public class CorresponsalesController : Controller
{
private readonly ICorresponsalesRepository _Repo;
private readonly IConfiguration _config;
private readonly string ZipsCorresponsalesPath;
private readonly string CorresponsalesFilePath;
public CorresponsalesController(ICorresponsalesRepository Repo, IConfiguration config)
{
_config = config;
_Repo = Repo;
ZipsCorresponsalesPath = _config.GetValue<string>("pathZipCorresponsales");
CorresponsalesFilePath = _config.GetValue<string>("CorresponsalesFilePath");
}
[Route("getAll")]
[HttpGet]
public async Task<IEnumerable<CatCorresponsales>> GatAll()
{
var entrada = await _Repo.GetAll();
return entrada;
}
[Route("getAllFormated")]
[HttpGet]
public async Task<IEnumerable<CatCorresponsales>> getAllFormated()
{
var entrada = await _Repo.GetAllFormated();
return entrada;
}
[Route("Append")]
[HttpPost]
public async Task<CatCorresponsales> Append([FromBody] CatCorresponsales data)
{
var entrada = await _Repo.Append(data);
return entrada;
}
[HttpDelete("Delete/{id}")]
public async Task<CatCorresponsales> Delete(int id)
{
return await _Repo.Delete(id);
}
}
}

@ -0,0 +1,47 @@
using CORRESPONSALBackend.Contracts.Catalogos;
using CORRESPONSALBackend.Models;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace CORRESPONSALBackend.Controllers.Catalogos
{
[Authorize]
[Route("api/Catalogos/Corresponsales/[controller]")]
[ApiController]
public class ProveedoresController : Controller
{
private readonly IProveedoresRepository _Repo;
private readonly IConfiguration _config;
public ProveedoresController(IProveedoresRepository Repo, IConfiguration config)
{
_config = config;
_Repo = Repo;
}
/// Catalogo de Proveedores
[HttpGet]
[Route("getAll")]
public async Task<IEnumerable<CatProveedores>> GetAll(int Clasificacion)
{
var entrada = await _Repo.GetAll(Clasificacion);
return entrada;
}
[HttpPost]
[Route("Append")]
public async Task<CatProveedores> Append([FromBody] CatProveedores data)
{
var entrada = await _Repo.Append(data);
return entrada;
}
[HttpDelete("Delete/{id}")]
public async Task<IActionResult> Delete(int id)
{
await _Repo.Delete(id);
return new OkObjectResult(new { respuesta = "Se elimino el registro" });
}
}
}

@ -0,0 +1,52 @@
using CORRESPONSALBackend.Contracts.Catalogos;
using CORRESPONSALBackend.Models.Catalogos;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace CORRESPONSALBackend.Controllers.Catalogos
{
[Authorize]
[Route("api/Catalogos/[controller]")]
public class TabuladorController : ControllerBase
{
private readonly ITabuladorRepository _Repo;
private readonly IConfiguration _config;
public TabuladorController(ITabuladorRepository Repo, IConfiguration config)
{
_config = config;
_Repo = Repo;
}
[HttpGet]
[Route("getAll")]
public async Task<IEnumerable<Tabulador>> GetAll(int id, int IdCliente)
{
return await _Repo.GetAll(id, IdCliente);
}
[HttpGet]
[Route("getByCustomer")]
public async Task<IEnumerable<Tabulador>> GetByCustomer(int IdCliente)
{
return await _Repo.GetAll(0, IdCliente);
}
[HttpPost]
[Route("Append")]
public async Task<Tabulador> Post([FromBody] Tabulador data)
{
return await _Repo.Append(data);
}
[HttpDelete("Delete/{id}")]
public async Task<IActionResult> Delete(int id)
{
await _Repo.Delete(id);
return new OkObjectResult(new { respuesta = "Se elimino el registro" });
}
}
}

@ -0,0 +1,58 @@
using CORRESPONSALBackend.Contracts.Catalogos;
using CORRESPONSALBackend.Models.Catalogos;
using CORRESPONSALBackend.DTO;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authorization;
namespace CORRESPONSALBackend.Controllers.Catalogos
{
[Authorize]
[Route("api/Catalogos/[controller]")]
[ApiController]
public class TabuladorDetalleController : ControllerBase
{
private readonly ITabuladorDetalleRepository _Repo;
private readonly IConfiguration _config;
public TabuladorDetalleController(ITabuladorDetalleRepository Repo, IConfiguration config)
{
_config = config;
_Repo = Repo;
}
[HttpGet]
[Route("getDetailByIdTab")]
public async Task<IEnumerable<TabuladorDetalle>> GetDetailByIdTab(int id)
{
return await _Repo.GetDetailByIdTab(id);
}
[HttpGet]
[Route("getAll")]
public async Task<IEnumerable<TabuladorDetalle>> GetAll(int id, int IdTabulador)
{
return await _Repo.GetAll(id, IdTabulador);
}
[HttpGet]
[Route("Conceptos/getAllConcepts")]
public async Task<IEnumerable<DTOConceptos>> GetAllConcepts()
{
return await _Repo.GetAllConcepts();
}
[HttpPost]
[Route("Append")]
public async Task<IEnumerable<TabuladorDetalle>> Post([FromBody] TabuladorDetalle data)
{
return await _Repo.Append(data);
}
[HttpDelete("Delete/{id}")]
public async Task<IActionResult> Delete(int id)
{
await _Repo.Delete(id);
return new OkObjectResult(new { respuesta = "Se elimino el registro" });
}
}
}

@ -0,0 +1,99 @@
using CORRESPONSALBackend.Contracts;
using CORRESPONSALBackend.DTO.Cliente;
using CORRESPONSALBackend.DTO.Usuario;
using CORRESPONSALBackend.Models;
using Microsoft.AspNetCore.Mvc;
namespace CORRESPONSALBackend.Controllers
{
[Route("api/[controller]")]
public class ClientesController : Controller
{
private readonly IClientesRepository _clientesRepo;
public ClientesController(IClientesRepository clientesRepo)
{
_clientesRepo = clientesRepo;
}
[Route("getAllClientes")]
[HttpGet]
public async Task<IActionResult> GetAllClientes(int id)
{
try
{
var clientes = await _clientesRepo.getAllClientes(id);
return Ok(clientes);
}
catch (Exception ex)
{
//log error
return StatusCode(500, ex.Message);
}
}
[Route("getClientesAsignados")]
[HttpGet]
public async Task<IActionResult> GetClientesAsignados(int id)
{
try
{
var clientes = await _clientesRepo.getClientesAsignados(id);
return Ok(clientes);
}
catch (Exception ex)
{
//log error
return StatusCode(500, ex.Message);
}
}
[Route("addCliente")]
[HttpPost]
public async Task<IActionResult> Post([FromBody] DTOClienteUsuario CC)
{
try
{
var clientes = await _clientesRepo.addCliente(CC);
return Ok(clientes);
}
catch (Exception ex)
{
//log error
return StatusCode(500, ex.Message);
}
}
[Route("asignaClienteProveedor")]
[HttpPost]
public async Task<IActionResult> Post([FromBody] DTOClienteProveedor cp)
{
try
{
var result = await _clientesRepo.asignaClienteProveedor(cp);
return Ok(result);
}
catch (Exception ex)
{
//log error
return StatusCode(500, ex.Message);
}
}
[Route("asignaClienteTransportista")]
[HttpPost]
public async Task<IActionResult> Post([FromBody] DTOUsuarioTransportista t)
{
try
{
var result = await _clientesRepo.asignaUsuarioTransportista(t);
return Ok(result);
}
catch (Exception ex)
{
//log error
return StatusCode(500, ex.Message);
}
}
}
}

@ -0,0 +1,38 @@
using CORRESPONSALBackend.Contracts.Contabilidad.Corresponsalias;
using CORRESPONSALBackend.Models.Corresponsales;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace CORRESPONSALBackend.Controllers.Contabilidad.Corresponsales
{
[Authorize]
[Route("api/Contabilidad/Corresponsales/[controller]")]
[ApiController]
public class ContabilidadTraficoController : ControllerBase
{
private readonly IContabilidadCorresponsaliasRepository _Repo;
private readonly IConfiguration _config;
public ContabilidadTraficoController(IContabilidadCorresponsaliasRepository Repo, IConfiguration config)
{
_config = config;
_Repo = Repo;
}
[HttpPost]
[Route("Validacion")]
public async Task<CorresponsalTraficoContabilidad> Validacion([FromBody] CorresponsalTraficoContabilidad data)
{
var entrada = await _Repo.Append(data);
return entrada;
}
[HttpGet]
[Route("Get")]
public async Task<IEnumerable<string>> Get(int IdTrafico, int tipo)
{
var entrada = await _Repo.Get(IdTrafico, tipo);
return entrada;
}
}
}

@ -0,0 +1,66 @@
using CORRESPONSALBackend.Contracts.Corresponsalias;
using CORRESPONSALBackend.Models;
using CORRESPONSALBackend.DTO.Corresponsales;
using CORRESPONSALBackend.Models.Corresponsales;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authorization;
namespace CORRESPONSALBackend.Controllers.Corresponsalias
{
[Authorize]
[Route("api/Corresponsalias/[controller]")]
[ApiController]
public class AnticiposController : Controller
{
private readonly ICorresponsaliasAnticiposRepository _Repo;
private readonly IConfiguration _config;
public AnticiposController(ICorresponsaliasAnticiposRepository Repo, IConfiguration config)
{
_config = config;
_Repo = Repo;
}
[HttpPost]
[Route("Append")]
public async Task<CorresponsalAnticipos> Append([FromBody] CorresponsalAnticipos data)
{
var entrada = await _Repo.Append(data);
return entrada;
}
[HttpGet]
[Route("Get")]
public async Task<IEnumerable<CorresponsalAnticipos>> GetAll([FromQuery] int IdTrafico)
{
var entrada = await _Repo.getAll(IdTrafico);
return entrada;
}
[HttpDelete("Delete/{id}")]
public async Task<IActionResult> Delete(int id)
{
await _Repo.Delete(id);
return new OkObjectResult(new { respuesta = "Se elimino el registro" });
}
[HttpGet]
[Route("getPendientesAutorizar")]
public async Task<DashboardTotal> GetTotalAnticiposPendientes()
{
var entrada = await _Repo.GetTotalAnticiposPendientes();
return entrada;
}
[HttpPost]
[Route("Autoriza")]
public async Task<CorresponsalAnticipos> Autoriza([FromBody] DTOCorresponsalesAnticipo data)
{
var entrada = await _Repo.Autoriza(data);
return entrada;
}
}
}

@ -0,0 +1,31 @@
using CORRESPONSALBackend.Contracts.Corresponsalias;
using CORRESPONSALBackend.Models.Corresponsales;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace CORRESPONSALBackend.Controllers.Corresponsalias
{
[Authorize]
[ApiController]
[Route("api/Corresponsalias/[controller]")]
public class CatAduanasController : ControllerBase
{
private readonly ICorresponsaliasCatAduanasRepository _Repo;
private readonly IConfiguration _config;
public CatAduanasController(ICorresponsaliasCatAduanasRepository Repo, IConfiguration config)
{
_config = config;
_Repo = Repo;
}
[HttpGet]
[Route("GetAll")]
public async Task<IEnumerable<CorresponsalCatAduanas>> GetAll([FromQuery] int IdCliente)
{
var entrada = await _Repo.getAll(IdCliente);
return entrada;
}
}
}

@ -0,0 +1,30 @@
using CORRESPONSALBackend.Contracts.Corresponsalias;
using CORRESPONSALBackend.Models.Corresponsales;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace CORRESPONSALBackend.Controllers.Corresponsalias
{
[Authorize]
[ApiController]
[Route("api/Corresponsalias/[controller]")]
public class CatDestinosController : ControllerBase
{
private readonly ICorresponsaliasCatDestinosRepository _Repo;
private readonly IConfiguration _config;
public CatDestinosController(ICorresponsaliasCatDestinosRepository Repo, IConfiguration config)
{
_config = config;
_Repo = Repo;
}
[HttpGet]
[Route("GetAll")]
public async Task<IEnumerable<CorresponsalCatDestinos>> GetAll([FromQuery] int IdCliente)
{
var entrada = await _Repo.getAll(IdCliente);
return entrada;
}
}
}

@ -0,0 +1,29 @@
using CORRESPONSALBackend.Contracts.Corresponsalias;
using CORRESPONSALBackend.Models.Corresponsales;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace CORRESPONSALBackend.Controllers.Corresponsalias
{
[ApiController]
[Route("api/Corresponsalias/[controller]")]
public class CatMediosEmbarquesController : Controller
{
private readonly ICorresponsaliasCatMediosEmbarqueRepository _Repo;
private readonly IConfiguration _config;
public CatMediosEmbarquesController(ICorresponsaliasCatMediosEmbarqueRepository Repo, IConfiguration config)
{
_config = config;
_Repo = Repo;
}
[HttpGet]
[Route("GetAll")]
public async Task<IEnumerable<CorresponsalCatMediosEmbarque>> GetAll()
{
var entrada = await _Repo.getAll();
return entrada;
}
}
}

@ -0,0 +1,33 @@
using CORRESPONSALBackend.Contracts.Corresponsalias;
using CORRESPONSALBackend.Models;
using CORRESPONSALBackend.DTO.Corresponsales;
using CORRESPONSALBackend.Models.Corresponsales;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authorization;
namespace CORRESPONSALBackend.Controllers.Corresponsalias
{
[Authorize]
[ApiController]
[Route("api/Corresponsalias/[controller]")]
public class CatTiposDocumento : Controller
{
private readonly ICorresponsaliasCatTiposDocumentosRepository _Repo;
private readonly IConfiguration _config;
public CatTiposDocumento(ICorresponsaliasCatTiposDocumentosRepository Repo, IConfiguration config)
{
_config = config;
_Repo = Repo;
}
[HttpGet]
[Route("Get")]
public async Task<IEnumerable<CorresponsalCatTiposDocumento>> GetAll([FromQuery] int Cliente, int Clasificacion)
{
var entrada = await _Repo.getAll(Cliente, Clasificacion);
return entrada;
}
}
}

@ -0,0 +1,30 @@
using CORRESPONSALBackend.Contracts.Corresponsalias;
using CORRESPONSALBackend.Models.Corresponsales;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace CORRESPONSALBackend.Controllers.Corresponsalias
{
// [Authorize]
[ApiController]
[Route("api/Corresponsalias/[controller]")]
public class CatTiposEmbarqueController : ControllerBase
{
private readonly ICorresponsaliasCatTipoEmbarqueRepository _Repo;
private readonly IConfiguration _config;
public CatTiposEmbarqueController(ICorresponsaliasCatTipoEmbarqueRepository Repo, IConfiguration config)
{
_config = config;
_Repo = Repo;
}
[HttpGet]
[Route("GetAll")]
public async Task<IEnumerable<CorresponsalCatTipoEmbarque>> GetAll()
{
var entrada = await _Repo.getAll();
return entrada;
}
}
}

@ -0,0 +1,47 @@
using CORRESPONSALBackend.Contracts.Corresponsalias;
using CORRESPONSALBackend.Models.Corresponsales;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace CORRESPONSALBackend.Controllers.Corresponsalias
{
[Authorize]
[Route("api/Corresponsalias/[controller]")]
[ApiController]
public class ContenedoresController : Controller
{
private readonly ICorresponsaliasContenedoresRepository _Repo;
private readonly IConfiguration _config;
public ContenedoresController(ICorresponsaliasContenedoresRepository Repo, IConfiguration config)
{
_config = config;
_Repo = Repo;
}
/// Corresponsales : Contenedores
[HttpGet]
[Route("getAll")]
public async Task<IEnumerable<CorresponsalesContenedores>> GetAllCorresponsalesContenedores([FromQuery] int IdTrafico)
{
var entrada = await _Repo.GetAll(IdTrafico);
return entrada;
}
[HttpPost]
[Route("Append")]
public async Task<CorresponsalesContenedores> CreateUpdateCorresponsalesContenedores([FromBody] CorresponsalesContenedores data)
{
var entrada = await _Repo.Append(data);
return entrada;
}
[HttpDelete("Delete/{id}")]
public async Task<IActionResult> DeleteCorresponsalesContenedores(int id)
{
await _Repo.Delete(id);
return new OkObjectResult(new { respuesta = "Se elimino el registro" });
}
}
}

@ -0,0 +1,91 @@
using CORRESPONSALBackend.Contracts.Corresponsalias;
using CORRESPONSALBackend.Models;
using CORRESPONSALBackend.DTO.Corresponsales;
using CORRESPONSALBackend.Models.Corresponsales;
using CORRESPONSALBackend.Contracts.Utils;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authorization;
namespace CORRESPONSALBackend.Controllers.Corresponsalias
{
[ApiController]
[Route("api/Corresponsalias/[controller]")]
public class CuentasComplementariasController : ControllerBase
{
// private readonly IFileManagerRepository _RepoFileManager;
private readonly ICorresponsaliasCuentasComplementarias _Repo;
private readonly IConfiguration _config;
public CuentasComplementariasController(ICorresponsaliasCuentasComplementarias Repo, IConfiguration config)
{
_config = config;
_Repo = Repo;
// _RepoFileManager = RepoFileManager;
}
[HttpPost]
[Route("Append")]
public async Task<CorresponsalCuentasComplementarias> Append([FromBody] DTOCorresponsalCuentaComplementaria data)
{
var entrada = await _Repo.Append(data);
return entrada;
}
[HttpGet]
[Route("Get")]
public async Task<IEnumerable<CorresponsalCuentasComplementarias>> Get([FromQuery] int IdTrafico)
{
var entrada = await _Repo.Get(IdTrafico);
return entrada;
}
[HttpGet]
[Route("GetPendientes")]
public async Task<DashboardTotal> GetPendientes()
{
var entrada = await _Repo.GetPendientes();
return entrada;
}
[HttpGet]
[Route("GetEstatus")]
public async Task<IEnumerable<CorresponsalCuentasComplementariasEstatus>> GetEstatus()
{
var entrada = await _Repo.GetEstatus();
return entrada;
}
[HttpPost]
[Route("AppendEstatus")]
public async Task<CorresponsalCuentasComplementariasEstatus> AppendEstatus(CorresponsalCuentasComplementariasEstatus data)
{
var entrada = await _Repo.AppendEstatus(data);
return entrada;
}
[HttpPost]
[Route("ChangeEstatus")]
public async Task<Boolean> ChangeEstatus([FromBody] DTOCorresponsalCuentaComplementariaEstatus data)
{
var entrada = await _Repo.ChangeEstatus(data);
return true;
}
[HttpGet]
[Route("GetLogEstatus")]
public async Task<IEnumerable<DTOLogCorresposalCuentaComplementaria>> GetLogEstatus(int id)
{
var entrada = await _Repo.GetLogEstatus(id);
return entrada;
}
[HttpPut("ClearFile/{IDCuenta}/{witchFile}")]
public async Task<Boolean> ClearFile(int IDCuenta, byte witchFile)
{
var entrada = await _Repo.ClearFile(IDCuenta, witchFile);
return entrada;
}
}
}

@ -0,0 +1,57 @@
using System.IO.Compression;
using CORRESPONSALBackend.Contracts.Corresponsalias;
using CORRESPONSALBackend.Models.Corresponsales;
using CORRESPONSALBackend.Services.C1896;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace CORRESPONSALBackend.Controllers.Corresponsalias
{
[Authorize]
[Route("api/Corresponsalias/[controller]")]
[ApiController]
public class FacturasController : Controller
{
private readonly ICorresponsaliasFacturasRepository _Repo;
private readonly IConfiguration _config;
public FacturasController(ICorresponsaliasFacturasRepository Repo, IConfiguration config)
{
_config = config;
_Repo = Repo;
}
/// Corresponsales: Facturas
[HttpGet]
[Route("getAll")]
public async Task<IEnumerable<CorresponsalFacturas>> GetAll([FromQuery] int idTrafico)
{
var entrada = await _Repo.GetAll(idTrafico);
return entrada;
}
[HttpPost]
[Route("Append")]
public async Task<CorresponsalFacturas> Append([FromBody] CorresponsalFacturas data)
{
var entrada = await _Repo.Append(data);
return entrada;
}
[HttpDelete("Delete/{id}")]
public async Task<IActionResult> DeleteCorresponsalesFacturas(int id)
{
await _Repo.Delete(id);
return new OkObjectResult(new { respuesta = "Se elimino el registro" });
}
//----------------------------------------------------------------------------------------------------------------------------------
/* [HttpGet]
[Route("uploadI1896Templete")]
public async Task<IEnumerable<I1896TempleteUpload>> UploadI1868Templete([FromQuery] int idTrafico)
{
SrvUploadTemplete Srv = new SrvUploadTemplete();
return Srv.ReadDataFromFile(@"c:\data\layout_omg_alen.txt");
}
*/
}
}

@ -0,0 +1,53 @@
using CORRESPONSALBackend.Contracts.Corresponsalias;
using CORRESPONSALBackend.Models.Corresponsales;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace CORRESPONSALBackend.Controllers.Corresponsalias
{
[Authorize]
[Route("api/Corresponsalias/[controller]")]
[ApiController]
public class FacturasTercerosController : Controller
{
private readonly ICorresponsaliasFacturasTercerosRepository _Repo;
private readonly IConfiguration _config;
public FacturasTercerosController(ICorresponsaliasFacturasTercerosRepository Repo, IConfiguration config)
{
_config = config;
_Repo = Repo;
}
[HttpGet]
[Route("getAll")]
public async Task<IEnumerable<CorresponsalFacturasTerceros>> GetAll([FromQuery] int idTrafico)
{
var entrada = await _Repo.GetAll(idTrafico);
return entrada;
}
[HttpPost]
[Route("Append")]
public async Task<IActionResult> Append([FromBody] CorresponsalFacturasTerceros data)
{
var entrada = await _Repo.Append(data);
if (entrada.id < 0)
{
return StatusCode(409, new { registro = entrada, respuesta = "Esa factura ya se ha registrado previamente" });
}
else
{
return StatusCode(200, new { registro = entrada, respuesta = "La factura se ha agregado exitosamente" });
}
}
[HttpDelete("Delete/{id}")]
public async Task<IActionResult> Delete(int id)
{
await _Repo.Delete(id);
return new OkObjectResult(new { respuesta = "Se elimino el registro" });
}
//----------------------------------------------------------------------------------------------------------------------------------
}
}

@ -0,0 +1,46 @@
using CORRESPONSALBackend.Contracts.Corresponsalias;
using CORRESPONSALBackend.Models.Corresponsales;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace CORRESPONSALBackend.Controllers.Corresponsalias
{
[Authorize]
[Route("api/Corresponsalias/[controller]")]
[ApiController]
public class GuiasController : ControllerBase
{
private readonly ICorresponsaliasGuiasRepository _Repo;
private readonly IConfiguration _config;
public GuiasController(ICorresponsaliasGuiasRepository Repo, IConfiguration config)
{
_config = config;
_Repo = Repo;
}
[HttpGet]
[Route("getAll")]
public async Task<IEnumerable<CorresponsalesGuias>> GetAllCorresponsalesGuias([FromQuery] int IdTrafico)
{
var entrada = await _Repo.GetAll(IdTrafico);
return entrada;
}
[HttpPost]
[Route("Append")]
public async Task<CorresponsalesGuias> CreateUpdateCorresponsalesGuias([FromBody] CorresponsalesGuias data)
{
var entrada = await _Repo.Append(data);
return entrada;
}
[HttpDelete("Delete/{id}")]
public async Task<IActionResult> DeleteCorresponsalesGuias(int id)
{
await _Repo.Delete(id);
return new OkObjectResult(new { respuesta = "Se elimino el registro" });
}
}
}

@ -0,0 +1,47 @@
using CORRESPONSALBackend.Contracts.Corresponsalias;
using CORRESPONSALBackend.Models.Corresponsales;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace CORRESPONSALBackend.Controllers.Corresponsalias
{
[Authorize]
[ApiController]
[Route("api/Corresponsalias/[controller]")]
public class PedimentoController : ControllerBase
{
private readonly ICorresponsaliasPedimentoRepository _Repo;
private readonly IConfiguration _config;
public PedimentoController(ICorresponsaliasPedimentoRepository Repo, IConfiguration config)
{
_config = config;
_Repo = Repo;
}
[HttpPost]
[Route("Append")]
public async Task<CorresponsalPedimento> Append([FromBody] CorresponsalPedimento data)
{
data.Activo = 1;
var entrada = await _Repo.Append(data);
return entrada;
}
[HttpGet]
[Route("Get")]
public async Task<CorresponsalPedimento> Get([FromQuery] int IdTrafico)
{
var entrada = await _Repo.Get(IdTrafico);
return entrada;
}
[HttpDelete("Delete/{id}")]
public async Task<IActionResult> Delete(int id)
{
await _Repo.Delete(id);
return new OkObjectResult(new { respuesta = "Se elimino el registro" });
}
}
}

@ -0,0 +1,55 @@
using CORRESPONSALBackend.Contracts.Corresponsalias;
using CORRESPONSALBackend.Models.Corresponsales;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace CORRESPONSALBackend.Controllers.Corresponsalias
{
[Authorize]
[ApiController]
[Route("api/Corresponsalias/[controller]")]
public class PedimentoPartidaController : ControllerBase
{
private readonly ICorresponsaliasPedimentoPartidasRepository _Repo;
private readonly IConfiguration _config;
public PedimentoPartidaController(ICorresponsaliasPedimentoPartidasRepository Repo, IConfiguration config)
{
_config = config;
_Repo = Repo;
}
[HttpGet]
[Route("GetAll")]
public async Task<IEnumerable<CorresponsalPedimentoPartida>> GetAll([FromQuery] int idTrafico)
{
var entrada = await _Repo.getAll(idTrafico);
return entrada;
}
[HttpPost]
[Route("Append")]
public async Task<CorresponsalPedimentoPartida> Append([FromBody] CorresponsalPedimentoPartida data)
{
var entrada = await _Repo.Append(data);
if (entrada.id < 0)
{
// return StatusCode(409, new { respuesta = "Esa partida ya se ha registrado previamente" });
data.id = -1;
return data;
}
else
{
return entrada;
}
}
[HttpDelete("Delete/{id}")]
public async Task<IActionResult> Delete(int id)
{
await _Repo.Delete(id);
return new OkObjectResult(new { respuesta = "Se elimino el registro" });
}
}
}

@ -0,0 +1,44 @@
using Microsoft.AspNetCore.Mvc;
using CORRESPONSALBackend.Contracts.Corresponsalias;
using CORRESPONSALBackend.Models.Corresponsales;
using Microsoft.AspNetCore.Authorization;
namespace CORRESPONSALBackend.Controllers.Corresponsalias
{
[Authorize]
[Route("api/Corresponsalias/[controller]")]
[ApiController]
public class PrecuentaController : ControllerBase
{
private readonly ICorresponsaliasPrecuentaRepository _Repo;
private readonly IConfiguration _config;
public PrecuentaController(ICorresponsaliasPrecuentaRepository Repo, IConfiguration config)
{
_config = config;
_Repo = Repo;
}
[HttpGet]
[Route("getAll")]
public async Task<IEnumerable<IPrecuenta>> GetAll([FromQuery] int id, int IdTrafico)
{
return await _Repo.GetAll(id, IdTrafico);
}
[HttpDelete("ChangeStatus/{id}")]
public async Task<IActionResult> ChangeStatus(int id)
{
await _Repo.ChangeStatus(id);
return new OkObjectResult(new { respuesta = "La informacion se actualizo" });
}
[HttpPut("Append/{IdTabulador}/{IdTrafico}")]
public async Task<IEnumerable<IPrecuenta>> Append(int IdTabulador, int IdTrafico)
{
var entrada = await _Repo.Append(IdTabulador, IdTrafico);
return entrada;
}
}
}

@ -0,0 +1,131 @@
using CORRESPONSALBackend.Contracts.Corresponsalias;
using CORRESPONSALBackend.Models;
using CORRESPONSALBackend.Models.Corresponsales;
using CORRESPONSALBackend.DTO.Corresponsales;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using CORRESPONSALBackend.Services.C1896;
using CORRESPONSALBackend.Repository.Corresponsalias;
namespace CORRESPONSALBackend.Controllers.Corresponsalias
{
[Authorize]
[Route("api/Corresponsalias/[controller]")]
[ApiController]
public class TraficosController : Controller
{
private readonly ICorresponsaliasTraficosRepository _Repo;
private readonly ICorresponsaliasFacturasRepository _RepoFacturas;
private readonly ICorresponsaliasContenedoresRepository _RepoContenedores;
private readonly IConfiguration _config;
public TraficosController(ICorresponsaliasTraficosRepository Repo, ICorresponsaliasFacturasRepository RepoFacturas, ICorresponsaliasContenedoresRepository RepoContenedores, IConfiguration config)
{
_config = config;
_Repo = Repo;
_RepoFacturas = RepoFacturas;
_RepoContenedores = RepoContenedores;
}
/// Corresponsales: Traficos
[HttpGet]
[Route("getTotal")]
public async Task<DashboardTotal> GetAll(int Mode)
{
var entrada = await _Repo.GetAll(Mode);
return entrada;
}
[HttpGet]
[Route("Get")]
public async Task<ITrafico> Get([FromQuery] int id)
{
var entrada = await _Repo.Get(id);
return entrada;
}
[HttpPut("AddRectificacion/{id}")]
public async Task<ICorRectificaciones> AddRectificacion(int id)
{
var entrada = await _Repo.AddRectificacion(id);
return entrada;
}
[HttpGet]
[Route("GetRectificaciones")]
public async Task<IEnumerable<ICorRectificaciones>> GetRectificaciones([FromQuery] int id)
{
var entrada = await _Repo.GetRectificaciones(id);
return entrada;
}
[HttpPost]
[Route("Append")]
public async Task<ITrafico> Append([FromBody] ITrafico data)
{
var entrada = await _Repo.Append(data);
return entrada;
}
[HttpGet]
[Route("GetCorTraficoEstatus")]
public async Task<IEnumerable<CorresponsalesTraficoEstatus>> GetCorresponsalesTraficoEstatus()
{
var entrada = await _Repo.GetTraficoEstatus();
return entrada;
}
[HttpPut("ValidateComplete/{id}")]
public async Task<ActionResult> ValidateComplete(int id, [FromBody] DTOTraficoCompleto data)
{
var entrada = await _Repo.ValidaTraficoCompleto(data);
return Ok(new { respuesta = "Informacion completa" });
}
[HttpPost]
[Route("AutoAppendI1896")]
public async Task<ITrafico> AutoAppendI1896()
{
ITrafico data = new ITrafico();
data.IdUsuario = 1;
data.IdCliente = 1896;
data.TipoOperacion = 2;
data.OpEntrada = 4;
data.OpSalida = 4;
data.IdCorresponsal = 5;
var entrada = await _Repo.Append(data);
return entrada;
}
[HttpPost]
[Route("Upload1896File")]
public async Task<List<I1896TempleteUpload>> Upload1896File(IFormFile Archivo, int id)
{
string tempPath = _config.GetValue<string>("pathTemp");
using (var fileStream = new FileStream(Path.Combine(tempPath, Archivo.FileName), FileMode.Create))
{
await Archivo.CopyToAsync(fileStream);
}
SrvUploadTemplete Srv = new SrvUploadTemplete(_Repo, _RepoFacturas, _RepoContenedores, _config);
return await Srv.AutoInsertFromTemplete(tempPath + Archivo.FileName, id);
}
[HttpPost]
[Route("Rectificacion/Historico/Append")]
public async Task<Boolean> RectificacionHistoricoAppend(DTORectificacionHistorico data)
{
var entrada = await _Repo.RectificacionHistoricoAppend(data);
return entrada;
}
[HttpGet]
[Route("Rectificacion/Historico/Get")]
public async Task<CorresponsaliasTraficoRectificacionHistorico> RectificacionHistoricoGet(int IdTrafico)
{
var entrada = await _Repo.RectificacionHistoricoGet(IdTrafico);
return entrada;
}
}
}

@ -0,0 +1,39 @@
using CORRESPONSALBackend.Contracts.Dashboard;
using CORRESPONSALBackend.Models;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authorization;
namespace CORRESPONSALBackend.Controllers.Dashboard
{
// [Authorize]
[Route("api/Dashboard/[controller]")]
[ApiController]
public class CorresponsalesController : ControllerBase
{
private readonly IDashboardCorresponsalesRepository _Repo;
private readonly IConfiguration _config;
public CorresponsalesController(IDashboardCorresponsalesRepository Repo, IConfiguration config)
{
_config = config;
_Repo = Repo;
}
// GET: api/<CorresponsalesController>
[HttpGet]
[Route("Get")]
public async Task<IEnumerable<DashboardCorresponsales>> Get()
{
return await _Repo.Get();
}
[HttpGet]
[Route("GetTipoCambio")]
public async Task<Decimal> GetTipoCambio(string Fecha)
{
return await _Repo.GetTipoCambio(Fecha);
}
}
}

@ -0,0 +1,204 @@
using System.Numerics;
//using CORRESPONSALBackend.Models.Catalogos;
using CORRESPONSALBackend.DTO;
using CORRESPONSALBackend.Contracts;
using CORRESPONSALBackend.Contracts.Clientes.CasaCuervo;
using CORRESPONSALBackend.Contracts.Utils;
using CORRESPONSALBackend.Models.Utils;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authorization;
namespace CORRESPONSALBackend.Controllers
{
// [Authorize]
[Route("api/[controller]")]
// [ApiController]
public class FileManagerController : Controller
{
private readonly IFileManagerRepository _Repo;
private readonly IUsuariosRepository _RepoUsuarios;
private readonly ICasaCuervoRepository _RepoCasaCuervo;
private readonly IFilePaths4ProcessRepository _RepoRelativePath;
private readonly IConfiguration _config;
private readonly string RootPathCorresponsales;
public FileManagerController(IFileManagerRepository Repo,
IFilePaths4ProcessRepository RepoRelativePath,
IConfiguration config,
IUsuariosRepository RepoUsuarios,
ICasaCuervoRepository RepoCasaCuervo)
{
_config = config;
_Repo = Repo;
_RepoUsuarios = RepoUsuarios;
_RepoCasaCuervo = RepoCasaCuervo;
_RepoRelativePath = RepoRelativePath;
RootPathCorresponsales = _config.GetValue<string>("AllFiles");
}
[Route("GetFileInfoByProcess")]
[HttpGet]
public async Task<FileManager> GetFileInfoByProcess([FromQuery] int id, int Proceso)
{
FileManager data = new FileManager();
data = await _Repo.getFileByProcess(id, Proceso);
return data;
}
[Route("GetFileInfoById")]
[HttpGet]
public async Task<FileManager> GetFileInfoByProcess([FromQuery] int id)
{
FileManager data = new FileManager();
data = await _Repo.getFileById(id);
return data;
}
[Route("AppendFileByProcess")]
[HttpPost]
public async Task<FileManager> AppendFileByProcess(IFormFile file, int IdUsuario, int Proceso, string Tags, int crud)
{
DateTime time = DateTime.Now;
FilePaths4Process RelativePath = await _RepoRelativePath.getPaths4ProcessById(Proceso);
string fullPath = "";
fullPath = RootPathCorresponsales + RelativePath.Path;
string fileMime = file.FileName.Substring(file.FileName.LastIndexOf('.') + 1);
string newFileName = file.FileName.Replace("." + fileMime, "") + "_" + time.ToString("yyyy_MM_dd_HH_mm_ss") + "." + fileMime;
FileManager data = new FileManager();
data.id = 0;
data.IdUsuario = IdUsuario;
data.NombreArchivo = newFileName;
data.Proceso = Proceso;
data.FechaRegistro = "";
data.Tags = Tags;
data.Activo = 1;
long fileLength = 0;
if (@crud == 1)
{
if (file.Length > 0)
{
var filePath = fullPath + newFileName;
using (var stream = System.IO.File.Create(filePath))
{
await file.CopyToAsync(stream);
}
fileLength = new System.IO.FileInfo(filePath).Length / 1024;
data.Size = fileLength;
if (fileLength > 0)
{
return await _Repo.FileManager(data);
}
}
}
return data;
}
// El aifuiente procaso se tiene que validar de todo a todo, ya que sera facilitado el acceso a usuarios externos a GEMCO: Clientes, Corresponsales, etc
/* [Route("AppendFileUpdatesCasaCuervo")]
[HttpPost]
public async Task<IActionResult> AppendFileUpdatesCasaCuervo(IFormFile file, string Usuario, string Contrasenia)
{
int Proceso = 6;
string Tags = "-1";
DateTime time = DateTime.Now;
FilePaths4Process RelativePath = await _RepoRelativePath.getPaths4ProcessById(Proceso);
string fullPath = "";
fullPath = RootPathCorresponsales + RelativePath.Path;
string fileMime = file.FileName.Substring(file.FileName.Length - 4);
string newFileName = file.FileName.Replace(fileMime, "") + "_" + time.ToString("yyyy_MM_dd_HH_mm_ss") + fileMime;
DTOLogin authUser = new DTOLogin();
authUser.Usuario = Usuario;
authUser.Contrasena = Contrasenia;
var ExternalUser = await _RepoUsuarios.GetUsuario(authUser);
FileManager data = new FileManager();
data.id = 0;
data.IdUsuario = ExternalUser.Id;
data.NombreArchivo = newFileName;
data.Proceso = Proceso;
data.FechaRegistro = "";
data.Tags = Tags;
data.Activo = 1;
long fileLength = 0;
string filePath = "";
filePath = fullPath + newFileName;
using (var stream = System.IO.File.Create(filePath))
{
await file.CopyToAsync(stream);
}
fileLength = new System.IO.FileInfo(filePath).Length / 1024;
data.Size = fileLength;
if (fileLength > 0)
{
SCasaCuervo proc = new SCasaCuervo(_RepoCasaCuervo, filePath);
var result = await proc.UpdateInfoFromCorresponsal();
if (result) return new OkObjectResult(new { respuesta = "El archivo se agrego exitosamente" });
else return new OkObjectResult(new { respuesta = "Ocurrio un error, el archivo no se guardo, verifique que el formato de fecha sea MM/dd/yyyy" });
}
return new OkObjectResult(new { respuesta = "Ocurrio un error el archivo no se guardo" });
} */
[Route("getFile")]
[HttpGet, DisableRequestSizeLimit]
public async Task<IActionResult> getFileFromFileManager([FromQuery] long id, int Proceso)
{
Boolean ExisteEnDisco = false;
FileManager recFound = await _Repo.getFileByProcess(id, Proceso);
FilePaths4Process RelativePath = await _RepoRelativePath.getPaths4ProcessById(Proceso);
string fullPath = "";
fullPath = RootPathCorresponsales + RelativePath.Path;
if (!String.IsNullOrEmpty(recFound.NombreArchivo))
{
try
{
if (System.IO.File.Exists(Path.Combine(fullPath, recFound.NombreArchivo)))
{
ExisteEnDisco = true;
}
else return BadRequest(new { respuesta = "Ese archivo no existe" });
}
catch (IOException ex)
{
return BadRequest(new { respuesta = "Ese archivo no existe" + ex.ToString() });
}
if (ExisteEnDisco)
{
string fileMime = recFound.NombreArchivo.Substring(recFound.NombreArchivo.Length - 3).ToLower();
var mime = "application/" + fileMime.ToLower();
string targetFile = fullPath + recFound.NombreArchivo;
if (System.IO.File.Exists(targetFile))
{
byte[] pdfBytes = System.IO.File.ReadAllBytes(targetFile);
MemoryStream ms = new MemoryStream(pdfBytes);
return new FileStreamResult(ms, mime);
}
}
}
return BadRequest(new { respuesta = "Ese archivo no existe" });
}
[HttpDelete("DeleteById/{id}")]
public async Task<IActionResult> DeleteByProcess(long id)
{
FileManager Found = await _Repo.getFileById(id);
FilePaths4Process RelativePath = await _RepoRelativePath.getPaths4ProcessById(Found.Proceso);
string fullPath = "";
fullPath = RootPathCorresponsales + RelativePath.Path;
try
{
if (System.IO.File.Exists(Path.Combine(fullPath, Found.NombreArchivo)))
{
System.IO.File.Delete(Path.Combine(fullPath, Found.NombreArchivo));
await _Repo.deleteFileByProcess(Found.id, Found.Proceso);
}
else return new OkObjectResult(new { respuesta = "Ese archivo no existe" });
}
catch (IOException ex)
{
return new OkObjectResult(new { respuesta = "Ocurrio un error al intentar eliminar el registro: " + ex.ToString() });
}
return new OkObjectResult(new { respuesta = "Se elimino el registro" });
}
}
}

@ -0,0 +1,165 @@
using CORRESPONSALBackend.Contracts;
using CORRESPONSALBackend.DTO;
using CORRESPONSALBackend.DTO.Usuario;
using CORRESPONSALBackend.Models;
using Microsoft.AspNetCore.Mvc;
namespace CORRESPONSALBackend.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class PerfilesController : ControllerBase
{
public IConfiguration _configuration;
private readonly IUsuariosRepository _usuariosRepo;
private readonly IMenuRepository _menuRepo;
private readonly IPerfilesRepository _perfilesRepo;
public PerfilesController(IConfiguration config, IUsuariosRepository usuariosRepo, IMenuRepository menuRepo, IPerfilesRepository perfilesRepo)
{
_configuration = config;
_usuariosRepo = usuariosRepo;
_menuRepo = menuRepo;
_perfilesRepo = perfilesRepo;
}
[Route("getPerfiles")]
[HttpGet]
public async Task<IActionResult> GetPerfiles()
{
try
{
var perfiles = await _perfilesRepo.getPerfiles();
return Ok(perfiles);
}
catch (Exception ex)
{
return StatusCode(500, ex.Message);
}
}
[Route("getMenu")]
[HttpGet]
public async Task<IActionResult> GetMenu()
{
try
{
var perfiles = await _perfilesRepo.getMenu();
return Ok(perfiles);
}
catch (Exception ex)
{
return StatusCode(500, ex.Message);
}
}
[Route("asignaItemMenu")]
[HttpPost]
public async Task<IActionResult> asignaItemMenu(DTOItemMenuPerfil data)
{
try
{
var perfiles = await _perfilesRepo.asignaItemMenuPerfil(data);
return Ok(perfiles);
}
catch (Exception ex)
{
return StatusCode(500, ex.Message);
}
}
[Route("getAllPerfilesMenu")]
[HttpGet]
public async Task<IActionResult> GetAllPerfilesMenu()
{
try
{
var perfiles = await _perfilesRepo.getAllPerfilesMenu();
return Ok(perfiles);
}
catch (Exception ex)
{
return StatusCode(500, ex.Message);
}
}
[Route("getPerfilMenuById")]
[HttpGet]
public async Task<IActionResult> GetPerfilMenuBuId(int id)
{
try
{
var perfiles = await _perfilesRepo.getPerfilMenuById(id);
return Ok(perfiles);
}
catch (Exception ex)
{
return StatusCode(500, ex.Message);
}
}
[Route("createPerfil")]
[HttpPost]
public async Task<IActionResult> createPerfil(DTOPerfilCreate data)
{
try
{
var perfiles = await _perfilesRepo.createPerfil(data);
return Ok(perfiles);
}
catch (Exception ex)
{
return StatusCode(500, ex.Message);
}
}
[Route("createItemMenu")]
[HttpPost]
public async Task<IActionResult> createItemMenu(Menu data)
{
try
{
var result = await _perfilesRepo.createItemMenu(data);
return Ok(result);
}
catch (Exception ex)
{
return StatusCode(500, ex.Message);
}
}
[Route("getAllTransportistas")]
[HttpGet]
public async Task<IActionResult> GetAllTransportistas(int id)
{
try
{
var transportistas = await _perfilesRepo.getAllTransportistas(id);
return Ok(transportistas);
}
catch (Exception ex)
{
return StatusCode(500, ex.Message);
}
}
[Route("getAllProveedores")]
[HttpGet]
public async Task<IActionResult> GetAllProveedores(int id)
{
try
{
var proveedores = await _perfilesRepo.getAllProveedores(id);
return Ok(proveedores);
}
catch (Exception ex)
{
return StatusCode(500, ex.Message);
}
}
}
}

@ -0,0 +1,189 @@
using CORRESPONSALBackend.Contracts;
using CORRESPONSALBackend.DTO;
using CORRESPONSALBackend.Models;
using Microsoft.AspNetCore.Mvc;
using CORRESPONSALBackend.DTO.Usuario;
namespace CORRESPONSALBackend.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class UsuariosController : ControllerBase
{
private readonly IUsuariosRepository _usuariosRepo;
private readonly IConfiguration _config;
public UsuariosController(IUsuariosRepository usuariosRepo, IConfiguration config) { _usuariosRepo = usuariosRepo; _config = config; }
[Route("getUsuarioById")]
[HttpGet]
public async Task<IActionResult> getAllUsuarios(int id)
{
try
{
var usuario = await _usuariosRepo.GetUsuarioById(id);
if (usuario == null) return NotFound();
return Ok(usuario);
}
catch (Exception ex) { return StatusCode(500, ex.Message); }
}
[Route("getAllUsuarios")]
[HttpGet]
public async Task<IActionResult> getAllUsuarios()
{
try
{
var usuarios = await _usuariosRepo.getAllUsuarios();
return Ok(usuarios);
}
catch (Exception ex) { return StatusCode(500, ex.Message); }
}
[Route("getAllUsuariosShort")]
[HttpGet]
public async Task<IActionResult> getAllUsuariosShort()
{
try
{
var usuarios = await _usuariosRepo.getAllUsuariosShort();
return Ok(usuarios);
}
catch (Exception ex) { return StatusCode(500, ex.Message); }
}
[Route("Auth")]
[HttpPost]
public async Task<IActionResult> Auth(DTOLogin user)
{
try
{
var usuarios = await _usuariosRepo.GetUsuario(user);
return Ok(usuarios);
}
catch (Exception ex) { return StatusCode(500, ex.Message); }
}
/* [Route("resetPassword")]
[HttpPost]
public async Task<IActionResult> resetPassword(DTOLogin user)
{
try
{
var result = await _usuariosRepo.resetPassword(user);
if (result == null)
{
return StatusCode(400, "Cuenta de usuario no existe");
}
return Ok(result);
}
catch (Exception ex)
{
return StatusCode(500, ex);
}
} */
[Route("searchUsuario")]
[HttpPost]
public async Task<IActionResult> searchUsuario(DTOLogin user)
{
try
{
var result = await _usuariosRepo.searchUsuario(user.Usuario);
if (result != null) return StatusCode(409, new { message = "Usuario registrado previamente" });
return Ok(new { message = "Usuario libre, no registrado previamente" });
}
catch (Exception ex)
{
return StatusCode(500, ex);
}
}
[Route("createUsuario")]
[HttpPost]
public async Task<IActionResult> POST(DTOUsuario user)
{
try
{
var usuario = await _usuariosRepo.createUsuario(user);
if (user.Id == 0)
{
/* Utilerias email = new Utilerias(_config);
Boolean sendOk = email.SendEmail("", usuario); */
}
return Ok(usuario);
}
catch (Exception ex) { return StatusCode(500, ex.Message); }
}
[Route("clonarUsuario")]
[HttpPost]
public async Task<IActionResult> POST(DTOClonarUsuario user)
{
try
{
var usuarios = await _usuariosRepo.clonarUsuario(user);
return Ok(usuarios);
}
catch (Exception ex) { return StatusCode(500, ex.Message); }
}
[Route("Catalogo/Roles/GET")]
[HttpGet]
public async Task<IActionResult> CatalogoRolesGET()
{
try
{
var Roles = await _usuariosRepo.CatalogoRolesGET();
return Ok(Roles);
}
catch (Exception ex) { return StatusCode(500, ex.Message); }
}
[Route("Catalogo/Roles/AsignadosGET")]
[HttpGet]
public async Task<IActionResult> RolesAsignadosGET(int id)
{
try
{
var Roles = await _usuariosRepo.RolesAsignadosGET(id);
return Ok(Roles);
}
catch (Exception ex) { return StatusCode(500, ex.Message); }
}
[Route("Catalogo/Usuarios/PerfilesParecidos")]
[HttpGet]
public async Task<IActionResult> GETPerfilesParecidos(string Perfil)
{
try
{
var perfiles = await _usuariosRepo.GETPerfilesParecidos(Perfil);
return Ok(perfiles);
}
catch (Exception ex)
{
return StatusCode(500, ex.Message);
}
}
[Route("DisableUser")]
[HttpPut]
public async Task<IActionResult> DisableUser(int id)
{
try
{
var result = await _usuariosRepo.DisableUser(id);
return Ok(result);
}
catch (Exception ex)
{
return StatusCode(500, ex.Message);
}
}
}
}

@ -0,0 +1,62 @@
using Microsoft.AspNetCore.Mvc;
using CORRESPONSALBackend.Services.MFileManager;
using CORRESPONSALBackend.Contracts.Utils;
using CORRESPONSALBackend.Models.Utils;
using Microsoft.AspNetCore.Authorization;
namespace CORRESPONSALBackend.Controllers.Utils
{
[Authorize]
[ApiController]
[Route("api/Utils/[controller]")]
public class MFileManagerController : ControllerBase
{
private readonly IFileManagerRepository _Repo;
private readonly IConfiguration _config;
private readonly IFilePaths4ProcessRepository _RepoRelativePath;
private readonly string RootPath;
public MFileManagerController(IConfiguration config, IFilePaths4ProcessRepository RepoRelativePath, IFileManagerRepository Repo)
{
_config = config;
_RepoRelativePath = RepoRelativePath;
_Repo = Repo;
RootPath = _config.GetValue<string>("AllFiles");
}
[HttpGet]
[Route("GetFilesFromLog")]
public async Task<List<FileManager>> GetFilesFromLog(int Tags, int Proceso)
{
FilePaths4Process RelativePath = await _RepoRelativePath.getPaths4ProcessById(Proceso);
SvcMFileManager FM = new SvcMFileManager(_config, _Repo, RootPath + RelativePath.Path);
return await FM.GetFilesFromLog(Tags, Proceso);
}
[HttpGet]
[Route("GetFileContentById")]
public async Task<IActionResult> GetFileContentById(long id, int Proceso)
{
FilePaths4Process RelativePath = await _RepoRelativePath.getPaths4ProcessById(Proceso);
SvcMFileManager FM = new SvcMFileManager(_config, _Repo, RootPath + RelativePath.Path);
return await FM.getFileContentById(id);
}
[HttpPost]
[Route("Append")]
public async Task<List<FileManager>> Append(List<IFormFile> FileList, int Tags, int Proceso, int Usuario)
{
List<string> data = new List<string>();
FilePaths4Process RelativePath = await _RepoRelativePath.getPaths4ProcessById(Proceso);
SvcMFileManager FM = new SvcMFileManager(_config, _Repo, RootPath + RelativePath.Path);
List<string> filePaths = await FM.SaveFile2DiskList(FileList);
var fileData = await FM.SaveFileLog(filePaths, Tags, Proceso, Usuario);
return fileData;
}
}
}

@ -0,0 +1,33 @@
using Microsoft.AspNetCore.Mvc;
using CORRESPONSALBackend.Contracts;
using Microsoft.AspNetCore.Authorization;
using CORRESPONSALBackend.DTO.Reportes;
using CORRESPONSALBackend.DTO.Corresponsales;
namespace CORRESPONSALBackend.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class ReportesController : ControllerBase
{
public IConfiguration _configuration;
private readonly IReportesRepository _reportesRepo;
public ReportesController(IConfiguration config, IReportesRepository reportesRepo)
{
_configuration = config;
_reportesRepo = reportesRepo;
}
[HttpGet]
[Route("RptCorresponsalesTraficos")]
public async Task<IEnumerable<DTOCorresponsalTrafico>> GetAllCorresponsalesTraficos([FromQuery] DTOReporteCorresponsales data)
{
var entrada = await _reportesRepo.GetRptCorresponsalesTraficos(data);
return entrada;
}
}
}

@ -0,0 +1,55 @@
using System.Security.Cryptography;
using System.Text;
namespace CORRESPONSALBackend.Crypto
{
public class CryptDecrypt
{
private readonly static string key = "G3mc0H42hk3y2!0$2*2#n4813dc2h47p";
public static string Encrypt(string text)
{
byte[] iv = new byte[16];
byte[] array;
using (Aes aes = Aes.Create())
{
aes.Key = Encoding.UTF8.GetBytes(key);
aes.IV = iv;
ICryptoTransform encrypt = aes.CreateEncryptor(aes.Key, aes.IV);
using (MemoryStream ms = new MemoryStream())
{
using (CryptoStream cryptoStream = new CryptoStream((Stream)ms, encrypt, CryptoStreamMode.Write))
{
using (StreamWriter streamWriter = new StreamWriter(cryptoStream))
{
streamWriter.Write(text);
}
array = ms.ToArray();
}
}
}
return Convert.ToBase64String(array);
}
public static string Decrypt(string text)
{
byte[] iv = new byte[16];
byte[] buffer = Convert.FromBase64String(text);
using (Aes aes = Aes.Create())
{
aes.Key = Encoding.UTF8.GetBytes(key);
aes.IV = iv;
ICryptoTransform decryptor = aes.CreateDecryptor(aes.Key, aes.IV);
using (MemoryStream ms = new MemoryStream(buffer))
{
using (CryptoStream cryptoStream = new CryptoStream((Stream)ms, decryptor, CryptoStreamMode.Read))
{
using (StreamReader sr = new StreamReader(cryptoStream))
{
return sr.ReadToEnd();
}
}
}
}
}
}
}

@ -0,0 +1,11 @@
namespace CORRESPONSALBackend.DTO.AnexoFacturacion
{
public class DTOAnexoFacturacionAlen
{
public string sReferencia { get; set; } = null!;
public double nHonorarios { get; set; } = 0;
public double nValidacion { get; set; } = 0;
public double nPrevalidacion { get; set; } = 0;
public double nCoordinacion { get; set; } = 0;
}
}

@ -0,0 +1,12 @@
namespace CORRESPONSALBackend.DTO.AnexoFacturacion
{
public class DTOAnexoFacturacionMission
{
public string sReferencia { get; set; } = null!;
public double CordCruce { get; set; } = 0;
public double CordFlete { get; set; } = 0;
public double nServicio { get; set; } = 0;
public double nContraprestacion { get; set; } = 0;
public double nHonorario { get; set; } = 0;
}
}

@ -0,0 +1,10 @@
namespace CORRESPONSALBackend.DTO.ArchivoElectronico
{
public class DTOAEPeriodo
{
public int Anio { get; set; } = 0!;
public int Mes { get; set; } = 0!;
public int NoCliente { get; set; } = 0!;
public int TipoOperacion { get; set; } = 0!;
}
}

@ -0,0 +1,12 @@
namespace CORRESPONSALBackend.DTO.ArchivoElectronico
{
public class DTOAEPeriodoSeleccion
{
public int Anio { get; set; } = 0!;
public int Mes { get; set; } = 0!;
public int NoCliente { get; set; } = 0!;
public int TipoOperacion { get; set; } = 0!;
public int IdUsuario { get; set; } = 0!;
public List<string>? Referencias { get; set; } = new List<string>();
}
}

@ -0,0 +1,10 @@
namespace CORRESPONSALBackend.DTO.ArchivoElectronico
{
public class DTOArchivoOficial
{
public int Anio { set; get; } = 0;
public int Mes { set; get; } = 0;
public int TipoOperacion { set; get; } = 0;
public int Cliente { set; get; } = 0;
}
}

@ -0,0 +1,20 @@
namespace CORRESPONSALBackend.DTO.Battery
{
public class DTOBatteryEntry
{
public int ID { get; set; } = 0!;
public string Trailer { get; set; } = null!;
public string IDPallet { get; set; } = null!;
public double Weight { get; set; } = 0!;
public string ControlNumber { get; set; } = null!; // New
public string CarrierName { get; set; } = null!; // New
public string DriverName { get; set; } = null!; // New
public string Forklift { get; set; } = null!; // New
public string? Issues { get; set; } = null!; // New
public string InTime { get; set; } = null!; // New
public string? OutTime { get; set; } = null!; // New
public int InOut { get; set; } = 0!; // New
public int IdIn { get; set; } = 0!; // New
public int IdOut { get; set; } = 0!; // New
}
}

@ -0,0 +1,8 @@
namespace CORRESPONSALBackend.DTO.Battery
{
public class DTOBatteryInfo
{
public int ID { get; set; } = 0!;
public int InOut { get; set; } = 0!;
}
}

@ -0,0 +1,12 @@
namespace CORRESPONSALBackend.DTO.Battery
{
public class DTOLogFotosBodega
{
public int? Proceso { set; get; } = 0;
public string? Referencia { set; get; } = null!;
public string? Inicio { set; get; } = null!;
public string? Fin { set; get; } = null!;
public string? Usuario { set; get; } = null!;
public string? Comentarios { set; get; } = null!;
}
}

@ -0,0 +1,12 @@
namespace CORRESPONSALBackend.DTO.Cliente
{
public class DTOClienteProveedor
{
public int IdUsuario { get; set; }
public string sClaveCliente { get; set; } = null!;
public string sClave { get; set; } = null!;
public string sRazonSocial { get; set; } = null!;
public string Direccion { get; set; } = null!;
public bool asignado { get; set; }
}
}

@ -0,0 +1,9 @@
namespace CORRESPONSALBackend.DTO.Cliente
{
public class DTOClienteUsuario
{
public int IdUsuario { get; set; }
public int sClave { get; set; }
public bool agregar { get; set; }
}
}

@ -0,0 +1,8 @@
namespace CORRESPONSALBackend.DTO.Clientes.CasaCuervo
{
public class DTO325AduanasPedidos
{
public string id { set; get; } = string.Empty;
public string value { set; get; } = string.Empty;
}
}

@ -0,0 +1,16 @@
namespace CORRESPONSALBackend.DTO.Clientes.CasaCuervo
{
public class DTO325ComplementaPedido
{
public string Pedido { set; get; } = string.Empty;
public string Factura { set; get; } = string.Empty;
public string UUID { set; get; } = string.Empty;
public string Trafico { set; get; } = string.Empty;
public string Pedimento { set; get; } = string.Empty;
public string Aduana { set; get; } = string.Empty;
public string Patente { set; get; } = string.Empty;
public string Modulacion { set; get; } = string.Empty;
public string? FechaCompromiso { set; get; } = string.Empty;
public string? Comentario { set; get; } = string.Empty;
}
}

@ -0,0 +1,10 @@
namespace CORRESPONSALBackend.DTO.Clientes.CasaCuervo
{
public class DTO325RptPedidos
{
public string Inicio { get; set; } = string.Empty;
public string Fin { get; set; } = string.Empty;
public string Aduana { get; set; } = string.Empty;
}
}

@ -0,0 +1,18 @@
namespace CORRESPONSALBackend.DTO.Clientes.CasaCuervo
{
public class DTO325UpdateFromWeb
{
public int id { get; set; } = 0!;
public string ComentarioGEMCO { get; set; } = string.Empty;
public string FechaCompromiso { get; set; } = string.Empty;
public string FechaCruce { get; set; } = string.Empty;
public string Factura { get; set; } = string.Empty;
public string MedidaCaja { get; set; } = string.Empty;
public string Sello1 { get; set; } = string.Empty;
public string Sello2 { get; set; } = string.Empty;
public string UUID { get; set; } = string.Empty;
public string Trafico { get; set; } = string.Empty;
public string Pedimento { get; set; } = string.Empty;
public string Patente { get; set; } = string.Empty;
}
}

@ -0,0 +1,9 @@
namespace CORRESPONSALBackend.DTO.Corresponsales
{
public class DTOCorresponsalCuentaComplementaria
{
public int Id { get; set; } = 0;
public int IdTrafico { get; set; } = 0;
public long IdFile { get; set; } = 0!;
}
}

@ -0,0 +1,8 @@
namespace CORRESPONSALBackend.DTO.Corresponsales
{
public class DTOCorresponsalCuentaComplementariaEstatus
{
public int Id { get; set; } = 0;
public byte Estatus { get; set; } = 0;
}
}

@ -0,0 +1,52 @@
namespace CORRESPONSALBackend.DTO.Corresponsales
{
public class DTOCorresponsalTrafico
{
public int id { get; set; } = 0;
public string? Folio { get; set; } = null!;
public string? FechaRegistro { get; set; } = null!;
public int IdUsuario { get; set; } = 0;
public string sUsuario { get; set; } = null!;
public int IdCliente { get; set; } = 0;
public string sCliente { get; set; } = null!;
public int TipoOperacion { get; set; } = 0;
public string sTipoOperacion { get; set; } = null!;
public int OpEntrada { get; set; } = 0;
public string sOpEntrada { get; set; } = null!;
public int OpSalida { get; set; } = 0;
public string sOpSalida { get; set; } = null!;
public int IdCorresponsal { get; set; } = 0;
public string sCorresponsal { get; set; } = null!;
public int? Bultos { get; set; } = 0;
public int? Kilos { get; set; } = 0;
public int? Estatus { get; set; } = 0;
public string sEstatus { get; set; } = null!;
public string? Trafico { get; set; } = null!;
public int? Aduana { get; set; } = 0;
public int? Patente { get; set; } = 0;
public int? Pedimento { get; set; } = 0;
public string? Clave { get; set; } = null!;
public string? FechaPago { get; set; } = null!;
public double? TipoCambio { get; set; } = 0;
public double? ValorAduanaMN { get; set; } = 0;
public double? TotalPagado { get; set; } = 0;
public double? ValorFacturaMN { get; set; } = 0;
public int? CantidadFracciones { get; set; } = 0;
public string? Buque { get; set; } = null!;
public double? ValorFacturaDls { get; set; } = 0;
public string? DescripcionMercancia { get; set; } = null!;
public string? Observaciones { get; set; } = null!;
public string? FechaDesaduanamiento { get; set; } = null!;
public byte? SemaforoFiscal { get; set; } = 0;
public string? NoCuenta { get; set; } = null!;
public string? FechaCuenta { get; set; } = null!;
public int? TipoMercancia { get; set; } = 0;
public string? UltimaActualizacion { get; set; } = null!;
public string? ZIPGEMCO { get; set; } = null!;
public string? ZIPCorresponsal { get; set; } = null!;
public int? Proceso { get; set; } = 0;
public int Rechazado { get; set; } = 0;
public int NoRecti { get; set; } = 0;
public byte? Activo { get; set; } = 0;
}
}

@ -0,0 +1,8 @@
namespace CORRESPONSALBackend.DTO.Corresponsales
{
public class DTOCorresponsalesAnticipo
{
public int id { get; set; } = 0;
public int IdUsuario { get; set; } = 0!;
}
}

@ -0,0 +1,9 @@
namespace CORRESPONSALBackend.DTO.Corresponsales
{
public class DTOLogCorresposalCuentaComplementaria
{
public int Estatus { get; set; } = 0;
public string FCreacion { get; set; } = null!;
public string sEstatus { get; set; } = null!;
}
}

@ -0,0 +1,9 @@
namespace CORRESPONSALBackend.DTO.Corresponsales
{
public class DTORectificacionHistorico
{
public int IdTrafico { get; set; } = 0;
public int IdUsuario { get; set; } = 0;
}
}

@ -0,0 +1,10 @@
namespace CORRESPONSALBackend.DTO.Corresponsales
{
public class DTOTraficoCompleto
{
public int Id { get; set; } = 0;
public int IdUsuario { get; set; } = 0;
public byte Estatus { get; set; } = 0;
public string Comentarios { get; set; } = null!;
}
}

@ -0,0 +1,8 @@
namespace CORRESPONSALBackend.DTO
{
public class DTOConceptos
{
public int Id { get; set; } = 0;
public string Concepto { get; set; } = null!;
}
}

@ -0,0 +1,10 @@
namespace CORRESPONSALBackend.DTO
{
public class DTOItemMenuPerfil
{
public int IdPerfil { get; set; } = 0;
public int itemMenu { get; set; } = 0;
public bool asignado { get; set; } = false;
}
}

@ -0,0 +1,8 @@
namespace CORRESPONSALBackend.DTO
{
public class DTOLogin
{
public string Usuario { get; set; } = null!;
public string Contrasena { get; set; } = null!;
}
}

@ -0,0 +1,8 @@
namespace CORRESPONSALBackend.DTO.Usuario
{
public class DTOPINData
{
public int PIN { get; set; } = 0!;
public string Correo { get; set; } = string.Empty;
}
}

@ -0,0 +1,8 @@
namespace CORRESPONSALBackend.DTO.Usuario
{
public class DTOPINUsuario
{
public int PIN { get; set; } = 0!;
public string Usuario { get; set; } = string.Empty;
}
}

@ -0,0 +1,12 @@
namespace CORRESPONSALBackend.DTO
{
public class DTOPedimentosSeleccion
{
public string Inicio { get; set; } = null!;
public string Fin { get; set; } = null!;
public int TipoOperacion { get; set; } = 0;
public int NoCliente { get; set; } = 0;
public int IdUsuario { get; set; } = 0;
public List<string>? Pedimentos { get; set; } = new List<string>();
}
}

@ -0,0 +1,8 @@
namespace CORRESPONSALBackend.DTO
{
public class DTORespuesta
{
public int code { get; set; } = 0!;
public string respuesta { get; set; } = null!;
}
}

@ -0,0 +1,11 @@
namespace CORRESPONSALBackend.DTO
{
public class DTORolesAsignados
{
public int Id { get; set; } = 0;
public int Usuario { get; set; } = 0;
public int Rol { get; set; } = 0;
public Boolean Activo { get; set; } = false;
}
}

@ -0,0 +1,11 @@
namespace CORRESPONSALBackend.Clientes.ZincInternacional.DTO
{
public class DTOSendEmail
{
public string To { get; set; } = null!;
public string Subject { get; set; } = null!;
public string Text { get; set; } = null!;
public string Html { get; set; } = null!;
}
}

@ -0,0 +1,12 @@
namespace CORRESPONSALBackend.DTO.Reportes
{
public class DTOReporte
{
public string Inicio { get; set; } = null!;
public string Fin { get; set; } = null!;
public int TipoOperacion { get; set; } = 0;
public int NoCliente { get; set; } = 0;
public int IdUsuario { get; set; } = 0;
//public List<string>? Pedimentos { get; set; } = new List<string>();
}
}

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace CORRESPONSALBackend.DTO.Reportes
{
public class DTOReporteCorresponsales
{
public string? Inicio { get; set; } = null!;
public string? Fin { get; set; } = null!;
public int? TipoOperacion { get; set; } = 0;
public int? NoCliente { get; set; } = 0;
public int IdCorresponsal { get; set; } = 0;
public int Proceso { get; set; } = 0;
public int Modo { get; set; } = 0;
}
}

@ -0,0 +1,8 @@
namespace CORRESPONSALBackend.DTO.Usuario
{
public class DTOClonarUsuario
{
public int IDUsuarioOrigen { get; set; } = 0!;
public int IdUsuarioDestino { get; set; } = 0!;
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save