mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 05:21:57 +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
|
||||
|
||||
if totalChick > 0 {
|
||||
updates["total_chick"] = totalChick
|
||||
recording.TotalChick = &totalChick
|
||||
remainingChick := totalChick - cumDepletion
|
||||
if remainingChick < 0 {
|
||||
remainingChick = 0
|
||||
}
|
||||
updates["total_chick"] = remainingChick
|
||||
recording.TotalChick = &remainingChick
|
||||
|
||||
cumRate := (float64(cumDepletion) / float64(totalChick)) * 100
|
||||
updates["cum_depletion_rate"] = cumRate
|
||||
|
||||
Reference in New Issue
Block a user