summaryrefslogtreecommitdiff
path: root/internal/api/interfaces.go
blob: 32d01208369fa91a62e7e6e3f48e19cc585885a7 (plain)
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
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) ([]models.Project, error)
	CreateTask(ctx context.Context, content, projectID string, dueDate *time.Time, priority int) (*models.Task, error)
	UpdateTask(ctx context.Context, taskID string, updates map[string]interface{}) error
	CompleteTask(ctx context.Context, taskID string) error
	Sync(ctx context.Context, syncToken string) (*TodoistSyncResponse, 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
}

// 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)
	_ PlanToEatAPI = (*PlanToEatClient)(nil)
)