You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using Connected.Data.DataProtection;
|
|
|
|
|
using Connected.Data.EntityProtection;
|
|
|
|
|
using Connected.Logistics.Documents.Receive;
|
|
|
|
|
using Connected.Middleware;
|
|
|
|
|
using Connected.ServiceModel;
|
|
|
|
|
|
|
|
|
|
namespace Connected.Logistics.Documents.Protection;
|
|
|
|
|
internal sealed class ReceiveProtector : MiddlewareComponent, IEntityProtector<IReceiveDocument>
|
|
|
|
|
{
|
|
|
|
|
public ReceiveProtector(IReceiveDocumentService documents)
|
|
|
|
|
{
|
|
|
|
|
Documents = documents;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IReceiveDocumentService Documents { get; }
|
|
|
|
|
|
|
|
|
|
public async Task Invoke(EntityProtectionArgs<IReceiveDocument> args)
|
|
|
|
|
{
|
|
|
|
|
if (await Documents.Select(new PrimaryKeyArgs<int> { Id = args.Entity.Id }) is not IReceiveDocument document)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
}
|