domain

package
v0.0.0-...-87346ed Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DeviceCategoryRobot is a variable for category of a device
	DeviceCategoryRobot = "ROBOT"
	// DeviceCategorySensor is a variable for a category of a device
	DeviceCategorySensor = "SENSOR"
)
View Source
const (
	DeviceDomainAreaCode      = "AREA"
	DeviceDomainCropCode      = "CROP"
	DeviceDomainFinanceCode   = "FINANCE"
	DeviceDomainGeneralCode   = "GENERAL"
	DeviceDomainInventoryCode = "INVENTORY"
	DeviceDomainReservoirCode = "RESERVOIR"
)

DeviceDomainAreaCode is used ...

View Source
const (
	// DeviceErrorTitleEmptyCode is used
	DeviceErrorTitleEmptyCode = iota

	// DeviceErrorIDInvalidCode error
	DeviceErrorIDInvalidCode

	// DeviceErrorDescriptionEmptyCode Errors
	DeviceErrorDescriptionEmptyCode

	// DeviceErrorStatusEmptyCode is a status error
	DeviceErrorStatusEmptyCode
	// DeviceErrorInvalidStatusCode is a status error
	DeviceErrorInvalidStatusCode

	// DeviceErrorDomainEmptyCode gives Domain Errors
	DeviceErrorDomainEmptyCode
	// DeviceErrorInvalidDomainCode gives Domain Errors
	DeviceErrorInvalidDomainCode

	// DeviceErrorCategoryEmptyCode gives Category Errors
	DeviceErrorCategoryEmptyCode
	// DeviceErrorInvalidCategoryCode gives Category Errors
	DeviceErrorInvalidCategoryCode

	// DeviceErrorAssetIDEmptyCode gives Parent UID Errors
	DeviceErrorAssetIDEmptyCode
	// DeviceErrorInvalidAssetIDCode gives Parent UID Errors
	DeviceErrorInvalidAssetIDCode

	// DeviceErrorInventoryIDEmptyCode gives Task Domain Errors
	DeviceErrorInventoryIDEmptyCode
	// DeviceErrorInvalidInventoryIDCode gives Task Domain Errors
	DeviceErrorInvalidInventoryIDCode
	// DeviceErrorInvalidAreaIDCode gives Task Domain Errors
	DeviceErrorInvalidAreaIDCode

	// DeviceErrorDeviceNotFoundCode gives Device General Errors
	DeviceErrorDeviceNotFoundCode
)
View Source
const (
	DeviceCreatedCode            = "DeviceCreated"
	DeviceTitleChangedCode       = "DeviceTitleChanged"
	DeviceDescriptionChangedCode = "DeviceDescriptionChanged"
	DeviceCategoryChangedCode    = "DeviceCategoryChanged"
	DeviceDetailsChangedCode     = "DeviceDetailsChanged"
	DeviceAssetIDChangedCode     = "DeviceAssetIDChanged"
)

DeviceCreatedCode is used

View Source
const (
	// DeviceStatusCreated defines status as 'start'
	DeviceStatusCreated = "START_DEVICE"
	// DeviceStatusCancelled defines status as 'stopped'
	DeviceStatusCancelled = "STOP_DEVICE"
	// DeviceStatusCompleted defines status as 'iddle'
	DeviceStatusCompleted = "DEVICE_IDLE"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

type Device struct {
	UID         uuid.UUID `json:"uid"`
	Title       string    `json:"title"`
	Description string    `json:"description"`
	CreatedDate time.Time `json:"created_date"`
	//DueDate       *time.Time `json:"due_date, omitempty"`
	//CompletedDate *time.Time `json:"completed_date"`
	//CancelledDate *time.Time `json:"cancelled_date"`
	//Priority      string     `json:"priority"`
	Status        string       `json:"status"`
	Domain        string       `json:"domain"`
	DomainDetails DeviceDomain `json:"domain_details"`
	Category      string       `json:"category"`
	//IsDue         bool       `json:"is_due"`
	AssetID *uuid.UUID `json:"asset_id"`

	// Events
	Version            int
	UncommittedChanges []interface{}
}

Device object is defined here

func CreateDevice

func CreateDevice(deviceService DeviceService, title string, description string, devicedomain DeviceDomain, devicecategory string, assetid *uuid.UUID) (*Device, error)

CreateDevice is a function that will add a new device to the system

func (*Device) ChangeDeviceCategory

func (t *Device) ChangeDeviceCategory(deviceService DeviceService, category string) (*Device, error)

ChangeDeviceCategory is a function used to update a device's category

func (*Device) ChangeDeviceDescription

func (t *Device) ChangeDeviceDescription(deviceService DeviceService, description string) (*Device, error)

ChangeDeviceDescription is a function used to update a device's description

func (*Device) ChangeDeviceDetails

func (t *Device) ChangeDeviceDetails(deviceService DeviceService, details DeviceDomain) (*Device, error)

ChangeDeviceDetails is a function used to update a device's details

func (*Device) ChangeDeviceTitle

func (t *Device) ChangeDeviceTitle(deviceService DeviceService, title string) (*Device, error)

ChangeDeviceTitle is a function that allows the user to change title of a device

func (*Device) TrackChange

func (t *Device) TrackChange(deviceService DeviceService, event interface{}) error

TrackChange is used

func (*Device) Transition

func (t *Device) Transition(deviceService DeviceService, event interface{}) error

Transition is used

type DeviceAssetIDChanged

type DeviceAssetIDChanged struct {
	UID     uuid.UUID  `json:"uid"`
	AssetID *uuid.UUID `json:"asset_id"`
}

DeviceAssetIDChanged is used

type DeviceCategory

type DeviceCategory struct {
	Code string
	Name string
}

DeviceCategory defines ...

func FindAllDeviceCategories

func FindAllDeviceCategories() []DeviceCategory

FindAllDeviceCategories allows a user to filter a search

func FindDeviceCategoryByCode

func FindDeviceCategoryByCode(code string) (DeviceCategory, error)

FindDeviceCategoryByCode allows a user to filter a search

type DeviceCategoryChanged

type DeviceCategoryChanged struct {
	UID      uuid.UUID `json:"uid"`
	Category string    `json:"category"`
}

DeviceCategoryChanged is used

type DeviceCreated

type DeviceCreated struct {
	UID           uuid.UUID    `json:"uid"`
	Title         string       `json:"title"`
	Description   string       `json:"description"`
	CreatedDate   time.Time    `json:"created_date"`
	Status        string       `json:"status"`
	Domain        string       `json:"domain"`
	DomainDetails DeviceDomain `json:"domain_details"`
	Category      string       `json:"category"`
	AssetID       *uuid.UUID   `json:"asset_id"`
}

DeviceCreated is used

type DeviceDescriptionChanged

type DeviceDescriptionChanged struct {
	UID         uuid.UUID `json:"uid"`
	Description string    `json:"description"`
}

DeviceDescriptionChanged is used ...

type DeviceDetailsChanged

type DeviceDetailsChanged struct {
	UID           uuid.UUID    `json:"uid"`
	DomainDetails DeviceDomain `json:"domain_details"`
}

DeviceDetailsChanged is used

type DeviceDomain

type DeviceDomain interface {
	Code() string
}

DeviceDomain is used ...

type DeviceDomainArea

type DeviceDomainArea struct {
	MaterialID *uuid.UUID `json:"material_id"`
}

DeviceDomainArea is used ...

func CreateDeviceDomainArea

func CreateDeviceDomainArea(deviceService DeviceService, category string, materialID *uuid.UUID) (DeviceDomainArea, error)

CreateDeviceDomainArea is used ....

func (DeviceDomainArea) Code

func (d DeviceDomainArea) Code() string

Code is used ...

type DeviceDomainCrop

type DeviceDomainCrop struct {
	MaterialID *uuid.UUID `json:"material_id"`
	AreaID     *uuid.UUID `json:"area_id"`
}

DeviceDomainCrop is used ...

func CreateDeviceDomainCrop

func CreateDeviceDomainCrop(deviceService DeviceService, category string, materialID *uuid.UUID, areaID *uuid.UUID) (DeviceDomainCrop, error)

CreateDeviceDomainCrop is used ...

func (DeviceDomainCrop) Code

func (d DeviceDomainCrop) Code() string

Code is used ...

type DeviceDomainFinance

type DeviceDomainFinance struct {
}

DeviceDomainFinance ...

func CreateDeviceDomainFinance

func CreateDeviceDomainFinance() (DeviceDomainFinance, error)

CreateDeviceDomainFinance is used ...

func (DeviceDomainFinance) Code

func (d DeviceDomainFinance) Code() string

Code is used ...

type DeviceDomainGeneral

type DeviceDomainGeneral struct {
}

DeviceDomainGeneral is used ...

func CreateDeviceDomainGeneral

func CreateDeviceDomainGeneral() (DeviceDomainGeneral, error)

CreateDeviceDomainGeneral is used ....

func (DeviceDomainGeneral) Code

func (d DeviceDomainGeneral) Code() string

Code is used ...

type DeviceDomainInventory

type DeviceDomainInventory struct {
}

DeviceDomainInventory is used ...

func CreateDeviceDomainInventory

func CreateDeviceDomainInventory() (DeviceDomainInventory, error)

CreateDeviceDomainInventory is used ...

func (DeviceDomainInventory) Code

func (d DeviceDomainInventory) Code() string

Code is used ...

type DeviceDomainReservoir

type DeviceDomainReservoir struct {
	MaterialID *uuid.UUID `json:"material_id"`
}

DeviceDomainReservoir is used ...

func CreateDeviceDomainReservoir

func CreateDeviceDomainReservoir(deviceService DeviceService, category string, materialID *uuid.UUID) (DeviceDomainReservoir, error)

CreateDeviceDomainReservoir is used ...

func (DeviceDomainReservoir) Code

func (d DeviceDomainReservoir) Code() string

Code is used ...

type DeviceError

type DeviceError struct {
	Code int
}

DeviceError is a custom error from Go built-in error

func (DeviceError) Error

func (e DeviceError) Error() string

type DeviceService

type DeviceService interface {
	FindAreaByID(uid uuid.UUID) ServiceResult
	FindCropByID(uid uuid.UUID) ServiceResult
	FindMaterialByID(uid uuid.UUID) ServiceResult
	FindReservoirByID(uid uuid.UUID) ServiceResult
}

DeviceService is used

type DeviceStatus

type DeviceStatus struct {
	Code string
	Name string
}

DeviceStatus is used ...

func FindAllDeviceStatus

func FindAllDeviceStatus() []DeviceStatus

FindAllDeviceStatus is used

func FindDeviceStatusByCode

func FindDeviceStatusByCode(code string) (DeviceStatus, error)

FindDeviceStatusByCode is used ...

type DeviceTitleChanged

type DeviceTitleChanged struct {
	UID   uuid.UUID `json:"uid"`
	Title string    `json:"title"`
}

DeviceTitleChanged is used ...

type ServiceResult

type ServiceResult struct {
	Result interface{}
	Error  error
}

ServiceResult is the container for service result

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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