feat(BE-116): add project chick in database schema

This commit is contained in:
aguhh18
2025-10-18 16:30:13 +07:00
parent a45c20d2ff
commit 68a670a2bd
13 changed files with 568 additions and 9 deletions
@@ -35,9 +35,12 @@ func NewProductWarehouseService(repo repository.ProductWarehouseRepository, vali
func (s productWarehouseService) withRelations(db *gorm.DB) *gorm.DB {
return db.
Preload("Product.Flags").
Preload("Product").
Preload("Product.Flags").
Preload("Warehouse").
Preload("Warehouse.Location").
Preload("Warehouse.Kandang").
Preload("Warehouse.Area").
Preload("CreatedUser")
}
@@ -85,6 +88,7 @@ func (s productWarehouseService) GetOne(c *fiber.Ctx, id uint) (*entity.ProductW
if errors.Is(err, gorm.ErrRecordNotFound) {
return nil, fiber.NewError(fiber.StatusNotFound, "ProductWarehouse not found")
}
if err != nil {
s.Log.Errorf("Failed get productWarehouse by id: %+v", err)
return nil, err