package ipc

import (
	"context"

	"github.com/AvengeMedia/dankcalendar/core/ent"
	"github.com/AvengeMedia/dankcalendar/core/internal/calendar"
	"github.com/AvengeMedia/dankcalendar/core/internal/colorscheme"
	"github.com/AvengeMedia/dankcalendar/core/internal/oauth"
	"github.com/AvengeMedia/dankcalendar/core/internal/reminders"
	"github.com/AvengeMedia/dankcalendar/core/repo"
)

type SyncTrigger interface {
	SyncAccount(ctx context.Context, acc *ent.Account) error
	SyncAll(ctx context.Context) error
}

type RemindersEngine interface {
	Upcoming(ctx context.Context, limit int) ([]reminders.Upcoming, error)
	SendTest() error
}

// URIOpener opens a URI with the user's default handler.
type URIOpener interface {
	OpenURI(uri string) error
}

type Deps struct {
	Repo        *repo.Repo
	Registry    *calendar.Registry
	Secrets     calendar.SecretStore
	Broker      *oauth.CallbackBroker
	Flows       *oauth.FlowRegistry
	HTTPAddr    string
	Sync        SyncTrigger
	Reminders   RemindersEngine
	Bus         *EventBus
	Pending     *PendingOpen
	Version     string
	ColorScheme *colorscheme.Watcher
	Opener      URIOpener
}
