Compare commits
11 Commits
86c9fdfcd7
...
567b9c9565
| Author | SHA1 | Date | |
|---|---|---|---|
| 567b9c9565 | |||
| b798181f91 | |||
| 7e8fc25ec9 | |||
| db76162697 | |||
| 2b4573ea73 | |||
| 4a043ed247 | |||
| a62a035ec6 | |||
| 1713a65014 | |||
| 695d7c83e0 | |||
| 428f71863d | |||
| cce2f8f90e |
@ -0,0 +1,47 @@
|
|||||||
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
using MediatR;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Application.Common.Notifications.RemoveSignature.Handlers;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class RemoveDocResult : INotificationHandler<RemoveSignatureNotification>
|
||||||
|
{
|
||||||
|
private readonly IRepository<Envelope> _repo;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="repository"></param>
|
||||||
|
public RemoveDocResult(IRepository<Envelope> repository)
|
||||||
|
{
|
||||||
|
_repo = repository;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="notification"></param>
|
||||||
|
/// <param name="cancel"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public Task Handle(RemoveSignatureNotification notification, CancellationToken cancel)
|
||||||
|
{
|
||||||
|
if(notification.EnvelopeId is null && notification.EnvelopeUuid is null)
|
||||||
|
return Task.CompletedTask;
|
||||||
|
|
||||||
|
return _repo.UpdateAsync(
|
||||||
|
envelope => envelope.DocResult = null,
|
||||||
|
query => {
|
||||||
|
if (notification.EnvelopeId is int envelopeId)
|
||||||
|
query = query.Where(envelope => envelope.Id == envelopeId);
|
||||||
|
|
||||||
|
if (notification.EnvelopeUuid is string uuid)
|
||||||
|
query = query.Where(envelope => envelope.Uuid == uuid);
|
||||||
|
|
||||||
|
return query;
|
||||||
|
}, cancel);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Dapper" Version="2.1.66" />
|
<PackageReference Include="Dapper" Version="2.1.66" />
|
||||||
<PackageReference Include="DigitalData.Core.Abstraction.Application" Version="1.4.0" />
|
<PackageReference Include="DigitalData.Core.Abstraction.Application" Version="1.5.0" />
|
||||||
<PackageReference Include="DigitalData.Core.Application" Version="3.4.0" />
|
<PackageReference Include="DigitalData.Core.Application" Version="3.4.0" />
|
||||||
<PackageReference Include="DigitalData.Core.Client" Version="2.1.0" />
|
<PackageReference Include="DigitalData.Core.Client" Version="2.1.0" />
|
||||||
<PackageReference Include="DigitalData.Core.Exceptions" Version="1.1.0" />
|
<PackageReference Include="DigitalData.Core.Exceptions" Version="1.1.0" />
|
||||||
|
|||||||
@ -1,18 +1,29 @@
|
|||||||
using MediatR;
|
using MediatR;
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
using EnvelopeGenerator.Application.Common.Query;
|
using EnvelopeGenerator.Application.Common.Query;
|
||||||
|
using EnvelopeGenerator.Application.Common.Dto;
|
||||||
|
using AutoMapper;
|
||||||
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
|
using EnvelopeGenerator.Application.Common.Extensions;
|
||||||
|
using EnvelopeGenerator.Domain.Entities;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Envelopes.Queries;
|
namespace EnvelopeGenerator.Application.Envelopes.Queries;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Repräsentiert eine Abfrage für Umschläge.
|
/// Repräsentiert eine Abfrage für Umschläge.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public record ReadEnvelopeQuery : EnvelopeQueryBase, IRequest
|
public record ReadEnvelopeQuery : EnvelopeQueryBase, IRequest<IEnumerable<EnvelopeDto>>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Abfrage des Include des Umschlags
|
/// Abfrage des Include des Umschlags
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public EnvelopeStatusQuery? Status { get; init; }
|
public EnvelopeStatusQuery? Status { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public bool? HasDocResult { get; init; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -65,4 +76,53 @@ public record EnvelopeStatusQuery
|
|||||||
/// Eine Liste von Statuswerten, die ignoriert werden werden.
|
/// Eine Liste von Statuswerten, die ignoriert werden werden.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public EnvelopeStatus[]? Ignore { get; init; }
|
public EnvelopeStatus[]? Ignore { get; init; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class ReadEnvelopeQueryHandler : IRequestHandler<ReadEnvelopeQuery, IEnumerable<EnvelopeDto>>
|
||||||
|
{
|
||||||
|
private readonly IMapper _mapper;
|
||||||
|
|
||||||
|
private readonly IRepository<Envelope> _repo;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="mapper"></param>
|
||||||
|
/// <param name="repo"></param>
|
||||||
|
public ReadEnvelopeQueryHandler(IMapper mapper, IRepository<Envelope> repo)
|
||||||
|
{
|
||||||
|
_mapper = mapper;
|
||||||
|
_repo = repo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancel"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
|
public async Task<IEnumerable<EnvelopeDto>> Handle(ReadEnvelopeQuery request, CancellationToken cancel)
|
||||||
|
{
|
||||||
|
var envelopesQ = _repo.Query.Where(request, notnull: false);
|
||||||
|
|
||||||
|
EnvelopeStatusQuery? statusQ = request.Status;
|
||||||
|
bool? hasDocResult = request.HasDocResult;
|
||||||
|
|
||||||
|
var filtered =
|
||||||
|
from envelope in envelopesQ
|
||||||
|
where (statusQ == null || statusQ.Include == null || statusQ.Include.Contains(envelope.Status))
|
||||||
|
&& (statusQ == null || statusQ.Ignore == null || !statusQ.Ignore.Contains(envelope.Status))
|
||||||
|
&& (statusQ == null || statusQ.Min == null || envelope.Status > statusQ.Min)
|
||||||
|
&& (statusQ == null || statusQ.Max == null || envelope.Status < statusQ.Max)
|
||||||
|
&& (!hasDocResult.HasValue || (hasDocResult.Value ? envelope.DocResult != null : envelope.DocResult == null))
|
||||||
|
select envelope;
|
||||||
|
|
||||||
|
var envelopes = await filtered.ToListAsync(cancel);
|
||||||
|
|
||||||
|
return _mapper.Map<IEnumerable<EnvelopeDto>>(envelopes);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -70,8 +70,8 @@
|
|||||||
<Reference Include="DigitalData.Controls.DocumentViewer, Version=1.9.8.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="DigitalData.Controls.DocumentViewer, Version=1.9.8.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\DigitalData.Controls.DocumentViewer.1.9.8\lib\net462\DigitalData.Controls.DocumentViewer.dll</HintPath>
|
<HintPath>..\packages\DigitalData.Controls.DocumentViewer.1.9.8\lib\net462\DigitalData.Controls.DocumentViewer.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="DigitalData.Core.Abstraction.Application, Version=1.4.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="DigitalData.Core.Abstraction.Application, Version=1.5.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\DigitalData.Core.Abstraction.Application.1.4.0\lib\net462\DigitalData.Core.Abstraction.Application.dll</HintPath>
|
<HintPath>..\packages\DigitalData.Core.Abstraction.Application.1.5.0\lib\net462\DigitalData.Core.Abstraction.Application.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="DigitalData.Core.Abstractions, Version=4.3.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="DigitalData.Core.Abstractions, Version=4.3.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\DigitalData.Core.Abstractions.4.3.0\lib\net462\DigitalData.Core.Abstractions.dll</HintPath>
|
<HintPath>..\packages\DigitalData.Core.Abstractions.4.3.0\lib\net462\DigitalData.Core.Abstractions.dll</HintPath>
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
<package id="AutoMapper" version="10.1.1" targetFramework="net462" />
|
<package id="AutoMapper" version="10.1.1" targetFramework="net462" />
|
||||||
<package id="BouncyCastle.Cryptography" version="2.5.0" targetFramework="net462" />
|
<package id="BouncyCastle.Cryptography" version="2.5.0" targetFramework="net462" />
|
||||||
<package id="DigitalData.Controls.DocumentViewer" version="1.9.8" targetFramework="net462" />
|
<package id="DigitalData.Controls.DocumentViewer" version="1.9.8" targetFramework="net462" />
|
||||||
<package id="DigitalData.Core.Abstraction.Application" version="1.4.0" targetFramework="net462" />
|
<package id="DigitalData.Core.Abstraction.Application" version="1.5.0" targetFramework="net462" />
|
||||||
<package id="DigitalData.Core.Abstractions" version="4.3.0" targetFramework="net462" />
|
<package id="DigitalData.Core.Abstractions" version="4.3.0" targetFramework="net462" />
|
||||||
<package id="DigitalData.Modules.Base" version="1.3.8" targetFramework="net462" />
|
<package id="DigitalData.Modules.Base" version="1.3.8" targetFramework="net462" />
|
||||||
<package id="DigitalData.Modules.Config" version="1.3.0" targetFramework="net462" />
|
<package id="DigitalData.Modules.Config" version="1.3.0" targetFramework="net462" />
|
||||||
|
|||||||
@ -72,8 +72,8 @@
|
|||||||
<Reference Include="DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
<Reference Include="DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||||
<Reference Include="DevExpress.XtraGauges.v21.2.Core, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
<Reference Include="DevExpress.XtraGauges.v21.2.Core, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||||
<Reference Include="DevExpress.XtraReports.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
<Reference Include="DevExpress.XtraReports.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||||
<Reference Include="DigitalData.Core.Abstraction.Application, Version=1.4.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="DigitalData.Core.Abstraction.Application, Version=1.5.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\DigitalData.Core.Abstraction.Application.1.4.0\lib\net462\DigitalData.Core.Abstraction.Application.dll</HintPath>
|
<HintPath>..\packages\DigitalData.Core.Abstraction.Application.1.5.0\lib\net462\DigitalData.Core.Abstraction.Application.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="DigitalData.Core.Abstractions, Version=4.3.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="DigitalData.Core.Abstractions, Version=4.3.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\DigitalData.Core.Abstractions.4.3.0\lib\net462\DigitalData.Core.Abstractions.dll</HintPath>
|
<HintPath>..\packages\DigitalData.Core.Abstractions.4.3.0\lib\net462\DigitalData.Core.Abstractions.dll</HintPath>
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
<packages>
|
<packages>
|
||||||
<package id="AutoMapper" version="10.1.1" targetFramework="net462" />
|
<package id="AutoMapper" version="10.1.1" targetFramework="net462" />
|
||||||
<package id="BouncyCastle.Cryptography" version="2.5.0" targetFramework="net462" />
|
<package id="BouncyCastle.Cryptography" version="2.5.0" targetFramework="net462" />
|
||||||
<package id="DigitalData.Core.Abstraction.Application" version="1.4.0" targetFramework="net462" />
|
<package id="DigitalData.Core.Abstraction.Application" version="1.5.0" targetFramework="net462" />
|
||||||
<package id="DigitalData.Core.Abstractions" version="4.3.0" targetFramework="net462" />
|
<package id="DigitalData.Core.Abstractions" version="4.3.0" targetFramework="net462" />
|
||||||
<package id="DigitalData.Modules.Base" version="1.3.8" targetFramework="net462" />
|
<package id="DigitalData.Modules.Base" version="1.3.8" targetFramework="net462" />
|
||||||
<package id="DigitalData.Modules.Config" version="1.3.0" targetFramework="net462" />
|
<package id="DigitalData.Modules.Config" version="1.3.0" targetFramework="net462" />
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
|
||||||
#if NETFRAMEWORK
|
#if NETFRAMEWORK
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@ -134,14 +133,12 @@ public class Envelope
|
|||||||
= false;
|
= false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
[NotMapped]
|
|
||||||
[Column("DOC_RESULT")]
|
[Column("DOC_RESULT")]
|
||||||
public byte[]
|
public byte[]
|
||||||
#if NET
|
#if NET
|
||||||
?
|
?
|
||||||
#endif
|
#endif
|
||||||
DocResult
|
DocResult { get; set; }
|
||||||
{ get; set; }
|
|
||||||
|
|
||||||
[ForeignKey("EnvelopeTypeId")]
|
[ForeignKey("EnvelopeTypeId")]
|
||||||
public virtual EnvelopeType
|
public virtual EnvelopeType
|
||||||
|
|||||||
@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="Controllers\" />
|
<Folder Include="Controllers\" />
|
||||||
|
<Folder Include="Controllers\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
35
EnvelopeGenerator.Finalizer/Extensions.cs
Normal file
35
EnvelopeGenerator.Finalizer/Extensions.cs
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
using EnvelopeGenerator.Finalizer.Job;
|
||||||
|
using Quartz;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Finalizer;
|
||||||
|
|
||||||
|
public static class Extensions
|
||||||
|
{
|
||||||
|
public static IServiceCollectionQuartzConfigurator ScheduleJobDefault<TJob>(this IServiceCollectionQuartzConfigurator q,
|
||||||
|
string croneEpression)
|
||||||
|
where TJob : IJob
|
||||||
|
{
|
||||||
|
var name = $"{typeof(TJob).FullName}";
|
||||||
|
var jobKey = new JobKey(name);
|
||||||
|
|
||||||
|
return q.ScheduleJob<TJob>(trigger => trigger
|
||||||
|
.WithIdentity(name + "-trigger")
|
||||||
|
.WithCronSchedule(croneEpression),
|
||||||
|
job => job.WithIdentity(jobKey)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IServiceCollectionQuartzConfigurator ScheduleJobDefault<TJob>(this IServiceCollectionQuartzConfigurator q,
|
||||||
|
IConfiguration configuration)
|
||||||
|
where TJob : IJob
|
||||||
|
{
|
||||||
|
var expression = configuration[$"{typeof(TJob).Name}:CronExpression"];
|
||||||
|
if (string.IsNullOrWhiteSpace(expression))
|
||||||
|
throw new InvalidOperationException(
|
||||||
|
"Cron expression for the Worker job is not configured. " +
|
||||||
|
"Please provide a valid cron schedule in the configuration under " +
|
||||||
|
$"'{typeof(TJob).FullName}:CronExpression'.");
|
||||||
|
|
||||||
|
return q.ScheduleJobDefault<TJob>(expression);
|
||||||
|
}
|
||||||
|
}
|
||||||
24
EnvelopeGenerator.Finalizer/Job/EnvelopeTaskApiJob.cs
Normal file
24
EnvelopeGenerator.Finalizer/Job/EnvelopeTaskApiJob.cs
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
using Quartz;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Finalizer.Job
|
||||||
|
{
|
||||||
|
public class EnvelopeTaskApiJob : IJob
|
||||||
|
{
|
||||||
|
private readonly ILogger<EnvelopeTaskApiJob> _logger;
|
||||||
|
|
||||||
|
public EnvelopeTaskApiJob(ILogger<EnvelopeTaskApiJob> logger)
|
||||||
|
{
|
||||||
|
_logger = logger;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task Execute(IJobExecutionContext context)
|
||||||
|
{
|
||||||
|
if (_logger.IsEnabled(LogLevel.Information))
|
||||||
|
{
|
||||||
|
_logger.LogInformation("{jobName} running at: {time}", context.JobDetail.Key, DateTimeOffset.Now);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
45
EnvelopeGenerator.Finalizer/Job/FinishEnvelopeJob.cs
Normal file
45
EnvelopeGenerator.Finalizer/Job/FinishEnvelopeJob.cs
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
using EnvelopeGenerator.Application.Envelopes.Queries;
|
||||||
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
using EnvelopeGenerator.Finalizer.Models;
|
||||||
|
using MediatR;
|
||||||
|
using Microsoft.Extensions.Options;
|
||||||
|
using Quartz;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Finalizer.Job
|
||||||
|
{
|
||||||
|
public class FinishEnvelopeJob : IJob
|
||||||
|
{
|
||||||
|
private readonly ILogger<FinishEnvelopeJob> _logger;
|
||||||
|
|
||||||
|
private readonly GdPictureOptions _gdPictureOptions;
|
||||||
|
|
||||||
|
private readonly IMediator _mediator;
|
||||||
|
|
||||||
|
public FinishEnvelopeJob(ILogger<FinishEnvelopeJob> logger, IOptions<GdPictureOptions> gdPictureOptions, IMediator mediator)
|
||||||
|
{
|
||||||
|
_logger = logger;
|
||||||
|
_gdPictureOptions = gdPictureOptions.Value;
|
||||||
|
_mediator = mediator;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task Execute(IJobExecutionContext context)
|
||||||
|
{
|
||||||
|
var cancel = context.CancellationToken;
|
||||||
|
if (_logger.IsEnabled(LogLevel.Information))
|
||||||
|
{
|
||||||
|
_logger.LogInformation("{jobName} running at: {time}", context.JobDetail.Key, DateTimeOffset.Now);
|
||||||
|
}
|
||||||
|
|
||||||
|
var envelopes = await _mediator.Send(new ReadEnvelopeQuery()
|
||||||
|
{
|
||||||
|
Status = new() { Include = [EnvelopeStatus.EnvelopeCompletelySigned] },
|
||||||
|
HasDocResult = false
|
||||||
|
}, cancel);
|
||||||
|
|
||||||
|
foreach (var envelope in envelopes)
|
||||||
|
{
|
||||||
|
// add sub-steps
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -2,6 +2,7 @@ using CommandDotNet.Execution;
|
|||||||
using EnvelopeGenerator.Application.ThirdPartyModules.Queries;
|
using EnvelopeGenerator.Application.ThirdPartyModules.Queries;
|
||||||
using EnvelopeGenerator.DependencyInjection;
|
using EnvelopeGenerator.DependencyInjection;
|
||||||
using EnvelopeGenerator.Finalizer;
|
using EnvelopeGenerator.Finalizer;
|
||||||
|
using EnvelopeGenerator.Finalizer.Job;
|
||||||
using EnvelopeGenerator.Finalizer.Models;
|
using EnvelopeGenerator.Finalizer.Models;
|
||||||
using EnvelopeGenerator.Infrastructure;
|
using EnvelopeGenerator.Infrastructure;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
@ -46,24 +47,11 @@ try
|
|||||||
builder.Services.AddSwaggerGen();
|
builder.Services.AddSwaggerGen();
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region AQuartz
|
#region Quartz
|
||||||
builder.Services.AddQuartz(q =>
|
builder.Services.AddQuartz(q =>
|
||||||
{
|
{
|
||||||
var name = $"{typeof(Worker).FullName}";
|
q.ScheduleJobDefault<FinishEnvelopeJob>(config);
|
||||||
var jobKey = new JobKey(name);
|
q.ScheduleJobDefault<EnvelopeTaskApiJob>(config);
|
||||||
q.AddJob<Worker>(opts => opts.WithIdentity(jobKey));
|
|
||||||
|
|
||||||
var expression = config[nameof(Worker) + ":CronExpression"];
|
|
||||||
if (string.IsNullOrWhiteSpace(expression))
|
|
||||||
throw new InvalidOperationException(
|
|
||||||
"Cron expression for the Worker job is not configured. " +
|
|
||||||
"Please provide a valid cron schedule in the configuration under " +
|
|
||||||
$"'{nameof(Worker)}:CronExpression'.");
|
|
||||||
|
|
||||||
q.AddTrigger(opts => opts
|
|
||||||
.ForJob(jobKey)
|
|
||||||
.WithIdentity(name + "-trigger")
|
|
||||||
.WithCronSchedule(expression));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
builder.Services.AddQuartzServer(options =>
|
builder.Services.AddQuartzServer(options =>
|
||||||
|
|||||||
@ -1,26 +0,0 @@
|
|||||||
using EnvelopeGenerator.Finalizer.Models;
|
|
||||||
using Microsoft.Extensions.Options;
|
|
||||||
using Quartz;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Finalizer
|
|
||||||
{
|
|
||||||
public class Worker : IJob
|
|
||||||
{
|
|
||||||
private readonly ILogger<Worker> _logger;
|
|
||||||
|
|
||||||
public Worker(ILogger<Worker> logger)
|
|
||||||
{
|
|
||||||
_logger = logger;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Task Execute(IJobExecutionContext context)
|
|
||||||
{
|
|
||||||
if (_logger.IsEnabled(LogLevel.Information))
|
|
||||||
{
|
|
||||||
_logger.LogInformation("Worker running at: {time}", DateTimeOffset.Now);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Task.CompletedTask;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
8
EnvelopeGenerator.Finalizer/appsettings.Job.json
Normal file
8
EnvelopeGenerator.Finalizer/appsettings.Job.json
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"FinishEnvelopeJob": {
|
||||||
|
"CronExpression": "* * * * * ?"
|
||||||
|
},
|
||||||
|
"EnvelopeTaskApiJob": {
|
||||||
|
"CronExpression": "* * * * * ?"
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,21 +0,0 @@
|
|||||||
{
|
|
||||||
"Logging": {
|
|
||||||
"LogLevel": {
|
|
||||||
"Default": "Information",
|
|
||||||
"Microsoft.Hosting.Lifetime": "Information"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"UseDbMigration": false,
|
|
||||||
"ConnectionStrings": {
|
|
||||||
"Default": "Server=SDD-VMP04-SQL17\\DD_DEVELOP01;Database=DD_ECM;User Id=sa;Password=dd;Encrypt=false;TrustServerCertificate=True;",
|
|
||||||
"DbMigrationTest": "Server=SDD-VMP04-SQL17\\DD_DEVELOP01;Database=DD_ECM_DATA_MIGR_TEST;User Id=sa;Password=dd;Encrypt=false;TrustServerCertificate=True;"
|
|
||||||
},
|
|
||||||
"DbTriggerParams": {
|
|
||||||
"Envelope": [ "TBSIG_ENVELOPE_AFT_INS" ],
|
|
||||||
"History": [ "TBSIG_ENVELOPE_HISTORY_AFT_INS" ],
|
|
||||||
"EmailOut": [ "TBEMLP_EMAIL_OUT_AFT_INS", "TBEMLP_EMAIL_OUT_AFT_UPD" ],
|
|
||||||
"EnvelopeReceiverReadOnly": [ "TBSIG_ENVELOPE_RECEIVER_READ_ONLY_UPD" ],
|
|
||||||
"Receiver": [],
|
|
||||||
"EmailTemplate": [ "TBSIG_EMAIL_TEMPLATE_AFT_UPD" ]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"Logging": {
|
|
||||||
"LogLevel": {
|
|
||||||
"Default": "Information",
|
|
||||||
"Microsoft.Hosting.Lifetime": "Information"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,81 +0,0 @@
|
|||||||
{
|
|
||||||
"Serilog": {
|
|
||||||
"Using": [ "Serilog.Sinks.Console", "Serilog.Sinks.File" ],
|
|
||||||
"MinimumLevel": {
|
|
||||||
"Default": "Verbose",
|
|
||||||
"Override": {
|
|
||||||
"Microsoft": "Warning",
|
|
||||||
"System": "Warning"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"WriteTo": [
|
|
||||||
{
|
|
||||||
"Name": "Console",
|
|
||||||
"Args": {
|
|
||||||
"outputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Name": "File",
|
|
||||||
"Args": {
|
|
||||||
"path": "E:/LogFiles/Digital Data/signFlow.Finalizer/log.Verbose-.txt",
|
|
||||||
"rollingInterval": "Day",
|
|
||||||
"restrictedToMinimumLevel": "Verbose",
|
|
||||||
"retainedFileCountLimit": 30,
|
|
||||||
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Name": "File",
|
|
||||||
"Args": {
|
|
||||||
"path": "E:/LogFiles/Digital Data/signFlow.Finalizer/log.Debug-.txt",
|
|
||||||
"rollingInterval": "Day",
|
|
||||||
"restrictedToMinimumLevel": "Debug",
|
|
||||||
"retainedFileCountLimit": 30,
|
|
||||||
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Name": "File",
|
|
||||||
"Args": {
|
|
||||||
"path": "E:/LogFiles/Digital Data/signFlow.Finalizer/log.Info-.txt",
|
|
||||||
"rollingInterval": "Day",
|
|
||||||
"restrictedToMinimumLevel": "Information",
|
|
||||||
"retainedFileCountLimit": 30,
|
|
||||||
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Name": "File",
|
|
||||||
"Args": {
|
|
||||||
"path": "E:/LogFiles/Digital Data/signFlow.Finalizer/log.Warning-.txt",
|
|
||||||
"rollingInterval": "Day",
|
|
||||||
"restrictedToMinimumLevel": "Warning",
|
|
||||||
"retainedFileCountLimit": 30,
|
|
||||||
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Name": "File",
|
|
||||||
"Args": {
|
|
||||||
"path": "E:/LogFiles/Digital Data/signFlow.Finalizer/log.Error-.txt",
|
|
||||||
"rollingInterval": "Day",
|
|
||||||
"restrictedToMinimumLevel": "Error",
|
|
||||||
"retainedFileCountLimit": 30,
|
|
||||||
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Name": "File",
|
|
||||||
"Args": {
|
|
||||||
"path": "E:/LogFiles/Digital Data/signFlow.Finalizer/log.Fatal-.txt",
|
|
||||||
"rollingInterval": "Day",
|
|
||||||
"restrictedToMinimumLevel": "Fatal",
|
|
||||||
"retainedFileCountLimit": 30,
|
|
||||||
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"Enrich": [ "FromLogContext", "WithMachineName", "WithThreadId" ]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
"IgnoredLabels": {
|
|
||||||
"Label": [
|
|
||||||
"Date",
|
|
||||||
"Datum",
|
|
||||||
"ZIP",
|
|
||||||
"PLZ",
|
|
||||||
"Place",
|
|
||||||
"Ort",
|
|
||||||
"Position",
|
|
||||||
"Stellung"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"Worker": {
|
|
||||||
"CronExpression": "* * * * * ?"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -22,8 +22,8 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Dapper" Version="2.1.66" />
|
<PackageReference Include="Dapper" Version="2.1.66" />
|
||||||
<PackageReference Include="DigitalData.Core.Abstraction.Application" Version="1.4.0" />
|
<PackageReference Include="DigitalData.Core.Abstraction.Application" Version="1.5.0" />
|
||||||
<PackageReference Include="DigitalData.Core.Infrastructure" Version="2.4.5" />
|
<PackageReference Include="DigitalData.Core.Infrastructure" Version="2.5.0" />
|
||||||
<PackageReference Include="QuestPDF" Version="2025.7.1" />
|
<PackageReference Include="QuestPDF" Version="2025.7.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Bogus" Version="35.6.3" />
|
<PackageReference Include="Bogus" Version="35.6.3" />
|
||||||
<PackageReference Include="coverlet.collector" Version="6.0.0" />
|
<PackageReference Include="coverlet.collector" Version="6.0.0" />
|
||||||
<PackageReference Include="DigitalData.Core.Abstraction.Application" Version="1.4.0" />
|
<PackageReference Include="DigitalData.Core.Abstraction.Application" Version="1.5.0" />
|
||||||
<PackageReference Include="DigitalData.Core.Abstractions" Version="4.3.0" />
|
<PackageReference Include="DigitalData.Core.Abstractions" Version="4.3.0" />
|
||||||
<PackageReference Include="DigitalData.Core.API" Version="2.2.1" />
|
<PackageReference Include="DigitalData.Core.API" Version="2.2.1" />
|
||||||
<PackageReference Include="DigitalData.Core.Application" Version="3.4.0" />
|
<PackageReference Include="DigitalData.Core.Application" Version="3.4.0" />
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user