storage

package
v0.0.0-...-ae75a06 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2022 License: Apache-2.0 Imports: 5 Imported by: 30

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AreaEvent

type AreaEvent struct {
	AreaUID     uuid.UUID
	Version     int
	CreatedDate time.Time
	Event       interface{}
}

type AreaEventStorage

type AreaEventStorage struct {
	Lock       *deadlock.RWMutex
	AreaEvents []AreaEvent
}

func CreateAreaEventStorage

func CreateAreaEventStorage() *AreaEventStorage

type AreaFarm

type AreaFarm struct {
	UID  uuid.UUID `json:"uid"`
	Name string    `json:"name"`
}

type AreaInstalled

type AreaInstalled struct {
	UID  uuid.UUID `json:"uid"`
	Name string    `json:"name"`
}

type AreaLocation

type AreaLocation domain.AreaLocation

type AreaNote

type AreaNote domain.AreaNote

type AreaPhoto

type AreaPhoto domain.AreaPhoto

type AreaRead

type AreaRead struct {
	UID         uuid.UUID     `json:"uid"`
	Name        string        `json:"name"`
	Size        AreaSize      `json:"size"`
	Location    AreaLocation  `json:"location"`
	Type        string        `json:"type"`
	Photo       AreaPhoto     `json:"photo"`
	CreatedDate time.Time     `json:"created_date"`
	Notes       []AreaNote    `json:"notes"`
	Farm        AreaFarm      `json:"farm"`
	Reservoir   AreaReservoir `json:"reservoir"`
}

type AreaReadStorage

type AreaReadStorage struct {
	Lock        *deadlock.RWMutex
	AreaReadMap map[uuid.UUID]AreaRead
}

func CreateAreaReadStorage

func CreateAreaReadStorage() *AreaReadStorage

type AreaReservoir

type AreaReservoir struct {
	UID  uuid.UUID `json:"uid"`
	Name string    `json:"name"`
}

type AreaSize

type AreaSize domain.AreaSize

type AreaStatus

type AreaStatus struct {
	Seeding int `json:"seeding"`
	Growing int `json:"growing"`
	Dumped  int `json:"dumped"`
}

type AreaType

type AreaType domain.AreaType

type Container

type Container struct {
	Type     string `json:"type"`
	Quantity int    `json:"quantity"`
	Cell     int    `json:"cell"`
}

type CropRead

type CropRead struct {
	UID        uuid.UUID  `json:"uid"`
	BatchID    string     `json:"batch_id"`
	Status     string     `json:"status"`
	Type       string     `json:"type"`
	Container  Container  `json:"container"`
	Inventory  Inventory  `json:"inventory"`
	AreaStatus AreaStatus `json:"area_status"`
	FarmUID    uuid.UUID  `json:"farm_id"`

	// Fields to track crop's movement
	InitialArea InitialArea `json:"initial_area"`
	MovedArea   []MovedArea `json:"moved_area"`
}

type FarmEvent

type FarmEvent struct {
	FarmUID     uuid.UUID
	Version     int
	CreatedDate time.Time
	Event       interface{}
}

type FarmEventStorage

type FarmEventStorage struct {
	Lock       *deadlock.RWMutex
	FarmEvents []FarmEvent
}

func CreateFarmEventStorage

func CreateFarmEventStorage() *FarmEventStorage

type FarmRead

type FarmRead struct {
	UID         uuid.UUID `json:"uid"`
	Name        string    `json:"name"`
	Latitude    string    `json:"latitude"`
	Longitude   string    `json:"longitude"`
	Type        string    `json:"type"`
	Country     string    `json:"country"`
	City        string    `json:"city"`
	IsActive    bool      `json:"is_active"`
	CreatedDate time.Time `json:"created_date"`
}

type FarmReadStorage

type FarmReadStorage struct {
	Lock        *deadlock.RWMutex
	FarmReadMap map[uuid.UUID]FarmRead
}

func CreateFarmReadStorage

func CreateFarmReadStorage() *FarmReadStorage

type InitialArea

type InitialArea struct {
	AreaUID         uuid.UUID  `json:"area_id"`
	Name            string     `json:"name"`
	InitialQuantity int        `json:"initial_quantity"`
	CurrentQuantity int        `json:"current_quantity"`
	LastWatered     *time.Time `json:"last_watered"`
	LastFertilized  *time.Time `json:"last_fertilized"`
	LastPruned      *time.Time `json:"last_pruned"`
	LastPesticided  *time.Time `json:"last_pesticided"`
	CreatedDate     time.Time  `json:"created_date"`
	LastUpdated     time.Time  `json:"last_updated"`
}

type Inventory

type Inventory struct {
	UID       uuid.UUID `json:"uid"`
	PlantType string    `json:"plant_type"`
	Name      string    `json:"name"`
}

type MaterialEvent

type MaterialEvent struct {
	MaterialUID uuid.UUID
	Version     int
	CreatedDate time.Time
	Event       interface{}
}

type MaterialEventStorage

type MaterialEventStorage struct {
	Lock           *deadlock.RWMutex
	MaterialEvents []MaterialEvent
}

func CreateMaterialEventStorage

func CreateMaterialEventStorage() *MaterialEventStorage

type MaterialQuantity

type MaterialQuantity domain.MaterialQuantity

type MaterialRead

type MaterialRead struct {
	UID            uuid.UUID        `json:"uid"`
	Name           string           `json:"name"`
	PricePerUnit   PricePerUnit     `json:"price_per_unit"`
	Type           MaterialType     `json:"type"`
	Quantity       MaterialQuantity `json:"quantity"`
	ExpirationDate *time.Time       `json:"expiration_date"`
	Notes          *string          `json:"notes"`
	IsExpense      *bool            `json:"is_expense"`
	ProducedBy     *string          `json:"produced_by"`
	CreatedDate    time.Time        `json:"created_date"`
}

type MaterialReadStorage

type MaterialReadStorage struct {
	Lock            *deadlock.RWMutex
	MaterialReadMap map[uuid.UUID]MaterialRead
}

func CreateMaterialReadStorage

func CreateMaterialReadStorage() *MaterialReadStorage

type MaterialType

type MaterialType domain.MaterialType

type MovedArea

type MovedArea struct {
	AreaUID         uuid.UUID  `json:"area_id"`
	Name            string     `json:"name"`
	InitialQuantity int        `json:"initial_quantity"`
	CurrentQuantity int        `json:"current_quantity"`
	LastWatered     *time.Time `json:"last_watered"`
	LastFertilized  *time.Time `json:"last_fertilized"`
	LastPruned      *time.Time `json:"last_pruned"`
	LastPesticided  *time.Time `json:"last_pesticided"`
	CreatedDate     time.Time  `json:"created_date"`
	LastUpdated     time.Time  `json:"last_updated"`
}

type PricePerUnit

type PricePerUnit domain.PricePerUnit

type ReservoirEvent

type ReservoirEvent struct {
	ReservoirUID uuid.UUID
	Version      int
	CreatedDate  time.Time
	Event        interface{}
}

type ReservoirEventStorage

type ReservoirEventStorage struct {
	Lock            *deadlock.RWMutex
	ReservoirEvents []ReservoirEvent
}

func CreateReservoirEventStorage

func CreateReservoirEventStorage() *ReservoirEventStorage

type ReservoirFarm

type ReservoirFarm struct {
	UID  uuid.UUID `json:"uid"`
	Name string    `json:"name"`
}

type ReservoirNote

type ReservoirNote domain.ReservoirNote

type ReservoirRead

type ReservoirRead struct {
	UID             uuid.UUID       `json:"uid"`
	Name            string          `json:"name"`
	WaterSource     WaterSource     `json:"water_source"`
	Farm            ReservoirFarm   `json:"farm"`
	Notes           []ReservoirNote `json:"notes"`
	CreatedDate     time.Time       `json:"created_date"`
	InstalledToArea []AreaInstalled `json:"installed_to_area"`
}

type ReservoirReadStorage

type ReservoirReadStorage struct {
	Lock             *deadlock.RWMutex
	ReservoirReadMap map[uuid.UUID]ReservoirRead
}

func CreateReservoirReadStorage

func CreateReservoirReadStorage() *ReservoirReadStorage

type WaterSource

type WaterSource struct {
	Type     string  `json:"type"`
	Capacity float32 `json:"capacity"`
}

Jump to

Keyboard shortcuts

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