Upstream sync
This commit is contained in:
@@ -17,15 +17,16 @@ var (
|
|||||||
|
|
||||||
// Service holds the domain service repositories
|
// Service holds the domain service repositories
|
||||||
type Service struct {
|
type Service struct {
|
||||||
Users *userService
|
Users *userService
|
||||||
Rides *rideService
|
Rides *rideService
|
||||||
Visits *visitService
|
Visits *visitService
|
||||||
Provider *providerService
|
Provider *providerService
|
||||||
Notification *notificationService
|
Notification *notificationService
|
||||||
Profile *profileService
|
Profile *profileService
|
||||||
Organization *organizationService
|
Organization *organizationService
|
||||||
Zipcodes *zipcodeService
|
Zipcodes *zipcodeService
|
||||||
Plan *planService
|
Plan *planService
|
||||||
|
PasswordReset *passwordResetService
|
||||||
}
|
}
|
||||||
|
|
||||||
// New returns a new domain Service instance
|
// New returns a new domain Service instance
|
||||||
@@ -34,15 +35,16 @@ func New(svc *service.Service, mapper *entitymapping.Mapper, notification *notif
|
|||||||
bcbsi := bcbsi.New(cfg)
|
bcbsi := bcbsi.New(cfg)
|
||||||
|
|
||||||
instance = &Service{
|
instance = &Service{
|
||||||
Users: newUserService(svc, mapper, bcbsi, cfg),
|
Users: newUserService(svc, mapper, bcbsi, cfg),
|
||||||
Rides: newRideService(svc, mapper),
|
Rides: newRideService(svc, mapper),
|
||||||
Visits: newVisitService(svc, mapper),
|
Visits: newVisitService(svc, mapper),
|
||||||
Provider: newProviderService(svc, mapper),
|
Provider: newProviderService(svc, mapper),
|
||||||
Notification: newNotificationService(svc, mapper, notification, cfg),
|
Notification: newNotificationService(svc, mapper, notification, cfg),
|
||||||
Profile: newProfileService(svc, mapper),
|
Profile: newProfileService(svc, mapper),
|
||||||
Organization: newOrganizationService(svc, mapper),
|
Organization: newOrganizationService(svc, mapper),
|
||||||
Zipcodes: newZipcodeService(svc, mapper),
|
Zipcodes: newZipcodeService(svc, mapper),
|
||||||
Plan: newPlanService(svc, mapper),
|
Plan: newPlanService(svc, mapper),
|
||||||
|
PasswordReset: newPasswordResetService(svc, mapper),
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -77,6 +77,16 @@ func (s *userService) GetByMemberID(memberID string) (retVal viewmodel.User, err
|
|||||||
return s.mapEntity.User.ToUserModel(user), nil
|
return s.mapEntity.User.ToUserModel(user), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetByEmail returns a specific user by its email
|
||||||
|
func (s *userService) GetByEmail(email string) (retVal viewmodel.User, err error) {
|
||||||
|
user, err := s.svc.Users.GetByEmail(email)
|
||||||
|
if err != nil {
|
||||||
|
return retVal, errors.Wrap(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return s.mapEntity.User.ToUserModel(user), nil
|
||||||
|
}
|
||||||
|
|
||||||
// Login returns a specific user by email and pass
|
// Login returns a specific user by email and pass
|
||||||
func (s *userService) FullLogin(loginType string, key string, pass string, profile string) (retVal viewmodel.User, err error) {
|
func (s *userService) FullLogin(loginType string, key string, pass string, profile string) (retVal viewmodel.User, err error) {
|
||||||
user, err := s.svc.Users.FullLogin(loginType, key, pass, profile)
|
user, err := s.svc.Users.FullLogin(loginType, key, pass, profile)
|
||||||
@@ -250,6 +260,10 @@ func (s *userService) CheckAndCreateMember(user viewmodel.User, provider viewmod
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if entityUser.UUID == "" {
|
||||||
|
entityUser = s.mapEntity.User.ToUserEntity(user)
|
||||||
|
}
|
||||||
|
|
||||||
var eligibility viewmodel.Eligibility
|
var eligibility viewmodel.Eligibility
|
||||||
loc, _ := time.LoadLocation("America/Chicago")
|
loc, _ := time.LoadLocation("America/Chicago")
|
||||||
eligibility.TrackingID = s.rangeIn(1000000, 9999999)
|
eligibility.TrackingID = s.rangeIn(1000000, 9999999)
|
||||||
@@ -261,7 +275,7 @@ func (s *userService) CheckAndCreateMember(user viewmodel.User, provider viewmod
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return viewmodel.User{}, &viewmodel.ValidationError{Message: fmt.Sprintf("Error finding provider by UUID: %s", err.Error())}
|
return viewmodel.User{}, &viewmodel.ValidationError{Message: fmt.Sprintf("Error finding provider by UUID: %s", err.Error())}
|
||||||
}
|
}
|
||||||
} else {
|
} else if entityProvider.InternalID != "" {
|
||||||
entityProvider, err = s.svc.Provider.GetByNPI(entityProvider.InternalID, entityAuthorUser)
|
entityProvider, err = s.svc.Provider.GetByNPI(entityProvider.InternalID, entityAuthorUser)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return viewmodel.User{}, &viewmodel.ValidationError{Message: fmt.Sprintf("Error finding provider by NPI: %s", err.Error())}
|
return viewmodel.User{}, &viewmodel.ValidationError{Message: fmt.Sprintf("Error finding provider by NPI: %s", err.Error())}
|
||||||
@@ -269,7 +283,8 @@ func (s *userService) CheckAndCreateMember(user viewmodel.User, provider viewmod
|
|||||||
}
|
}
|
||||||
|
|
||||||
if entityProvider.InternalID == "" {
|
if entityProvider.InternalID == "" {
|
||||||
return viewmodel.User{}, &viewmodel.ValidationError{Message: "Provider not found"}
|
eligibility.Provider.ProviderNPI = "1699849786"
|
||||||
|
eligibility.Provider.ProviderName = "LITHOLINK CORPORATION"
|
||||||
} else {
|
} else {
|
||||||
eligibility.Provider.ProviderNPI = entityProvider.InternalID
|
eligibility.Provider.ProviderNPI = entityProvider.InternalID
|
||||||
eligibility.Provider.ProviderName = entityProvider.OrganizatioName
|
eligibility.Provider.ProviderName = entityProvider.OrganizatioName
|
||||||
|
|||||||
@@ -13,16 +13,17 @@ var (
|
|||||||
|
|
||||||
// Mapper has mapping methods to map entities to view models
|
// Mapper has mapping methods to map entities to view models
|
||||||
type Mapper struct {
|
type Mapper struct {
|
||||||
User *userMapping
|
User *userMapping
|
||||||
Ride *rideMapping
|
Ride *rideMapping
|
||||||
Visit *visitMapping
|
Visit *visitMapping
|
||||||
Address *addressMapping
|
Address *addressMapping
|
||||||
Provider *providerMapping
|
Provider *providerMapping
|
||||||
Notification *notificationMapping
|
Notification *notificationMapping
|
||||||
Profile *profileMapping
|
Profile *profileMapping
|
||||||
Organization *organizationMapping
|
Organization *organizationMapping
|
||||||
Zipcode *zipcodeMapping
|
Zipcode *zipcodeMapping
|
||||||
Plan *planMapping
|
Plan *planMapping
|
||||||
|
PasswordReset *passwordResetMapping
|
||||||
}
|
}
|
||||||
|
|
||||||
// New returns an EntityMapper for fluent mapping
|
// New returns an EntityMapper for fluent mapping
|
||||||
@@ -40,6 +41,7 @@ func New() *Mapper {
|
|||||||
instance.Organization = &organizationMapping{instance}
|
instance.Organization = &organizationMapping{instance}
|
||||||
instance.Zipcode = &zipcodeMapping{instance}
|
instance.Zipcode = &zipcodeMapping{instance}
|
||||||
instance.Plan = &planMapping{instance}
|
instance.Plan = &planMapping{instance}
|
||||||
|
instance.PasswordReset = &passwordResetMapping{instance}
|
||||||
})
|
})
|
||||||
|
|
||||||
return instance
|
return instance
|
||||||
|
|||||||
@@ -20,16 +20,17 @@ var (
|
|||||||
|
|
||||||
// Conn is the MySQL connection manager
|
// Conn is the MySQL connection manager
|
||||||
type Conn struct {
|
type Conn struct {
|
||||||
db *sql.DB
|
db *sql.DB
|
||||||
users *userRepo
|
users *userRepo
|
||||||
rides *rideRepo
|
rides *rideRepo
|
||||||
visit *visitRepo
|
visit *visitRepo
|
||||||
provider *providerRepo
|
provider *providerRepo
|
||||||
notification *notificationRepo
|
notification *notificationRepo
|
||||||
profile *profileRepo
|
profile *profileRepo
|
||||||
organization *organizationRepo
|
organization *organizationRepo
|
||||||
zipcodes *zipcodeRepo
|
zipcodes *zipcodeRepo
|
||||||
plan *planRepo
|
plan *planRepo
|
||||||
|
passwordReset *passwordResetRepo
|
||||||
}
|
}
|
||||||
|
|
||||||
// Begin starts a transaction
|
// Begin starts a transaction
|
||||||
@@ -90,6 +91,10 @@ func (c *Conn) Plans() contract.PlanRepo {
|
|||||||
return c.plan
|
return c.plan
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *Conn) PasswordReset() contract.PasswordResetRepo {
|
||||||
|
return c.passwordReset
|
||||||
|
}
|
||||||
|
|
||||||
// Instance returns an instance of a DataManager
|
// Instance returns an instance of a DataManager
|
||||||
func Instance(cfg *config.Config) (contract.DataManager, error) {
|
func Instance(cfg *config.Config) (contract.DataManager, error) {
|
||||||
once.Do(func() {
|
once.Do(func() {
|
||||||
@@ -123,6 +128,7 @@ func Instance(cfg *config.Config) (contract.DataManager, error) {
|
|||||||
instance.organization = newOrganizationRepo(db)
|
instance.organization = newOrganizationRepo(db)
|
||||||
instance.zipcodes = newZipcodeRepo(db)
|
instance.zipcodes = newZipcodeRepo(db)
|
||||||
instance.plan = newPlanRepo(db)
|
instance.plan = newPlanRepo(db)
|
||||||
|
instance.passwordReset = newPasswordResetRepo(db)
|
||||||
})
|
})
|
||||||
|
|
||||||
return instance, connErr
|
return instance, connErr
|
||||||
|
|||||||
@@ -8,16 +8,17 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type transaction struct {
|
type transaction struct {
|
||||||
tx *sql.Tx
|
tx *sql.Tx
|
||||||
users *userRepo
|
users *userRepo
|
||||||
rides *rideRepo
|
rides *rideRepo
|
||||||
visits *visitRepo
|
visits *visitRepo
|
||||||
provider *providerRepo
|
provider *providerRepo
|
||||||
notification *notificationRepo
|
notification *notificationRepo
|
||||||
profile *profileRepo
|
profile *profileRepo
|
||||||
organization *organizationRepo
|
organization *organizationRepo
|
||||||
zipcodes *zipcodeRepo
|
zipcodes *zipcodeRepo
|
||||||
plan *planRepo
|
plan *planRepo
|
||||||
|
passwordReset *passwordResetRepo
|
||||||
}
|
}
|
||||||
|
|
||||||
func newTransaction(tx *sql.Tx) *transaction {
|
func newTransaction(tx *sql.Tx) *transaction {
|
||||||
@@ -34,6 +35,7 @@ func newTransaction(tx *sql.Tx) *transaction {
|
|||||||
t.organization = newOrganizationRepo(tx)
|
t.organization = newOrganizationRepo(tx)
|
||||||
t.zipcodes = newZipcodeRepo(tx)
|
t.zipcodes = newZipcodeRepo(tx)
|
||||||
t.plan = newPlanRepo(tx)
|
t.plan = newPlanRepo(tx)
|
||||||
|
t.passwordReset = newPasswordResetRepo(tx)
|
||||||
|
|
||||||
return t
|
return t
|
||||||
}
|
}
|
||||||
@@ -81,6 +83,10 @@ func (t transaction) Plans() contract.PlanRepo {
|
|||||||
return t.plan
|
return t.plan
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (t transaction) PasswordReset() contract.PasswordResetRepo {
|
||||||
|
return t.passwordReset
|
||||||
|
}
|
||||||
|
|
||||||
func (t *transaction) Commit() error {
|
func (t *transaction) Commit() error {
|
||||||
|
|
||||||
err := t.tx.Commit()
|
err := t.tx.Commit()
|
||||||
|
|||||||
@@ -48,6 +48,32 @@ func (c *userRepo) GetByMemberID(memberID string) (entity.User, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *userRepo) GetByEmail(email string) (entity.User, error) {
|
||||||
|
finalQuery := c.getQuery() + " AND b.email = ?"
|
||||||
|
|
||||||
|
user, err := c.parseSet(c.conn.Query(finalQuery, email))
|
||||||
|
if err != nil {
|
||||||
|
return entity.User{}, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(user) > 0 {
|
||||||
|
retVal := user[0]
|
||||||
|
retVal.Contacts, err = c.GetContacts(retVal.ID)
|
||||||
|
if err != nil {
|
||||||
|
return entity.User{}, err
|
||||||
|
}
|
||||||
|
|
||||||
|
retVal.Addresses = nil
|
||||||
|
retVal.Addresses, err = c.getAddressByUserID(retVal.ID)
|
||||||
|
if err != nil {
|
||||||
|
return entity.User{}, err
|
||||||
|
}
|
||||||
|
return retVal, nil
|
||||||
|
} else {
|
||||||
|
return entity.User{}, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (c *userRepo) GetByUUID(uuid string, profile string) (entity.User, error) {
|
func (c *userRepo) GetByUUID(uuid string, profile string) (entity.User, error) {
|
||||||
params := make([]interface{}, 0)
|
params := make([]interface{}, 0)
|
||||||
params = append(params, uuid)
|
params = append(params, uuid)
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ type repoManager interface {
|
|||||||
Organization() OrganizationRepo
|
Organization() OrganizationRepo
|
||||||
Zipcodes() ZipcodeRepo
|
Zipcodes() ZipcodeRepo
|
||||||
Plans() PlanRepo
|
Plans() PlanRepo
|
||||||
|
PasswordReset() PasswordResetRepo
|
||||||
}
|
}
|
||||||
|
|
||||||
// UserRepo defines the data set for users
|
// UserRepo defines the data set for users
|
||||||
@@ -22,6 +23,7 @@ type UserRepo interface {
|
|||||||
GetByID(userID int64) (retVal entity.User, err error)
|
GetByID(userID int64) (retVal entity.User, err error)
|
||||||
GetByUUID(uuid string, profile string) (entity.User, error)
|
GetByUUID(uuid string, profile string) (entity.User, error)
|
||||||
GetByMemberID(memberID string) (entity.User, error)
|
GetByMemberID(memberID string) (entity.User, error)
|
||||||
|
GetByEmail(email string) (entity.User, error)
|
||||||
Login(email string, pass string) (entity.User, error)
|
Login(email string, pass string) (entity.User, error)
|
||||||
FullLogin(loginType string, key string, pass string, profile string) (entity.User, error)
|
FullLogin(loginType string, key string, pass string, profile string) (entity.User, error)
|
||||||
Create(user entity.User) (entity.User, error)
|
Create(user entity.User) (entity.User, error)
|
||||||
@@ -124,3 +126,12 @@ type ZipcodeRepo interface {
|
|||||||
GetAll() ([]entity.Zipcode, error)
|
GetAll() ([]entity.Zipcode, error)
|
||||||
GetByParticipatingZipcode(zipcode string) (entity.Zipcode, error)
|
GetByParticipatingZipcode(zipcode string) (entity.Zipcode, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type PasswordResetRepo interface {
|
||||||
|
GetAll() ([]entity.PasswordReset, error)
|
||||||
|
CreatePasswordResetEntry(passwordResetEntry entity.PasswordReset) (entity.PasswordReset, error)
|
||||||
|
GetByID(ID int64) (entity.PasswordReset, error)
|
||||||
|
GetByToken(token string) (entity.PasswordReset, error)
|
||||||
|
SetTokenOpened(token string) error
|
||||||
|
SetTokenUsed(token string) error
|
||||||
|
}
|
||||||
|
|||||||
@@ -15,18 +15,19 @@ var (
|
|||||||
|
|
||||||
// Service holds the domain service repositories
|
// Service holds the domain service repositories
|
||||||
type Service struct {
|
type Service struct {
|
||||||
db contract.DataManager
|
db contract.DataManager
|
||||||
cache contract.CacheManager
|
cache contract.CacheManager
|
||||||
tnc contract.TNCManager
|
tnc contract.TNCManager
|
||||||
Users *userService
|
Users *userService
|
||||||
Rides *rideService
|
Rides *rideService
|
||||||
Visits *visitService
|
Visits *visitService
|
||||||
Provider *providerService
|
Provider *providerService
|
||||||
Notification *notificationService
|
Notification *notificationService
|
||||||
Profile *profileService
|
Profile *profileService
|
||||||
Organization *organizationService
|
Organization *organizationService
|
||||||
Zipcodes *zipcodeService
|
Zipcodes *zipcodeService
|
||||||
Plans *planService
|
Plans *planService
|
||||||
|
PasswordReset *passwordResetService
|
||||||
}
|
}
|
||||||
|
|
||||||
// New returns a new domain Service instance
|
// New returns a new domain Service instance
|
||||||
@@ -43,6 +44,7 @@ func New(db contract.DataManager, cache contract.CacheManager, cfg *config.Confi
|
|||||||
instance.Organization = newOrganizationService(instance)
|
instance.Organization = newOrganizationService(instance)
|
||||||
instance.Zipcodes = newZipcodeService(instance)
|
instance.Zipcodes = newZipcodeService(instance)
|
||||||
instance.Plans = newPlanService(instance)
|
instance.Plans = newPlanService(instance)
|
||||||
|
instance.PasswordReset = newPasswordResetService(instance)
|
||||||
})
|
})
|
||||||
|
|
||||||
return instance, nil
|
return instance, nil
|
||||||
|
|||||||
@@ -37,6 +37,10 @@ func (s *userService) GetByMemberID(memberID string) (entity.User, error) {
|
|||||||
return s.svc.db.Users().GetByMemberID(memberID)
|
return s.svc.db.Users().GetByMemberID(memberID)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *userService) GetByEmail(email string) (entity.User, error) {
|
||||||
|
return s.svc.db.Users().GetByEmail(email)
|
||||||
|
}
|
||||||
|
|
||||||
// Login returns a specific user by email and pass
|
// Login returns a specific user by email and pass
|
||||||
func (s *userService) Login(email string, pass string) (entity.User, error) {
|
func (s *userService) Login(email string, pass string) (entity.User, error) {
|
||||||
return s.svc.db.Users().Login(email, pass)
|
return s.svc.db.Users().Login(email, pass)
|
||||||
@@ -72,7 +76,7 @@ func (s *userService) CreateBulk(users []entity.User) ([]entity.User, error) {
|
|||||||
return users, nil
|
return users, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *userService) UpdateLogin(user entity.User) error {
|
func (s *userService) UpdateLogin(user entity.User) error {
|
||||||
return s.svc.db.Users().UpdateLogin(user)
|
return s.svc.db.Users().UpdateLogin(user)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import (
|
|||||||
"bitbucket.org/nemt/nemt-portal-api/server/router/lyfthookroute"
|
"bitbucket.org/nemt/nemt-portal-api/server/router/lyfthookroute"
|
||||||
"bitbucket.org/nemt/nemt-portal-api/server/router/notificationroute"
|
"bitbucket.org/nemt/nemt-portal-api/server/router/notificationroute"
|
||||||
"bitbucket.org/nemt/nemt-portal-api/server/router/organizationroute"
|
"bitbucket.org/nemt/nemt-portal-api/server/router/organizationroute"
|
||||||
|
"bitbucket.org/nemt/nemt-portal-api/server/router/passwordresetroute"
|
||||||
"bitbucket.org/nemt/nemt-portal-api/server/router/placesroute"
|
"bitbucket.org/nemt/nemt-portal-api/server/router/placesroute"
|
||||||
"bitbucket.org/nemt/nemt-portal-api/server/router/profileroute"
|
"bitbucket.org/nemt/nemt-portal-api/server/router/profileroute"
|
||||||
"bitbucket.org/nemt/nemt-portal-api/server/router/providerroute"
|
"bitbucket.org/nemt/nemt-portal-api/server/router/providerroute"
|
||||||
@@ -39,6 +40,7 @@ func Register(e *echo.Echo, cfg *config.Config, svc *applicationservice.Service,
|
|||||||
externalroute.Register(prefixGroup.Group("/ext"), cfg, svc, tnc, notification)
|
externalroute.Register(prefixGroup.Group("/ext"), cfg, svc, tnc, notification)
|
||||||
authenticateroute.Register(prefixGroup.Group("/authenticate"), cfg, svc)
|
authenticateroute.Register(prefixGroup.Group("/authenticate"), cfg, svc)
|
||||||
selfregisterroute.Register(prefixGroup.Group("/selfregister"), cfg, svc)
|
selfregisterroute.Register(prefixGroup.Group("/selfregister"), cfg, svc)
|
||||||
|
passwordresetroute.Register(prefixGroup.Group("/passwordreset"), cfg, svc)
|
||||||
|
|
||||||
appGroup := prefixGroup.Group("/" + cfg.App.Name)
|
appGroup := prefixGroup.Group("/" + cfg.App.Name)
|
||||||
usersroute.Register(appGroup.Group("/users"), cfg, svc)
|
usersroute.Register(appGroup.Group("/users"), cfg, svc)
|
||||||
|
|||||||
@@ -102,6 +102,11 @@ func ResponseAPINotEligibleWithMessageError(c echo.Context, message string) erro
|
|||||||
return ResponseAPIError(c, http.StatusForbidden, message, false)
|
return ResponseAPIError(c, http.StatusForbidden, message, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//ResponseAPIPasswordResetFailed returns a standard API error when password reset fails
|
||||||
|
func ResponseAPIPasswordResetFailed(c echo.Context, message string) error {
|
||||||
|
return ResponseAPIError(c, http.StatusForbidden, message, false)
|
||||||
|
}
|
||||||
|
|
||||||
func ignoreDefaultWrappedErrors(c echo.Context, errorToHandle *errors.WrappedError, handler func(echo.Context, error) error) error {
|
func ignoreDefaultWrappedErrors(c echo.Context, errorToHandle *errors.WrappedError, handler func(echo.Context, error) error) error {
|
||||||
err := errorToHandle.GetOriginalError()
|
err := errorToHandle.GetOriginalError()
|
||||||
|
|
||||||
|
|||||||
@@ -348,11 +348,7 @@ func (c *controller) handleMember(ctx echo.Context) error {
|
|||||||
return routeutils.ResponseAPIAuthError(ctx, "phonenumber or email is required", false)
|
return routeutils.ResponseAPIAuthError(ctx, "phonenumber or email is required", false)
|
||||||
}
|
}
|
||||||
|
|
||||||
provider, err := c.svc.Provider.GetByNPI("1699849786", authUser)
|
provider := viewmodel.ProviderResp{}
|
||||||
if err != nil {
|
|
||||||
return routeutils.ResponseAPIAuthError(ctx, "Provider not found", false)
|
|
||||||
}
|
|
||||||
|
|
||||||
user, err = c.svc.Users.CheckAndCreateMember(user, provider, authUser)
|
user, err = c.svc.Users.CheckAndCreateMember(user, provider, authUser)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if validationError, ok := err.(*viewmodel.ValidationError); ok {
|
if validationError, ok := err.(*viewmodel.ValidationError); ok {
|
||||||
|
|||||||
@@ -19,7 +19,8 @@ func authSkipper(ctx echo.Context) bool {
|
|||||||
strings.Contains(path, "/v1/notification/ws") ||
|
strings.Contains(path, "/v1/notification/ws") ||
|
||||||
strings.HasPrefix(path, "/v1/lyfthook") ||
|
strings.HasPrefix(path, "/v1/lyfthook") ||
|
||||||
strings.HasPrefix(path, "/v1/docs") ||
|
strings.HasPrefix(path, "/v1/docs") ||
|
||||||
strings.HasPrefix(path, "/v1/selfregister"))
|
strings.HasPrefix(path, "/v1/selfregister") ||
|
||||||
|
strings.HasPrefix(path, "/v1/passwordreset"))
|
||||||
}
|
}
|
||||||
|
|
||||||
// appSkipper is the default skipper for the application routes
|
// appSkipper is the default skipper for the application routes
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ func ValidateSelfregistration(user *viewmodel.User) []errors.ValidationError {
|
|||||||
|
|
||||||
//Provider NPI validation
|
//Provider NPI validation
|
||||||
if len(user.Provider.InternalID) != 10 || !isNumeric(user.Provider.InternalID) {
|
if len(user.Provider.InternalID) != 10 || !isNumeric(user.Provider.InternalID) {
|
||||||
result = append(result, errors.ValidationError{Field: "provider.internal_id", Message: "Provider NPI must be 10 digit number"})
|
result = append(result, errors.ValidationError{Field: "provider.internal_id", Message: "Provider NPI must be a 10 digit number"})
|
||||||
}
|
}
|
||||||
|
|
||||||
//First name validation
|
//First name validation
|
||||||
|
|||||||
Reference in New Issue
Block a user