aboutsummaryrefslogtreecommitdiffstats
path: root/timetask/fields.go
diff options
context:
space:
mode:
authorTeddy Wing2017-03-12 15:17:36 +0100
committerTeddy Wing2017-03-12 15:17:36 +0100
commit3291b4dd10cd3b9b2a5d4a4d4ebebe99038ad948 (patch)
tree8cfd1e151de71a08ed57a2d8fafc79b9f47dad60 /timetask/fields.go
parent7a8db5312bbb43c986fbae7aa14960e22080b03b (diff)
downloadtimetasker-3291b4dd10cd3b9b2a5d4a4d4ebebe99038ad948.tar.bz2
Make fields named structs
We'll be needing to refer to these fields as named types, so create types for them and reference them in the config object.
Diffstat (limited to 'timetask/fields.go')
-rw-r--r--timetask/fields.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/timetask/fields.go b/timetask/fields.go
new file mode 100644
index 0000000..84bf93a
--- /dev/null
+++ b/timetask/fields.go
@@ -0,0 +1,27 @@
+package timetask
+
+type IDName struct {
+ ID uint
+ Name string
+}
+
+type Client struct {
+ IDName
+ Projects []Project
+}
+
+type Project struct {
+ IDName
+ Modules []Module
+ Tasks []Task
+ WorkTypes []WorkType `yaml:"work_types"`
+}
+
+type Module IDName
+type Task IDName
+type WorkType IDName
+
+type Fields struct {
+ PersonID uint `yaml:"person_id"`
+ Clients []Client
+}