tickets

package
v0.0.0-...-b012a22 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(c client.AmountClient, u ui.Interactor, ticketID int64, a float64, amountedAt time.Time) error

Add adds a new amount to a ticket

func Create

func Create(c client.TicketClient, u ui.Interactor, description string) error

Create adds a new ticket to the user's list of tickets

func EditAmounts

func EditAmounts(c client.AmountClient, u ui.Interactor, tIDs []int64, amountedAfter time.Time, amountedBefore time.Time) error

EditAmounts opens an editor with the amounts returned by user-entered query parameters and allows the user to edit the amounts

func EditTimes

func EditTimes(c client.TimeClient, u ui.Interactor, tIDs []int64, start time.Time, end time.Time) error

EditTimes opens an editor with the times returned by user-entered query parameters and allows the user to edit the times

func ListTickets

func ListTickets(c client.TicketClient, u ui.Interactor) error

ListTickets displays the tickets assigned to a user

func ListTimes

func ListTimes(c client.TimeClient, u ui.Interactor) error

ListTimes lists the open times (without end time) associated with a user.

func Start

func Start(c client.TimeClient, u ui.Interactor, ticketID int64, t *time.Time) error

Start creates a new time with a StartedAt value of the current time.

func Stop

func Stop(c client.TimeClient, u ui.Interactor, timeID int64, t *time.Time) error

Stop sets a time's EndedAt value to the current time.

Types

type Amount

type Amount struct {
	ID          int64     `json:"id,omitempty"`
	TicketID    int64     `json:"ticket_id"`
	Description string    `json:"ticket_description,omitempty"`
	Amount      float64   `json:"amount"`
	AmountedAt  time.Time `json:"amounted_at"`
}

Amount is numerical value tied to a ticket at a specific time

type LineErr

type LineErr struct {
	Line  string
	Error error
}

LineErr represents an error parsing a line in the time edit file

type LineErrs

type LineErrs struct {
	LineErrors []LineErr
}

LineErrs holds a slice of LineErrs

func (*LineErrs) AppendErr

func (l *LineErrs) AppendErr(line string, err error)

AppendErr appends a LineErr to LineErrs

func (*LineErrs) Err

func (l *LineErrs) Err() error

Err returns nil if the LineErrs does not have a LineErr, otherwise it returns itself

func (*LineErrs) Error

func (l *LineErrs) Error() string

Error implements the error interface

type Ticket

type Ticket struct {
	ID          int64      `json:"id"`
	Description string     `json:"description"`
	ClosedAt    *time.Time `json:"closed_at"`
	DaysInWeek  float32    `json:"days_in_week"`
	Priority    int64      `json:"priority"`
}

Ticket is an activity that a user can log time or amounts against

type Time

type Time struct {
	ID          int64      `json:"id,omitempty"`
	TicketID    int64      `json:"ticket_id,omitempty"`
	Description string     `json:"ticket_description,omitempty"`
	StartedAt   *time.Time `json:"started_at,omitempty"`
	EndedAt     *time.Time `json:"ended_at,omitempty"`
}

Time is a block of time assigned to a ticket.

Jump to

Keyboard shortcuts

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