Files
farmcal/cmd/server/types.go

118 lines
1.7 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
}
type Plan struct {
ID int64
FieldID sql.NullInt64
TargetRef string
TargetName string
CropID int64
CropName string
StartMonth int
StartDay int
HarvestMonth int
HarvestDay int
Notes string
}
type Task struct {
Type string
Field string
Message string
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
}
type PlanningPage struct {
BasePage
Settings Settings
Months []MonthOption
Crops []Crop
Plans []Plan
PlanningTargets []PlanningTarget
}
type GeneralPage struct {
BasePage
Settings Settings
Months []MonthOption
}