codex ticket rework
This commit is contained in:
@@ -21,6 +21,8 @@ class ProjectFactory extends Factory
|
||||
return [
|
||||
'name' => Str::title(fake()->unique()->words(asText: true)),
|
||||
'key' => Str::upper(fake()->unique()->lexify('?????')),
|
||||
'show_author' => true,
|
||||
'show_story_points' => true,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace Database\Factories;
|
||||
use App\Actions\ProjectTicketMetadata\InitializeProjectTicketMetadata;
|
||||
use App\Models\Project;
|
||||
use App\Models\Ticket;
|
||||
use App\Models\TicketPriority;
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
@@ -22,12 +22,15 @@ class TicketFactory extends Factory
|
||||
{
|
||||
return [
|
||||
'acceptance_criteria' => fake()->paragraph(),
|
||||
'assignee_user_id' => null,
|
||||
'author_user_id' => User::factory(),
|
||||
'board_column_id' => null,
|
||||
'blocked_comment' => null,
|
||||
'description' => fake()->paragraphs(2, true),
|
||||
'is_blocked' => false,
|
||||
'parent_ticket_id' => null,
|
||||
'sequence_number' => 1,
|
||||
'story_points' => null,
|
||||
'ticket_key' => 'TEST-1',
|
||||
'title' => fake()->sentence(4),
|
||||
];
|
||||
@@ -46,14 +49,9 @@ class TicketFactory extends Factory
|
||||
|
||||
app(InitializeProjectTicketMetadata::class)->handle($project);
|
||||
|
||||
$priority = TicketPriority::factory()->for($project)->create([
|
||||
'name' => 'Medium',
|
||||
'position' => 1,
|
||||
]);
|
||||
|
||||
$ticket->project_id = $project->id;
|
||||
$ticket->ticket_type_id = $project->ticketTypes()->firstOrFail()->id;
|
||||
$ticket->ticket_priority_id = $priority->id;
|
||||
$ticket->ticket_priority_id = $project->ticketPriorities()->firstOrFail()->id;
|
||||
$ticket->sequence_number = 1;
|
||||
$ticket->ticket_key = "{$project->key}-1";
|
||||
});
|
||||
|
||||
@@ -39,7 +39,7 @@ class TicketFieldValueFactory extends Factory
|
||||
$ticketFieldDefinition = $ticketFieldValue->ticket_field_definition_id === null
|
||||
? TicketFieldDefinition::factory()->for($ticket->project)->create([
|
||||
'field_type' => 'number',
|
||||
'label' => 'Story Points',
|
||||
'label' => 'Custom Number',
|
||||
'position' => $ticket->project->ticketFieldDefinitions()->count() + 1,
|
||||
])
|
||||
: TicketFieldDefinition::query()->findOrFail($ticketFieldValue->ticket_field_definition_id);
|
||||
|
||||
@@ -19,11 +19,10 @@ class TicketTypeFactory extends Factory
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'is_builtin' => false,
|
||||
'is_parent' => false,
|
||||
'name' => fake()->unique()->jobTitle(),
|
||||
'position' => 1,
|
||||
'project_id' => Project::factory(),
|
||||
'system_key' => null,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user