@@ -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())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user