refactor(Config): DocumentPathDmz, ExportPathDmz und DocumentPathMoveAftsend sowohl in der Entität als auch im DTO entfernt.
This commit is contained in:
parent
61ff2f8cde
commit
9c431ddf56
@ -1,4 +1,5 @@
|
||||
using DigitalData.Core.Abstractions;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace EnvelopeGenerator.Application.DTOs
|
||||
@ -8,11 +9,9 @@ namespace EnvelopeGenerator.Application.DTOs
|
||||
int SendingProfile,
|
||||
string SignatureHost,
|
||||
string ExternalProgramName,
|
||||
string ExportPath,
|
||||
string DocumentPathDmz,
|
||||
string ExportPathDmz,
|
||||
string DocumentPathMoveAftsend) : IUnique<int>
|
||||
string ExportPath) : IUnique<int>
|
||||
{
|
||||
[NotMapped]
|
||||
[JsonIgnore]
|
||||
[Obsolete("Configuration does not have an ID; it represents a single table in the database.")]
|
||||
public int Id => throw new InvalidOperationException("This configuration does not support an ID as it represents a single row in the database.");
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
using DigitalData.Core.Abstractions;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace EnvelopeGenerator.Domain.Entities
|
||||
{
|
||||
@ -23,19 +24,9 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
[Column("EXPORT_PATH", TypeName = "nvarchar(256)")]
|
||||
public string? ExportPath { get; init; }
|
||||
|
||||
[Column("DOCUMENT_PATH_DMZ", TypeName = "nvarchar(512)")]
|
||||
[Required]
|
||||
public string? DocumentPathDmz { get; init; }
|
||||
|
||||
[Column("EXPORT_PATH_DMZ", TypeName = "nvarchar(512)")]
|
||||
[Required]
|
||||
public required string ExportPathDmz { get; init; }
|
||||
|
||||
[Column("DOCUMENT_PATH_MOVE_AFTSEND", TypeName = "nvarchar(512)")]
|
||||
[Required]
|
||||
public required string DocumentPathMoveAftsend { get; init; }
|
||||
|
||||
[Obsolete("Configuration does not have an ID; it represents a single table in the database.")]
|
||||
[NotMapped]
|
||||
[JsonIgnore]
|
||||
public int Id => throw new InvalidOperationException("This configuration does not support an ID as it represents a single table in the database.");
|
||||
}
|
||||
}
|
||||
@ -98,13 +98,6 @@ namespace EnvelopeGenerator.Web.Services
|
||||
//if documenet_path_dmz is existing in config, replace the path with it
|
||||
var config = await _configService.ReadDefaultAsync();
|
||||
|
||||
if (config.DocumentPathDmz is not null && config.DocumentPathDmz != string.Empty)
|
||||
foreach (var doc in envelope.Documents)
|
||||
{
|
||||
doc.Filepath = doc.Filepath.Replace(config.DocumentPath, config.DocumentPathDmz);
|
||||
}
|
||||
|
||||
|
||||
return new()
|
||||
{
|
||||
Receiver = receiver,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user