feat(tasks): complete task management system with Kanban, Calendar, notifications
- Add Task model with subtasks, priorities, status transitions, dates, hours - Add Comment polymorphic model for tasks/issues/projects - Livewire components: TaskManager (list+filters), TaskForm (modal), TaskDetail, TaskKanban (drag&drop), TaskCalendar (FullCalendar) - TaskPolicy with permissions (view/create/edit/delete/assign/manage all) - Notifications: assigned, status change, overdue, comment added - Daily overdue notification job scheduled - Dashboard widget unifies IssueTask + Task - i18n: en/es/fr/ru (393 keys each) - Routes, navigation, offline sync support - 101 tests passing, Pint compliant on new files
This commit is contained in:
+22
-5
@@ -13,7 +13,7 @@ use Spatie\Permission\Traits\HasRoles;
|
||||
class User extends Authenticatable
|
||||
{
|
||||
/** @use HasFactory<UserFactory> */
|
||||
use HasFactory, Notifiable, HasRoles, HasApiTokens;
|
||||
use HasApiTokens, HasFactory, HasRoles, Notifiable;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
@@ -47,16 +47,17 @@ class User extends Authenticatable
|
||||
{
|
||||
return [
|
||||
'email_verified_at' => 'datetime',
|
||||
'password' => 'hashed',
|
||||
'valid_from' => 'date',
|
||||
'valid_until' => 'date',
|
||||
'password' => 'hashed',
|
||||
'valid_from' => 'date',
|
||||
'valid_until' => 'date',
|
||||
];
|
||||
}
|
||||
|
||||
public function company()
|
||||
{
|
||||
return $this->belongsTo(\App\Models\Company::class);
|
||||
return $this->belongsTo(Company::class);
|
||||
}
|
||||
|
||||
// Many-to-many with projects
|
||||
public function projects()
|
||||
{
|
||||
@@ -68,4 +69,20 @@ class User extends Authenticatable
|
||||
{
|
||||
return $this->hasMany(ProgressUpdate::class);
|
||||
}
|
||||
|
||||
// Tasks
|
||||
public function createdTasks()
|
||||
{
|
||||
return $this->hasMany(Task::class, 'created_by');
|
||||
}
|
||||
|
||||
public function assignedTasks()
|
||||
{
|
||||
return $this->hasMany(Task::class, 'assigned_to');
|
||||
}
|
||||
|
||||
public function completedTasks()
|
||||
{
|
||||
return $this->hasMany(Task::class, 'completed_by');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user