Revert "voucher"

This reverts commit cfe690a40f.
This commit is contained in:
Aditya Siregar
2025-09-16 19:31:39 +07:00
parent 36c2352cb2
commit 12ee54390f
15 changed files with 2 additions and 1199 deletions
+1 -15
View File
@@ -40,7 +40,6 @@ type Router struct {
chartOfAccountHandler *handler.ChartOfAccountHandler
accountHandler *handler.AccountHandler
orderIngredientTransactionHandler *handler.OrderIngredientTransactionHandler
voucherHandler *handler.VoucherHandler
authMiddleware *middleware.AuthMiddleware
}
@@ -91,9 +90,7 @@ func NewRouter(cfg *config.Config,
accountService service.AccountService,
accountValidator validator.AccountValidator,
orderIngredientTransactionService service.OrderIngredientTransactionService,
orderIngredientTransactionValidator validator.OrderIngredientTransactionValidator,
voucherService service.VoucherService,
voucherValidator validator.VoucherValidator) *Router {
orderIngredientTransactionValidator validator.OrderIngredientTransactionValidator) *Router {
return &Router{
config: cfg,
@@ -123,7 +120,6 @@ func NewRouter(cfg *config.Config,
chartOfAccountHandler: handler.NewChartOfAccountHandler(chartOfAccountService, chartOfAccountValidator),
accountHandler: handler.NewAccountHandler(accountService, accountValidator),
orderIngredientTransactionHandler: handler.NewOrderIngredientTransactionHandler(&orderIngredientTransactionService, orderIngredientTransactionValidator),
voucherHandler: handler.NewVoucherHandler(voucherService, voucherValidator),
authMiddleware: authMiddleware,
}
}
@@ -430,16 +426,6 @@ func (r *Router) addAppRoutes(rg *gin.Engine) {
orderIngredientTransactions.POST("/bulk", r.orderIngredientTransactionHandler.BulkCreateOrderIngredientTransactions)
}
vouchers := protected.Group("/vouchers")
vouchers.Use(r.authMiddleware.RequireAdminOrManager())
{
vouchers.GET("/spin", r.voucherHandler.GetRandomVouchersForSpin)
vouchers.GET("/rows", r.voucherHandler.GetRandomVouchersByRows)
vouchers.GET("", r.voucherHandler.ListVouchers)
vouchers.GET("/:id", r.voucherHandler.GetVoucherByID)
vouchers.GET("/code/:code", r.voucherHandler.GetVoucherByCode)
}
outlets := protected.Group("/outlets")
outlets.Use(r.authMiddleware.RequireAdminOrManager())
{