mirror of
https://github.com/warmbly/warmbly.git
synced 2026-09-06 08:01:24 +00:00
32 lines
1.0 KiB
Go
32 lines
1.0 KiB
Go
package user
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/google/uuid"
|
|
"github.com/warmbly/warmbly/internal/errx"
|
|
"github.com/warmbly/warmbly/internal/infrastructure/cache"
|
|
"github.com/warmbly/warmbly/internal/models"
|
|
"github.com/warmbly/warmbly/internal/repository"
|
|
)
|
|
|
|
type UserService interface {
|
|
SaveUser(ctx context.Context, user *models.User) *errx.Error
|
|
GetUser(ctx context.Context, userID uuid.UUID) (*models.User, *errx.Error)
|
|
CompleteOnboarding(ctx context.Context, userID uuid.UUID, firstName, lastName, referralSource, role, teamSize string) *errx.Error
|
|
UpdateProfile(ctx context.Context, userID uuid.UUID, firstName, lastName string) *errx.Error
|
|
UpdateUndoSendSeconds(ctx context.Context, userID uuid.UUID, seconds int) *errx.Error
|
|
}
|
|
|
|
type userService struct {
|
|
cache *cache.Cache
|
|
userRepository repository.UserRepository
|
|
}
|
|
|
|
func NewService(userRepository repository.UserRepository, cache *cache.Cache) UserService {
|
|
return &userService{
|
|
userRepository: userRepository,
|
|
cache: cache,
|
|
}
|
|
}
|