summaryrefslogtreecommitdiff
path: root/src/marlin.web/Models/Job.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/marlin.web/Models/Job.cs')
-rw-r--r--src/marlin.web/Models/Job.cs48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/marlin.web/Models/Job.cs b/src/marlin.web/Models/Job.cs
new file mode 100644
index 0000000..bd60773
--- /dev/null
+++ b/src/marlin.web/Models/Job.cs
@@ -0,0 +1,48 @@
+namespace marlin.web.Models;
+
+public class Job
+{
+ public Guid Id { get; set; }
+
+ public Guid SourceId { get; set; }
+ public VersionControlSource Source { get; set; }
+
+ public Guid BranchId { get; set; }
+ public VersionControlledBranch Branch { get; set; }
+
+ public Guid CommitId { get; set; }
+ public VersionControlledCommit Commit { get; set; }
+
+ public string CreatedReason { get; set; }
+ public DateTime CreatedAt { get; set; }
+ public JobStatus Status { get; set; }
+ public ICollection<JobStatusUpdate> StatusUpdates { get; set; }
+
+ public Guid? AgentId { get; set; }
+ public Agent? Agent { get; set; }
+
+ public string? ClaimToken { get; set; }
+
+ public string Recipe { get; set; }
+ // plan
+}
+
+public class JobStatusUpdate
+{
+ public Guid Id { get; set; }
+
+ public Guid JobId { get; set; }
+ public Job Job { get; set; }
+
+ public DateTime At { get; set; }
+ public JobStatus Status { get; set; }
+}
+
+public enum JobStatus
+{
+ Pending,
+ Active,
+ Cancelled,
+ Success,
+ Failed
+} \ No newline at end of file