package auth

import (
	"time"

	"secondbit.org/uuid"
)

type Profile struct {
	ID         uuid.ID
	Name       string
	Passphrase string
	Email      string
	Created    time.Time
	LastSeen   time.Time
}

type Login struct {
	Type      string
	Value     string
	ProfileID uuid.ID
	Created   time.Time
	LastUsed  time.Time
}

type ProfileStore interface {
	GetProfileByID(id uuid.ID) (Profile, error)
	GetProfileByLogin(loginType, value, passphrase string) (Profile, error)
	SaveProfile(user Profile) error
	UpdateProfile(id uuid.ID, name, passphrase, email *string) error
	DeleteProfile(id uuid.ID) error

	SaveLogin(login Login) error
	DeleteLogin(login Login) error
	UpdateLogin(id uuid.ID, lastUsed time.Time) error
}
