- Implementierung von LINQ-Abfragen innerhalb der Core-Bibliothek zur Minderung von SQL-Injection-Anfälligkeiten für DB-Operationen von Umschlägen und Empfängern. - Aktualisierung der Geschäftslogik in der Service-Schicht für verbessertes Transaktionshandling. - Erweiterung der ServiceMessage um eine neue Flag-Funktion zum Verfolgen von Cybersecurity- und Datenintegritätsproblemen. - Hinzufügen spezifischer Benutzerverhaltensflags zur besseren Erkennung und Behandlung potenzieller Datenverletzungen.
40 lines
2.1 KiB
C#
40 lines
2.1 KiB
C#
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;
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
namespace EnvelopeGenerator.Application.Services
|
|
{
|
|
public class EnvelopeService : BasicCRUDService<IEnvelopeRepository, EnvelopeDto, Envelope, int>, IEnvelopeService
|
|
{
|
|
private readonly ILogger _logger;
|
|
public EnvelopeService(IEnvelopeRepository repository, IKeyTranslationService translationService, IMapper mapper, ILogger<EnvelopeService> logger)
|
|
: base(repository, translationService, mapper)
|
|
{
|
|
_logger = logger;
|
|
}
|
|
|
|
public async Task<IServiceResult<IEnumerable<EnvelopeDto>>> ReadAllWithAsync(bool documents = false, bool envelopeReceivers = false, bool history = false, bool documentReceiverElement = false)
|
|
{
|
|
var envelopes = await _repository.ReadAllWithAsync(documents: documents, envelopeReceivers: envelopeReceivers, history: history, documentReceiverElement: documentReceiverElement);
|
|
var readDto = _mapper.MapOrThrow<IEnumerable<EnvelopeDto>>(envelopes);
|
|
return Successful(readDto);
|
|
}
|
|
|
|
public async Task<IServiceResult<EnvelopeDto>> ReadByUuidAsync(string uuid, string? signature = null, bool withDocuments = false, bool withEnvelopeReceivers = false, bool withHistory = false, bool withDocumentReceiverElement = false, bool withUser = false, bool withAll = false)
|
|
{
|
|
var envelope = await _repository.ReadByUuidAsync(uuid: uuid, signature: signature, withDocuments: withDocuments, withEnvelopeReceivers: withEnvelopeReceivers, withHistory: withHistory, withDocumentReceiverElement: withDocumentReceiverElement, withUser:withUser, withAll:withAll);
|
|
|
|
if (envelope is null)
|
|
return Failed<EnvelopeDto>();
|
|
|
|
var readDto = _mapper.MapOrThrow<EnvelopeDto>(envelope);
|
|
return Successful(readDto);
|
|
}
|
|
}
|
|
} |