Add ability to set task to done, fixes ST-244

This commit is contained in:
Constantin Graf
2024-06-24 14:25:26 +02:00
committed by Gregor Vostrak
parent 75e739f6fb
commit 364168debd
9 changed files with 236 additions and 0 deletions

View File

@@ -25,6 +25,7 @@ class TaskFactory extends Factory
'name' => $this->faker->word(),
'project_id' => Project::factory(),
'organization_id' => Organization::factory(),
'done_at' => null,
];
}
@@ -37,6 +38,15 @@ class TaskFactory extends Factory
});
}
public function isDone(): self
{
return $this->state(function (array $attributes) {
return [
'done_at' => $this->faker->dateTime('now', 'UTC'),
];
});
}
public function forOrganization(Organization $organization): self
{
return $this->state(function (array $attributes) use ($organization) {