2015-02-02 04:32:32 -06:00
|
|
|
package models
|
|
|
|
|
|
|
|
import "errors"
|
|
|
|
|
2020-11-05 06:07:06 -06:00
|
|
|
var ErrCommandValidationFailed = errors.New("command missing required fields")
|
2015-02-02 04:32:32 -06:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2015-02-05 02:49:00 -06:00
|
|
|
Result map[int64]bool // dashboard ids
|
2015-02-02 04:32:32 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
type IsStarredByUserQuery struct {
|
|
|
|
UserId int64
|
|
|
|
DashboardId int64
|
|
|
|
|
|
|
|
Result bool
|
|
|
|
}
|