File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ func AdaptCaseDto(c models.Case) APICase {
39
39
Events : pure_utils .Map (c .Events , NewAPICaseEvent ),
40
40
InboxId : c .InboxId ,
41
41
Name : c .Name ,
42
- Status : string ( c .Status ),
42
+ Status : c .Status . EnrichedStatus ( c . SnoozedUntil , c . Boost ),
43
43
Outcome : string (c .Outcome ),
44
44
Tags : pure_utils .Map (c .Tags , NewAPICaseTag ),
45
45
Files : pure_utils .Map (c .Files , NewAPICaseFile ),
Original file line number Diff line number Diff line change @@ -78,6 +78,16 @@ func (s CaseStatus) CanTransition(newStatus CaseStatus) bool {
78
78
}
79
79
}
80
80
81
+ func (s CaseStatus ) EnrichedStatus (snoozedUntil * time.Time , boost * BoostReason ) string {
82
+ if s == CaseInvestigating && snoozedUntil != nil && snoozedUntil .After (time .Now ()) {
83
+ return "snoozed"
84
+ }
85
+ if s == CaseInvestigating && boost != nil {
86
+ return "waiting_for_action"
87
+ }
88
+ return string (s )
89
+ }
90
+
81
91
type CaseOutcome string
82
92
83
93
const (
You can’t perform that action at this time.
0 commit comments