Files
RenewCMS/internal/domain/user/userRepositoryInterface.go
T

27 lines
1.2 KiB
Go

package user
import "time"
type Repository interface {
Get(id uint32) (User, error)
GetByUsername(username string) (User, error)
GetByEmail(email string) (User, error)
GetAll() ([]User, error)
FindByIDs(ids []uint32) ([]User, error)
Create(user User) (User, error)
Delete(id uint32) error
DeleteIfRole(id uint32, roleID uint32) error
UpdateVerificationStatus(userId uint32, isVerified bool) (User, error)
UpdatePassword(userId uint32, password string) (User, error)
UpdatePasswordResetCode(userId uint32, code string, expiration time.Time) (User, error)
ClearVerificationCode(userId uint32) (User, error)
ResetPassword(userId uint32, hashedPassword string) (User, error)
UpdateDisplayName(userId uint32, displayName string) (User, error)
IsEmailInUse(email string, exceptUserId uint32) (bool, error)
SetPendingEmailChange(userId uint32, pendingEmail string, code string, expiration time.Time) (User, error)
ClearPendingEmailChange(userId uint32) (User, error)
ConfirmEmailChange(userId uint32, pendingEmail string, code string, now time.Time) (User, error)
UpdateRole(id uint32, from uint32, to uint32, assignedBy uint32) (User, error)
TransferOwnership(from uint32, to uint32, ownerRoleID uint32, formerRoleID uint32) error
}