Documentation ¶
Index ¶
- Constants
- type ServiceResult
- type Task
- func (t *Task) CancelTask(taskService TaskService)
- func (t *Task) ChangeTaskCategory(taskService TaskService, category string) (*Task, error)
- func (t *Task) ChangeTaskDescription(taskService TaskService, description string) (*Task, error)
- func (t *Task) ChangeTaskDetails(taskService TaskService, details TaskDomain) (*Task, error)
- func (t *Task) ChangeTaskDueDate(taskService TaskService, duedate *time.Time) (*Task, error)
- func (t *Task) ChangeTaskPriority(taskService TaskService, priority string) (*Task, error)
- func (t *Task) ChangeTaskTitle(taskService TaskService, title string) (*Task, error)
- func (t *Task) CompleteTask(taskService TaskService)
- func (t *Task) SetTaskAsDue(taskService TaskService)
- func (state *Task) TrackChange(taskService TaskService, event interface{}) error
- func (state *Task) Transition(taskService TaskService, event interface{}) error
- type TaskAssetIDChanged
- type TaskCancelled
- type TaskCategory
- type TaskCategoryChanged
- type TaskCompleted
- type TaskCreated
- type TaskDescriptionChanged
- type TaskDetailsChanged
- type TaskDomain
- type TaskDomainArea
- type TaskDomainCrop
- type TaskDomainFinance
- type TaskDomainGeneral
- type TaskDomainInventory
- type TaskDomainReservoir
- type TaskDue
- type TaskDueDateChanged
- type TaskError
- type TaskPriority
- type TaskPriorityChanged
- type TaskService
- type TaskStatus
- type TaskTitleChanged
Constants ¶
View Source
const ( TaskCategoryArea = "AREA" TaskCategoryCrop = "CROP" TaskCategoryFinance = "FINANCE" TaskCategoryGeneral = "GENERAL" TaskCategoryInventory = "INVENTORY" TaskCategoryNutrient = "NUTRIENT" TaskCategoryPestControl = "PESTCONTROL" TaskCategoryReservoir = "RESERVOIR" TaskCategorySafety = "SAFETY" TaskCategorySanitation = "SANITATION" )
View Source
const ( TaskDomainAreaCode = "AREA" TaskDomainCropCode = "CROP" TaskDomainFinanceCode = "FINANCE" TaskDomainGeneralCode = "GENERAL" TaskDomainInventoryCode = "INVENTORY" TaskDomainReservoirCode = "RESERVOIR" )
View Source
const ( // Title Errors TaskErrorTitleEmptyCode = iota // Invalid Task ID Error TaskErrorIDInvalidCode // Description Errors TaskErrorDescriptionEmptyCode // Date Errors TaskErrorDueDateEmptyCode TaskErrorDueDateInvalidCode // Priority Errors TaskErrorPriorityEmptyCode TaskErrorInvalidPriorityCode // Status Errors TaskErrorStatusEmptyCode TaskErrorInvalidStatusCode // Domain Errors TaskErrorDomainEmptyCode TaskErrorInvalidDomainCode // Category Errors TaskErrorCategoryEmptyCode TaskErrorInvalidCategoryCode // Parent UID Errors TaskErrorAssetIDEmptyCode TaskErrorInvalidAssetIDCode // Task Domain Errors TaskErrorInventoryIDEmptyCode TaskErrorInvalidInventoryIDCode TaskErrorInvalidAreaIDCode // Task General Errors TaskErrorTaskNotFoundCode )
View Source
const ( TaskCreatedCode = "TaskCreated" TaskTitleChangedCode = "TaskTitleChanged" TaskDescriptionChangedCode = "TaskDescriptionChanged" TaskPriorityChangedCode = "TaskPriorityChanged" TaskDueDateChangedCode = "TaskDueDateChanged" TaskCategoryChangedCode = "TaskCategoryChanged" TaskDetailsChangedCode = "TaskDetailsChanged" TaskAssetIDChangedCode = "TaskAssetIDChanged" TaskCompletedCode = "TaskCompleted" TaskCancelledCode = "TaskCancelled" TaskDueCode = "TaskDue" )
View Source
const ( TaskPriorityUrgent = "URGENT" TaskPriorityNormal = "NORMAL" )
View Source
const ( TaskStatusCreated = "CREATED" TaskStatusCancelled = "CANCELLED" TaskStatusCompleted = "COMPLETED" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ServiceResult ¶
type ServiceResult struct { Result interface{} Error error }
ServiceResult is the container for service result
type Task ¶
type Task 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 TaskDomain `json:"domain_details"` Category string `json:"category"` IsDue bool `json:"is_due"` AssetID *uuid.UUID `json:"asset_id"` // Events Version int UncommittedChanges []interface{} }
func CreateTask ¶
func CreateTask(taskService TaskService, title string, description string, duedate *time.Time, priority string, taskdomain TaskDomain, taskcategory string, assetid *uuid.UUID) (*Task, error)
CreateTask
func (*Task) ChangeTaskCategory ¶
func (t *Task) ChangeTaskCategory(taskService TaskService, category string) (*Task, error)
func (*Task) ChangeTaskDescription ¶
func (t *Task) ChangeTaskDescription(taskService TaskService, description string) (*Task, error)
func (*Task) ChangeTaskDetails ¶
func (t *Task) ChangeTaskDetails(taskService TaskService, details TaskDomain) (*Task, error)
func (*Task) ChangeTaskDueDate ¶
func (*Task) ChangeTaskPriority ¶
func (t *Task) ChangeTaskPriority(taskService TaskService, priority string) (*Task, error)
func (*Task) ChangeTaskTitle ¶
func (t *Task) ChangeTaskTitle(taskService TaskService, title string) (*Task, error)
func (*Task) TrackChange ¶
func (state *Task) TrackChange(taskService TaskService, event interface{}) error
func (*Task) Transition ¶
func (state *Task) Transition(taskService TaskService, event interface{}) error
type TaskAssetIDChanged ¶
type TaskCancelled ¶
type TaskCategory ¶
func FindAllTaskCategories ¶
func FindAllTaskCategories() []TaskCategory
func FindTaskCategoryByCode ¶
func FindTaskCategoryByCode(code string) (TaskCategory, error)
type TaskCategoryChanged ¶
type TaskCompleted ¶
type TaskCreated ¶
type TaskCreated 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"` Priority string `json:"priority"` Status string `json:"status"` Domain string `json:"domain"` DomainDetails TaskDomain `json:"domain_details"` Category string `json:"category"` IsDue bool `json:"is_due"` AssetID *uuid.UUID `json:"asset_id"` }
type TaskDescriptionChanged ¶
type TaskDetailsChanged ¶
type TaskDetailsChanged struct { UID uuid.UUID `json:"uid"` DomainDetails TaskDomain `json:"domain_details"` }
type TaskDomain ¶
type TaskDomain interface {
Code() string
}
type TaskDomainArea ¶
AREA
func CreateTaskDomainArea ¶
func CreateTaskDomainArea(taskService TaskService, category string, materialID *uuid.UUID) (TaskDomainArea, error)
CreateTaskDomainArea
func (TaskDomainArea) Code ¶
func (d TaskDomainArea) Code() string
type TaskDomainCrop ¶
type TaskDomainCrop struct { MaterialID *uuid.UUID `json:"material_id"` AreaID *uuid.UUID `json:"area_id"` }
CROP
func CreateTaskDomainCrop ¶
func CreateTaskDomainCrop(taskService TaskService, category string, materialID *uuid.UUID, areaID *uuid.UUID) (TaskDomainCrop, error)
CreateTaskDomainCrop
func (TaskDomainCrop) Code ¶
func (d TaskDomainCrop) Code() string
type TaskDomainFinance ¶
type TaskDomainFinance struct { }
FINANCE
func CreateTaskDomainFinance ¶
func CreateTaskDomainFinance() (TaskDomainFinance, error)
CreateTaskDomainFinance
func (TaskDomainFinance) Code ¶
func (d TaskDomainFinance) Code() string
type TaskDomainGeneral ¶
type TaskDomainGeneral struct { }
GENERAL
func CreateTaskDomainGeneral ¶
func CreateTaskDomainGeneral() (TaskDomainGeneral, error)
CreateTaskDomainGeneral
func (TaskDomainGeneral) Code ¶
func (d TaskDomainGeneral) Code() string
type TaskDomainInventory ¶
type TaskDomainInventory struct { }
INVENTORY
func CreateTaskDomainInventory ¶
func CreateTaskDomainInventory() (TaskDomainInventory, error)
CreateTaskDomainInventory
func (TaskDomainInventory) Code ¶
func (d TaskDomainInventory) Code() string
type TaskDomainReservoir ¶
RESERVOIR
func CreateTaskDomainReservoir ¶
func CreateTaskDomainReservoir(taskService TaskService, category string, materialID *uuid.UUID) (TaskDomainReservoir, error)
CreateTaskDomainReservoir
func (TaskDomainReservoir) Code ¶
func (d TaskDomainReservoir) Code() string
type TaskDueDateChanged ¶
type TaskError ¶
type TaskError struct {
Code int
}
TaskError is a custom error from Go built-in error
type TaskPriority ¶
func FindAllTaskPriority ¶
func FindAllTaskPriority() []TaskPriority
func FindTaskPriorityByCode ¶
func FindTaskPriorityByCode(code string) (TaskPriority, error)
type TaskPriorityChanged ¶
type TaskService ¶
type TaskService interface { FindAreaByID(uid uuid.UUID) ServiceResult FindCropByID(uid uuid.UUID) ServiceResult FindMaterialByID(uid uuid.UUID) ServiceResult FindReservoirByID(uid uuid.UUID) ServiceResult }
type TaskStatus ¶
func FindAllTaskStatus ¶
func FindAllTaskStatus() []TaskStatus
func FindTaskStatusByCode ¶
func FindTaskStatusByCode(code string) (TaskStatus, error)
type TaskTitleChanged ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.