194 lines
2.9 KiB
Go
194 lines
2.9 KiB
Go
package main
|
|
|
|
import "database/sql"
|
|
|
|
type Settings struct {
|
|
DaysPerMonth int
|
|
CurrentMonth int
|
|
CurrentCycle 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
|
|
StartPeriod int
|
|
StartMonth int
|
|
StartDay int
|
|
StartCycle int
|
|
HarvestPeriod int
|
|
HarvestMonth int
|
|
HarvestDay int
|
|
HarvestCycle 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
|
|
TaskPeriod int
|
|
Month int
|
|
Day int
|
|
YearOffset int
|
|
Cycle 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 CycleOption struct {
|
|
Value int
|
|
Label string
|
|
}
|
|
|
|
type CalendarDay struct {
|
|
Day int
|
|
Tasks []Task
|
|
Groups []FieldTaskGroup
|
|
}
|
|
|
|
type CalendarMonth struct {
|
|
Offset int
|
|
Month int
|
|
Label string
|
|
YearOffset int
|
|
Days []CalendarDay
|
|
}
|
|
|
|
type BasePage struct {
|
|
ActivePath string
|
|
Error string
|
|
Info string
|
|
}
|
|
|
|
type FieldTaskGroup struct {
|
|
Field string
|
|
Tasks []Task
|
|
}
|
|
|
|
type DashboardPage struct {
|
|
BasePage
|
|
Settings Settings
|
|
CurrentMonth string
|
|
TodayTasks []Task
|
|
TodayGroups []FieldTaskGroup
|
|
Calendar []CalendarMonth
|
|
PlanningCount int
|
|
MatrixEnabled bool
|
|
MatrixRoomID string
|
|
MatrixError string
|
|
MatrixMessages []MatrixMessage
|
|
}
|
|
|
|
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
|
|
CycleOffsets []CycleOption
|
|
Crops []Crop
|
|
Plans []Plan
|
|
PlanningTargets []PlanningTarget
|
|
TaskTemplates []CustomTaskTemplate
|
|
CustomTasks []CustomTask
|
|
}
|
|
|
|
type GeneralPage struct {
|
|
BasePage
|
|
Settings Settings
|
|
Months []MonthOption
|
|
}
|
|
|
|
type MatrixMessage struct {
|
|
Sender string
|
|
Body string
|
|
Timestamp string
|
|
}
|