mirror of https://github.com/Squidex/squidex.git
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.
53 lines
1.5 KiB
53 lines
1.5 KiB
// ==========================================================================
|
|
// Squidex Headless CMS
|
|
// ==========================================================================
|
|
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
|
// All rights reserved. Licensed under the MIT license.
|
|
// ==========================================================================
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading;
|
|
using Squidex.Domain.Apps.Core.Rules.EnrichedEvents;
|
|
using Squidex.Domain.Apps.Events;
|
|
using Squidex.Infrastructure.EventSourcing;
|
|
|
|
namespace Squidex.Domain.Apps.Core.HandleRules
|
|
{
|
|
public interface IRuleTriggerHandler
|
|
{
|
|
Type TriggerType { get; }
|
|
|
|
bool CanCreateSnapshotEvents
|
|
{
|
|
get => false;
|
|
}
|
|
|
|
IAsyncEnumerable<EnrichedEvent> CreateSnapshotEventsAsync(RuleContext context,
|
|
CancellationToken ct)
|
|
{
|
|
return AsyncEnumerable.Empty<EnrichedEvent>();
|
|
}
|
|
|
|
IAsyncEnumerable<EnrichedEvent> CreateEnrichedEventsAsync(Envelope<AppEvent> @event, RuleContext context,
|
|
CancellationToken ct);
|
|
|
|
string? GetName(AppEvent @event)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
bool Trigger(Envelope<AppEvent> @event, RuleContext context)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
bool Trigger(EnrichedEvent @event, RuleContext context)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
bool Handles(AppEvent @event);
|
|
}
|
|
}
|
|
|