Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
phiros committed Apr 8, 2019
2 parents 8af0e69 + fc49486 commit 20f1ae5
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 35 deletions.
3 changes: 3 additions & 0 deletions domain/account.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package domain

type AccountApi interface{}
3 changes: 3 additions & 0 deletions domain/customer.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package domain

type CustomerApi interface{}
4 changes: 4 additions & 0 deletions domain/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ type Project struct {
Name string
Note string
}

type ProjectApi interface {
Projects() ([]*Project, error)
}
4 changes: 4 additions & 0 deletions domain/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ type Service struct {
Name string
Note string
}

type ServiceApi interface {
Services() ([]*Service, error)
}
8 changes: 8 additions & 0 deletions domain/time_entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,11 @@ type TimeEntryQuery struct {
To *LocalDate
Direction string
}

type TimeEntryApi interface {
TimeEntries(query *TimeEntryQuery) ([]*TimeEntry, error)
TimeEntry(id TimeEntryId) (*TimeEntry, error)
CreateTimeEntry(command *TimeEntryCommand) (*TimeEntry, error)
EditTimeEntry(id TimeEntryId, command *TimeEntryCommand) error
DeleteTimeEntry(id TimeEntryId) error
}
6 changes: 6 additions & 0 deletions domain/tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ type StoppedTimeEntry struct {
Id TimeEntryId
Minutes Minutes
}

type TrackerApi interface {
Tracker() (*TrackingTimeEntry, error)
StartTracker(id TimeEntryId) (*TrackingTimeEntry, *StoppedTimeEntry, error)
StopTracker(id TimeEntryId) (*StoppedTimeEntry, error)
}
3 changes: 3 additions & 0 deletions domain/user.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package domain

type UserApi interface{}
42 changes: 7 additions & 35 deletions mite/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,42 +12,14 @@ import (
const contentType = "application/json"
const userAgentTemplate = "mite-go/%s (+github.com/leanovate/mite-go)"

type AccountApi interface{}

type TimeEntryApi interface {
TimeEntries(query *domain.TimeEntryQuery) ([]*domain.TimeEntry, error)
TimeEntry(id domain.TimeEntryId) (*domain.TimeEntry, error)
CreateTimeEntry(command *domain.TimeEntryCommand) (*domain.TimeEntry, error)
EditTimeEntry(id domain.TimeEntryId, command *domain.TimeEntryCommand) error
DeleteTimeEntry(id domain.TimeEntryId) error
}

type TrackerApi interface {
Tracker() (*domain.TrackingTimeEntry, error)
StartTracker(id domain.TimeEntryId) (*domain.TrackingTimeEntry, *domain.StoppedTimeEntry, error)
StopTracker(id domain.TimeEntryId) (*domain.StoppedTimeEntry, error)
}

type CustomerApi interface{}

type ProjectApi interface {
Projects() ([]*domain.Project, error)
}

type ServiceApi interface {
Services() ([]*domain.Service, error)
}

type UserApi interface{}

type Api interface {
AccountApi
TimeEntryApi
TrackerApi
CustomerApi
ProjectApi
ServiceApi
UserApi
domain.AccountApi
domain.TimeEntryApi
domain.TrackerApi
domain.CustomerApi
domain.ProjectApi
domain.ServiceApi
domain.UserApi
}

type api struct {
Expand Down

0 comments on commit 20f1ae5

Please sign in to comment.