mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
feat/BE/US-76/TASK-122,133,121,120 Recording
This commit is contained in:
@@ -550,8 +550,12 @@ func (s *recordingService) computeAndUpdateMetrics(tx *gorm.DB, recording *entit
|
|||||||
recording.CumDepletion = &cumDepletionInt
|
recording.CumDepletion = &cumDepletionInt
|
||||||
|
|
||||||
if totalChick > 0 {
|
if totalChick > 0 {
|
||||||
updates["total_chick"] = totalChick
|
remainingChick := totalChick - cumDepletion
|
||||||
recording.TotalChick = &totalChick
|
if remainingChick < 0 {
|
||||||
|
remainingChick = 0
|
||||||
|
}
|
||||||
|
updates["total_chick"] = remainingChick
|
||||||
|
recording.TotalChick = &remainingChick
|
||||||
|
|
||||||
cumRate := (float64(cumDepletion) / float64(totalChick)) * 100
|
cumRate := (float64(cumDepletion) / float64(totalChick)) * 100
|
||||||
updates["cum_depletion_rate"] = cumRate
|
updates["cum_depletion_rate"] = cumRate
|
||||||
|
|||||||
Reference in New Issue
Block a user