Browse Source

Added interface.

pull/364/head
Sebastian Stehle 7 years ago
parent
commit
69e02c2db6
  1. 46
      src/Squidex.Domain.Apps.Core.Model/Contents/Status2.cs
  2. 24
      src/Squidex.Domain.Apps.Entities/Contents/IContentWorkflow.cs

46
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<Status2>
{
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;
}
}
}

24
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<Status2> GetInitialStatusAsync(ISchemaEntity schema);
Task<bool> IsValidNextStatus(IContentEntity content, Status2 next);
Task<Status2[]> GetNextsAsync(IContentEntity content);
Task<Status2[]> GetAllAsync(ISchemaEntity schema);
}
}
Loading…
Cancel
Save