feat: preload additional related entities in GetById method of InventoryMovementRepository
Deploy Application / deploy (push) Successful in 19s Details

This commit is contained in:
Habib Fatkhul Rohman 2025-12-10 14:13:26 +07:00
parent 7adb6a433a
commit 111d0cffa3
1 changed files with 6 additions and 0 deletions

View File

@ -41,6 +41,12 @@ func (r *inventoryMovementRepository) GetById(ctx context.Context, tx *gorm.DB,
var movement entities.TInventoryMovementEntity
if err := tx.WithContext(ctx).
Preload("Client").
Preload("SourceLocation").
Preload("DestinationLocation").
Preload("SourceZone").
Preload("DestinationZone").
Preload("SourceAisle").
Preload("DestinationAisle").
First(&movement, "id = ?", id).Error; err != nil {
return movement, err
}