Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Amount ¶
type Amount struct { ID int64 `db:"id" json:"id"` UserID int64 `db:"user_id" json:"user_id"` TicketID int64 `db:"ticket_id" json:"ticket_id"` Description string `db:"description" json:"description"` Amount float64 `db:"amount" json:"amount"` AmountedAt *time.Time `db:"amounted_at" json:"amounted_at"` }
Amount represents an amount logged against a ticket
func CreateAmount ¶
CreateAmount adds a new amount record to the database
func GetAmountsByUserID ¶
func GetAmountsByUserID(userID int64, aq *AmountQuery) ([]Amount, error)
GetAmountsByUserID returns all amounts in the database associated with a user id
type AmountQuery ¶
type AmountQuery struct { UserID int64 `db:"user_id"` AmountedAfter *time.Time `db:"amounted_after"` AmountedBefore *time.Time `db:"amounted_before"` }
AmountQuery defines the parameters for listing times
type Ticket ¶
type Ticket struct { ID int64 `db:"id" json:"id"` UserID int64 `db:"user_id" json:"user_id"` Description string `db:"description" json:"description"` ClosedAt *time.Time `db:"closed_at" json:"closed_at"` DaysInWeek float32 `db:"days_in_week" json:"days_in_week"` Priority int64 `db:"priority" json:"priority"` }
Ticket is an activity that a user can log time or amounts against
func CreateTicket ¶
CreateTicket adds a ticket record to the database
func GetTicketsByUserID ¶
GetTicketsByUserID returns all tickets in the database associated with a user id
type Time ¶
type Time struct { ID int64 `db:"id" json:"id"` UserID int64 `db:"user_id" json:"user_id"` TicketID int64 `db:"ticket_id" json:"ticket_id"` Description string `db:"description" json:"description"` StartedAt *time.Time `db:"started_at" json:"started_at"` BrokeAt *time.Time `db:"broke_at" json:"broke_at"` EndedAt *time.Time `db:"ended_at" json:"ended_at"` }
Time represents time logged against a ticket
func CreateTime ¶
CreateTime adds a new time record to the database
func DeleteTime ¶
DeleteTime deletes a time record from the database
func GetTimesByUserID ¶
GetTimesByUserID returns all times in the database associated with a user id