diff --git a/src/Arma.Demo.Core/Processing/Package.cs b/src/Arma.Demo.Core/Processing/Package.cs new file mode 100644 index 0000000..45b5349 --- /dev/null +++ b/src/Arma.Demo.Core/Processing/Package.cs @@ -0,0 +1,6 @@ +namespace Arma.Demo.Core.Processing; +public class Package +{ + public static Guid Key => Guid.NewGuid(); + public string Name { get; set; } +} \ No newline at end of file diff --git a/src/Arma.Demo.Core/Processing/Process.cs b/src/Arma.Demo.Core/Processing/Process.cs new file mode 100644 index 0000000..ae90eea --- /dev/null +++ b/src/Arma.Demo.Core/Processing/Process.cs @@ -0,0 +1,7 @@ +namespace Arma.Demo.Core.Processing; +public class Process +{ + public string Name { get; set; } + + public List Tasks { get; set; } +} \ No newline at end of file diff --git a/src/Arma.Demo.Core/Processing/ProcessTask.cs b/src/Arma.Demo.Core/Processing/ProcessTask.cs new file mode 100644 index 0000000..bed78a8 --- /dev/null +++ b/src/Arma.Demo.Core/Processing/ProcessTask.cs @@ -0,0 +1,8 @@ +namespace Arma.Demo.Core.Processing; +public class ProcessTask +{ + public int Step { get; set; } + public string Name { get; set; } + public string Section { get; set; } + public int Duration { get; set; } +} \ No newline at end of file diff --git a/tests/processing-test/PackageGenerator.cs b/tests/processing-test/PackageGenerator.cs new file mode 100644 index 0000000..5337e45 --- /dev/null +++ b/tests/processing-test/PackageGenerator.cs @@ -0,0 +1,8 @@ +using Arma.Demo.Core.Processing; + +namespace Processor; +public static class PackageGenerator +{ + public static Package ApprovalPackage() => + new() { Name = "Demo Approval" }; +} \ No newline at end of file diff --git a/tests/processing-test/ProcessGenerator.cs b/tests/processing-test/ProcessGenerator.cs new file mode 100644 index 0000000..0affb0e --- /dev/null +++ b/tests/processing-test/ProcessGenerator.cs @@ -0,0 +1,49 @@ +using Arma.Demo.Core.Processing; + +namespace Processor; +public static class ProcessGenerator +{ + public static Process ApprovalProcess() => + new() + { + Name = "Demo Approval Process", + Tasks = new() + { + new() + { + Name = "Security Review", + Section = "Cybersecurity", + Step = 1, + Duration = 800 + }, + new() + { + Name = "Legal Review", + Section = "Legal", + Step = 2, + Duration = 1100 + }, + new() + { + Name = "Informal Review", + Section = "Operational Review Board", + Step = 3, + Duration = 500 + }, + new() + { + Name = "Formal Review", + Section = "Command Review Board", + Step = 4, + Duration = 1800 + }, + new() + { + Name = "Final Approval", + Section = "Headquarters Commander", + Step = 5, + Duration = 1000 + } + } + }; +} \ No newline at end of file diff --git a/tests/processing-test/Processor.csproj b/tests/processing-test/Processor.csproj new file mode 100644 index 0000000..3e742da --- /dev/null +++ b/tests/processing-test/Processor.csproj @@ -0,0 +1,14 @@ + + + + + + + + Exe + net7.0 + enable + enable + + + diff --git a/tests/processing-test/Program.cs b/tests/processing-test/Program.cs new file mode 100644 index 0000000..bccbba0 --- /dev/null +++ b/tests/processing-test/Program.cs @@ -0,0 +1,21 @@ +using Arma.Demo.Core.Processing; +using Processor; + +Package package = PackageGenerator.ApprovalPackage(); + +Console.WriteLine($"Submitting package {package.Name} for approval"); + +await Task.Delay(1200); + +Process process = ProcessGenerator.ApprovalProcess(); + +Console.WriteLine($"Package {package.Name} assigned process {process.Name}"); + +foreach (ProcessTask task in process.Tasks) +{ + Console.WriteLine($"Current step: {task.Name}"); + await Task.Delay(task.Duration); + Console.WriteLine($"Package {package.Name} was approved by {task.Section}"); +} + +Console.WriteLine($"Package {package.Name} was successfully approved"); \ No newline at end of file