This commit is contained in:
Zeeshaun
2026-03-24 15:26:03 -05:00
parent 1e5beb292a
commit 9cc87337b8
333 changed files with 17931 additions and 0 deletions
@@ -0,0 +1,23 @@
using System.Collections.Generic;
namespace LCU.Library.Internal.DispatcherModels.Constants;
public static class ActionMessages
{
public static readonly List<string> Messages = new()
{
Retry,
Skip,
RunJob,
CancelJob,
ActivateJob,
DeactivateJob
};
public const string Retry = "Retry Attempted";
public const string Skip = "Skipped Item";
public const string RunJob = "Run Now has closed this Execution and a new Execution has been started";
public const string CancelJob = "Cancel Job";
public const string ActivateJob = "Activate Job";
public const string DeactivateJob = "Deactivate Job";
}
@@ -0,0 +1,16 @@
using System.Collections.Generic;
namespace LCU.Library.Internal.DispatcherModels.Constants;
public static class JobSortableFields
{
public static readonly List<string> JobFields = new()
{
Description,
Name,
NextRunTime
};
public const string Description = "Description";
public const string Name = "Name";
public const string NextRunTime = "NextRunTime";
}
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace LCU.Library.Internal.DispatcherModels.Entities
{
public class CleanUpJobSetting
{
public int CleanUpJobSettingId { get; set; }
[Required]
[Range(-1000, 0, ErrorMessage = "Value must be 0 or a negative number. ")]
public int CompletionDaysPast { get; set; }
[ForeignKey("CleanUpJobSettingId")]
public ICollection<CleanUpJobTag> CleanUpJobTags { get; set; }
}
}
@@ -0,0 +1,15 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace LCU.Library.Internal.DispatcherModels.Entities
{
public class CleanUpJobTag
{
public int CleanUpJobTagId { get; set; }
[Required]
public int CleanUpJobSettingId { get; set; }
public int TagId { get; set; }
[ForeignKey("TagId")]
public Tag Tag { get; set; }
}
}
@@ -0,0 +1,26 @@
using System;
using System.ComponentModel.DataAnnotations;
namespace LCU.Library.Internal.DispatcherModels.Entities;
public class ExecutionMessage
{
public ExecutionMessage()
{
}
public ExecutionMessage(int workItemExecutionId, string message)
{
WorkItemExecutionId = workItemExecutionId;
Message = message;
User = Environment.UserName;
MessageDate = DateTime.Now;
}
public int ExecutionMessageId { get; set; }
[Required]
public int WorkItemExecutionId { get; set; }
public string User { get; set; }
public DateTime? MessageDate { get; set; }
public string Message { get; set; }
}
@@ -0,0 +1,98 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using LCU.Library.Internal.ApiResponse.Models;
using LCU.Library.Internal.DispatcherModels.Enums;
using LCU.Library.Internal.DispatcherModels.Models;
namespace LCU.Library.Internal.DispatcherModels.Entities;
public class Job : Errorable
{
public int JobId { get; set; }
[Required]
[StringLength(200, ErrorMessage = "Requesting Application Max Length is 200")]
public string RequestingApplication { get; set; }
[Required]
[StringLength(200, ErrorMessage = "Name Max Length is 200")]
public string Name { get; set; }
[StringLength(8000, ErrorMessage = "Description Max Length is 8000")]
public string Description { get; set; }
[Required]
[StringLength(200, ErrorMessage = "Created by Max Length is 200")]
public string CreatedBy { get; set; }
public DateTime CreatedAt { get; set; }
[StringLength(200, ErrorMessage = "Modified by Max Length is 200")]
public string ModifiedBy { get; set; }
public DateTime? ModifiedDate { get; set; }
public string CronSchedule { get; set; }
public DateTime? NextRunTime { get; set; }
public DateTime? SoftDeleteDate { get; set; }
public bool SkipHolidays { get; set; } = false;
public JobStatus JobStatus { get; set; } = JobStatus.Inactive;
[ForeignKey("JobId")]
public ICollection<JobErrorRecipient> JobErrorRecipients { get; set; } = new List<JobErrorRecipient>();
[ForeignKey("JobId")]
public ICollection<JobTag> JobTags { get; set; } = new List<JobTag>();
[Required]
[ForeignKey("JobId")]
public ICollection<WorkItem> WorkItems { get; set; } = new List<WorkItem>();
[NotMapped]
public bool IsNewJob
{
get
{
return JobId <= 0;
}
}
public void ResetRunTimeAndStatus()
{
NextRunTime = null;
JobStatus = JobStatus.Inactive;
}
[NotMapped]
public bool IsPending
{
get
{
return WorkItems.All(workItem => workItem.CurrentWorkItemExecution == null);
}
}
[NotMapped]
public StatusType CurrentStatus
{
get
{
if (NextRunTime == null)
{
return StatusType.Inactive;
}
var currentWorkItem = WorkItems.FirstOrDefault(workItem => workItem.CurrentWorkItemExecution != null);
return IsPending || currentWorkItem == null ? StatusType.Pending : currentWorkItem.CurrentWorkItemExecution.Status;
}
}
[NotMapped]
public ReturnResponse ReturnResponse { get; set; }
}
@@ -0,0 +1,8 @@
namespace LCU.Library.Internal.DispatcherModels.Entities;
public class JobErrorRecipient
{
public int JobErrorRecipientId { get; set; }
public int JobId { get; set; }
public string Recipient { get; set; }
}
@@ -0,0 +1,11 @@
using System.ComponentModel.DataAnnotations.Schema;
namespace LCU.Library.Internal.DispatcherModels.Entities;
public class JobTag
{
public int JobTagId { get; set; }
public int JobId { get; set; }
public int TagId { get; set; }
[ForeignKey("TagId")]
public Tag Tag { get; set; }
}
@@ -0,0 +1,10 @@
using System.ComponentModel.DataAnnotations;
namespace LCU.Library.Internal.DispatcherModels.Entities;
public class Tag
{
public int TagId { get; set; }
[Required]
[StringLength(300, ErrorMessage = "Requesting Application Max Length is 300")]
public string TagName { get; set; }
}
@@ -0,0 +1,48 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using LCU.Library.Internal.DispatcherModels.Enums;
using LCU.Library.Internal.DispatcherModels.Helpers;
namespace LCU.Library.Internal.DispatcherModels.Entities;
public class WorkItem
{
public int WorkItemId { get; set; }
public int JobId { get; set; }
[Required]
[StringLength(200, ErrorMessage = "Name Max Length is 200")]
public string Name { get; set; }
[StringLength(8000, ErrorMessage = "Description Max Length is 8000")]
public string Description { get; set; }
[Required]
public int Order { get; set; }
public string SerializedPayload { get; set; }
public string Url { get; set; }
public HttpMethodType HttpMethod { get; set; }
[Required]
public ActionType ActionType { get; set; }
public bool CancelJobOnFailure { get; set; }
public int CancelJobLimit { get; set; }
public int CanceledJobCounter { get; set; }
[ForeignKey("WorkItemId")]
public ICollection<WorkItemExecution> WorkItemExecutions { get; set; }
[NotMapped]
public WorkItemExecution CurrentWorkItemExecution
{
get
{
var currentWorkItemExecution = WorkItemExecutions?.FirstOrDefault(wie => wie.CompletedTimestamp == null);
if (currentWorkItemExecution != null)
{
currentWorkItemExecution = Clone.DeepClone(currentWorkItemExecution);
}
return currentWorkItemExecution;
}
}
[NotMapped]
public bool IsNewWorkItem => WorkItemId <= 0;
[NotMapped]
public bool RequiresJobCancellation => CancelJobOnFailure && CanceledJobCounter <= CancelJobLimit;
}
@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using LCU.Library.Internal.DispatcherModels.Enums;
using LCU.Library.Internal.DispatcherModels.Models;
namespace LCU.Library.Internal.DispatcherModels.Entities;
public class WorkItemExecution : Errorable
{
public WorkItemExecution()
{
}
public WorkItemExecution(int workItemId)
{
WorkItemId = workItemId;
Status = StatusType.Processing;
StartedTimestamp = DateTime.Now;
}
public int WorkItemExecutionId { get; set; }
[Required]
public int WorkItemId { get; set; }
[Required]
public StatusType Status { get; set; }
public DateTime? StartedTimestamp { get; set; }
public DateTime? CompletedTimestamp { get; set; }
[ForeignKey("WorkItemExecutionId")]
public ICollection<ExecutionMessage> ExecutionMessages { get; set; }
public static WorkItemExecution SetAsFinal(WorkItemExecution workItemExecution, StatusType finalStatus)
{
workItemExecution.Status = finalStatus;
workItemExecution.CompletedTimestamp = DateTime.Now;
return workItemExecution;
}
}
@@ -0,0 +1,69 @@
namespace LCU.Library.Internal.DispatcherModels.Enums;
public enum ActionType
{
MoveFile = 0,
CopyFile = 1,
RenameFile = 2,
DeleteFile = 3,
//SftpFile = 4,
//SftpDynamicFile = 5,
ZipDirectory = 6,
Email = 7,
CreateDirectory = 8,
RenameDirectory = 9,
UnzipFile = 10,
CoreArchiveRequest = 11,
EncryptFileData = 12,
DecryptFileData = 13,
SftpUploadFile = 14,
SftpDownloadFile = 15,
ModifyFile = 16,
DocumentIngestor = 17,
DocumentBatchIngestion = 18,
UnzipPasswordProtectedFile = 19,
IngestorPdfPartitioner = 20,
MemberDocumentNotification = 21,
RemoteDepositCaptureXmlFile = 22,
DeleteDirectory = 23,
DataCleanUp = 24,
AtmPersonCheckHolds = 25,
HistoricalDocumentIngestor = 26,
HistoricalDocumentBatchIngestion = 27,
HistoricalIngestorPdfPartitioner = 28,
NoticeProcessorExtractRequest = 29,
NoticeProcessorSummaryEmailRequest = 30,
DataCleanupNcoaUpdateRequest = 31,
IngestionFolderCleanUp = 32,
MomBotRequest = 33,
BlendDataRequest = 34,
DialerUploadRequest = 35,
UploadDoNotCallRequest = 36,
DataCleanUpFannieMaeRequest = 37,
CreateVoAppsCampaignsRequest = 38,
UploadVoAppsCampaignResultsRequest = 39,
ImportCreditCardSalesRequest = 40,
DataCleanUpIndirectFundingRequest = 41,
ImportIndirectVehicleSalesRequest = 42,
ValidateFileRequest = 43,
ExtractIndexFileData = 44,
IndexFieldMapperRequest = 45,
DealerAchNotificationRequest = 46,
InitiateRealTimeAlertsRequest = 47,
InitiateRealTimeAlertsErroredProcessingRequest = 48,
IncentiveProcessRequest = 49,
NightlyIncentiveProcessRequest = 50,
ActionCreditCardRequest = 51,
ActionVehicleRequest = 52,
AlliedGapMbpRequest = 53,
DayforceProcessRequest = 54,
GoalDispersalRequest = 55,
PayoutIncentiveRequest = 56,
ReportingRequest = 57,
ValidateFileSizeInRange = 58,
DeleteEmptyDirectoryRequest = 59,
DocumentRetentionCleanupRequest = 60,
UploadVoAppsCampaignResultsErrorRequest = 61,
RepoBatchProcessRequest = 62,
DocumentIngestorProcessStatusEmail = 63
}
@@ -0,0 +1,8 @@
namespace LCU.Library.Internal.DispatcherModels.Enums;
public enum DetermineOperationType
{
Completed = 0,
Failed = 1,
Skipped = 2
}
@@ -0,0 +1,7 @@
namespace LCU.Library.Internal.DispatcherModels.Enums;
public enum HttpMethodType
{
Unknown,
Post
}
@@ -0,0 +1,12 @@
namespace LCU.Library.Internal.DispatcherModels.Enums
{
public enum JobStatus
{
Inactive = 0,
ReadyToSchedule = 1,
PendingToRun = 2,
Processing = 3,
DeterminingOperation = 4,
Failed = 5
}
}
@@ -0,0 +1,11 @@
namespace LCU.Library.Internal.DispatcherModels.Enums;
public enum StatusType
{
Pending,
Processing,
Completed,
Failed,
Inactive,
Skipped
}
@@ -0,0 +1,16 @@
using Newtonsoft.Json;
namespace LCU.Library.Internal.DispatcherModels.Helpers;
public static class Clone
{
public static T DeepClone<T>(this T source)
{
if (source is null)
{
return default;
}
var deserializeSettings = new JsonSerializerSettings { ObjectCreationHandling = ObjectCreationHandling.Replace };
return JsonConvert.DeserializeObject<T>(JsonConvert.SerializeObject(source), deserializeSettings);
}
}
@@ -0,0 +1,146 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Version>1.20.14</Version>
<Description>
1.0.0 - Initial Creation
1.1.0 - Addition of Tag, JobTag, new filter for tags, and List of JobTags in Job model.
1.2.0 - Addition of new Sftp action types in enum.
1.3.0 - Addition of JobSortable field constants, Job Filter model changes.
1.4.0 - Addition of JobTags to JobDetails model.
1.5.0 - Upgrade ApiResponse.Models nuget
1.6.0 - Tag name attribute update
1.7.0 - Addition of Pagination models
1.8.0 - Addition of Execution Messages model
1.9.0 - Update to Action Message constant
1.10.0 - Update to Action Type model
1.11.0 - Added DocumentIngestor to ActionType
1.11.1 - WorkItemExecution change for creation constructor to set StartedTimestamp and create a new SetAsCompleted helper method.
1.12.0 - Added BatchIngestion and UnzipPasswordProtected ActionTypes
1.13.0 - Added DocumentIngestor IngestorPdfPartitionerRequest
1.14.0 - Added DocumentIngestor's MemberDocumentNotificationRequest
1.15.0 - Added RemoteDepositCaptureXmlRequest and updated DocumentIngestorModels nuget
1.16.0 - Added DeleteDirectoryRequest Workitem and updated DocumentIngestorModels nuget
1.17.0 - Added UpdatePersonForCheckHoldRequest and DataCleanup Workitems
1.18.0 - Update FileOperations and FTP API Nuget for models
1.18.1 - Added HistoricalDocumentIngestor, HistoricalDocumentBatchIngestion, and HistoricalIngestorPdfPartitioner WorkItems
1.19.0 - Add ExtractRequest and ProcessingSummaryEmail request from NoticeProcessor API
1.19.1 - Added new WorkItem Properties for Canceling Jobs on Failure.
1.19.2 - Refactors/Cleanup
1.19.3 - Removed unused Job property ReadyForScheduling and added defaults for Job property collections.
1.19.4 - Add NcoaUpdate workItem
1.19.5 - Removed SystemMessage field from WorkItemExecution
1.19.6 - Changed ErrorMessage and limit for Job, JobDetails, WorkItem, and WorkItemDetails Description
1.19.7 - Update Job model and add CleanUpJobSetting and CleanUpJobTag
1.19.8 - Add IngestionFolderCleanUp WorkItem
1.19.9 - Add MomBot WorkItem
1.19.10 - Removed SftpFile and SftpDynamicFile from ActionType Enum
1.19.11 - Add BlendApi Data Sync Request WorkItem
1.19.12 - Added DialerUploadRequest WorkItem
1.19.13 - Added UploadDoNotCallRequest WorkItem
1.19.14 - Added FannieMaeMortgageRequest WorkItem
1.19.15 - Added CreateVoAppsCampaignsRequest WorkItem
1.19.16 - Added UploadVoAppsCampaignRequest WorkItem
1.19.17 - Added ImportCreditCardSalesRequest WorkItem
1.19.18 - Added DataCleanUpIndirectFundingRequest WorkItem
1.19.19 - Added ImportIndirectVehicleSalesRequest WorkItem
1.19.20 - Added SkipHolidays to Job
1.19.21 - Add ValidateFileRequest FileOperations WorkItem
1.19.22 - Added ExtractIndexFileData WorkItem
1.19.23 - Added IndexFieldMapperRequest WorkItem
1.19.24 - Added DealerAchNotification WorkItem
1.19.25 - Add RealTimeAlerts WorkItem
1.19.26 - Add RealTimeAlerts Errored Process WorkItem
1.20.0 - Upgrade to dotnet8
1.20.1 - Add CopyJobRequest and CopyJobResponse
1.20.2 - Remove CopyJobResponse
1.20.3 - Add Incentive Mgr Work Items
1.20.4 - Add ValidateFileSizeInRangeRequest
1.20.5 - Added DeleteEmptyDirectoryRequest WorkItem
1.20.6 - Added DocumentRetentionCleanup WorkItem
1.20.7 - Update DispatcherReturnResponse
1.20.8 - Add DetermineOperationType Enum
1.20.9 - Update Filter Defaults for JobStatus
1.20.10 - Add JobStatus to JobDetails
1.20.11 - Added VoAppsCampaignErrorResults WorkItem
1.20.12 - Update JobErrorDetail to use JobStatus
1.20.13 - Update for RepoAPI
1.20.14 - Update DocumentIngestorModels Nuget package
</Description>
<PackageReleaseNotes>
1.0.0 - Initial Creation
1.1.0 - Addition of Tag, JobTag, new filter for tags, and List of JobTags in Job model.
1.2.0 - Addition of new Sftp action types in enum.
1.3.0 - Addition of JobSortable field constants, Job Filter model changes.
1.4.0 - Addition of JobTags to JobDetails model.
1.5.0 - Upgrade ApiResponse.Models nuget
1.6.0 - Tag name attribute update
1.7.0 - Addition of Pagination models
1.8.0 - Addition of Execution Messages model
1.9.0 - Update to Action Message constant
1.10.0 - Update to Action Type model
1.11.0 - Added DocumentIngestor to ActionType
1.11.1 - WorkItemExecution change for creation constructor to set StartedTimestamp and create a new SetAsCompleted helper method.
1.12.0 - Added BatchIngestion and UnzipPasswordProtected ActionTypes
1.13.0 - Added DocumentIngestor IngestorPdfPartitionerRequest
1.14.0 - Added DocumentIngestor's MemberDocumentNotificationRequest
1.15.0 - Added RemoteDepositCaptureXmlRequest and updated DocumentIngestorModels nuget
1.16.0 - Added DeleteDirectoryRequest Workitem and updated DocumentIngestorModels nuget
1.17.0 - Added UpdatePersonForCheckHoldRequest and DataCleanup Workitems
1.18.0 - Update FileOperations and FTP API Nuget for models
1.18.1 - Added HistoricalDocumentIngestor, HistoricalDocumentBatchIngestion, and HistoricalIngestorPdfPartitioner WorkItems
1.19.0 - Add ExtractRequest and ProcessingSummaryEmail request from NoticeProcessor API
1.19.1 - Added new WorkItem Properties for Canceling Jobs on Failure.
1.19.2 - Refactors/Cleanup
1.19.3 - Removed unused Job property ReadyForScheduling and added defaults for Job property collections.
1.19.4 - Add NcoaUpdate workItem
1.19.5 - Removed SystemMessage field from WorkItemExecution
1.19.6 - Changed ErrorMessage and limit for Job, JobDetails, WorkItem, and WorkItemDetails Description
1.19.7 - Update Job model and add CleanUpJobSetting and CleanUpJobTag
1.19.8 - Add IngestionFolderCleanUp WorkItem
1.19.9 - Add MomBot WorkItem
1.19.10 - Removed SftpFile and SftpDynamicFile from ActionType Enum
1.19.11 - Add BlendApi Data Sync Request WorkItem
1.19.12 - Added DialerUploadRequest WorkItem
1.19.13 - Added UploadDoNotCallRequest WorkItem
1.19.14 - Added FannieMaeMortgageRequest WorkItem
1.19.15 - Added CreateVoAppsCampaignsRequest WorkItem
1.19.16 - Added UploadVoAppsCampaignRequest WorkItem
1.19.17 - Added ImportCreditCardSalesRequest WorkItem
1.19.18 - Added DataCleanUpIndirectFundingRequest WorkItem
1.19.19 - Added ImportIndirectVehicleSalesRequest WorkItem
1.19.20 - Added SkipHolidays to Job
1.19.21 - Add ValidateFileRequest FileOperations WorkItem
1.19.22 - Added ExtractIndexFileData WorkItem
1.19.23 - Added IndexFieldMapperRequest WorkItem
1.19.24 - Added DealerAchNotification WorkItem
1.19.25 - Add RealTimeAlerts WorkItem
1.19.26 - Add RealTimeAlerts Errored Process WorkItem
1.20.0 - Upgrade to dotnet8
1.20.1 - Add CopyJobRequest and CopyJobResponse
1.20.2 - Remove CopyJobResponse
1.20.3 - Add Incentive Mgr Work Items
1.20.4 - Add ValidateFileSizeInRangeRequest
1.20.5 - Added DeleteEmptyDirectoryRequest WorkItem
1.20.6 - Added DocumentRetentionCleanup WorkItem
1.20.7 - Update DispatcherReturnResponse
1.20.8 - Add DetermineOperationType Enum
1.20.9 - Update Filter Defaults for JobStatus
1.20.10 - Add JobStatus to JobDetails
1.20.11 - Added VoAppsCampaignErrorResults WorkItem
1.20.12 - Update JobErrorDetail to use JobStatus
1.20.13 - Update for RepoAPI
1.20.14 - Update DocumentIngestorModels Nuget package
</PackageReleaseNotes>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="LCU.Library.Internal.ApiResponse.Models" Version="3.3.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
</ItemGroup>
</Project>
@@ -0,0 +1,7 @@
namespace LCU.Library.Internal.DispatcherModels.Models;
public class DispatcherReturnResponse
{
public int WorkItemId { get; set; }
public bool Skipped { get; set; } = false;
}
@@ -0,0 +1,6 @@
namespace LCU.Library.Internal.DispatcherModels.Models;
public class Errorable
{
public int? AttemptsToExecute { get; set; }
}
@@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace LCU.Library.Internal.DispatcherModels.Models;
public class Filter
{
/// <summary>
/// Filter has default of all statuses minus Inactive and default to NextRunTime Ascending for sorting.
/// This prevents null NextRunTimes to display first, user will see the most recent NextRunTime
/// </summary>
public Filter()
{
var listStatus = new List<StatusFilter>();
foreach (var item in Enum.GetValues(typeof(Enums.JobStatus)))
{
if ((Enums.JobStatus)item != Enums.JobStatus.Inactive)
{
StatusFilter statusFilter = new() { IsEnabled = true, JobStatus = (Enums.JobStatus)item };
listStatus.Add(statusFilter);
}
}
var listSortableFields = new List<SortableField>();
SortableField sortField = new() { Field = Constants.JobSortableFields.NextRunTime, IsDescending = false };
listSortableFields.Add(sortField);
StatusFilters = listStatus;
SortableFields = listSortableFields;
Page = 1;
Limit = 10;
}
public string JobName { get; set; }
public string JobDescription { get; set; }
public DateTime? NextRuntimeGreaterThanDate { get; set; } = null;
public List<StatusFilter> StatusFilters { get; set; }
public List<int> TagIdFilters { get; set; }
public List<SortableField> SortableFields { get; set; }
[Range(1, 1000)]
public int Page { get; set; }
[Range(1, 1000)]
public int Limit { get; set; }
}
@@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using LCU.Library.Internal.DispatcherModels.Entities;
using LCU.Library.Internal.DispatcherModels.Enums;
namespace LCU.Library.Internal.DispatcherModels.Models;
public class JobDetails
{
public int JobId { get; set; } = 0;
[StringLength(200, ErrorMessage = "Requesting Application Max Length is 200")]
public string RequestingApplication { get; set; }
[Required]
[StringLength(200, ErrorMessage = "Name Max Length is 200")]
public string Name { get; set; }
[StringLength(8000, ErrorMessage = "Description Max Length is 8000")]
public string Description { get; set; }
public string CreatedBy { get; set; }
public DateTime CreatedAt { get; set; }
public string ModifiedBy { get; set; }
public DateTime? ModifiedDate { get; set; }
public string CronSchedule { get; set; }
public DateTime? NextRunTime { get; set; }
public bool SkipHolidays { get; set; } = false;
public JobStatus JobStatus { get; set; } = JobStatus.Inactive;
public List<string> ErrorRecipients { get; set; }
public List<JobTag> JobTags { get; set; }
}
@@ -0,0 +1,9 @@
namespace LCU.Library.Internal.DispatcherModels.Models;
public class JobErrorDetail
{
public string JobName { get; set; }
public string WorkItemName { get; set; }
public string JobStatus { get; set; }
public string StartTime { get; set; }
}
@@ -0,0 +1,31 @@
using LCU.Library.Internal.DispatcherModels.Models.Results;
using System;
using System.Collections.Generic;
namespace LCU.Library.Internal.DispatcherModels.Models;
public class PagedResponse<T> where T : class
{
public PagedResponse() { }
public PagedResponse(PagedResult<T> pagedResult, Filter filter)
{
TotalItems = pagedResult.Total;
Items = pagedResult.Items;
TotalPages = pagedResult.Total == 0 ? 1 : (int)Math.Ceiling((decimal)pagedResult.Total / filter.Limit);
CurrentPage = filter.Page > this.TotalPages ? this.TotalPages : filter.Page;
if (pagedResult.Total > (filter.Page * filter.Limit))
{
NextPage = filter.Page + 1;
}
if (filter.Page > 1)
{
PreviousPage = filter.Page - 1;
}
}
public IEnumerable<T> Items { get; set; }
public int NextPage { get; set; }
public int PreviousPage { get; set; }
public int TotalItems { get; set; }
public int CurrentPage { get; set; }
public int TotalPages { get; set; }
}
@@ -0,0 +1,9 @@
using System.Collections.Generic;
namespace LCU.Library.Internal.DispatcherModels.Models.Requests
{
public class BatchedErroredJobAlertRequest
{
public List<ErroredJobAlertRequest> ErroredJobAlertRequests { get; set; }
}
}
@@ -0,0 +1,7 @@
namespace LCU.Library.Internal.DispatcherModels.Models.Requests;
public class CopyJobRequest
{
public int JobId { get; set; }
public bool ChangeEnvironment { get; set; } = true;
}
@@ -0,0 +1,12 @@
using LCU.Library.Internal.DispatcherModels.Entities;
using LCU.Library.Internal.DispatcherModels.Enums;
namespace LCU.Library.Internal.DispatcherModels.Models.Requests
{
public class DetermineOperationRequest
{
public Job CurrentJob { get; set; }
public WorkItem CurrentWorkItem { get; set; }
public DetermineOperationType DetermineOperationType { get; set; }
}
}
@@ -0,0 +1,10 @@
using LCU.Library.Internal.DispatcherModels.Entities;
namespace LCU.Library.Internal.DispatcherModels.Models.Requests
{
public class ErroredJobAlertRequest
{
public Job CurrentJob { get; set; }
public WorkItem CurrentWorkItem { get; set; }
}
}
@@ -0,0 +1,11 @@
using System.Collections.Generic;
namespace LCU.Library.Internal.DispatcherModels.Models.Requests
{
public class JobFailureRequest
{
public int JobId { get; set; }
public int WorkItemId { get; set; }
public List<string> ExecutionMessages { get; set; }
}
}
@@ -0,0 +1,36 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
namespace LCU.Library.Internal.DispatcherModels.Models.Results
{
public class CleanUpJobBatchResult
{
public List<string> Messages { get; set; } = new List<string>();
public int FailureCount { get; set; } = 0;
[NotMapped]
public bool IsSuccessfull
{
get
{
return FailureCount == 0;
}
}
[NotMapped]
public bool IsFailure
{
get
{
return FailureCount > 0;
}
}
public void AddToFailureCount(string message)
{
Messages.Add(message);
FailureCount++;
}
}
}
@@ -0,0 +1,8 @@
using System.Collections.Generic;
namespace LCU.Library.Internal.DispatcherModels.Models.Results;
public class PagedResult<T> where T : class
{
public IEnumerable<T> Items { get; set; }
public int Total { get; set; }
}
@@ -0,0 +1,8 @@
namespace LCU.Library.Internal.DispatcherModels.Models;
public class SortableField
{
public string Field { get; set; }
public int Position { get; set; }
public bool IsDescending { get; set; }
}
@@ -0,0 +1,8 @@
using LCU.Library.Internal.DispatcherModels.Enums;
namespace LCU.Library.Internal.DispatcherModels.Models;
public class StatusFilter
{
public bool IsEnabled { get; set; }
public JobStatus JobStatus { get; set; }
}
@@ -0,0 +1,20 @@
using System.ComponentModel.DataAnnotations;
namespace LCU.Library.Internal.DispatcherModels.Models
{
public class WorkItemDetails
{
public int WorkItemId { get; set; } = 0;
public int JobId { get; set; } = 0;
[Required]
[StringLength(200, ErrorMessage = "Name Max Length is 200")]
public string Name { get; set; }
[StringLength(8000, ErrorMessage = "Description Max Length is 8000")]
public string Description { get; set; }
public bool CancelJobOnFailure { get; set; } = false;
[Range(0, 100, ErrorMessage = "Limit Range must be between 0-100.")]
public int CancelJobLimit { get; set; } = 0;
[Required]
public int Order { get; set; }
}
}