Compare commits
6 Commits
7fefc68061
...
09a231d01f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
09a231d01f | ||
|
|
2007ae91fb | ||
|
|
8d118308cd | ||
|
|
1a978c0ab7 | ||
|
|
ce0b1f1785 | ||
|
|
0698b44b68 |
@@ -66,6 +66,9 @@ namespace EnvelopeGenerator.Application.DTOs
|
|||||||
public string? StatusTranslated { get; set; }
|
public string? StatusTranslated { get; set; }
|
||||||
|
|
||||||
public string? ContractTypeTranslated { get; set; }
|
public string? ContractTypeTranslated { get; set; }
|
||||||
public IEnumerable<EnvelopeDocumentDto>? Documents { get; set; }
|
|
||||||
|
public byte[]? DocResult { get; init; }
|
||||||
|
|
||||||
|
public IEnumerable<EnvelopeDocumentDto>? Documents { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -82,8 +82,4 @@
|
|||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="Procedures\" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -21,7 +21,6 @@
|
|||||||
DocumentOpened = 2004
|
DocumentOpened = 2004
|
||||||
DocumentSigned = 2005
|
DocumentSigned = 2005
|
||||||
DocumentForwarded = 4001
|
DocumentForwarded = 4001
|
||||||
SignatureConfirmed = 2006
|
|
||||||
DocumentRejected = 2007
|
DocumentRejected = 2007
|
||||||
EnvelopeShared = 2008
|
EnvelopeShared = 2008
|
||||||
EnvelopeViewed = 2009
|
EnvelopeViewed = 2009
|
||||||
@@ -33,6 +32,20 @@
|
|||||||
DocumentMod_Rotation = 4001
|
DocumentMod_Rotation = 4001
|
||||||
End Enum
|
End Enum
|
||||||
|
|
||||||
|
Public Class Status
|
||||||
|
Public Shared ReadOnly NonHist As IReadOnlyList(Of EnvelopeStatus) = New List(Of EnvelopeStatus) From {
|
||||||
|
EnvelopeStatus.Invalid,
|
||||||
|
EnvelopeStatus.EnvelopeSaved,
|
||||||
|
EnvelopeStatus.EnvelopeSent,
|
||||||
|
EnvelopeStatus.EnvelopePartlySigned
|
||||||
|
}
|
||||||
|
|
||||||
|
Public Shared ReadOnly RelatedToFormApp As IReadOnlyList(Of EnvelopeStatus) = New List(Of EnvelopeStatus) From {
|
||||||
|
EnvelopeStatus.EnvelopeCreated,
|
||||||
|
EnvelopeStatus.DocumentMod_Rotation
|
||||||
|
}
|
||||||
|
End Class
|
||||||
|
|
||||||
'TODO: standardize in xwiki
|
'TODO: standardize in xwiki
|
||||||
Public Enum ReferenceType
|
Public Enum ReferenceType
|
||||||
Receiver = 0
|
Receiver = 0
|
||||||
|
|||||||
@@ -86,6 +86,9 @@ namespace EnvelopeGenerator.Domain.Entities
|
|||||||
[Column("TFA_ENABLED", TypeName = "bit")]
|
[Column("TFA_ENABLED", TypeName = "bit")]
|
||||||
public bool TFAEnabled { get; set; }
|
public bool TFAEnabled { get; set; }
|
||||||
|
|
||||||
|
[Column("DOC_RESULT", TypeName = "varbinary(max)")]
|
||||||
|
public byte[]? DocResult { get; init; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The sender of envelope
|
/// The sender of envelope
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -1,20 +1,16 @@
|
|||||||
using Microsoft.Extensions.Caching.Memory;
|
using Microsoft.Extensions.Caching.Memory;
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Extensions;
|
namespace EnvelopeGenerator.Extensions;
|
||||||
|
|
||||||
public static class MemoryCacheExtensions
|
public static class MemoryCacheExtensions
|
||||||
{
|
{
|
||||||
|
private static readonly Guid BaseId = Guid.NewGuid();
|
||||||
|
|
||||||
public static IDictionary<string, int> GetEnumAsDictionary<TEnum>(this IMemoryCache memoryCache)
|
public static IDictionary<string, int> GetEnumAsDictionary<TEnum>(this IMemoryCache memoryCache)
|
||||||
where TEnum : Enum
|
where TEnum : Enum
|
||||||
{
|
=> memoryCache.GetOrCreate(BaseId + typeof(TEnum).FullName, _ =>
|
||||||
var dict = new Dictionary<string, int>();
|
Enum.GetValues(typeof(TEnum))
|
||||||
|
.Cast<TEnum>()
|
||||||
foreach (TEnum role in Enum.GetValues(typeof(TEnum)))
|
.ToDictionary(e => e.ToString(), e => Convert.ToInt32(e)))
|
||||||
{
|
?? throw new InvalidOperationException($"Failed to cache or retrieve enum dictionary for type '{typeof(TEnum).FullName}'.");
|
||||||
dict[role.ToString()] = Convert.ToInt32(role);
|
|
||||||
}
|
|
||||||
|
|
||||||
return dict;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,7 +76,60 @@ public class EnvelopeController : ControllerBase
|
|||||||
if (envelope.Uuid is string uuid)
|
if (envelope.Uuid is string uuid)
|
||||||
envelopes = envelopes.Where(e => e.Uuid == uuid);
|
envelopes = envelopes.Where(e => e.Uuid == uuid);
|
||||||
|
|
||||||
return Ok(envelope);
|
return Ok(envelopes);
|
||||||
|
},
|
||||||
|
Fail: IActionResult (msg, ntc) =>
|
||||||
|
{
|
||||||
|
_logger.LogNotice(ntc);
|
||||||
|
return StatusCode(StatusCodes.Status500InternalServerError);
|
||||||
|
});
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_logger.LogError("Trotz erfolgreicher Autorisierung wurde die Benutzer-ID nicht als Ganzzahl erkannt. Dies könnte auf eine fehlerhafte Erstellung der Anspruchsliste zurückzuführen sein.");
|
||||||
|
return StatusCode(StatusCodes.Status500InternalServerError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.LogError(ex, "{Message}", ex.Message);
|
||||||
|
return StatusCode(StatusCodes.Status500InternalServerError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Ruft das Ergebnis eines Dokuments basierend auf der ID ab.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id">Die eindeutige ID des Umschlags.</param>
|
||||||
|
/// <param name="view">Gibt an, ob das Dokument inline angezeigt werden soll (true) oder als Download bereitgestellt wird (false).</param>
|
||||||
|
/// <returns>Eine IActionResult-Instanz, die das Dokument oder einen Fehlerstatus enthält.</returns>
|
||||||
|
/// <response code="200">Das Dokument wurde erfolgreich abgerufen.</response>
|
||||||
|
/// <response code="404">Das Dokument wurde nicht gefunden oder ist nicht verfügbar.</response>
|
||||||
|
/// <response code="500">Ein unerwarteter Fehler ist aufgetreten.</response>
|
||||||
|
[HttpGet("doc-result")]
|
||||||
|
public async Task<IActionResult> GetDocResultAsync([FromQuery] int id, [FromQuery] bool view = false)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (User.GetId() is int intId)
|
||||||
|
return await _envelopeService.ReadByUserAsync(intId).ThenAsync(
|
||||||
|
Success: envelopes =>
|
||||||
|
{
|
||||||
|
var envelope = envelopes.Where(e => e.Id == id).FirstOrDefault();
|
||||||
|
|
||||||
|
if (envelope is null)
|
||||||
|
return NotFound("Envelope not available.");
|
||||||
|
else if (envelope?.DocResult is null)
|
||||||
|
return NotFound("The document has not been fully signed or the result has not yet been released.");
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (view)
|
||||||
|
{
|
||||||
|
Response.Headers.Append("Content-Disposition", "inline; filename=\"" + envelope.Uuid + ".pdf\"");
|
||||||
|
return File(envelope.DocResult, "application/pdf");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return File(envelope.DocResult, "application/pdf", $"{envelope.Uuid}.pdf");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
Fail: IActionResult (msg, ntc) =>
|
Fail: IActionResult (msg, ntc) =>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ using EnvelopeGenerator.Extensions;
|
|||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.Extensions.Caching.Memory;
|
using Microsoft.Extensions.Caching.Memory;
|
||||||
using Microsoft.IdentityModel.Tokens;
|
|
||||||
using static EnvelopeGenerator.Common.Constants;
|
using static EnvelopeGenerator.Common.Constants;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -140,7 +140,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"TFARegParams": {
|
"TFARegParams": {
|
||||||
"TimeLimit": "00:30:00"
|
"TimeLimit": "90.00:00:00"
|
||||||
},
|
},
|
||||||
"DbTriggerParams": {
|
"DbTriggerParams": {
|
||||||
"Envelope": [ "TBSIG_ENVELOPE_HISTORY_AFT_INS" ],
|
"Envelope": [ "TBSIG_ENVELOPE_HISTORY_AFT_INS" ],
|
||||||
|
|||||||
Reference in New Issue
Block a user