Browse Source

Fix for scheduling.

pull/364/head
Sebastian 7 years ago
parent
commit
4b7fa30f4a
  1. 11
      src/Squidex.Domain.Apps.Entities/Contents/ScheduleJob.cs
  2. 10
      src/Squidex/Areas/Api/Controllers/Contents/Models/ScheduleJobDto.cs

11
src/Squidex.Domain.Apps.Entities/Contents/ScheduleJob.cs

@ -1,4 +1,5 @@
// ========================================================================== 
// ==========================================================================
// Squidex Headless CMS // Squidex Headless CMS
// ========================================================================== // ==========================================================================
// Copyright (c) Squidex UG (haftungsbeschraenkt) // Copyright (c) Squidex UG (haftungsbeschraenkt)
@ -22,17 +23,17 @@ namespace Squidex.Domain.Apps.Entities.Contents
public Instant DueTime { get; } public Instant DueTime { get; }
public ScheduleJob(Guid id, Status status, RefToken scheduledBy, Instant due) public ScheduleJob(Guid id, Status status, RefToken scheduledBy, Instant dueTime)
{ {
Id = id; Id = id;
ScheduledBy = scheduledBy; ScheduledBy = scheduledBy;
Status = status; Status = status;
DueTime = due; DueTime = dueTime;
} }
public static ScheduleJob Build(Status status, RefToken by, Instant due) public static ScheduleJob Build(Status status, RefToken scheduledBy, Instant dueTime)
{ {
return new ScheduleJob(Guid.NewGuid(), status, by, due); return new ScheduleJob(Guid.NewGuid(), status, scheduledBy, dueTime);
} }
} }
} }

10
src/Squidex/Areas/Api/Controllers/Contents/Models/ScheduleJobDto.cs

@ -6,6 +6,7 @@
// ========================================================================== // ==========================================================================
using System; using System;
using System.ComponentModel.DataAnnotations;
using NodaTime; using NodaTime;
using Squidex.Domain.Apps.Core.Contents; using Squidex.Domain.Apps.Core.Contents;
using Squidex.Infrastructure; using Squidex.Infrastructure;
@ -25,13 +26,14 @@ namespace Squidex.Areas.Api.Controllers.Contents.Models
public Status Status { get; set; } public Status Status { get; set; }
/// <summary> /// <summary>
/// The user who schedule the content. /// The target date and time when the content should be scheduled.
/// </summary> /// </summary>
public RefToken ScheduledBy { get; set; } public Instant DueTime { get; set; }
/// <summary> /// <summary>
/// The target date and time when the content should be scheduled. /// The user who schedule the content.
/// </summary> /// </summary>
public Instant DueTime { get; set; } [Required]
public RefToken ScheduledBy { get; set; }
} }
} }

Loading…
Cancel
Save