- SQL-SELECT-Anweisungen in Dokumenten aktualisiert, um alle Spalten abzurufen.

- Prioritätsbehandlung für document_path_dmz in EnvelopeService.LoadEnvelopes hinzugefügt.
- CRUD-Operationen in EnvlopeDocument und ConfigurationFile Services/Repositories unter Verwendung von WebCoreModules implementiert.
- Verschiedene Dateimethoden in [spezifischen Orten oder Klassen, falls zutreffend] auf async umgestellt.
This commit is contained in:
Developer 02
2024-03-14 12:46:38 +01:00
parent a2b0682a77
commit 6f59906a7e
37 changed files with 624 additions and 93 deletions

View File

@@ -0,0 +1,14 @@
using DigitalData.Core.Contracts.Application;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
using EnvelopeGenerator.Infrastructure.Contracts;
namespace EnvelopeGenerator.Application.Contracts
{
public interface IConfigService : IBasicCRUDService<IConfigRepository, ConfigDto, Config, int>
{
Task<IServiceResult<ConfigDto>> ReadFirstAsync();
async Task<IServiceResult<ConfigDto>> ReadDefaultAsync() => await ReadFirstAsync();
}
}

View File

@@ -0,0 +1,11 @@
using DigitalData.Core.Contracts.Application;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
using EnvelopeGenerator.Infrastructure.Contracts;
namespace EnvelopeGenerator.Application.Contracts
{
public interface IEnvelopeDocumentService : IBasicCRUDService<IEnvelopeDocumentRepository, EnvelopeDocumentDto, EnvelopeDocument, int>
{
}
}

View File

@@ -0,0 +1,15 @@
namespace EnvelopeGenerator.Application.DTOs
{
public record ConfigDto
{
public string DocumentPath { get; init; }
public int SendingProfile { get; init; }
public string SignatureHost { get; init; }
public string ExternalProgramName { get; init; }
public string ExportPath { get; init; }
public string DocumentPathDmz { get; init; }
public string ExportPathDmz { get; init; }
public string SignedMailPath { get; init; }
public string DocumentPathMoveAftsend { get; init; }
}
}

View File

@@ -0,0 +1,12 @@
namespace EnvelopeGenerator.Application.DTOs
{
public record EnvelopeDocumentDto
{
public int Guid { get; init; }
public int EnvelopeId { get; init; }
public string Filename { get; init; }
public string Filepath { get; init; }
public DateTime AddedWhen { get; init; }
public string FilenameOriginal { get; init; }
}
}

View File

@@ -0,0 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AutoMapper" Version="13.0.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\EnvelopeGenerator.Infrastructure\EnvelopeGenerator.Infrastructure.csproj" />
</ItemGroup>
<ItemGroup>
<Reference Include="DigitalData.Core.Application">
<HintPath>..\..\WebCoreModules\DigitalData.Core.Application\bin\Debug\net7.0\DigitalData.Core.Application.dll</HintPath>
</Reference>
<Reference Include="DigitalData.Core.Contracts">
<HintPath>..\..\WebCoreModules\DigitalData.Core.Application\bin\Debug\net7.0\DigitalData.Core.Contracts.dll</HintPath>
</Reference>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,18 @@
using AutoMapper;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.MappingProfiles
{
public class BasicDtoMappingProfile : Profile
{
public BasicDtoMappingProfile()
{
CreateMap<Config, ConfigDto>();
CreateMap<EnvelopeDocument, EnvelopeDocumentDto>();
CreateMap<ConfigDto, Config>();
CreateMap<EnvelopeDocumentDto, EnvelopeDocument>();
}
}
}

View File

@@ -0,0 +1,30 @@
using AutoMapper;
using DigitalData.Core.Application;
using DigitalData.Core.Contracts.Application;
using DigitalData.Core.Contracts.CultureServices;
using EnvelopeGenerator.Application.Contracts;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
using EnvelopeGenerator.Infrastructure.Contracts;
namespace EnvelopeGenerator.Application.Services
{
public class ConfigService : BasicCRUDService<IConfigRepository, ConfigDto, Config, int>, IConfigService
{
public ConfigService(IConfigRepository repository, IKeyTranslationService translationService, IMapper mapper) : base(repository, translationService, mapper)
{
}
public async Task<IServiceResult<ConfigDto>> ReadFirstAsync()
{
var config = await _repository.ReadFirstAsync();
if (config is null)
return Failed<ConfigDto>("There is no configuration in DB.");
return Successful(_mapper.MapOrThrow<ConfigDto>(config));
}
public async Task<IServiceResult<ConfigDto>> ReadDefaultAsync() => await ReadFirstAsync();
}
}

View File

@@ -0,0 +1,18 @@
using AutoMapper;
using DigitalData.Core.Application;
using DigitalData.Core.Contracts.Application;
using DigitalData.Core.Contracts.CultureServices;
using EnvelopeGenerator.Application.Contracts;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
using EnvelopeGenerator.Infrastructure.Contracts;
namespace EnvelopeGenerator.Application.Services
{
public class EnvelopeDocumentService : BasicCRUDService<IEnvelopeDocumentRepository, EnvelopeDocumentDto, EnvelopeDocument, int>, IEnvelopeDocumentService
{
public EnvelopeDocumentService(IEnvelopeDocumentRepository repository, IKeyTranslationService translationService, IMapper mapper) : base(repository, translationService, mapper)
{
}
}
}