Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
189 changes: 70 additions & 119 deletions src/BL/Models/Enums/Enums.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@


using System.ComponentModel.DataAnnotations;
using System.Numerics;
using System.Text.Json.Serialization;
using System.Xml.Linq;
using System.ComponentModel.DataAnnotations;

namespace BL.Models.Enums
{
Expand All @@ -13,174 +8,160 @@ public enum StatusType
//Parent only
[Display(Name = "Waiting for Child Subs To Complete")]
WaitingForChildSubsToComplete = 0,

//Stage 1
[Display(Name = "Waiting for Agent To Transfer")]
WaitingForAgentToTransfer = 1,

//Stage 2
[Display(Name = "Transferred To Pod")]
TransferredToPod = 2,
[Display(Name = "Transferred To Agent")]
TransferredToAgent = 2,

//Stage 3
[Display(Name = "Pod Processing")]
PodProcessing = 3,
[Display(Name = "Processing Submission")]
Processing = 3,

//Stage 3
//Green
[Display(Name = "Pod Processing Complete")]
PodProcessingComplete = 4,
[Display(Name = "Processing Complete")]
ProcessingComplete = 4,

//Stage 4
[Display(Name = "Data Out Approval Begun")]
DataOutApprovalBegun = 5,

//Stage 4
//Red
[Display(Name = "Data Out Rejected")]
DataOutApprovalRejected = 6,
[Display(Name = "Data Out Rejected")] DataOutApprovalRejected = 6,

//Stage 4
//Green
[Display(Name = "Data Out Approved")]
DataOutApproved = 7,
[Display(Name = "Data Out Approved")] DataOutApproved = 7,

//Stage 1
//Red
[Display(Name = "User Not On Project")]
UserNotOnProject = 8,

//Stage 2
//Red
[Display(Name = "User not authorised for project on TRE")]
InvalidUser = 9,

//Stage 2
//Red
[Display(Name = "TRE Not Authorised For Project")]
TRENotAuthorisedForProject = 10,
TreNotAuthorisedForProject = 10,

//Stage 5
//Green I think this is our completed enum
[Display(Name = "Completed")]
Completed = 11,
//Green
[Display(Name = "Completed")] Completed = 11,

//Stage 1
//Red
[Display(Name = "Invalid Submission")]
InvalidSubmission = 12,
[Display(Name = "Invalid Submission")] InvalidSubmission = 12,

//Stage 1
//Red
[Display(Name = "Cancelling Children")]
CancellingChildren = 13,

//Stage 1
//Red
[Display(Name = "Request Cancellation")]
RequestCancellation = 14,

//Stage 1
//Red
[Display(Name = "Cancellation Request Sent")]
CancellationRequestSent = 15,

//Stage 5
//Red
[Display(Name = "Cancelled")]
Cancelled = 16,
//Stage 1
[Display(Name = "Waiting For Crate Format Check")]
SubmissionWaitingForCrateFormatCheck = 17,
[Display(Name = "Cancelled")] Cancelled = 16,

//Unused
[Display(Name = "Validating User")]
ValidatingUser = 18,
[Display(Name = "Validating User")] ValidatingUser = 18,

//Unused
[Display(Name = "Validating Submission")]
ValidatingSubmission = 19,

//Unused
//Green
[Display(Name = "Validation Successful")]
ValidationSuccessful = 20,

//Stage 2
[Display(Name = "Agent Transferring To Pod")]
AgentTransferringToPod = 21,

//Stage 2
//Red
[Display(Name = "Transfer To Pod Failed")]
TransferToPodFailed = 22,

//Unused
[Display(Name = "Tre Rejected Project")]
TRERejectedProject = 23,
TreAgentRejectedProject = 23,

//Unused
[Display(Name = "Tre Approved Project")]
TREApprovedProject = 24,
TreApprovedProject = 24,

//Stage 3
//Red
[Display(Name = "Pod Processing Failed")]
PodProcessingFailed = 25,
[Display(Name = "Processing Failed")] ProcessingFailed = 25,

//Stage 1
//Parent only
[Display(Name = "Running")]
Running = 26,
[Display(Name = "Running")] Running = 26,

//Stage 5
//Red
[Display(Name = "Failed")]
Failed = 27,
//Stage 3
[Display(Name = "Waiting for a Crate")]
WaitingForCrate = 30,
//Stage 3
[Display(Name = "Fetching Crate")]
FetchingCrate = 31,
//Stage 3
[Display(Name = "Crate queued")]
Queued = 32,
//Stage 3
[Display(Name = "Validating Crate")]
ValidatingCrate = 33,
Failed = 27,

//Stage 3
[Display(Name = "Fetching workflow")]
FetchingWorkflow=34,
[Display(Name = "Fetching workflow")] FetchingWorkflow = 34,

//Stage 3
[Display(Name = "Preparing workflow")]
StagingWorkflow=35,
[Display(Name = "Preparing workflow")] StagingWorkflow = 35,

//Stage 3
[Display(Name = "Executing workflow")]
ExecutingWorkflow = 36,
[Display(Name = "Executing workflow")] ExecutingWorkflow = 36,

//Stage 3
[Display(Name = "Preparing outputs")]
PreparingOutputs = 37,
[Display(Name = "Preparing outputs")] PreparingOutputs = 37,

//Stage 3
[Display(Name = "Requested Egress")]
DataOutRequested=38,
[Display(Name = "Requested Egress")] DataOutRequested = 38,

//Stage 3
[Display(Name = "Waiting for Egress results")]
TransferredForDataOut = 39,

//Stage 3
[Display(Name = "Finalising approved results")]
PackagingApprovedResults=40,
PackagingApprovedResults = 40,

//Stage 3
//Green
[Display(Name = "Completed")]
Complete=41,
[Display(Name = "Completed")] Complete = 41,

//Stage 3
//Red
[Display(Name = "Failed")]
Failure = 42,
[Display(Name = "Failed")] Failure = 42,

//Stage 1
[Display(Name = "Submission has been received")]
SubmissionReceived = 43,
//Stage 1
//Green
[Display(Name = "Crate Validated")]
SubmissionCrateValidated = 44,
//Stage 1
//Red
[Display(Name = "Crate Failed Validation")]
SubmissionCrateValidationFailed = 45,
//Stage 2
//Green
[Display(Name = "Crate Validated")]
TreCrateValidated = 46,
//Stage 2
//Red
[Display(Name = "Crate Failed Validation")]
TreCrateValidationFailed = 47,
//Stage 2
[Display(Name = "Waiting For Crate Format Check")]
TreWaitingForCrateFormatCheck = 48,

//Stage 5
//Green
//Parent Only
[Display(Name = "Complete but not all TREs returned a result")]
PartialResult = 49,


}

public enum Decision
Expand All @@ -197,42 +178,12 @@ public enum FileStatus
Rejected = 2
}



public enum EgressStatus
{
[Display(Name = "Not completed")]
NotCompleted = 0,
[Display(Name = "Fully Approved")]
FullyApproved = 1,
[Display(Name = "Fully Rejected")]
FullyRejected = 2,
[Display(Name = "Partially Approved")]
PartiallyApproved = 3
[Display(Name = "Not completed")] NotCompleted = 0,
[Display(Name = "Fully Approved")] FullyApproved = 1,
[Display(Name = "Fully Rejected")] FullyRejected = 2,
[Display(Name = "Partially Approved")] PartiallyApproved = 3
}

public class EnumHelper
{
public static List<StatusType> GetHutchAllowedStatusUpdates()
{
return new List<StatusType>()
{
StatusType.WaitingForCrate,
StatusType.FetchingCrate,
StatusType.Queued,
StatusType.ValidatingCrate,
StatusType.FetchingWorkflow,
StatusType.StagingWorkflow,
StatusType.ExecutingWorkflow,
StatusType.PreparingOutputs,
StatusType.DataOutRequested,
StatusType.TransferredForDataOut,
StatusType.PackagingApprovedResults,
StatusType.Complete,
StatusType.Failure
};
}
}


}
}
Loading
Loading