package passwordresetroute

import (
	"bitbucket.org/nemt/nemt-portal-api/application/applicationservice"
	"bitbucket.org/nemt/nemt-portal-api/infra/config"
	"github.com/labstack/echo"
)

const (
	resetRequest  = "/request/:email"
	resetComplete = "/complete/:token"
	tokenOpen     = "/open/:token"
)

func Register(r *echo.Group, cfg *config.Config, svc *applicationservice.Service) {
	ctrl := controllerInstance(svc, cfg)

	r.POST(resetRequest, ctrl.handleResetRequest)
	r.POST(resetComplete, ctrl.handleResetComplete)
	r.POST(tokenOpen, ctrl.handleTokenOpen)
}
