package accountdb

import (
	"context"

	"github.com/tech/sendico/pkg/db/repository"
	"github.com/tech/sendico/pkg/model"
)

func (db *AccountDB) GetByToken(ctx context.Context, email string) (*model.Account, error) {
	var account model.Account
	return &account, db.FindOne(ctx, repository.Query().Filter(repository.Field("verifyToken"), email), &account)
}
