codex ticket rework
This commit is contained in:
@@ -11,7 +11,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
#[Fillable(['name', 'key', 'show_story_points'])]
|
||||
#[Fillable(['name', 'key', 'show_author', 'show_story_points'])]
|
||||
class Project extends Model
|
||||
{
|
||||
/** @use HasFactory<ProjectFactory> */
|
||||
@@ -20,6 +20,7 @@ class Project extends Model
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'show_author' => 'boolean',
|
||||
'show_story_points' => 'boolean',
|
||||
];
|
||||
}
|
||||
|
||||
@@ -11,6 +11,8 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
#[Fillable([
|
||||
'acceptance_criteria',
|
||||
'assignee_user_id',
|
||||
'author_user_id',
|
||||
'board_column_id',
|
||||
'blocked_comment',
|
||||
'description',
|
||||
@@ -44,6 +46,16 @@ class Ticket extends Model
|
||||
return $this->belongsTo(BoardColumn::class);
|
||||
}
|
||||
|
||||
public function assignee(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'assignee_user_id');
|
||||
}
|
||||
|
||||
public function author(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'author_user_id');
|
||||
}
|
||||
|
||||
public function childTickets(): HasMany
|
||||
{
|
||||
return $this->hasMany(Ticket::class, 'parent_ticket_id')
|
||||
|
||||
@@ -7,6 +7,7 @@ use Illuminate\Database\Eloquent\Attributes\Fillable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
#[Fillable(['name', 'position', 'project_id', 'is_parent'])]
|
||||
class TicketType extends Model
|
||||
@@ -25,4 +26,9 @@ class TicketType extends Model
|
||||
{
|
||||
return $this->belongsTo(Project::class);
|
||||
}
|
||||
|
||||
public function tickets(): HasMany
|
||||
{
|
||||
return $this->hasMany(Ticket::class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,4 +59,14 @@ class User extends Authenticatable
|
||||
->orderBy('provider')
|
||||
->orderBy('base_url');
|
||||
}
|
||||
|
||||
public function assignedTickets(): HasMany
|
||||
{
|
||||
return $this->hasMany(Ticket::class, 'assignee_user_id');
|
||||
}
|
||||
|
||||
public function authoredTickets(): HasMany
|
||||
{
|
||||
return $this->hasMany(Ticket::class, 'author_user_id');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user