codex/fix: store stocks on farm warehouse when recording egg

This commit is contained in:
Adnan Zahir
2026-04-04 11:21:50 +07:00
parent 34a3fc44a8
commit 2a39342d55
3 changed files with 403 additions and 4 deletions
@@ -347,7 +347,10 @@ func (r *projectFlockKandangRepositoryImpl) GetByID(ctx context.Context, id uint
func (r *projectFlockKandangRepositoryImpl) GetByIDLight(ctx context.Context, id uint) (*entity.ProjectFlockKandang, error) {
record := new(entity.ProjectFlockKandang)
if err := r.db.WithContext(ctx).
Preload("Kandang").
Preload("Kandang.Location").
Preload("ProjectFlock").
Preload("ProjectFlock.Location").
First(record, id).Error; err != nil {
return nil, err
}