Used DateTimeOffset instead of DateTime

This commit is contained in:
Raymond den Haan 2024-07-12 08:08:29 +02:00
parent bd3797dea5
commit e52d716eaa
4 changed files with 8 additions and 8 deletions

View file

@ -5,5 +5,5 @@ public enum ApplicationRole
Default,
Api,
Worker,
Monitoring
Monitor
}

View file

@ -6,6 +6,6 @@ public class HasJournalUpdateRequest
/// The unique identifier of a workflow instance.
public string WorkflowInstanceId { get; set; } = default!;
/// The start date for checking for updates in the workflow instance.
public DateTime UpdatesSince { get; set; }
/// The start date for checking for updates in the workflow instance journal.
public DateTimeOffset UpdatesSince { get; set; }
}

View file

@ -31,8 +31,8 @@ public static class WebApplicationExtensions
config.Serializer.RequestDeserializer = DeserializeRequestAsync;
config.Serializer.ResponseSerializer = SerializeRequestAsync;
config.Binding.ValueParserFor<DateTime>(s =>
new(DateTime.TryParse(s.ToString(),CultureInfo.InvariantCulture,DateTimeStyles.RoundtripKind, out var result), result));
config.Binding.ValueParserFor<DateTimeOffset>(s =>
new(DateTimeOffset.TryParse(s.ToString(),CultureInfo.InvariantCulture,DateTimeStyles.RoundtripKind, out var result), result));
});
/// <summary>

View file

@ -2,12 +2,12 @@ using FastEndpoints;
namespace Elsa.Workflows.Api.Endpoints.WorkflowInstances.Journal.HasUpdates;
/// The request to check if there are updates for a workflow instance.
/// The request to check if there are updates for a workflow instance journal.
public class Request
{
/// The unique identifier of a workflow instance.
[BindFrom("id")] public string WorkflowInstanceId { get; set; } = default!;
/// The start date for checking for updates in the workflow instance.
public DateTime UpdatesSince { get; set; }
/// The start date for checking for updates in the workflow instance journal.
public DateTimeOffset UpdatesSince { get; set; }
}