Add EmailOut components: entity, DTO, repository, and services

- Introduced EmailOut and EmailOutDto for data management.
- Added EmailOutRepository and service interfaces based on CRUD patterns.
This commit is contained in:
Developer 02
2024-04-16 16:25:55 +02:00
parent f7b11e3427
commit f2e718565d
9 changed files with 174 additions and 2 deletions

View File

@@ -38,7 +38,7 @@ namespace EnvelopeGenerator.Web.Controllers
{
try
{
var passwordFromConfig = _config["Config:AdminPassword"] ?? throw new InvalidOperationException("No admin password configured!");
var passwordFromConfig = _config["Config:AdminPassword"];
if (passwordFromConfig == null)
{
@@ -56,8 +56,9 @@ namespace EnvelopeGenerator.Web.Controllers
return View(envelopes);
}
catch (Exception e)
catch(Exception ex)
{
_logger.LogError(ex, "Unexpected error");
ViewData["error"] = "Unknown error!";
return View("Index");
}
@@ -66,6 +67,8 @@ namespace EnvelopeGenerator.Web.Controllers
[HttpGet("/EnvelopeKey/{envelopeReceiverId}")]
public async Task<IActionResult> SendAccessCode([FromRoute] string envelopeReceiverId)
{
var envelope = await _envelopeService.ReadByUuidAsync(envelopeReceiverId.GetEnvelopeUuid());
EnvelopeResponse response = await envelopeOldService.LoadEnvelope(envelopeReceiverId);
if (response.Envelope.UseAccessCode)