Add roles and time tracking to tasks tab - #160
Open
icole wants to merge 11 commits into
Open
Conversation
Foundation for Roles & Time Tracking feature. Includes validations for title, role_type, and group; scopes for filtering; Discardable soft-delete support; and PaperTrail versioning.
Implements the join model between roles and users with assignment_type (holder/backup/co_holder), date tracking, and active status. Includes a callback to keep role vacancy status in sync and a partial unique index to prevent duplicate active holders.
Create time_entries table for tracking hours spent on roles and tasks. Supports task and reconciliation entry types with month-based scoping. Uncomment has_many :time_entries in Role model.
Create model with validations (title, frequency, role), generate_task! method, and due_for_generation? logic. Frequencies: daily, weekly, biweekly, monthly, quarterly. Role association on generated tasks deferred to Task 5 when role_id column is added to tasks table.
Add role_id foreign key to tasks table, enable Role has_many :tasks, permit role_id in tasks controller, and fix RecurringTaskTemplate to include role when generating tasks.
Implements full CRUD for community roles with DaisyUI views, soft-delete support, and nested routes for future role_assignments, time_entries, and recurring_task_templates controllers.
Implements nested resource controller for assigning users to roles with holder/backup/co_holder types and optional term dates.
Implements time logging for roles with task and reconciliation entry types. Includes views for listing entries with monthly summaries and a form for creating new entries.
Add a Community Roles icon link in the tasks page header alongside the Add button, and include a role select dropdown in the task form so tasks can be optionally associated with a role.
Allows users to record monthly sentiment (too_much, just_right, too_little) per role, with uniqueness constraint ensuring one response per user/role/month.
Job iterates over RecurringTaskTemplate records, checks if each is due for generation based on its frequency, and creates a Task assigned to the role's current active holder.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
New models
Role— title, duties, description/guide, group, type (role vs committee), term length, vacancy trackingRoleAssignment— links users to roles as holder/backup/co-holder with term datesTimeEntry— hours logged against tasks or roles (per-task or monthly reconciliation)RecurringTaskTemplate— auto-generates tasks on a schedule (daily/weekly/biweekly/monthly/quarterly)WorkloadSentiment— monthly too-much/just-right/too-little self-report per roleUI
Test plan