mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-24 15:25:43 +00:00
Feat[BE]: refactored Chickin createone and implement approvals and add more needed constant
This commit is contained in:
@@ -670,18 +670,19 @@ func (s *recordingService) getPreviousRecording(tx *gorm.DB, projectFlockKandang
|
||||
}
|
||||
|
||||
func (s *recordingService) getTotalChick(tx *gorm.DB, projectFlockKandangId uint) (int64, error) {
|
||||
var population entity.ProjectFlockPopulation
|
||||
err := tx.
|
||||
Where("project_flock_kandang_id = ?", projectFlockKandangId).
|
||||
Order("created_at DESC").
|
||||
First(&population).Error
|
||||
if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||
return 0, nil
|
||||
}
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return int64(math.Round(population.InitialQuantity)), nil
|
||||
// var population entity.ProjectFlockPopulation
|
||||
// err := tx.
|
||||
// Where("project_flock_kandang_id = ?", projectFlockKandangId).
|
||||
// Order("created_at DESC").
|
||||
// First(&population).Error
|
||||
// if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||
// return 0, nil
|
||||
// }
|
||||
// if err != nil {
|
||||
// return 0, err
|
||||
// }
|
||||
//todo : nanti ganti lagi mas saya hardcode dulu
|
||||
return int64(math.Round(1000)), nil
|
||||
}
|
||||
|
||||
func (s *recordingService) getAverageBodyWeight(tx *gorm.DB, recordingID uint) (float64, error) {
|
||||
|
||||
Reference in New Issue
Block a user