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
+10
View File
@@ -46,6 +46,7 @@ type Router struct {
customerAuthHandler *handler.CustomerAuthHandler
customerPointsHandler *handler.CustomerPointsHandler
spinGameHandler *handler.SpinGameHandler
hppHandler *handler.HPPHandler
authMiddleware *middleware.AuthMiddleware
customerAuthMiddleware *middleware.CustomerAuthMiddleware
}
@@ -108,6 +109,7 @@ func NewRouter(cfg *config.Config,
customerAuthValidator validator.CustomerAuthValidator,
customerPointsService service.CustomerPointsService,
spinGameService service.SpinGameService,
hppService *service.HPPServiceImpl,
customerAuthMiddleware *middleware.CustomerAuthMiddleware) *Router {
return &Router{
@@ -144,6 +146,7 @@ func NewRouter(cfg *config.Config,
customerAuthHandler: handler.NewCustomerAuthHandler(customerAuthService, customerAuthValidator),
customerPointsHandler: handler.NewCustomerPointsHandler(customerPointsService),
spinGameHandler: handler.NewSpinGameHandler(spinGameService),
hppHandler: handler.NewHPPHandler(hppService, transformer.NewTransformer()),
authMiddleware: authMiddleware,
customerAuthMiddleware: customerAuthMiddleware,
productVariantHandler: handler.NewProductVariantHandler(productVariantService, productVariantValidator),
@@ -360,6 +363,13 @@ func (r *Router) addAppRoutes(rg *gin.Engine) {
analytics.GET("/profit-loss", r.analyticsHandler.GetProfitLossAnalytics)
}
hpp := protected.Group("/hpp")
hpp.Use(r.authMiddleware.RequireAdminOrManager())
{
hpp.GET("/standard", r.hppHandler.GetStandardHPP)
hpp.GET("/real", r.hppHandler.GetRealHPP)
}
tables := protected.Group("/tables")
tables.Use(r.authMiddleware.RequireAdminOrManager())
{