---
# System prepended metadata

title: Tasks remake

---

# Tasks remake
Existing models
- Tasks
 string "title"
 bigint "author_id"
 string "assignee_type"
 bigint "assignee_id"
 integer "status", default: 0
 integer "priority", default: 0
 datetime "due_date"
 integer "frequency_type"
 integer "termination_type"
 datetime "termination_at"
 integer "termination_count"
 datetime "start_at"
 datetime "last_completed_date"
- Comments (Polymorphic)
 bigint "author_id", null: false
 string "commentable_type"
 bigint "commentable_id"

![](https://i.imgur.com/TXCwBaD.png)
![](https://i.imgur.com/K4uau9P.png)
![](https://i.imgur.com/2eslacW.png)


### New Task Models
- Board
    - name:string
    - privacy:integer[enum] (invite_only, anyone_join, group_join)
    - label1_name:string
- Label
    - board_id:integer (Example: 123)
    - label_handle:integer[enum] (label1, label2, label3)
    - name:string (Example: GoVSpace3)
    - color:string (Example: #00FF5A)
- Section
    - board_id:integer
    - name:string
    - position:integer
- Collaborators
    - board_id:integer
    - user_id:integer
    - notification_status_update:boolean
    - notification_conversation:boolean
    - notification_task_added:boolean
    - role:integer[enum] (owner)


### Update existing models

**Tasks**
- label1_id:integer (optional)
- board_id:integer (initially, optional)
- section_id:integer (optional)
- completed_at:datetime (optional)
- completed_by_id:integer (optional)
- position:integer

## Questions
- Can a task belong in multiple boards?
    - Steve to answer
- How insane should permissions be on a board?
    - Owner (Can do everything update board, labels, sections etc)
    - Viewer (Maybe can only comment on a task?)
    - Editor (can create tasks, comments, etc)
    - Steve to answer
- Review + Redo how automatic tasks work (bandwidth overages)

## Plan of attack

### Remove status from `Task` model
- [x] Write a data migration to backfill existing tasks with last_completed_date
- [x] Deploy changes to production
- [x] Remove status column
- [x] Remove code that relies on status column
- [x] Deploy changes to production

### Adding the concept of a `Board`
- [x] Add new Board model
- [x] Add board create, update and archive (Maybe hide this in UI for now)
- [x] Add collaborators
- [x] Write a data migration to move all tasks to a board
    - [x] Create new boards required
    - [x] Assign tasks to appropriate board
- [x] Add board dropdown to task create and update


### Adding support for a `Section` within a `Board`
- [x] Add new Section model
- [x] Add ability to create, update and remove a section
- [x] Allow sections to be ordered on a board (drag n drop)
- [x] Add section column to tasks
- [x] Ensure tasks without a section assigned appear at the top of the board
- [x] Add section field to tasks
- [x] Drag + Drop Tasks between sections


### Addding `Label` to `Tasks`
- [x] Add new Label model
- [x] Add ability to configure a labels names and colors per board

### Nice touch-ups
- [x] Go over all breadcrumbs and cancel links
- [x] Ability to edit task to empty section
- [x] Remove private_board from dropdowns

Still to do go live
- [x] Add Labels to Tasks
- [ ] Task show when scrolled down page
- [x] Remove polymorphic task assignee maybe?? Should just be people on the board
- [x] Invite People (remove self from list)
- [x] Permissions on everything (sort of done views)
- [x] Delete section + unassign tasks
- [x] Emails
- [x] Confirm reoccuring hasn't broken
- [x] Searching tasks
- [x] Check automated task creation (bandwidth overage/ssl monitor) works
- [x] Show completed tasks

Nice Haves
- [ ] icon to labels
- [ ] Real time updating
- [ ] Character counter on task subjects as long subjects look shit

### Add followers to tasks
A task should only be assigned to an individual to prevent nobody being responsible.

However allow followers so that all notifications can be triggered to that person.

- Allow different users to be followers of a task
- @mention in a comment or the task description should automatically add the person as a follower

### Nice to haves
- Automatic Testing using RSpec