Rules.cs
2.61 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
namespace RobotProductionSystem.Api.Services;
public static class Rules
{
public static readonly string[] DeviceTypeCategories = ["robot", "controller", "vision", "chassis", "communication", "power", "sensor", "actuator", "other"];
public static readonly string[] WorkOrderStatuses = ["draft", "pending_dispatch", "running", "paused", "pending_qc", "completed", "closed"];
public static readonly string[] SnStatuses = ["pending", "in_process", "completed", "frozen", "scrapped"];
public static readonly string[] SnExceptionStatuses = ["none", "open", "rework", "closed"];
public static readonly string[] OperationStatuses = ["pending", "in_progress", "pending_test", "failed", "rework", "completed", "skipped"];
public static readonly string[] MemberRoles = ["member", "admin", "customer"];
public static readonly string[] DashboardStatuses = ["pending_dispatch", "running", "pending_qc", "in_exception", "completed"];
public static readonly Dictionary<string, string[]> WorkOrderAllowedTransitions = new()
{
["draft"] = ["edit_draft", "dispatch"],
["pending_dispatch"] = ["pause", "resume", "close"],
["running"] = ["pause", "close"],
["paused"] = ["resume", "close"],
["pending_qc"] = ["close"],
["completed"] = ["close"],
["closed"] = []
};
public static readonly Dictionary<string, string> WorkOrderActionToStatus = new()
{
["dispatch"] = "pending_dispatch",
["pause"] = "paused",
["resume"] = "running",
["close"] = "closed"
};
public static readonly Dictionary<string, string[]> SnAllowedActions = new()
{
["pending"] = ["freeze", "scrap"],
["in_process"] = ["freeze", "scrap"],
["completed"] = ["freeze", "scrap"],
["frozen"] = ["unfreeze", "scrap"],
["scrapped"] = []
};
public static readonly Dictionary<string, string[]> OperationAllowedActions = new()
{
["pending"] = ["start", "skip"],
["in_progress"] = ["complete_assembly", "submit_test", "skip"],
["pending_test"] = ["submit_test", "skip"],
["failed"] = ["complete_rework", "skip"],
["rework"] = ["complete_rework", "skip"],
["completed"] = [],
["skipped"] = []
};
public static readonly Dictionary<string, string> OperationNextAction = new()
{
["pending"] = "start",
["in_progress"] = "complete_assembly",
["pending_test"] = "submit_test",
["failed"] = "complete_rework",
["rework"] = "complete_rework",
["completed"] = "go_next_step",
["skipped"] = "audit_review"
};
}