Merge branch 'dev/gio' into 'feat/BE/Sprint-6'

fix query changes field stock logs

See merge request mbugroup/lti-api!83
This commit is contained in:
Hafizh A. Y.
2025-12-08 02:46:50 +00:00
2 changed files with 2 additions and 2 deletions
@@ -198,7 +198,7 @@ func (s *adjustmentService) AdjustmentHistory(c *fiber.Ctx, query *validation.Qu
db = s.withRelations(db)
db = db.Where("log_type = ?", entity.LogTypeAdjustment)
db = db.Where("loggable_type = ?", entity.LogTypeAdjustment)
if query.TransactionType != "" {
db = db.Where("transaction_type = ?", strings.ToUpper(query.TransactionType))
@@ -30,7 +30,7 @@ func (r *StockLogRepositoryImpl) GetByFlaggable(ctx context.Context, logType str
var stockLogs []*entity.StockLog
err := r.DB().WithContext(ctx).
Where("log_type = ? AND log_id = ?", logType, logId).
Where("loggable_type = ? AND log_id = ?", logType, logId).
Preload("ProductWarehouse").
Preload("ProductWarehouse.Product").
Preload("ProductWarehouse.Warehouse").