mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
feat(BE): enhance product warehouse handling and automatic calculations for delivery and sales orders
This commit is contained in:
+1
-4
@@ -84,7 +84,6 @@ func (s productionStandardService) GetOne(c *fiber.Ctx, id uint) (*entity.Produc
|
||||
return nil, fiber.NewError(fiber.StatusNotFound, "ProductionStandard not found")
|
||||
}
|
||||
if err != nil {
|
||||
s.Log.Errorf("Failed get productionStandard by id: %+v", err)
|
||||
return nil, err
|
||||
}
|
||||
return productionStandard, nil
|
||||
@@ -111,6 +110,7 @@ func (s *productionStandardService) CreateOne(c *fiber.Ctx, req *validation.Crea
|
||||
var createdStandard *entity.ProductionStandard
|
||||
|
||||
err = s.Repository.DB().WithContext(c.Context()).Transaction(func(tx *gorm.DB) error {
|
||||
|
||||
standardRepoTx := repository.NewProductionStandardRepository(tx)
|
||||
productionStandardDetailRepoTx := repository.NewProductionStandardDetailRepository(tx)
|
||||
standardGrowthDetailRepoTx := repository.NewStandardGrowthDetailRepository(tx)
|
||||
@@ -207,7 +207,6 @@ func (s productionStandardService) UpdateOne(c *fiber.Ctx, req *validation.Updat
|
||||
|
||||
nameExists, err := s.Repository.NameExists(c.Context(), *req.Name, &id)
|
||||
if err != nil {
|
||||
s.Log.Errorf("Failed to check existing production standard: %+v", err)
|
||||
return err
|
||||
}
|
||||
if nameExists {
|
||||
@@ -285,7 +284,6 @@ func (s productionStandardService) UpdateOne(c *fiber.Ctx, req *validation.Updat
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
s.Log.Errorf("Failed to update production standard: %+v", err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -297,7 +295,6 @@ func (s productionStandardService) DeleteOne(c *fiber.Ctx, id uint) error {
|
||||
if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||
return fiber.NewError(fiber.StatusNotFound, "ProductionStandard not found")
|
||||
}
|
||||
s.Log.Errorf("Failed to delete productionStandard: %+v", err)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user