1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
package api
import (
"context"
"time"
"task-dashboard/internal/models"
)
// TodoistAPI defines the interface for Todoist operations
type TodoistAPI interface {
GetTasks(ctx context.Context) ([]models.Task, error)
GetProjects(ctx context.Context) (map[string]string, error)
CreateTask(ctx context.Context, content, projectID string, dueDate *time.Time, priority int) (*models.Task, error)
CompleteTask(ctx context.Context, taskID string) error
}
// TrelloAPI defines the interface for Trello operations
type TrelloAPI interface {
GetBoards(ctx context.Context) ([]models.Board, error)
GetCards(ctx context.Context, boardID string) ([]models.Card, error)
GetLists(ctx context.Context, boardID string) ([]models.List, error)
GetBoardsWithCards(ctx context.Context) ([]models.Board, error)
CreateCard(ctx context.Context, listID, name, description string, dueDate *time.Time) (*models.Card, error)
UpdateCard(ctx context.Context, cardID string, updates map[string]interface{}) error
}
// ObsidianAPI defines the interface for Obsidian operations
type ObsidianAPI interface {
GetNotes(ctx context.Context, limit int) ([]models.Note, error)
}
// PlanToEatAPI defines the interface for PlanToEat operations
type PlanToEatAPI interface {
GetUpcomingMeals(ctx context.Context, days int) ([]models.Meal, error)
GetRecipes(ctx context.Context) error
AddMealToPlanner(ctx context.Context, recipeID string, date time.Time, mealType string) error
}
// Ensure concrete types implement interfaces
var (
_ TodoistAPI = (*TodoistClient)(nil)
_ TrelloAPI = (*TrelloClient)(nil)
_ ObsidianAPI = (*ObsidianClient)(nil)
_ PlanToEatAPI = (*PlanToEatClient)(nil)
)
|