summaryrefslogtreecommitdiff
path: root/src/marlin.web/Models/Job.cs
blob: bd6077340c7e76f4dc32a9e143e05e2214d31f7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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
}