models

package module
v0.0.0-...-5a32478 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2023 License: GPL-3.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	CreatedOn time.Time
	Actions   []GardenAction
}

type GardenAction

type GardenAction struct {
	Subject []Specimen
	Type    GardenActionsType
}

type GardenActionsType

type GardenActionsType string
const (
	WateredAction      GardenActionsType = "Watered"
	SownAction         GardenActionsType = "Sown"
	TransplantedAction GardenActionsType = "Transplanted"
	RemovedAction      GardenActionsType = "Removed"
	FertilizedAction   GardenActionsType = "Fertlized"
	UnknownAction      GardenActionsType = ""
)

type GrowingState

type GrowingState string
const (
	Sown         GrowingState = "SOWN"
	Seedling     GrowingState = "SEEDLING"
	Transplanted GrowingState = "TRANSPLANTED"
	Mature       GrowingState = "MATURE"
	Removed      GrowingState = "REMOVED"
	Perannual    GrowingState = "PERANNUAL"
)

type Plant

type Plant struct {
	Id                 uint32
	Name               string
	MinDaysToGerminate uint8
	MaxDaysToGerminate uint8
	MinDaysToMaturity  uint8
	MaxDaysToMaturity  uint8
	IsPerAnnual        bool
}

type Specimen

type Specimen struct {
	Id             uint32
	Plant          Plant
	SownDate       time.Time
	TransplantDate time.Time
	State          GrowingState
}

func (Specimen) EstimatedGerminationDate

func (self Specimen) EstimatedGerminationDate() (time.Time, time.Time)

Returns the lower and upper bounds of the estimated germination

If the sown data is zero, the function will return zero date time for upper and lower

func (Specimen) EstimatedMaturityDate

func (self Specimen) EstimatedMaturityDate() (time.Time, time.Time)

Returns the estimated maturity date for the specimen

If sown date for the specimen is zero, returns zero for both lower and upper

func (Specimen) ToString

func (self Specimen) ToString() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL