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 DigitalData.Core.Abstractions;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.DTOs
|
namespace EnvelopeGenerator.Application.DTOs
|
||||||
@ -8,11 +9,9 @@ namespace EnvelopeGenerator.Application.DTOs
|
|||||||
int SendingProfile,
|
int SendingProfile,
|
||||||
string SignatureHost,
|
string SignatureHost,
|
||||||
string ExternalProgramName,
|
string ExternalProgramName,
|
||||||
string ExportPath,
|
string ExportPath) : IUnique<int>
|
||||||
string DocumentPathDmz,
|
|
||||||
string ExportPathDmz,
|
|
||||||
string DocumentPathMoveAftsend) : IUnique<int>
|
|
||||||
{
|
{
|
||||||
|
[NotMapped]
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
[Obsolete("Configuration does not have an ID; it represents a single table in the database.")]
|
[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.");
|
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 DigitalData.Core.Abstractions;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Domain.Entities
|
namespace EnvelopeGenerator.Domain.Entities
|
||||||
{
|
{
|
||||||
@ -23,19 +24,9 @@ namespace EnvelopeGenerator.Domain.Entities
|
|||||||
[Column("EXPORT_PATH", TypeName = "nvarchar(256)")]
|
[Column("EXPORT_PATH", TypeName = "nvarchar(256)")]
|
||||||
public string? ExportPath { get; init; }
|
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.")]
|
[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.");
|
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
|
//if documenet_path_dmz is existing in config, replace the path with it
|
||||||
var config = await _configService.ReadDefaultAsync();
|
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()
|
return new()
|
||||||
{
|
{
|
||||||
Receiver = receiver,
|
Receiver = receiver,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user