package recruiting // Task is one piece of work on someone's queue. type Task struct { ID string `json:"id"` Title string `json:"title"` Detail string `json:"detail,omitempty"` Status string `json:"status"` Priority string `json:"priority"` // AssignedTo is empty when the work is unassigned, which happens when the person who held it left. // A task is work that still needs doing, so it is handed to nobody and shown, not deleted. AssignedTo string `json:"assigned_to,omitempty"` AssigneeName string `json:"assignee_name,omitempty"` DueAt string `json:"due_at,omitempty"` CompletedAt string `json:"completed_at,omitempty"` // Bucket is the queue this task falls in, computed in the organization's timezone: overdue, // today, soon, later, or none when there is no due date. Bucket string `json:"bucket"` // DueInDays is whole days from today to the due date, in the organization's timezone. Negative when // overdue. Absent when there is no due date, which is not the same as zero. DueInDays *int `json:"due_in_days,omitempty"` CandidateID string `json:"candidate_id,omitempty"` CandidateName string `json:"candidate_name,omitempty"` RequisitionID string `json:"requisition_id,omitempty"` RequisitionTitle string `json:"requisition_title,omitempty"` ApplicationID string `json:"application_id,omitempty"` ContactID string `json:"contact_id,omitempty"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` } type CreateTaskInput struct { Title string `json:"title"` Detail string `json:"detail"` Priority string `json:"priority"` AssignedTo string `json:"assigned_to"` DueAt string `json:"due_at"` CandidateID string `json:"candidate_id"` ContactID string `json:"contact_id"` RequisitionID string `json:"requisition_id"` ApplicationID string `json:"application_id"` } // UpdateTaskInput. completed_at is absent on purpose: it is maintained by the database from the status, // so reopening a task clears it and closing one stamps it, from any path. type UpdateTaskInput struct { ExpectedUpdatedAt string `json:"expected_updated_at"` Title *string `json:"title,omitempty"` Detail *string `json:"detail,omitempty"` Status *string `json:"status,omitempty"` Priority *string `json:"priority,omitempty"` AssignedTo *string `json:"assigned_to,omitempty"` DueAt *string `json:"due_at,omitempty"` } type TaskList struct { Tasks []Task `json:"tasks"` Limit int `json:"limit"` Offset int `json:"offset"` Total int `json:"total"` } // TaskQueue is the work view: counts per bucket plus the tasks themselves, all computed in the // organization's timezone so "today" means the working day rather than a UTC day. type TaskQueue struct { TimeZone string `json:"time_zone"` Overdue int `json:"overdue"` Today int `json:"today"` Soon int `json:"soon"` Later int `json:"later"` NoDueDate int `json:"no_due_date"` Unassigned int `json:"unassigned"` Tasks []Task `json:"tasks"` }