add project linking.
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-04-03 16:30:43 +02:00
parent 2c5d87134d
commit 2a6c04893d
17 changed files with 365 additions and 46 deletions
+10
View File
@@ -67,6 +67,11 @@ type TaskUpdate struct {
ProjectID *string `json:"projectId"`
}
type TaskLink struct {
TaskID string `json:"taskId" db:"task_id"`
ProjectID string `json:"projectId" db:"project_id"`
}
type TaskResult struct {
Task
Item *Item `json:"item"`
@@ -87,7 +92,12 @@ type TaskFilter struct {
type TaskRepository interface {
Find(ctx context.Context, id string) (*Task, error)
List(ctx context.Context, filter TaskFilter) ([]*Task, error)
ListWithLinks(ctx context.Context, filter TaskFilter) ([]*Task, []*TaskLink, error)
Insert(ctx context.Context, task Task) error
Update(ctx context.Context, task Task) error
CreateLink(ctx context.Context, link TaskLink) error
DeleteLink(ctx context.Context, link TaskLink) error
UnlinkTask(ctx context.Context, task Task) error
UnlinkProject(ctx context.Context, project Project) error
Delete(ctx context.Context, task Task) error
}