2020-04-30 14:32:48 +02:00
|
|
|
package entity
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
var LabelFixtures = map[string]Label{
|
|
|
|
"landscape": {
|
|
|
|
ID: 1000000,
|
|
|
|
LabelUUID: "lt9k3pw1wowuy3c2",
|
|
|
|
LabelSlug: "landscape",
|
|
|
|
CustomSlug: "landscape",
|
|
|
|
LabelName: "Landscape",
|
|
|
|
LabelPriority: 0,
|
|
|
|
LabelFavorite: true,
|
|
|
|
LabelDescription: "",
|
|
|
|
LabelNotes: "",
|
|
|
|
LabelCategories: []*Label{},
|
|
|
|
Links: []Link{},
|
|
|
|
CreatedAt: time.Now(),
|
|
|
|
UpdatedAt: time.Now(),
|
|
|
|
DeletedAt: nil,
|
|
|
|
New: false,
|
|
|
|
},
|
2020-04-30 17:26:21 +02:00
|
|
|
"flower": {
|
|
|
|
ID: 1000001,
|
|
|
|
LabelUUID: "lt9k3pw1wowuy3c3",
|
|
|
|
LabelSlug: "flower",
|
|
|
|
CustomSlug: "flower",
|
|
|
|
LabelName: "Flower",
|
|
|
|
LabelPriority: 1,
|
|
|
|
LabelFavorite: true,
|
|
|
|
LabelDescription: "",
|
|
|
|
LabelNotes: "",
|
|
|
|
LabelCategories: []*Label{},
|
|
|
|
Links: []Link{},
|
|
|
|
CreatedAt: time.Now(),
|
|
|
|
UpdatedAt: time.Now(),
|
|
|
|
DeletedAt: nil,
|
|
|
|
New: false,
|
|
|
|
},
|
|
|
|
"cake": {
|
|
|
|
ID: 1000002,
|
|
|
|
LabelUUID: "lt9k3pw1wowuy3c4",
|
|
|
|
LabelSlug: "cake",
|
|
|
|
CustomSlug: "kuchen",
|
|
|
|
LabelName: "Cake",
|
|
|
|
LabelPriority: 5,
|
|
|
|
LabelFavorite: false,
|
|
|
|
LabelDescription: "",
|
|
|
|
LabelNotes: "",
|
|
|
|
LabelCategories: []*Label{},
|
|
|
|
Links: []Link{},
|
|
|
|
CreatedAt: time.Now(),
|
|
|
|
UpdatedAt: time.Now(),
|
|
|
|
DeletedAt: nil,
|
|
|
|
New: false,
|
|
|
|
},
|
|
|
|
"cow": {
|
|
|
|
ID: 1000003,
|
|
|
|
LabelUUID: "lt9k3pw1wowuy3c5",
|
|
|
|
LabelSlug: "cow",
|
|
|
|
CustomSlug: "kuh",
|
2020-05-01 14:13:59 +02:00
|
|
|
LabelName: "COW",
|
2020-04-30 17:26:21 +02:00
|
|
|
LabelPriority: -1,
|
|
|
|
LabelFavorite: true,
|
|
|
|
LabelDescription: "",
|
|
|
|
LabelNotes: "",
|
|
|
|
LabelCategories: []*Label{},
|
|
|
|
Links: []Link{},
|
|
|
|
CreatedAt: time.Now(),
|
|
|
|
UpdatedAt: time.Now(),
|
|
|
|
DeletedAt: nil,
|
|
|
|
New: false,
|
|
|
|
},
|
2020-04-30 14:32:48 +02:00
|
|
|
}
|
|
|
|
|
2020-05-01 14:13:59 +02:00
|
|
|
var LabelFixtureLandscape = LabelFixtures["landscape"]
|
|
|
|
var LabelFixtureFlower = LabelFixtures["flower"]
|
|
|
|
var LabelFixtureCake = LabelFixtures["cake"]
|
|
|
|
|
2020-04-30 14:32:48 +02:00
|
|
|
// CreateLabelFixtures inserts known entities into the database for testing.
|
2020-04-30 20:07:03 +02:00
|
|
|
func CreateLabelFixtures() {
|
2020-04-30 14:32:48 +02:00
|
|
|
for _, entity := range LabelFixtures {
|
2020-04-30 20:07:03 +02:00
|
|
|
Db().Create(&entity)
|
2020-04-30 14:32:48 +02:00
|
|
|
}
|
|
|
|
}
|