Animierte Navbar-Anzeige für envelopeDto-Informationen hinzugefügt

This commit is contained in:
Developer 02
2024-04-04 17:35:43 +02:00
parent 29ae546d98
commit cbb03d77ba
9 changed files with 105 additions and 65 deletions

View File

@@ -8,5 +8,7 @@ namespace EnvelopeGenerator.Application.Contracts
public interface IEnvelopeService : IBasicCRUDService<IEnvelopeRepository, EnvelopeDto, Envelope, int>
{
Task<IServiceResult<IEnumerable<EnvelopeDto>>> ReadAllWithAsync(bool documents = false, bool receivers = false, bool history = false);
Task<IServiceResult<EnvelopeDto>> ReadByUuidAsync(string uuid, bool withDocuments = false, bool withReceivers = false, bool withHistory = false);
}
}

View File

@@ -18,8 +18,19 @@ namespace EnvelopeGenerator.Application.Services
public async Task<IServiceResult<IEnumerable<EnvelopeDto>>> ReadAllWithAsync(bool documents = false, bool receivers = false, bool history = false)
{
var entities = await _repository.ReadAllWithAsync(documents: documents, receivers: receivers, history: history);
var readDto = _mapper.MapOrThrow<IEnumerable<EnvelopeDto>>(entities);
var envelopes = await _repository.ReadAllWithAsync(documents: documents, receivers: receivers, history: history);
var readDto = _mapper.MapOrThrow<IEnumerable<EnvelopeDto>>(envelopes);
return Successful(readDto);
}
public async Task<IServiceResult<EnvelopeDto>> ReadByUuidAsync(string uuid, bool withDocuments = false, bool withReceivers = false, bool withHistory = false)
{
var envelope = await _repository.ReadByUuidAsync(uuid: uuid, withDocuments: withDocuments, withReceivers: withReceivers, withHistory: withHistory);
if (envelope is null)
return Failed<EnvelopeDto>();
var readDto = _mapper.MapOrThrow<EnvelopeDto>(envelope);
return Successful(readDto);
}
}