user auth register

This commit is contained in:
Aditya Siregar
2025-09-18 01:32:01 +07:00
parent c68b536480
commit 65f61b65cf
24 changed files with 2065 additions and 14 deletions
+16 -1
View File
@@ -43,6 +43,7 @@ type Router struct {
gamificationHandler *handler.GamificationHandler
rewardHandler *handler.RewardHandler
campaignHandler *handler.CampaignHandler
customerAuthHandler *handler.CustomerAuthHandler
authMiddleware *middleware.AuthMiddleware
}
@@ -99,7 +100,9 @@ func NewRouter(cfg *config.Config,
rewardService service.RewardService,
rewardValidator validator.RewardValidator,
campaignService service.CampaignService,
campaignValidator validator.CampaignValidator) *Router {
campaignValidator validator.CampaignValidator,
customerAuthService service.CustomerAuthService,
customerAuthValidator validator.CustomerAuthValidator) *Router {
return &Router{
config: cfg,
@@ -132,6 +135,7 @@ func NewRouter(cfg *config.Config,
gamificationHandler: handler.NewGamificationHandler(gamificationService, gamificationValidator),
rewardHandler: handler.NewRewardHandler(rewardService, rewardValidator),
campaignHandler: handler.NewCampaignHandler(campaignService, campaignValidator),
customerAuthHandler: handler.NewCustomerAuthHandler(customerAuthService, customerAuthValidator),
authMiddleware: authMiddleware,
}
}
@@ -166,6 +170,17 @@ func (r *Router) addAppRoutes(rg *gin.Engine) {
auth.GET("/profile", r.authHandler.GetProfile)
}
// Customer authentication routes
customerAuth := v1.Group("/customer-auth")
{
customerAuth.POST("/check-phone", r.customerAuthHandler.CheckPhone)
customerAuth.POST("/register/start", r.customerAuthHandler.RegisterStart)
customerAuth.POST("/register/verify-otp", r.customerAuthHandler.RegisterVerifyOtp)
customerAuth.POST("/register/set-password", r.customerAuthHandler.RegisterSetPassword)
customerAuth.POST("/login", r.customerAuthHandler.Login)
customerAuth.POST("/resend-otp", r.customerAuthHandler.ResendOtp)
}
organizations := v1.Group("/organizations")
{
organizations.POST("", r.organizationHandler.CreateOrganization)