diff --git a/src/Squidex.Domain.Apps.Core.Model/Contents/Status2.cs b/src/Squidex.Domain.Apps.Core.Model/Contents/Status2.cs new file mode 100644 index 000000000..c8cbea8dd --- /dev/null +++ b/src/Squidex.Domain.Apps.Core.Model/Contents/Status2.cs @@ -0,0 +1,46 @@ +// ========================================================================== +// Squidex Headless CMS +// ========================================================================== +// Copyright (c) Squidex UG (haftungsbeschränkt) +// All rights reserved. Licensed under the MIT license. +// ========================================================================== + +using Squidex.Infrastructure; +using System; + +namespace Squidex.Domain.Apps.Core.Contents +{ + public struct Status2 : IEquatable + { + public static readonly Status2 Published = new Status2("Published"); + + public string Name { get; } + + public Status2(string name) + { + Guard.NotNullOrEmpty(name, nameof(name)); + + Name = name; + } + + public override bool Equals(object obj) + { + return base.Equals(obj); + } + + public bool Equals(Status2 other) + { + throw new NotImplementedException(); + } + + public override int GetHashCode() + { + return base.GetHashCode(); + } + + public override string ToString() + { + return Name; + } + } +} diff --git a/src/Squidex.Domain.Apps.Entities/Contents/IContentWorkflow.cs b/src/Squidex.Domain.Apps.Entities/Contents/IContentWorkflow.cs new file mode 100644 index 000000000..06738ec71 --- /dev/null +++ b/src/Squidex.Domain.Apps.Entities/Contents/IContentWorkflow.cs @@ -0,0 +1,24 @@ +// ========================================================================== +// Squidex Headless CMS +// ========================================================================== +// Copyright (c) Squidex UG (haftungsbeschraenkt) +// All rights reserved. Licensed under the MIT license. +// ========================================================================== + +using System.Threading.Tasks; +using Squidex.Domain.Apps.Core.Contents; +using Squidex.Domain.Apps.Entities.Schemas; + +namespace Squidex.Domain.Apps.Entities.Contents +{ + public interface IContentWorkflow + { + Task GetInitialStatusAsync(ISchemaEntity schema); + + Task IsValidNextStatus(IContentEntity content, Status2 next); + + Task GetNextsAsync(IContentEntity content); + + Task GetAllAsync(ISchemaEntity schema); + } +}