164 lines
2.4 KiB
Go
164 lines
2.4 KiB
Go
package main
|
|
|
|
import "database/sql"
|
|
|
|
type Settings struct {
|
|
DaysPerMonth int
|
|
CurrentMonth int
|
|
CurrentDay int
|
|
}
|
|
|
|
type Field struct {
|
|
ID int64
|
|
Number int
|
|
Name string
|
|
Owned bool
|
|
GroupKey string
|
|
GroupName string
|
|
}
|
|
|
|
type FieldGroup struct {
|
|
Key string
|
|
Name string
|
|
Numbers string
|
|
}
|
|
|
|
type Crop struct {
|
|
ID int64
|
|
Name string
|
|
SowStartMonth int
|
|
SowEndMonth int
|
|
GrowMonths int
|
|
BestSaleMonth int
|
|
RegrowEnabled bool
|
|
RegrowCycles int
|
|
}
|
|
|
|
type Product struct {
|
|
ID int64
|
|
Name string
|
|
BestSaleMonth int
|
|
}
|
|
|
|
type Plan struct {
|
|
ID int64
|
|
FieldID sql.NullInt64
|
|
TargetRef string
|
|
TargetName string
|
|
CropID int64
|
|
CropName string
|
|
GrowMonths int
|
|
StartMonth int
|
|
StartDay int
|
|
HarvestMonth int
|
|
HarvestDay int
|
|
Notes string
|
|
RegrowEnabled bool
|
|
RegrowCycles int
|
|
}
|
|
|
|
type CropStep struct {
|
|
ID int64
|
|
CropID int64
|
|
CropName string
|
|
Phase string
|
|
MonthOffset int
|
|
Title string
|
|
}
|
|
|
|
type CustomTaskTemplate struct {
|
|
ID int64
|
|
Title string
|
|
}
|
|
|
|
type CustomTask struct {
|
|
ID int64
|
|
TemplateID sql.NullInt64
|
|
Title string
|
|
Month int
|
|
Day int
|
|
YearOffset int
|
|
TargetName string
|
|
Notes string
|
|
}
|
|
|
|
type Task struct {
|
|
UID string
|
|
Type string
|
|
Field string
|
|
Message string
|
|
Month int
|
|
Day int
|
|
YearOffset int
|
|
Completed bool
|
|
SortOrder int
|
|
}
|
|
|
|
type PlanningTarget struct {
|
|
Ref string
|
|
Label string
|
|
}
|
|
|
|
type MonthOption struct {
|
|
Value int
|
|
Label string
|
|
}
|
|
|
|
type CalendarDay struct {
|
|
Day int
|
|
Tasks []Task
|
|
}
|
|
|
|
type CalendarMonth struct {
|
|
Offset int
|
|
Month int
|
|
Label string
|
|
YearOffset int
|
|
Days []CalendarDay
|
|
}
|
|
|
|
type BasePage struct {
|
|
ActivePath string
|
|
Error string
|
|
Info string
|
|
}
|
|
|
|
type DashboardPage struct {
|
|
BasePage
|
|
Settings Settings
|
|
CurrentMonth string
|
|
TodayTasks []Task
|
|
Calendar []CalendarMonth
|
|
PlanningCount int
|
|
}
|
|
|
|
type FieldsPage struct {
|
|
BasePage
|
|
Fields []Field
|
|
Groups []FieldGroup
|
|
}
|
|
|
|
type CropsPage struct {
|
|
BasePage
|
|
Crops []Crop
|
|
CropSteps []CropStep
|
|
Products []Product
|
|
}
|
|
|
|
type PlanningPage struct {
|
|
BasePage
|
|
Settings Settings
|
|
Months []MonthOption
|
|
Crops []Crop
|
|
Plans []Plan
|
|
PlanningTargets []PlanningTarget
|
|
TaskTemplates []CustomTaskTemplate
|
|
CustomTasks []CustomTask
|
|
}
|
|
|
|
type GeneralPage struct {
|
|
BasePage
|
|
Settings Settings
|
|
Months []MonthOption
|
|
}
|