entities

package
v0.0.0-...-46b8622 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2017 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTimeout     = jsonrpc2.NewError(0, "TIMEOUT")
	ErrMaintenance = jsonrpc2.NewError(4, "MAINTENANCE")
)

Global error codes

View Source
var (
	ErrInvalidPlanningID = jsonrpc2.NewError(100, "INVALID_PLANNING_ID")
	ErrNoActivePlanning  = jsonrpc2.NewError(101, "NO_ACTIVE_PLANNING")
	ErrInvalidUserID     = jsonrpc2.NewError(102, "INVALID_USER_ID")
	ErrPlanningClosed    = jsonrpc2.NewError(103, "PLANNING_CLOSED")
	ErrPlanningOutdated  = jsonrpc2.NewError(104, "PLANNING_OUTDATED")
	ErrOutdatedReport    = jsonrpc2.NewError(105, "OUTDATED_REPORT")
	ErrNegativeSpentTime = jsonrpc2.NewError(106, "NEGATIVE_SPENT_TIME")
)

Application specific codes

Functions

This section is empty.

Types

type ActivityID

type ActivityID int64

ActivityID is helper type to avoid invalid int usage

type ExtendedPlanning

type ExtendedPlanning struct {
	Planning
	Estimation   int64
	LastActivity int64
	Outdated     bool
}

ExtendedPlanning is Planning with additional information

type IssueID

type IssueID int64

IssueID is helper type to avoid invalid int usage

type ModifySpentTimeFunc

type ModifySpentTimeFunc func(*SpentTime) (*SpentTime, error)

ModifySpentTimeFunc is function to modify SpentTime for user

type NewActivePlanning

type NewActivePlanning struct {
	UserID     ctxtg.UserID
	PlanningID PlanningID
	Time       int64
}

NewActivePlanning represents new active planning for user

type NewPlanning

type NewPlanning struct {
	UserID          ctxtg.UserID
	ProjectID       ProjectID
	TrackerID       TrackerID
	IssueID         IssueID
	IssueTitle      string
	IssueURL        string
	IssueEstimation int64
	IssueDueDate    int64
	IssueDone       int
	ActivityID      ActivityID
	Estimation      int64
}

NewPlanning is representation of new user plan for today

type PlannedTime

type PlannedTime struct {
	ID         int64      `db:"id"`
	PlanningID PlanningID `db:"planning_id"`
	Estimation int64      `db:"estimation"`
	Reason     string     `db:"reason"`
	CreatedAt  int64      `db:"created_at"`
}

PlannedTime represents expected time to spent on PlanningID by user

type Planning

type Planning struct {
	ID              PlanningID     `db:"id"`
	UserID          ctxtg.UserID   `db:"user_id"`
	Status          PlanningStatus `db:"-"`
	ProjectID       ProjectID      `db:"project_id"`
	TrackerID       TrackerID      `db:"tracker_id"`
	IssueID         IssueID        `db:"issue_id"`
	IssueTitle      string         `db:"issue_title"`
	IssueURL        string         `db:"issue_url"`
	IssueEstimation int64          `db:"issue_estim"`
	IssueDueDate    int64          `db:"issue_due_date"`
	IssueDone       int            `db:"issue_done"`
	ActivityID      ActivityID     `db:"activity_id"`
	SpentOnline     int            `db:"spent_online"`
	SpentOffline    int            `db:"spent_offline"`
	Reported        int64          `db:"reported"`
	CreatedAt       int64          `db:"created_at"`
}

Planning represents user plan for today

type PlanningID

type PlanningID int64

PlanningID is helper type to avoid invalid int usage

type PlanningReport

type PlanningReport struct {
	PlanningID PlanningID
	Progress   int
	Time       int64
}

PlanningReport represents final report in the end of planning

type PlanningStatus

type PlanningStatus string

PlanningStatus is type for open or closed planning statuses

const (
	Open   PlanningStatus = "OPEN"
	Closed PlanningStatus = "CLOSED"
)

Available planning statuses

type ProjectID

type ProjectID int64

ProjectID is helper type to avoid invalid int usage

type SpentTime

type SpentTime struct {
	UserID            ctxtg.UserID
	PlanningID        PlanningID
	PlanningCreatedAt int64
	Started           int64
	Last              int64
	SpentOnline       int
}

SpentTime represents user's spent time on planning

type SpentTimeHistory

type SpentTimeHistory struct {
	PlanningID PlanningID      `db:"planning_id"`
	Spent      int             `db:"spent"`
	StartedAt  int64           `db:"started_at"`
	EndedAt    int64           `db:"ended_at"`
	Status     SpentTimeStatus `db:"-"`
}

SpentTimeHistory represents small amount of history

type SpentTimeReport

type SpentTimeReport struct {
	UserID     ctxtg.UserID
	PlanningID PlanningID
	Spent      int
	Time       int64
}

SpentTimeReport represents spent time on planning report

type SpentTimeStatus

type SpentTimeStatus string

SpentTimeStatus is type for online or offline spent time status

const (
	Online  SpentTimeStatus = "ONLINE"
	Offline SpentTimeStatus = "OFFLINE"
)

Available spent time statuses

type Status

type Status string

Status is helper type to avoid invalid string usage

type TrackerID

type TrackerID int64

TrackerID is helper type to avoid invalid int usage

Jump to

Keyboard shortcuts

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