package state

import (
	"context"

	"github.com/StevanFreeborn/gator/internal/config"
	"github.com/StevanFreeborn/gator/internal/database"
)

type State struct {
	Database  *database.Queries
	Config    *config.Config
	Arguments []string
}

func NewState(d *database.Queries, c *config.Config, args []string) *State {
	return &State{Database: d, Config: c, Arguments: args}
}

func (s *State) GetCurrentUser(ctx context.Context) (database.User, error) {
	return s.Database.GetUserByName(ctx, s.Config.CurrentUserName)
}
