Skip to content

Commit

Permalink
Merge pull request #1474 from bakaphp/feat-task-list
Browse files Browse the repository at this point in the history
refact: migration and response
  • Loading branch information
kaioken authored Jun 9, 2024
2 parents 5b0abd0 + 66f6a41 commit 09dca2b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ public function up(): void
$table->bigInteger('apps_id')->index();
$table->bigInteger('users_id')->index();
$table->enum('status', ['pending', 'in_progress', 'completed'])->default('pending')->comment('pending, in_progress, completed')->index();
$table->bigInteger('engagement_start_id')->index();
$table->bigInteger('engagement_end_id')->index();
$table->json('config');
$table->bigInteger('engagement_start_id')->nullable()->index();
$table->bigInteger('engagement_end_id')->nullable()->index();
$table->json('config')->nullable();
$table->timestamps();
$table->tinyInteger('is_deleted')->default(0)->index();

Expand Down
6 changes: 0 additions & 6 deletions src/Domains/ActionEngine/Tasks/Models/TaskEngagementItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,11 @@ public function lead(): BelongsTo
return $this->belongsTo(Lead::class, 'lead_id');
}

/**
* temp relationship to engagement will only work on LeadTaskEngagementItem
*/
public function engagementStart(): HasOne
{
return $this->hasOne(Engagement::class, 'id', 'engagement_start_id');
}

/**
* temp relationship to engagement will only work on LeadTaskEngagementItem
*/
public function engagementEnd(): HasOne
{
return $this->hasOne(Engagement::class, 'id', 'engagement_end_id');
Expand Down
11 changes: 11 additions & 0 deletions src/Domains/ActionEngine/Tasks/Models/TaskListItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,19 @@ public function action(): BelongsTo
return $this->belongsTo(CompanyAction::class, 'companies_action_id');
}

/**
* temp relationship to engagement will only work on LeadTaskEngagementItem
*/
public function engagementStart(): HasOne
{
return $this->hasOne(Engagement::class, 'id', 'engagement_start_id');
}

/**
* temp relationship to engagement will only work on LeadTaskEngagementItem
*/
public function engagementEnd(): HasOne
{
return $this->hasOne(Engagement::class, 'id', 'engagement_end_id');
}
}

0 comments on commit 09dca2b

Please sign in to comment.