Refactor receiver methods for async support

Updated repository and service interfaces to use async methods for retrieving receiver information. Changed method signatures to include optional parameters for `id` and `signature`, and made existing parameters nullable. Adjusted related service and controller implementations to ensure consistent usage of the new async methods. Improved error handling in the repository to enforce parameter requirements. Updated using directives in the repository for necessary dependencies.
This commit is contained in:
Developer 02
2025-05-12 09:38:29 +02:00
parent 4401a70217
commit c1bce7c639
6 changed files with 33 additions and 12 deletions

View File

@@ -162,9 +162,9 @@ public class EnvelopeReceiverService : BasicCRUDService<IEnvelopeReceiverReposit
return Result.Success(dto_list);
}
public async Task<DataResult<string?>> ReadLastUsedReceiverNameByMail(string mail)
public async Task<DataResult<string?>> ReadLastUsedReceiverNameByMailAsync(string? mail = null, int? id = null, string? signature = null)
{
var er = await _repository.ReadLastByReceiver(mail);
var er = await _repository.ReadLastByReceiverAsync(mail, id, signature);
return er is null ? Result.Fail<string?>().Notice(LogLevel.None, Flag.NotFound) : Result.Success(er.Name);
}