Add ingredieints
This commit is contained in:
+4
-4
@@ -40,7 +40,7 @@ func NewApp(db *gorm.DB) *App {
|
||||
func (a *App) Initialize(cfg *config.Config) error {
|
||||
repos := a.initRepositories()
|
||||
processors := a.initProcessors(cfg, repos)
|
||||
services := a.initServices(processors, cfg)
|
||||
services := a.initServices(processors, repos, cfg)
|
||||
validators := a.initValidators()
|
||||
middleware := a.initMiddleware(services)
|
||||
healthHandler := handler.NewHealthHandler()
|
||||
@@ -140,7 +140,7 @@ type repositories struct {
|
||||
fileRepo *repository.FileRepositoryImpl
|
||||
customerRepo *repository.CustomerRepository
|
||||
analyticsRepo *repository.AnalyticsRepositoryImpl
|
||||
tableRepo *repository.TableRepository
|
||||
tableRepo repository.TableRepositoryInterface
|
||||
unitRepo *repository.UnitRepository
|
||||
ingredientRepo *repository.IngredientRepository
|
||||
}
|
||||
@@ -232,7 +232,7 @@ type services struct {
|
||||
ingredientService *service.IngredientServiceImpl
|
||||
}
|
||||
|
||||
func (a *App) initServices(processors *processors, cfg *config.Config) *services {
|
||||
func (a *App) initServices(processors *processors, repos *repositories, cfg *config.Config) *services {
|
||||
authConfig := cfg.Auth()
|
||||
jwtSecret := authConfig.AccessTokenSecret()
|
||||
authService := service.NewAuthService(processors.userProcessor, jwtSecret)
|
||||
@@ -243,7 +243,7 @@ func (a *App) initServices(processors *processors, cfg *config.Config) *services
|
||||
productService := service.NewProductService(processors.productProcessor)
|
||||
productVariantService := service.NewProductVariantService(processors.productVariantProcessor)
|
||||
inventoryService := service.NewInventoryService(processors.inventoryProcessor)
|
||||
orderService := service.NewOrderServiceImpl(processors.orderProcessor)
|
||||
orderService := service.NewOrderServiceImpl(processors.orderProcessor, repos.tableRepo)
|
||||
paymentMethodService := service.NewPaymentMethodService(processors.paymentMethodProcessor)
|
||||
fileService := service.NewFileServiceImpl(processors.fileProcessor)
|
||||
var customerService service.CustomerService = service.NewCustomerService(processors.customerProcessor)
|
||||
|
||||
Reference in New Issue
Block a user