hairizuanbinnoorazman / tasker

Create tasks from CLI and post it to task management platforms
1 stars 0 forks source link

Creating new common task interface between different platforms #6

Closed hairizuanbinnoorazman closed 6 years ago

hairizuanbinnoorazman commented 6 years ago

In order to allow interoperability between the platforms, we would need to design a common task struct which would consume the other services via interfaces

As of now, the platforms should be able provide the following set of services:
(May differ in definition between platforms)

hairizuanbinnoorazman commented 6 years ago

After initial thoughts, this is the interface that has come up along the way

type PlatformActions interface {
    ListProjects() ([]Project, error)
    ListTasks(projectID string) ([]Task, error)
    ListUsers(projectID string) ([]User, error)
    CreateTask(projectID, taskName string) (Task, error)
    CompleteTask(projectID, taskID string) (Task, error)
    AssignTask(projectID, taskID, userID string) (Task, error)
    AssignLabel(projectID, taskID, label string) (Task, error)
}

We need to take note that if there is any new functions that is to be added on this interface, we would need to implement across all platforms (a caution)

We can probably extend interface by composing it into another interface which would allow us to slowly extend the service - once the new interface is fully adopted => We can probably reuse this interface name once more (or refactor to switch out to utilize the original name)

hairizuanbinnoorazman commented 6 years ago

We can probably close this task for now -> If there is further discussions on this, we can create a new issue for it