package dto

import "time"

// ThreadInboxCursor is the browser-facing JSON payload carried inside thread inbox pagination tokens.
type ThreadInboxCursor struct {
	SortAt          time.Time `json:"sortAt"`
	ThreadChannelID string    `json:"threadChannelId"`
}

// ConversationCursor is the browser-facing JSON payload carried inside Inbox conversation pagination tokens.
type ConversationCursor struct {
	PinnedAt *time.Time `json:"pinnedAt,omitempty"`
	SortAt   time.Time  `json:"sortAt"`
	ScopeID  string     `json:"scopeId"`
}

// IMConversationCursor is the browser-facing JSON payload carried inside IM conversation index pagination tokens.
type IMConversationCursor struct {
	PinnedAt       *time.Time `json:"pinnedAt,omitempty"`
	SortAt         time.Time  `json:"sortAt"`
	ConversationID string     `json:"conversationId"`
}

// TaskBrowseCursor is the browser-facing JSON payload carried inside task browse pagination tokens.
type TaskBrowseCursor struct {
	SortMode string `json:"sortMode"`
	Value    string `json:"value"`
	TaskID   string `json:"taskId"`
}

// TaskBrowseManualCursorValue is the sort value JSON for manual task-board ordering.
type TaskBrowseManualCursorValue struct {
	CreatedAt  string `json:"createdAt"`
	TaskNumber int64  `json:"taskNumber"`
}

// TaskBrowseRecentCursorValue is the sort value JSON for recently-updated task-board ordering.
type TaskBrowseRecentCursorValue struct {
	ActivityAt string `json:"activityAt"`
	TaskNumber int64  `json:"taskNumber"`
}

// TaskBrowseCreatedTimeCursorValue is the sort value JSON for created-time task-board ordering.
type TaskBrowseCreatedTimeCursorValue struct {
	CreatedAt  string `json:"createdAt"`
	ActivityAt string `json:"activityAt"`
	TaskNumber int64  `json:"taskNumber"`
}

// TaskBrowseTitleCursorValue is the sort value JSON for title task-board ordering.
type TaskBrowseTitleCursorValue struct {
	Title      string `json:"title"`
	CreatedAt  string `json:"createdAt"`
	TaskNumber int64  `json:"taskNumber"`
}

// TaskBrowsePriorityCursorValue is the sort value JSON for priority task-board ordering.
type TaskBrowsePriorityCursorValue struct {
	Missing    bool   `json:"missing"`
	Label      string `json:"label"`
	CreatedAt  string `json:"createdAt"`
	TaskNumber int64  `json:"taskNumber"`
}

// TaskTimelineCursor is the browser-facing JSON payload carried inside task discussion/activity pagination tokens.
type TaskTimelineCursor struct {
	Seq       int64     `json:"seq,omitempty"`
	CreatedAt time.Time `json:"createdAt"`
	ID        string    `json:"id"`
}

// DaemonWorkspaceFile is one file-tree node in the daemon workspace-file protocol.
type DaemonWorkspaceFile struct {
	Name           string     `json:"name"`
	Path           string     `json:"path"`
	IsDirectory    *bool      `json:"isDirectory"`
	Size           int64      `json:"size,omitempty"`
	ModifiedAt     *time.Time `json:"modifiedAt,omitempty"`
	ChildDirCount  int        `json:"childDirCount,omitempty"`
	ChildFileCount int        `json:"childFileCount,omitempty"`
}
