15 lines
683 B
Go
15 lines
683 B
Go
package domain
|
|
|
|
import "git.cin.su/m/Assistant/contracts/work"
|
|
|
|
func AssessConsequences(id string, target string, impact, reversibility, uncertainty, recoverability, cost int64, at int64) work.ConsequenceAssessment {
|
|
a := work.ConsequenceAssessment{ID: id, TargetRefs: []string{target}, Impact: impact, Reversibility: reversibility, Uncertainty: uncertainty, Recoverability: recoverability, CostOfError: cost, RecordedAtUnixMillis: at}
|
|
a.RequiresDryRun = impact >= 700 || reversibility >= 700
|
|
a.RequiresBackup = reversibility >= 500
|
|
a.RecommendedConfirmation = "STANDARD"
|
|
if uncertainty*cost > 500000 {
|
|
a.RecommendedConfirmation = "EXPLICIT_OWNER_CONFIRMATION"
|
|
}
|
|
return a
|
|
}
|