Files
warmbly/internal/app/user/onboarding.go
T
Matthew Meszaros da82993846 feat: add campaign workflow backend support
Add sequence action-node storage and execution, template conditional rendering, lead progress state, profile updates, webhook fan-out throttling, and supporting repository fixes.
2026-06-06 07:49:52 +02:00

32 lines
1006 B
Go

package user
import (
"context"
"github.com/google/uuid"
"github.com/warmbly/warmbly/internal/errx"
)
func (s *userService) CompleteOnboarding(ctx context.Context, userID uuid.UUID, firstName, lastName, referralSource, role, teamSize string) *errx.Error {
if err := s.userRepository.UpdateOnboarding(ctx, userID, firstName, lastName, referralSource, role, teamSize); err != nil {
return errx.InternalError()
}
s.cache.Del(ctx, getUserKey(userID))
return nil
}
// UpdateProfile persists the user's display name (first/last) from the profile
// settings page. Distinct from CompleteOnboarding, which also captures the
// one-time questionnaire answers; this is the editable, repeatable name update.
func (s *userService) UpdateProfile(ctx context.Context, userID uuid.UUID, firstName, lastName string) *errx.Error {
if err := s.userRepository.UpdateProfile(ctx, userID, firstName, lastName); err != nil {
return errx.InternalError()
}
s.cache.Del(ctx, getUserKey(userID))
return nil
}