Worked on dashboard starring and unstarring, renamed favorite model to star
This commit is contained in:
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user