Skip to content

Commit

Permalink
only update bsc objective's trend if some value changed
Browse files Browse the repository at this point in the history
  • Loading branch information
jschuhmann47 committed Nov 21, 2024
1 parent 0650b66 commit e917885
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/herramientas/balancedScorecard/balancedScorecard.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,13 @@ objectiveSchema.pre('save', function (next) {
(this.baseline + currentStep)
).toFixed(2)

if (this.progress > lastProgress) {
this.trend = Trend.Upwards
} else if (this.progress < lastProgress) {
this.trend = Trend.Downwards
} else this.trend = Trend.Stable
if (this.progress != lastProgress) {
if (this.progress > lastProgress) {
this.trend = Trend.Upwards
} else if (this.progress < lastProgress) {
this.trend = Trend.Downwards
} else this.trend = Trend.Stable
}

if (dev > -5) this.deviation = Deviation.None
else if (dev >= -30) this.deviation = Deviation.Acceptable
Expand Down

0 comments on commit e917885

Please sign in to comment.