Update product receipe
This commit is contained in:
@@ -79,6 +79,7 @@ func (a *App) Initialize(cfg *config.Config) error {
|
||||
validators.tableValidator,
|
||||
services.unitService,
|
||||
services.ingredientService,
|
||||
services.productRecipeService,
|
||||
)
|
||||
|
||||
return nil
|
||||
@@ -144,6 +145,7 @@ type repositories struct {
|
||||
tableRepo repository.TableRepositoryInterface
|
||||
unitRepo *repository.UnitRepository
|
||||
ingredientRepo *repository.IngredientRepository
|
||||
productRecipeRepo *repository.ProductRecipeRepository
|
||||
}
|
||||
|
||||
func (a *App) initRepositories() *repositories {
|
||||
@@ -168,6 +170,7 @@ func (a *App) initRepositories() *repositories {
|
||||
tableRepo: repository.NewTableRepository(a.db),
|
||||
unitRepo: repository.NewUnitRepository(a.db),
|
||||
ingredientRepo: repository.NewIngredientRepository(a.db),
|
||||
productRecipeRepo: repository.NewProductRecipeRepository(a.db),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,6 +191,7 @@ type processors struct {
|
||||
tableProcessor *processor.TableProcessor
|
||||
unitProcessor *processor.UnitProcessorImpl
|
||||
ingredientProcessor *processor.IngredientProcessorImpl
|
||||
productRecipeProcessor *processor.ProductRecipeProcessorImpl
|
||||
fileClient processor.FileClient
|
||||
}
|
||||
|
||||
@@ -211,6 +215,7 @@ func (a *App) initProcessors(cfg *config.Config, repos *repositories) *processor
|
||||
tableProcessor: processor.NewTableProcessor(repos.tableRepo, repos.orderRepo),
|
||||
unitProcessor: processor.NewUnitProcessor(repos.unitRepo),
|
||||
ingredientProcessor: processor.NewIngredientProcessor(repos.ingredientRepo, repos.unitRepo),
|
||||
productRecipeProcessor: processor.NewProductRecipeProcessor(repos.productRecipeRepo, repos.productRepo, repos.ingredientRepo),
|
||||
fileClient: fileClient,
|
||||
}
|
||||
}
|
||||
@@ -234,6 +239,7 @@ type services struct {
|
||||
tableService *service.TableServiceImpl
|
||||
unitService *service.UnitServiceImpl
|
||||
ingredientService *service.IngredientServiceImpl
|
||||
productRecipeService *service.ProductRecipeServiceImpl
|
||||
}
|
||||
|
||||
func (a *App) initServices(processors *processors, repos *repositories, cfg *config.Config) *services {
|
||||
@@ -256,6 +262,7 @@ func (a *App) initServices(processors *processors, repos *repositories, cfg *con
|
||||
tableService := service.NewTableService(processors.tableProcessor, transformer.NewTableTransformer())
|
||||
unitService := service.NewUnitService(processors.unitProcessor)
|
||||
ingredientService := service.NewIngredientService(processors.ingredientProcessor)
|
||||
productRecipeService := service.NewProductRecipeService(processors.productRecipeProcessor)
|
||||
|
||||
return &services{
|
||||
userService: service.NewUserService(processors.userProcessor),
|
||||
@@ -276,6 +283,7 @@ func (a *App) initServices(processors *processors, repos *repositories, cfg *con
|
||||
tableService: tableService,
|
||||
unitService: unitService,
|
||||
ingredientService: ingredientService,
|
||||
productRecipeService: productRecipeService,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user