| | | 1 | | using Elsa.Workflows.Runtime.Entities; |
| | | 2 | | |
| | | 3 | | namespace Elsa.Workflows.Api.Endpoints.BookmarkQueueDeadLetters; |
| | | 4 | | |
| | | 5 | | public class ListRequest |
| | | 6 | | { |
| | | 7 | | public int? Page { get; set; } |
| | | 8 | | public int? PageSize { get; set; } |
| | | 9 | | public string? WorkflowInstanceId { get; set; } |
| | | 10 | | } |
| | | 11 | | |
| | | 12 | | public class ListResponse(ICollection<BookmarkQueueDeadLetterModel> items, long totalCount) |
| | | 13 | | { |
| | | 14 | | public ICollection<BookmarkQueueDeadLetterModel> Items { get; set; } = items; |
| | | 15 | | public long TotalCount { get; set; } = totalCount; |
| | | 16 | | } |
| | | 17 | | |
| | | 18 | | public class BookmarkQueueDeadLetterModel |
| | | 19 | | { |
| | 3 | 20 | | public string Id { get; set; } = null!; |
| | 3 | 21 | | public string? TenantId { get; set; } |
| | 3 | 22 | | public string OriginalQueueItemId { get; set; } = null!; |
| | 3 | 23 | | public string? WorkflowInstanceId { get; set; } |
| | 3 | 24 | | public string? CorrelationId { get; set; } |
| | 3 | 25 | | public string? BookmarkId { get; set; } |
| | 3 | 26 | | public string? StimulusHash { get; set; } |
| | 3 | 27 | | public string? ActivityInstanceId { get; set; } |
| | 3 | 28 | | public string? ActivityTypeName { get; set; } |
| | 3 | 29 | | public DateTimeOffset OriginalCreatedAt { get; set; } |
| | 3 | 30 | | public DateTimeOffset DeadLetteredAt { get; set; } |
| | 3 | 31 | | public string Reason { get; set; } = null!; |
| | 3 | 32 | | public int DeliveryAttempts { get; set; } |
| | 3 | 33 | | public DateTimeOffset? LastAttemptedAt { get; set; } |
| | 3 | 34 | | public string? LastErrorType { get; set; } |
| | 3 | 35 | | public string? LastErrorMessage { get; set; } |
| | 3 | 36 | | public bool CanReplay { get; set; } |
| | 3 | 37 | | public DateTimeOffset? ReplayedAt { get; set; } |
| | 3 | 38 | | public string? ReplayedQueueItemId { get; set; } |
| | | 39 | | |
| | 1 | 40 | | public static BookmarkQueueDeadLetterModel FromEntity(BookmarkQueueDeadLetterItem item) => new() |
| | 1 | 41 | | { |
| | 1 | 42 | | Id = item.Id, |
| | 1 | 43 | | TenantId = item.TenantId, |
| | 1 | 44 | | OriginalQueueItemId = item.OriginalQueueItemId, |
| | 1 | 45 | | WorkflowInstanceId = item.WorkflowInstanceId, |
| | 1 | 46 | | CorrelationId = item.CorrelationId, |
| | 1 | 47 | | BookmarkId = item.BookmarkId, |
| | 1 | 48 | | StimulusHash = item.StimulusHash, |
| | 1 | 49 | | ActivityInstanceId = item.ActivityInstanceId, |
| | 1 | 50 | | ActivityTypeName = item.ActivityTypeName, |
| | 1 | 51 | | OriginalCreatedAt = item.OriginalCreatedAt, |
| | 1 | 52 | | DeadLetteredAt = item.DeadLetteredAt, |
| | 1 | 53 | | Reason = item.Reason, |
| | 1 | 54 | | DeliveryAttempts = item.DeliveryAttempts, |
| | 1 | 55 | | LastAttemptedAt = item.LastAttemptedAt, |
| | 1 | 56 | | LastErrorType = item.LastErrorType, |
| | 1 | 57 | | LastErrorMessage = item.LastErrorMessage, |
| | 1 | 58 | | CanReplay = item.CanReplay, |
| | 1 | 59 | | ReplayedAt = item.ReplayedAt, |
| | 1 | 60 | | ReplayedQueueItemId = item.ReplayedQueueItemId |
| | 1 | 61 | | }; |
| | | 62 | | } |
| | | 63 | | |
| | | 64 | | public class ReplayResponse(bool replayed, string? queueItemId, string? reason) |
| | | 65 | | { |
| | | 66 | | public bool Replayed { get; set; } = replayed; |
| | | 67 | | public string? QueueItemId { get; set; } = queueItemId; |
| | | 68 | | public string? Reason { get; set; } = reason; |
| | | 69 | | } |