Worked on dashboard starring and unstarring, renamed favorite model to star

This commit is contained in:
Torkel Ödegaard
2015-02-02 11:32:32 +01:00
parent 706481b1a3
commit ad3d15e28d
12 changed files with 231 additions and 118 deletions
-29
View File
@@ -1,29 +0,0 @@
package models
type Favorite struct {
Id int64
UserId int64
DashboardId int64
}
// ----------------------
// COMMANDS
type AddAsFavoriteCommand struct {
UserId int64
DashboardId int64
}
type RemoveAsFavoriteCommand struct {
UserId int64
DashboardId int64
}
// ---------------------
// QUERIES
type GetUserFavoritesQuery struct {
UserId int64
Result []Favorite
}
+40
View File
@@ -0,0 +1,40 @@
package models
import "errors"
var ErrCommandValidationFailed = errors.New("Command missing required fields")
type Star struct {
Id int64
UserId int64
DashboardId int64
}
// ----------------------
// COMMANDS
type StarDashboardCommand struct {
UserId int64
DashboardId int64
}
type UnstarDashboardCommand struct {
UserId int64
DashboardId int64
}
// ---------------------
// QUERIES
type GetUserStarsQuery struct {
UserId int64
Result []Star
}
type IsStarredByUserQuery struct {
UserId int64
DashboardId int64
Result bool
}