summaryrefslogtreecommitdiff
path: root/model/recipe.go
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2024-03-03 20:06:40 +0100
committerxengineering <me@xengineering.eu>2024-03-04 20:33:58 +0100
commitb62c686702622b747ab082b7b12b3e611e1d7e1f (patch)
treeaa0f31ad0381dbeb3247870744d07bc9c81ed31b /model/recipe.go
parent4dcd846aa7c8d15c96ba13380f48b985fb2c992e (diff)
downloadceres-b62c686702622b747ab082b7b12b3e611e1d7e1f.tar
ceres-b62c686702622b747ab082b7b12b3e611e1d7e1f.tar.zst
ceres-b62c686702622b747ab082b7b12b3e611e1d7e1f.zip
model: Create test data with Go instead of SQL
This allows to formulate the test data with an object-based model which is easier than writing it down in a relational model.
Diffstat (limited to 'model/recipe.go')
-rw-r--r--model/recipe.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/model/recipe.go b/model/recipe.go
index c9ef6fb..ce16ee4 100644
--- a/model/recipe.go
+++ b/model/recipe.go
@@ -126,3 +126,26 @@ func (r *Recipe) Delete() error {
return nil
}
+
+func RecipeTestData() []Recipe {
+ return []Recipe{
+ {
+ Id: "1",
+ Title: "Pancakes",
+ Portions: "4",
+ Url: "https://example.org",
+ Notes: "Very fluffy",
+ Created: "",
+ LastChanged: "",
+ },
+ {
+ Id: "2",
+ Title: "Burger",
+ Portions: "2",
+ Url: "https://xengineering.eu/git/ceres",
+ Notes: "Delicious!",
+ Created: "",
+ LastChanged: "",
+ },
+ }
+}