package store

import "time"

type Store interface {
	ListWorkspaces() []Workspace
	ListMembers(workspaceSlug string) []Member
	GetMemberByID(memberID string) (Member, error)
	UpdateMember(memberID string, input UpdateMemberInput) (Member, error)
	ListInvites(workspaceSlug string) []Invite
	GetInviteByID(inviteID string) (Invite, error)
	GetInviteByToken(token string) (Invite, error)
	CreateInvite(input CreateInviteInput) Invite
	RevokeInvite(inviteID string) error
	AcceptInvite(token string, input AcceptInviteInput) (Invite, error)
	ListActivities(workspaceSlug string) []ActivityEntry
	ListBoardGroups(workspaceSlug string) []BoardGroup
	GetBoardGroupByID(groupID string) (BoardGroup, error)
	CreateBoardGroup(input CreateBoardGroupInput) BoardGroup
	UpdateBoardGroup(groupID string, input UpdateBoardGroupInput) (BoardGroup, error)
	ListLabels(workspaceSlug string) []Label
	CreateLabel(input CreateLabelInput) Label
	ListTasks(workspaceSlug string) []Task
	GetTaskByID(taskID string) (Task, error)
	CreateTask(input CreateTaskInput) Task
	UpdateTask(taskID string, input UpdateTaskInput) (Task, error)
	ListEvents(workspaceSlug string) []CalendarEvent
	GetEventByID(eventID string) (CalendarEvent, error)
	CreateEvent(input CreateEventInput) CalendarEvent
	UpdateEvent(eventID string, input UpdateEventInput) (CalendarEvent, error)
	ListNotes(workspaceSlug string) []Note
	GetNoteByID(noteID string) (Note, error)
	CreateNote(input CreateNoteInput) Note
	UpdateNote(noteID string, input UpdateNoteInput) (Note, error)
	ListFocusSessions(workspaceSlug string) []FocusSession
	GetFocusSessionByID(sessionID string) (FocusSession, error)
	CreateFocusSession(input CreateFocusSessionInput) FocusSession
	UpdateFocusSession(sessionID string, input UpdateFocusSessionInput) (FocusSession, error)
	ListAllMailboxes() []Mailbox
	ListMailboxes(workspaceSlug string) []Mailbox
	GetMailboxByID(mailboxID string) (Mailbox, error)
	GetMailboxConnection(mailboxID string) (MailboxConnection, error)
	CreateMailbox(input CreateMailboxRecordInput) (Mailbox, error)
	UpdateMailboxSyncStatus(mailboxID string, input UpdateMailboxSyncStatusInput) (Mailbox, error)
	ListMailMessages(workspaceSlug string, mailboxID string) []MailMessage
	GetMailMessageByID(messageID string) (MailMessage, error)
	UpsertMailMessages(mailboxID string, messages []InboundMailMessage) error
	LinkMailMessageTask(messageID string, taskID string) (MailMessage, error)
	ListOutgoingMails(workspaceSlug string, mailboxID string) []OutgoingMail
	ListDueOutgoingMails(now time.Time, limit int) []OutgoingMail
	GetOutgoingMailByID(outgoingMailID string) (OutgoingMail, error)
	CreateOutgoingMail(input CreateOutgoingMailInput) (OutgoingMail, error)
	UpdateOutgoingMailStatus(outgoingMailID string, input UpdateOutgoingMailStatusInput) (OutgoingMail, error)
	// CRM
	ListContacts(workspaceSlug string) []Contact
	GetContactByID(contactID string) (Contact, error)
	CreateContact(input CreateContactInput) Contact
	UpdateContact(contactID string, input UpdateContactInput) (Contact, error)
	DeleteContact(contactID string) error
	ListCompanies(workspaceSlug string) []Company
	GetCompanyByID(companyID string) (Company, error)
	CreateCompany(input CreateCompanyInput) Company
	UpdateCompany(companyID string, input UpdateCompanyInput) (Company, error)
	DeleteCompany(companyID string) error
	LinkContactToTask(contactID, taskID string) error
	UnlinkContactFromTask(contactID, taskID string) error
	ListContactsForTask(taskID string) []Contact
	LinkContactToEvent(contactID, eventID string) error
	ListContactsForEvent(eventID string) []Contact
	// Inbox
	ListInboxItems(workspaceSlug string) []InboxItem
	CreateInboxItem(input CreateInboxItemInput) InboxItem
	ProcessInboxItem(itemID string, entityType, entityID string) error
	DeleteInboxItem(itemID string) error
	// Time tracking
	ListTimeEntries(workspaceSlug string) []TimeEntry
	CreateTimeEntry(input CreateTimeEntryInput) TimeEntry
	UpdateTimeEntry(entryID string, input UpdateTimeEntryInput) (TimeEntry, error)
	DeleteTimeEntry(entryID string) error
	// Saved views
	ListSavedViews(workspaceSlug, entityType string) []SavedView
	CreateSavedView(input CreateSavedViewInput) SavedView
	DeleteSavedView(viewID string) error
	// Integrations
	ListIntegrations(workspaceSlug string) []Integration
	GetIntegrationByID(integrationID string) (Integration, error)
	CreateIntegration(input CreateIntegrationInput) Integration
	DeleteIntegration(integrationID string) error
	// Webhooks
	ListWebhooks(workspaceSlug string) []Webhook
	CreateWebhook(input CreateWebhookInput) Webhook
	DeleteWebhook(webhookID string) error
	// Notifications
	ListNotifications(userEmail string, limit int) []Notification
	CreateNotification(input CreateNotificationInput) Notification
	MarkNotificationRead(notificationID string) error
	MarkAllNotificationsRead(userEmail string) error
	UnreadNotificationCount(userEmail string) int
	// Presence
	UpdatePresence(input UpdatePresenceInput) Presence
	ListPresence(workspaceSlug string, entityType, entityID string) []Presence
	ClearPresence(workspaceSlug, userEmail string) error
}
