aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main.go24
-rw-r--r--timetask/fields.go27
2 files changed, 28 insertions, 23 deletions
diff --git a/main.go b/main.go
index 5c6e5e4..0d3a465 100644
--- a/main.go
+++ b/main.go
@@ -16,29 +16,7 @@ type Config struct {
Username string
PasswordCmd string `yaml:"password_cmd"`
}
- Fields struct {
- PersonID uint `yaml:"person_id"`
- Clients []struct {
- ID uint
- Name string
- Projects []struct {
- ID uint
- Name string
- Modules []struct {
- ID uint
- Name string
- }
- Tasks []struct {
- ID uint
- Name string
- }
- WorkTypes []struct {
- ID uint
- Name string
- } `yaml:"work_types"`
- }
- }
- }
+ Fields timetask.Fields
}
var config Config
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
+}