Implementasi HPP std dan real

This commit is contained in:
2026-04-23 11:28:51 +07:00
parent d3dddea1c7
commit 9b606b4c8b
10 changed files with 959 additions and 0 deletions
+8
View File
@@ -104,6 +104,7 @@ func (a *App) Initialize(cfg *config.Config) error {
validators.customerAuthValidator,
services.customerPointsService,
services.spinGameService,
services.hppService,
middleware.customerAuthMiddleware,
)
@@ -190,6 +191,7 @@ type repositories struct {
customerAuthRepo repository.CustomerAuthRepository
customerPointsRepo repository.CustomerPointsRepository
otpRepo repository.OtpRepository
hppRepo *repository.HPPRepositoryImpl
txManager *repository.TxManager
}
@@ -235,6 +237,7 @@ func (a *App) initRepositories() *repositories {
customerAuthRepo: repository.NewCustomerAuthRepository(a.db),
customerPointsRepo: repository.NewCustomerPointsRepository(a.db),
otpRepo: repository.NewOtpRepository(a.db),
hppRepo: repository.NewHPPRepositoryImpl(a.db),
txManager: repository.NewTxManager(a.db),
}
}
@@ -276,6 +279,7 @@ type processors struct {
customerAuthProcessor processor.CustomerAuthProcessor
customerPointsProcessor *processor.CustomerPointsProcessor
otpProcessor processor.OtpProcessor
hppProcessor *processor.HPPProcessorImpl
fileClient processor.FileClient
inventoryMovementService service.InventoryMovementService
}
@@ -323,6 +327,7 @@ func (a *App) initProcessors(cfg *config.Config, repos *repositories) *processor
customerAuthProcessor: processor.NewCustomerAuthProcessor(repos.customerAuthRepo, otpProcessor, repos.otpRepo, cfg.GetCustomerJWTSecret(), cfg.GetCustomerJWTExpiresTTL()),
customerPointsProcessor: processor.NewCustomerPointsProcessor(repos.customerPointsRepo, repos.gameRepo),
otpProcessor: otpProcessor,
hppProcessor: processor.NewHPPProcessorImpl(repos.hppRepo),
fileClient: fileClient,
inventoryMovementService: inventoryMovementService,
}
@@ -361,6 +366,7 @@ type services struct {
customerAuthService service.CustomerAuthService
customerPointsService service.CustomerPointsService
spinGameService service.SpinGameService
hppService *service.HPPServiceImpl
}
func (a *App) initServices(processors *processors, repos *repositories, cfg *config.Config) *services {
@@ -396,6 +402,7 @@ func (a *App) initServices(processors *processors, repos *repositories, cfg *con
customerAuthService := service.NewCustomerAuthService(processors.customerAuthProcessor)
customerPointsService := service.NewCustomerPointsService(processors.customerPointsProcessor)
spinGameService := service.NewSpinGameService(processors.gamePlayProcessor, repos.txManager)
hppService := service.NewHPPServiceImpl(processors.hppProcessor)
// Update order service with order ingredient transaction service
orderService = service.NewOrderServiceImpl(processors.orderProcessor, repos.tableRepo, orderIngredientTransactionService, processors.orderIngredientTransactionProcessor, *repos.productRecipeRepo, repos.txManager)
@@ -433,6 +440,7 @@ func (a *App) initServices(processors *processors, repos *repositories, cfg *con
customerAuthService: customerAuthService,
customerPointsService: customerPointsService,
spinGameService: spinGameService,
hppService: hppService,
}
}