package router

import (
	"bpmsapi/handler"
	"log"

	"github.com/gin-gonic/gin"
	_ "github.com/go-sql-driver/mysql"
)

func InitUserRouter(r *gin.RouterGroup) {
	userroute := r.Group("/user")
	userroute.POST("/signupCustomer", handler.NewCommonHandler("Common").SignupHandler)
	userroute.POST("/addfeedback", handler.NewCommonHandler("Common").AddFeedbackHandler)
	userroute.POST("/addAddress", handler.NewCommonHandler("Common").AddAddressHandler)
	userroute.GET("/getInitConfig", handler.NewUserHandler("User").InitConfigHandler)
	userroute.GET("/getTimeSlot", handler.NewTimeSlotHandler("Timeslot").GetTimeSlotHandler)
	userroute.GET("/fetchProblemCategory", handler.NewUserHandler("user").FetchProblemCategoryHandler)
	userroute.GET("/getProblemDescription", handler.NewServiceRequestHandler("Servicerequest").GetProblemDescriptionHandler)
	userroute.POST("/createServiceRequest", handler.NewServiceRequestHandler("Servicerequest").CreateServiceRequestHandler)
	userroute.GET("/fetchServiceRequest", handler.NewServiceRequestHandler("Servicerequest").FetchServiceRequestHandler)
	userroute.POST("/updateProfile", handler.NewUserHandler("User").UpdateProfileHandler)
	userroute.POST("/updateServiceRequest", handler.NewUserHandler("User").UpdateServiceRequestHandler)
	userroute.POST("/createOnlinePaymentId", handler.NewPaymentHandler("OnlinePayment").CreateOnlinePaymentIdHandler)
	userroute.POST("/userApartmentMapping",handler.NewApartmentHandler("User").UserApartmentMappingHandler)
	userroute.POST("/userApartmentUpdate", handler.NewApartmentHandler("User").UserApartmentUpdateHandler)
	userroute.POST("/updateNotificationToken", handler.NewNotificationHandler("Notification").UpdateNoficationTokenHandler)
	log.Println("Router configured")
}

/*func InitAuthentication(c *gin.Context) {
	db, _ := sqlx.Connect("mysql", "root:Innoknights@19@(109.106.255.67:3306)/bpmsdb")
	userRepository := repository.UserRepositoryInit(db)
	notification := repository.NotificationRepositoryInit(db)
	authService := service.AuthenticateServiceInit(*notification, *userRepository)
	authhandler := handler.AuthenticationHandlerInit(*authService)
	response := authhandler.AuthenticateCustomer("7418217465")
	c.Set("response", response)
}*/
