added status restriction

This commit is contained in:
2026-04-14 19:07:15 +02:00
parent 9927a91327
commit fb10ecd535
12 changed files with 570 additions and 69 deletions
@@ -88,7 +88,6 @@ return new class extends Migration
->update(['ticket_status_id' => $ticketStatusId]);
});
$this->createFullTransitionMatrix((int) $project->id);
});
}
@@ -110,24 +109,4 @@ return new class extends Migration
'updated_at' => $now,
]);
}
private function createFullTransitionMatrix(int $projectId): void
{
$now = now();
$statusIds = DB::table('ticket_statuses')
->where('project_id', $projectId)
->pluck('id')
->map(fn (int|string $statusId): int => (int) $statusId);
$statusIds->each(function (int $fromStatusId) use ($now, $statusIds): void {
$statusIds->each(function (int $toStatusId) use ($fromStatusId, $now): void {
DB::table('ticket_status_transitions')->insertOrIgnore([
'created_at' => $now,
'from_ticket_status_id' => $fromStatusId,
'to_ticket_status_id' => $toStatusId,
'updated_at' => $now,
]);
});
});
}
};